{-# 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.Glue.UpdateConnection
(
UpdateConnection (..),
newUpdateConnection,
updateConnection_catalogId,
updateConnection_name,
updateConnection_connectionInput,
UpdateConnectionResponse (..),
newUpdateConnectionResponse,
updateConnectionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateConnection = UpdateConnection'
{
UpdateConnection -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
UpdateConnection -> Text
name :: Prelude.Text,
UpdateConnection -> ConnectionInput
connectionInput :: ConnectionInput
}
deriving (UpdateConnection -> UpdateConnection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateConnection -> UpdateConnection -> Bool
$c/= :: UpdateConnection -> UpdateConnection -> Bool
== :: UpdateConnection -> UpdateConnection -> Bool
$c== :: UpdateConnection -> UpdateConnection -> Bool
Prelude.Eq, ReadPrec [UpdateConnection]
ReadPrec UpdateConnection
Int -> ReadS UpdateConnection
ReadS [UpdateConnection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateConnection]
$creadListPrec :: ReadPrec [UpdateConnection]
readPrec :: ReadPrec UpdateConnection
$creadPrec :: ReadPrec UpdateConnection
readList :: ReadS [UpdateConnection]
$creadList :: ReadS [UpdateConnection]
readsPrec :: Int -> ReadS UpdateConnection
$creadsPrec :: Int -> ReadS UpdateConnection
Prelude.Read, Int -> UpdateConnection -> ShowS
[UpdateConnection] -> ShowS
UpdateConnection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateConnection] -> ShowS
$cshowList :: [UpdateConnection] -> ShowS
show :: UpdateConnection -> String
$cshow :: UpdateConnection -> String
showsPrec :: Int -> UpdateConnection -> ShowS
$cshowsPrec :: Int -> UpdateConnection -> ShowS
Prelude.Show, forall x. Rep UpdateConnection x -> UpdateConnection
forall x. UpdateConnection -> Rep UpdateConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateConnection x -> UpdateConnection
$cfrom :: forall x. UpdateConnection -> Rep UpdateConnection x
Prelude.Generic)
newUpdateConnection ::
Prelude.Text ->
ConnectionInput ->
UpdateConnection
newUpdateConnection :: Text -> ConnectionInput -> UpdateConnection
newUpdateConnection Text
pName_ ConnectionInput
pConnectionInput_ =
UpdateConnection'
{ $sel:catalogId:UpdateConnection' :: Maybe Text
catalogId = forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateConnection' :: Text
name = Text
pName_,
$sel:connectionInput:UpdateConnection' :: ConnectionInput
connectionInput = ConnectionInput
pConnectionInput_
}
updateConnection_catalogId :: Lens.Lens' UpdateConnection (Prelude.Maybe Prelude.Text)
updateConnection_catalogId :: Lens' UpdateConnection (Maybe Text)
updateConnection_catalogId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnection' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:UpdateConnection' :: UpdateConnection -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: UpdateConnection
s@UpdateConnection' {} Maybe Text
a -> UpdateConnection
s {$sel:catalogId:UpdateConnection' :: Maybe Text
catalogId = Maybe Text
a} :: UpdateConnection)
updateConnection_name :: Lens.Lens' UpdateConnection Prelude.Text
updateConnection_name :: Lens' UpdateConnection Text
updateConnection_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnection' {Text
name :: Text
$sel:name:UpdateConnection' :: UpdateConnection -> Text
name} -> Text
name) (\s :: UpdateConnection
s@UpdateConnection' {} Text
a -> UpdateConnection
s {$sel:name:UpdateConnection' :: Text
name = Text
a} :: UpdateConnection)
updateConnection_connectionInput :: Lens.Lens' UpdateConnection ConnectionInput
updateConnection_connectionInput :: Lens' UpdateConnection ConnectionInput
updateConnection_connectionInput = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnection' {ConnectionInput
connectionInput :: ConnectionInput
$sel:connectionInput:UpdateConnection' :: UpdateConnection -> ConnectionInput
connectionInput} -> ConnectionInput
connectionInput) (\s :: UpdateConnection
s@UpdateConnection' {} ConnectionInput
a -> UpdateConnection
s {$sel:connectionInput:UpdateConnection' :: ConnectionInput
connectionInput = ConnectionInput
a} :: UpdateConnection)
instance Core.AWSRequest UpdateConnection where
type
AWSResponse UpdateConnection =
UpdateConnectionResponse
request :: (Service -> Service)
-> UpdateConnection -> Request UpdateConnection
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 UpdateConnection
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateConnection)))
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 -> UpdateConnectionResponse
UpdateConnectionResponse'
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 UpdateConnection where
hashWithSalt :: Int -> UpdateConnection -> Int
hashWithSalt Int
_salt UpdateConnection' {Maybe Text
Text
ConnectionInput
connectionInput :: ConnectionInput
name :: Text
catalogId :: Maybe Text
$sel:connectionInput:UpdateConnection' :: UpdateConnection -> ConnectionInput
$sel:name:UpdateConnection' :: UpdateConnection -> Text
$sel:catalogId:UpdateConnection' :: UpdateConnection -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
catalogId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ConnectionInput
connectionInput
instance Prelude.NFData UpdateConnection where
rnf :: UpdateConnection -> ()
rnf UpdateConnection' {Maybe Text
Text
ConnectionInput
connectionInput :: ConnectionInput
name :: Text
catalogId :: Maybe Text
$sel:connectionInput:UpdateConnection' :: UpdateConnection -> ConnectionInput
$sel:name:UpdateConnection' :: UpdateConnection -> Text
$sel:catalogId:UpdateConnection' :: UpdateConnection -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
catalogId
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 ConnectionInput
connectionInput
instance Data.ToHeaders UpdateConnection where
toHeaders :: UpdateConnection -> 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
"AWSGlue.UpdateConnection" :: 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 UpdateConnection where
toJSON :: UpdateConnection -> Value
toJSON UpdateConnection' {Maybe Text
Text
ConnectionInput
connectionInput :: ConnectionInput
name :: Text
catalogId :: Maybe Text
$sel:connectionInput:UpdateConnection' :: UpdateConnection -> ConnectionInput
$sel:name:UpdateConnection' :: UpdateConnection -> Text
$sel:catalogId:UpdateConnection' :: UpdateConnection -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CatalogId" 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
catalogId,
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
"ConnectionInput" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ConnectionInput
connectionInput)
]
)
instance Data.ToPath UpdateConnection where
toPath :: UpdateConnection -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateConnection where
toQuery :: UpdateConnection -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateConnectionResponse = UpdateConnectionResponse'
{
UpdateConnectionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateConnectionResponse -> UpdateConnectionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateConnectionResponse -> UpdateConnectionResponse -> Bool
$c/= :: UpdateConnectionResponse -> UpdateConnectionResponse -> Bool
== :: UpdateConnectionResponse -> UpdateConnectionResponse -> Bool
$c== :: UpdateConnectionResponse -> UpdateConnectionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateConnectionResponse]
ReadPrec UpdateConnectionResponse
Int -> ReadS UpdateConnectionResponse
ReadS [UpdateConnectionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateConnectionResponse]
$creadListPrec :: ReadPrec [UpdateConnectionResponse]
readPrec :: ReadPrec UpdateConnectionResponse
$creadPrec :: ReadPrec UpdateConnectionResponse
readList :: ReadS [UpdateConnectionResponse]
$creadList :: ReadS [UpdateConnectionResponse]
readsPrec :: Int -> ReadS UpdateConnectionResponse
$creadsPrec :: Int -> ReadS UpdateConnectionResponse
Prelude.Read, Int -> UpdateConnectionResponse -> ShowS
[UpdateConnectionResponse] -> ShowS
UpdateConnectionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateConnectionResponse] -> ShowS
$cshowList :: [UpdateConnectionResponse] -> ShowS
show :: UpdateConnectionResponse -> String
$cshow :: UpdateConnectionResponse -> String
showsPrec :: Int -> UpdateConnectionResponse -> ShowS
$cshowsPrec :: Int -> UpdateConnectionResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateConnectionResponse x -> UpdateConnectionResponse
forall x.
UpdateConnectionResponse -> Rep UpdateConnectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateConnectionResponse x -> UpdateConnectionResponse
$cfrom :: forall x.
UpdateConnectionResponse -> Rep UpdateConnectionResponse x
Prelude.Generic)
newUpdateConnectionResponse ::
Prelude.Int ->
UpdateConnectionResponse
newUpdateConnectionResponse :: Int -> UpdateConnectionResponse
newUpdateConnectionResponse Int
pHttpStatus_ =
UpdateConnectionResponse'
{ $sel:httpStatus:UpdateConnectionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateConnectionResponse_httpStatus :: Lens.Lens' UpdateConnectionResponse Prelude.Int
updateConnectionResponse_httpStatus :: Lens' UpdateConnectionResponse Int
updateConnectionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateConnectionResponse' :: UpdateConnectionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateConnectionResponse
s@UpdateConnectionResponse' {} Int
a -> UpdateConnectionResponse
s {$sel:httpStatus:UpdateConnectionResponse' :: Int
httpStatus = Int
a} :: UpdateConnectionResponse)
instance Prelude.NFData UpdateConnectionResponse where
rnf :: UpdateConnectionResponse -> ()
rnf UpdateConnectionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateConnectionResponse' :: UpdateConnectionResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus