{-# 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.LexV2Models.DeleteImport
(
DeleteImport (..),
newDeleteImport,
deleteImport_importId,
DeleteImportResponse (..),
newDeleteImportResponse,
deleteImportResponse_importId,
deleteImportResponse_importStatus,
deleteImportResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexV2Models.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteImport = DeleteImport'
{
DeleteImport -> Text
importId :: Prelude.Text
}
deriving (DeleteImport -> DeleteImport -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteImport -> DeleteImport -> Bool
$c/= :: DeleteImport -> DeleteImport -> Bool
== :: DeleteImport -> DeleteImport -> Bool
$c== :: DeleteImport -> DeleteImport -> Bool
Prelude.Eq, ReadPrec [DeleteImport]
ReadPrec DeleteImport
Int -> ReadS DeleteImport
ReadS [DeleteImport]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteImport]
$creadListPrec :: ReadPrec [DeleteImport]
readPrec :: ReadPrec DeleteImport
$creadPrec :: ReadPrec DeleteImport
readList :: ReadS [DeleteImport]
$creadList :: ReadS [DeleteImport]
readsPrec :: Int -> ReadS DeleteImport
$creadsPrec :: Int -> ReadS DeleteImport
Prelude.Read, Int -> DeleteImport -> ShowS
[DeleteImport] -> ShowS
DeleteImport -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteImport] -> ShowS
$cshowList :: [DeleteImport] -> ShowS
show :: DeleteImport -> String
$cshow :: DeleteImport -> String
showsPrec :: Int -> DeleteImport -> ShowS
$cshowsPrec :: Int -> DeleteImport -> ShowS
Prelude.Show, forall x. Rep DeleteImport x -> DeleteImport
forall x. DeleteImport -> Rep DeleteImport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteImport x -> DeleteImport
$cfrom :: forall x. DeleteImport -> Rep DeleteImport x
Prelude.Generic)
newDeleteImport ::
Prelude.Text ->
DeleteImport
newDeleteImport :: Text -> DeleteImport
newDeleteImport Text
pImportId_ =
DeleteImport' {$sel:importId:DeleteImport' :: Text
importId = Text
pImportId_}
deleteImport_importId :: Lens.Lens' DeleteImport Prelude.Text
deleteImport_importId :: Lens' DeleteImport Text
deleteImport_importId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteImport' {Text
importId :: Text
$sel:importId:DeleteImport' :: DeleteImport -> Text
importId} -> Text
importId) (\s :: DeleteImport
s@DeleteImport' {} Text
a -> DeleteImport
s {$sel:importId:DeleteImport' :: Text
importId = Text
a} :: DeleteImport)
instance Core.AWSRequest DeleteImport where
type AWSResponse DeleteImport = DeleteImportResponse
request :: (Service -> Service) -> DeleteImport -> Request DeleteImport
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteImport
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteImport)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Maybe ImportStatus -> Int -> DeleteImportResponse
DeleteImportResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"importId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"importStatus")
forall (f :: * -> *) a b. Applicative f => 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 DeleteImport where
hashWithSalt :: Int -> DeleteImport -> Int
hashWithSalt Int
_salt DeleteImport' {Text
importId :: Text
$sel:importId:DeleteImport' :: DeleteImport -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
importId
instance Prelude.NFData DeleteImport where
rnf :: DeleteImport -> ()
rnf DeleteImport' {Text
importId :: Text
$sel:importId:DeleteImport' :: DeleteImport -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
importId
instance Data.ToHeaders DeleteImport where
toHeaders :: DeleteImport -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DeleteImport where
toPath :: DeleteImport -> ByteString
toPath DeleteImport' {Text
importId :: Text
$sel:importId:DeleteImport' :: DeleteImport -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/imports/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
importId, ByteString
"/"]
instance Data.ToQuery DeleteImport where
toQuery :: DeleteImport -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteImportResponse = DeleteImportResponse'
{
DeleteImportResponse -> Maybe Text
importId :: Prelude.Maybe Prelude.Text,
DeleteImportResponse -> Maybe ImportStatus
importStatus :: Prelude.Maybe ImportStatus,
DeleteImportResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteImportResponse -> DeleteImportResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteImportResponse -> DeleteImportResponse -> Bool
$c/= :: DeleteImportResponse -> DeleteImportResponse -> Bool
== :: DeleteImportResponse -> DeleteImportResponse -> Bool
$c== :: DeleteImportResponse -> DeleteImportResponse -> Bool
Prelude.Eq, ReadPrec [DeleteImportResponse]
ReadPrec DeleteImportResponse
Int -> ReadS DeleteImportResponse
ReadS [DeleteImportResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteImportResponse]
$creadListPrec :: ReadPrec [DeleteImportResponse]
readPrec :: ReadPrec DeleteImportResponse
$creadPrec :: ReadPrec DeleteImportResponse
readList :: ReadS [DeleteImportResponse]
$creadList :: ReadS [DeleteImportResponse]
readsPrec :: Int -> ReadS DeleteImportResponse
$creadsPrec :: Int -> ReadS DeleteImportResponse
Prelude.Read, Int -> DeleteImportResponse -> ShowS
[DeleteImportResponse] -> ShowS
DeleteImportResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteImportResponse] -> ShowS
$cshowList :: [DeleteImportResponse] -> ShowS
show :: DeleteImportResponse -> String
$cshow :: DeleteImportResponse -> String
showsPrec :: Int -> DeleteImportResponse -> ShowS
$cshowsPrec :: Int -> DeleteImportResponse -> ShowS
Prelude.Show, forall x. Rep DeleteImportResponse x -> DeleteImportResponse
forall x. DeleteImportResponse -> Rep DeleteImportResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteImportResponse x -> DeleteImportResponse
$cfrom :: forall x. DeleteImportResponse -> Rep DeleteImportResponse x
Prelude.Generic)
newDeleteImportResponse ::
Prelude.Int ->
DeleteImportResponse
newDeleteImportResponse :: Int -> DeleteImportResponse
newDeleteImportResponse Int
pHttpStatus_ =
DeleteImportResponse'
{ $sel:importId:DeleteImportResponse' :: Maybe Text
importId = forall a. Maybe a
Prelude.Nothing,
$sel:importStatus:DeleteImportResponse' :: Maybe ImportStatus
importStatus = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteImportResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteImportResponse_importId :: Lens.Lens' DeleteImportResponse (Prelude.Maybe Prelude.Text)
deleteImportResponse_importId :: Lens' DeleteImportResponse (Maybe Text)
deleteImportResponse_importId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteImportResponse' {Maybe Text
importId :: Maybe Text
$sel:importId:DeleteImportResponse' :: DeleteImportResponse -> Maybe Text
importId} -> Maybe Text
importId) (\s :: DeleteImportResponse
s@DeleteImportResponse' {} Maybe Text
a -> DeleteImportResponse
s {$sel:importId:DeleteImportResponse' :: Maybe Text
importId = Maybe Text
a} :: DeleteImportResponse)
deleteImportResponse_importStatus :: Lens.Lens' DeleteImportResponse (Prelude.Maybe ImportStatus)
deleteImportResponse_importStatus :: Lens' DeleteImportResponse (Maybe ImportStatus)
deleteImportResponse_importStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteImportResponse' {Maybe ImportStatus
importStatus :: Maybe ImportStatus
$sel:importStatus:DeleteImportResponse' :: DeleteImportResponse -> Maybe ImportStatus
importStatus} -> Maybe ImportStatus
importStatus) (\s :: DeleteImportResponse
s@DeleteImportResponse' {} Maybe ImportStatus
a -> DeleteImportResponse
s {$sel:importStatus:DeleteImportResponse' :: Maybe ImportStatus
importStatus = Maybe ImportStatus
a} :: DeleteImportResponse)
deleteImportResponse_httpStatus :: Lens.Lens' DeleteImportResponse Prelude.Int
deleteImportResponse_httpStatus :: Lens' DeleteImportResponse Int
deleteImportResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteImportResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteImportResponse' :: DeleteImportResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteImportResponse
s@DeleteImportResponse' {} Int
a -> DeleteImportResponse
s {$sel:httpStatus:DeleteImportResponse' :: Int
httpStatus = Int
a} :: DeleteImportResponse)
instance Prelude.NFData DeleteImportResponse where
rnf :: DeleteImportResponse -> ()
rnf DeleteImportResponse' {Int
Maybe Text
Maybe ImportStatus
httpStatus :: Int
importStatus :: Maybe ImportStatus
importId :: Maybe Text
$sel:httpStatus:DeleteImportResponse' :: DeleteImportResponse -> Int
$sel:importStatus:DeleteImportResponse' :: DeleteImportResponse -> Maybe ImportStatus
$sel:importId:DeleteImportResponse' :: DeleteImportResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
importId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ImportStatus
importStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus