{-# 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.AppFlow.DeleteConnectorProfile
(
DeleteConnectorProfile (..),
newDeleteConnectorProfile,
deleteConnectorProfile_forceDelete,
deleteConnectorProfile_connectorProfileName,
DeleteConnectorProfileResponse (..),
newDeleteConnectorProfileResponse,
deleteConnectorProfileResponse_httpStatus,
)
where
import Amazonka.AppFlow.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 DeleteConnectorProfile = DeleteConnectorProfile'
{
DeleteConnectorProfile -> Maybe Bool
forceDelete :: Prelude.Maybe Prelude.Bool,
DeleteConnectorProfile -> Text
connectorProfileName :: Prelude.Text
}
deriving (DeleteConnectorProfile -> DeleteConnectorProfile -> Bool
(DeleteConnectorProfile -> DeleteConnectorProfile -> Bool)
-> (DeleteConnectorProfile -> DeleteConnectorProfile -> Bool)
-> Eq DeleteConnectorProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteConnectorProfile -> DeleteConnectorProfile -> Bool
$c/= :: DeleteConnectorProfile -> DeleteConnectorProfile -> Bool
== :: DeleteConnectorProfile -> DeleteConnectorProfile -> Bool
$c== :: DeleteConnectorProfile -> DeleteConnectorProfile -> Bool
Prelude.Eq, ReadPrec [DeleteConnectorProfile]
ReadPrec DeleteConnectorProfile
Int -> ReadS DeleteConnectorProfile
ReadS [DeleteConnectorProfile]
(Int -> ReadS DeleteConnectorProfile)
-> ReadS [DeleteConnectorProfile]
-> ReadPrec DeleteConnectorProfile
-> ReadPrec [DeleteConnectorProfile]
-> Read DeleteConnectorProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteConnectorProfile]
$creadListPrec :: ReadPrec [DeleteConnectorProfile]
readPrec :: ReadPrec DeleteConnectorProfile
$creadPrec :: ReadPrec DeleteConnectorProfile
readList :: ReadS [DeleteConnectorProfile]
$creadList :: ReadS [DeleteConnectorProfile]
readsPrec :: Int -> ReadS DeleteConnectorProfile
$creadsPrec :: Int -> ReadS DeleteConnectorProfile
Prelude.Read, Int -> DeleteConnectorProfile -> ShowS
[DeleteConnectorProfile] -> ShowS
DeleteConnectorProfile -> String
(Int -> DeleteConnectorProfile -> ShowS)
-> (DeleteConnectorProfile -> String)
-> ([DeleteConnectorProfile] -> ShowS)
-> Show DeleteConnectorProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteConnectorProfile] -> ShowS
$cshowList :: [DeleteConnectorProfile] -> ShowS
show :: DeleteConnectorProfile -> String
$cshow :: DeleteConnectorProfile -> String
showsPrec :: Int -> DeleteConnectorProfile -> ShowS
$cshowsPrec :: Int -> DeleteConnectorProfile -> ShowS
Prelude.Show, (forall x. DeleteConnectorProfile -> Rep DeleteConnectorProfile x)
-> (forall x.
Rep DeleteConnectorProfile x -> DeleteConnectorProfile)
-> Generic DeleteConnectorProfile
forall x. Rep DeleteConnectorProfile x -> DeleteConnectorProfile
forall x. DeleteConnectorProfile -> Rep DeleteConnectorProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteConnectorProfile x -> DeleteConnectorProfile
$cfrom :: forall x. DeleteConnectorProfile -> Rep DeleteConnectorProfile x
Prelude.Generic)
newDeleteConnectorProfile ::
Prelude.Text ->
DeleteConnectorProfile
newDeleteConnectorProfile :: Text -> DeleteConnectorProfile
newDeleteConnectorProfile Text
pConnectorProfileName_ =
DeleteConnectorProfile' :: Maybe Bool -> Text -> DeleteConnectorProfile
DeleteConnectorProfile'
{ $sel:forceDelete:DeleteConnectorProfile' :: Maybe Bool
forceDelete =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:connectorProfileName:DeleteConnectorProfile' :: Text
connectorProfileName = Text
pConnectorProfileName_
}
deleteConnectorProfile_forceDelete :: Lens.Lens' DeleteConnectorProfile (Prelude.Maybe Prelude.Bool)
deleteConnectorProfile_forceDelete :: (Maybe Bool -> f (Maybe Bool))
-> DeleteConnectorProfile -> f DeleteConnectorProfile
deleteConnectorProfile_forceDelete = (DeleteConnectorProfile -> Maybe Bool)
-> (DeleteConnectorProfile -> Maybe Bool -> DeleteConnectorProfile)
-> Lens
DeleteConnectorProfile
DeleteConnectorProfile
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnectorProfile' {Maybe Bool
forceDelete :: Maybe Bool
$sel:forceDelete:DeleteConnectorProfile' :: DeleteConnectorProfile -> Maybe Bool
forceDelete} -> Maybe Bool
forceDelete) (\s :: DeleteConnectorProfile
s@DeleteConnectorProfile' {} Maybe Bool
a -> DeleteConnectorProfile
s {$sel:forceDelete:DeleteConnectorProfile' :: Maybe Bool
forceDelete = Maybe Bool
a} :: DeleteConnectorProfile)
deleteConnectorProfile_connectorProfileName :: Lens.Lens' DeleteConnectorProfile Prelude.Text
deleteConnectorProfile_connectorProfileName :: (Text -> f Text)
-> DeleteConnectorProfile -> f DeleteConnectorProfile
deleteConnectorProfile_connectorProfileName = (DeleteConnectorProfile -> Text)
-> (DeleteConnectorProfile -> Text -> DeleteConnectorProfile)
-> Lens DeleteConnectorProfile DeleteConnectorProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnectorProfile' {Text
connectorProfileName :: Text
$sel:connectorProfileName:DeleteConnectorProfile' :: DeleteConnectorProfile -> Text
connectorProfileName} -> Text
connectorProfileName) (\s :: DeleteConnectorProfile
s@DeleteConnectorProfile' {} Text
a -> DeleteConnectorProfile
s {$sel:connectorProfileName:DeleteConnectorProfile' :: Text
connectorProfileName = Text
a} :: DeleteConnectorProfile)
instance Core.AWSRequest DeleteConnectorProfile where
type
AWSResponse DeleteConnectorProfile =
DeleteConnectorProfileResponse
request :: DeleteConnectorProfile -> Request DeleteConnectorProfile
request = Service -> DeleteConnectorProfile -> Request DeleteConnectorProfile
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteConnectorProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteConnectorProfile)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteConnectorProfile))
-> Logger
-> Service
-> Proxy DeleteConnectorProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteConnectorProfile)))
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 -> DeleteConnectorProfileResponse
DeleteConnectorProfileResponse'
(Int -> DeleteConnectorProfileResponse)
-> Either String Int
-> Either String DeleteConnectorProfileResponse
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 DeleteConnectorProfile
instance Prelude.NFData DeleteConnectorProfile
instance Core.ToHeaders DeleteConnectorProfile where
toHeaders :: DeleteConnectorProfile -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteConnectorProfile -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 DeleteConnectorProfile where
toJSON :: DeleteConnectorProfile -> Value
toJSON DeleteConnectorProfile' {Maybe Bool
Text
connectorProfileName :: Text
forceDelete :: Maybe Bool
$sel:connectorProfileName:DeleteConnectorProfile' :: DeleteConnectorProfile -> Text
$sel:forceDelete:DeleteConnectorProfile' :: DeleteConnectorProfile -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"forceDelete" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
forceDelete,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"connectorProfileName"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
connectorProfileName
)
]
)
instance Core.ToPath DeleteConnectorProfile where
toPath :: DeleteConnectorProfile -> ByteString
toPath = ByteString -> DeleteConnectorProfile -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/delete-connector-profile"
instance Core.ToQuery DeleteConnectorProfile where
toQuery :: DeleteConnectorProfile -> QueryString
toQuery = QueryString -> DeleteConnectorProfile -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteConnectorProfileResponse = DeleteConnectorProfileResponse'
{
DeleteConnectorProfileResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteConnectorProfileResponse
-> DeleteConnectorProfileResponse -> Bool
(DeleteConnectorProfileResponse
-> DeleteConnectorProfileResponse -> Bool)
-> (DeleteConnectorProfileResponse
-> DeleteConnectorProfileResponse -> Bool)
-> Eq DeleteConnectorProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteConnectorProfileResponse
-> DeleteConnectorProfileResponse -> Bool
$c/= :: DeleteConnectorProfileResponse
-> DeleteConnectorProfileResponse -> Bool
== :: DeleteConnectorProfileResponse
-> DeleteConnectorProfileResponse -> Bool
$c== :: DeleteConnectorProfileResponse
-> DeleteConnectorProfileResponse -> Bool
Prelude.Eq, ReadPrec [DeleteConnectorProfileResponse]
ReadPrec DeleteConnectorProfileResponse
Int -> ReadS DeleteConnectorProfileResponse
ReadS [DeleteConnectorProfileResponse]
(Int -> ReadS DeleteConnectorProfileResponse)
-> ReadS [DeleteConnectorProfileResponse]
-> ReadPrec DeleteConnectorProfileResponse
-> ReadPrec [DeleteConnectorProfileResponse]
-> Read DeleteConnectorProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteConnectorProfileResponse]
$creadListPrec :: ReadPrec [DeleteConnectorProfileResponse]
readPrec :: ReadPrec DeleteConnectorProfileResponse
$creadPrec :: ReadPrec DeleteConnectorProfileResponse
readList :: ReadS [DeleteConnectorProfileResponse]
$creadList :: ReadS [DeleteConnectorProfileResponse]
readsPrec :: Int -> ReadS DeleteConnectorProfileResponse
$creadsPrec :: Int -> ReadS DeleteConnectorProfileResponse
Prelude.Read, Int -> DeleteConnectorProfileResponse -> ShowS
[DeleteConnectorProfileResponse] -> ShowS
DeleteConnectorProfileResponse -> String
(Int -> DeleteConnectorProfileResponse -> ShowS)
-> (DeleteConnectorProfileResponse -> String)
-> ([DeleteConnectorProfileResponse] -> ShowS)
-> Show DeleteConnectorProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteConnectorProfileResponse] -> ShowS
$cshowList :: [DeleteConnectorProfileResponse] -> ShowS
show :: DeleteConnectorProfileResponse -> String
$cshow :: DeleteConnectorProfileResponse -> String
showsPrec :: Int -> DeleteConnectorProfileResponse -> ShowS
$cshowsPrec :: Int -> DeleteConnectorProfileResponse -> ShowS
Prelude.Show, (forall x.
DeleteConnectorProfileResponse
-> Rep DeleteConnectorProfileResponse x)
-> (forall x.
Rep DeleteConnectorProfileResponse x
-> DeleteConnectorProfileResponse)
-> Generic DeleteConnectorProfileResponse
forall x.
Rep DeleteConnectorProfileResponse x
-> DeleteConnectorProfileResponse
forall x.
DeleteConnectorProfileResponse
-> Rep DeleteConnectorProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteConnectorProfileResponse x
-> DeleteConnectorProfileResponse
$cfrom :: forall x.
DeleteConnectorProfileResponse
-> Rep DeleteConnectorProfileResponse x
Prelude.Generic)
newDeleteConnectorProfileResponse ::
Prelude.Int ->
DeleteConnectorProfileResponse
newDeleteConnectorProfileResponse :: Int -> DeleteConnectorProfileResponse
newDeleteConnectorProfileResponse Int
pHttpStatus_ =
DeleteConnectorProfileResponse' :: Int -> DeleteConnectorProfileResponse
DeleteConnectorProfileResponse'
{ $sel:httpStatus:DeleteConnectorProfileResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteConnectorProfileResponse_httpStatus :: Lens.Lens' DeleteConnectorProfileResponse Prelude.Int
deleteConnectorProfileResponse_httpStatus :: (Int -> f Int)
-> DeleteConnectorProfileResponse
-> f DeleteConnectorProfileResponse
deleteConnectorProfileResponse_httpStatus = (DeleteConnectorProfileResponse -> Int)
-> (DeleteConnectorProfileResponse
-> Int -> DeleteConnectorProfileResponse)
-> Lens
DeleteConnectorProfileResponse
DeleteConnectorProfileResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnectorProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteConnectorProfileResponse' :: DeleteConnectorProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteConnectorProfileResponse
s@DeleteConnectorProfileResponse' {} Int
a -> DeleteConnectorProfileResponse
s {$sel:httpStatus:DeleteConnectorProfileResponse' :: Int
httpStatus = Int
a} :: DeleteConnectorProfileResponse)
instance
Prelude.NFData
DeleteConnectorProfileResponse