{-# 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.Discovery.DeleteApplications
(
DeleteApplications (..),
newDeleteApplications,
deleteApplications_configurationIds,
DeleteApplicationsResponse (..),
newDeleteApplicationsResponse,
deleteApplicationsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Discovery.Types
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 DeleteApplications = DeleteApplications'
{
DeleteApplications -> [Text]
configurationIds :: [Prelude.Text]
}
deriving (DeleteApplications -> DeleteApplications -> Bool
(DeleteApplications -> DeleteApplications -> Bool)
-> (DeleteApplications -> DeleteApplications -> Bool)
-> Eq DeleteApplications
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteApplications -> DeleteApplications -> Bool
$c/= :: DeleteApplications -> DeleteApplications -> Bool
== :: DeleteApplications -> DeleteApplications -> Bool
$c== :: DeleteApplications -> DeleteApplications -> Bool
Prelude.Eq, ReadPrec [DeleteApplications]
ReadPrec DeleteApplications
Int -> ReadS DeleteApplications
ReadS [DeleteApplications]
(Int -> ReadS DeleteApplications)
-> ReadS [DeleteApplications]
-> ReadPrec DeleteApplications
-> ReadPrec [DeleteApplications]
-> Read DeleteApplications
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteApplications]
$creadListPrec :: ReadPrec [DeleteApplications]
readPrec :: ReadPrec DeleteApplications
$creadPrec :: ReadPrec DeleteApplications
readList :: ReadS [DeleteApplications]
$creadList :: ReadS [DeleteApplications]
readsPrec :: Int -> ReadS DeleteApplications
$creadsPrec :: Int -> ReadS DeleteApplications
Prelude.Read, Int -> DeleteApplications -> ShowS
[DeleteApplications] -> ShowS
DeleteApplications -> String
(Int -> DeleteApplications -> ShowS)
-> (DeleteApplications -> String)
-> ([DeleteApplications] -> ShowS)
-> Show DeleteApplications
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteApplications] -> ShowS
$cshowList :: [DeleteApplications] -> ShowS
show :: DeleteApplications -> String
$cshow :: DeleteApplications -> String
showsPrec :: Int -> DeleteApplications -> ShowS
$cshowsPrec :: Int -> DeleteApplications -> ShowS
Prelude.Show, (forall x. DeleteApplications -> Rep DeleteApplications x)
-> (forall x. Rep DeleteApplications x -> DeleteApplications)
-> Generic DeleteApplications
forall x. Rep DeleteApplications x -> DeleteApplications
forall x. DeleteApplications -> Rep DeleteApplications x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteApplications x -> DeleteApplications
$cfrom :: forall x. DeleteApplications -> Rep DeleteApplications x
Prelude.Generic)
newDeleteApplications ::
DeleteApplications
newDeleteApplications :: DeleteApplications
newDeleteApplications =
DeleteApplications' :: [Text] -> DeleteApplications
DeleteApplications'
{ $sel:configurationIds:DeleteApplications' :: [Text]
configurationIds =
[Text]
forall a. Monoid a => a
Prelude.mempty
}
deleteApplications_configurationIds :: Lens.Lens' DeleteApplications [Prelude.Text]
deleteApplications_configurationIds :: ([Text] -> f [Text]) -> DeleteApplications -> f DeleteApplications
deleteApplications_configurationIds = (DeleteApplications -> [Text])
-> (DeleteApplications -> [Text] -> DeleteApplications)
-> Lens DeleteApplications DeleteApplications [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteApplications' {[Text]
configurationIds :: [Text]
$sel:configurationIds:DeleteApplications' :: DeleteApplications -> [Text]
configurationIds} -> [Text]
configurationIds) (\s :: DeleteApplications
s@DeleteApplications' {} [Text]
a -> DeleteApplications
s {$sel:configurationIds:DeleteApplications' :: [Text]
configurationIds = [Text]
a} :: DeleteApplications) (([Text] -> f [Text])
-> DeleteApplications -> f DeleteApplications)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DeleteApplications
-> f DeleteApplications
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest DeleteApplications where
type
AWSResponse DeleteApplications =
DeleteApplicationsResponse
request :: DeleteApplications -> Request DeleteApplications
request = Service -> DeleteApplications -> Request DeleteApplications
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteApplications
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteApplications)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteApplications))
-> Logger
-> Service
-> Proxy DeleteApplications
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteApplications)))
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 -> DeleteApplicationsResponse
DeleteApplicationsResponse'
(Int -> DeleteApplicationsResponse)
-> Either String Int -> Either String DeleteApplicationsResponse
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 DeleteApplications
instance Prelude.NFData DeleteApplications
instance Core.ToHeaders DeleteApplications where
toHeaders :: DeleteApplications -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteApplications -> 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
"AWSPoseidonService_V2015_11_01.DeleteApplications" ::
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 DeleteApplications where
toJSON :: DeleteApplications -> Value
toJSON DeleteApplications' {[Text]
configurationIds :: [Text]
$sel:configurationIds:DeleteApplications' :: DeleteApplications -> [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"configurationIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
configurationIds)
]
)
instance Core.ToPath DeleteApplications where
toPath :: DeleteApplications -> ByteString
toPath = ByteString -> DeleteApplications -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteApplications where
toQuery :: DeleteApplications -> QueryString
toQuery = QueryString -> DeleteApplications -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteApplicationsResponse = DeleteApplicationsResponse'
{
DeleteApplicationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteApplicationsResponse -> DeleteApplicationsResponse -> Bool
(DeleteApplicationsResponse -> DeleteApplicationsResponse -> Bool)
-> (DeleteApplicationsResponse
-> DeleteApplicationsResponse -> Bool)
-> Eq DeleteApplicationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteApplicationsResponse -> DeleteApplicationsResponse -> Bool
$c/= :: DeleteApplicationsResponse -> DeleteApplicationsResponse -> Bool
== :: DeleteApplicationsResponse -> DeleteApplicationsResponse -> Bool
$c== :: DeleteApplicationsResponse -> DeleteApplicationsResponse -> Bool
Prelude.Eq, ReadPrec [DeleteApplicationsResponse]
ReadPrec DeleteApplicationsResponse
Int -> ReadS DeleteApplicationsResponse
ReadS [DeleteApplicationsResponse]
(Int -> ReadS DeleteApplicationsResponse)
-> ReadS [DeleteApplicationsResponse]
-> ReadPrec DeleteApplicationsResponse
-> ReadPrec [DeleteApplicationsResponse]
-> Read DeleteApplicationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteApplicationsResponse]
$creadListPrec :: ReadPrec [DeleteApplicationsResponse]
readPrec :: ReadPrec DeleteApplicationsResponse
$creadPrec :: ReadPrec DeleteApplicationsResponse
readList :: ReadS [DeleteApplicationsResponse]
$creadList :: ReadS [DeleteApplicationsResponse]
readsPrec :: Int -> ReadS DeleteApplicationsResponse
$creadsPrec :: Int -> ReadS DeleteApplicationsResponse
Prelude.Read, Int -> DeleteApplicationsResponse -> ShowS
[DeleteApplicationsResponse] -> ShowS
DeleteApplicationsResponse -> String
(Int -> DeleteApplicationsResponse -> ShowS)
-> (DeleteApplicationsResponse -> String)
-> ([DeleteApplicationsResponse] -> ShowS)
-> Show DeleteApplicationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteApplicationsResponse] -> ShowS
$cshowList :: [DeleteApplicationsResponse] -> ShowS
show :: DeleteApplicationsResponse -> String
$cshow :: DeleteApplicationsResponse -> String
showsPrec :: Int -> DeleteApplicationsResponse -> ShowS
$cshowsPrec :: Int -> DeleteApplicationsResponse -> ShowS
Prelude.Show, (forall x.
DeleteApplicationsResponse -> Rep DeleteApplicationsResponse x)
-> (forall x.
Rep DeleteApplicationsResponse x -> DeleteApplicationsResponse)
-> Generic DeleteApplicationsResponse
forall x.
Rep DeleteApplicationsResponse x -> DeleteApplicationsResponse
forall x.
DeleteApplicationsResponse -> Rep DeleteApplicationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteApplicationsResponse x -> DeleteApplicationsResponse
$cfrom :: forall x.
DeleteApplicationsResponse -> Rep DeleteApplicationsResponse x
Prelude.Generic)
newDeleteApplicationsResponse ::
Prelude.Int ->
DeleteApplicationsResponse
newDeleteApplicationsResponse :: Int -> DeleteApplicationsResponse
newDeleteApplicationsResponse Int
pHttpStatus_ =
DeleteApplicationsResponse' :: Int -> DeleteApplicationsResponse
DeleteApplicationsResponse'
{ $sel:httpStatus:DeleteApplicationsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteApplicationsResponse_httpStatus :: Lens.Lens' DeleteApplicationsResponse Prelude.Int
deleteApplicationsResponse_httpStatus :: (Int -> f Int)
-> DeleteApplicationsResponse -> f DeleteApplicationsResponse
deleteApplicationsResponse_httpStatus = (DeleteApplicationsResponse -> Int)
-> (DeleteApplicationsResponse
-> Int -> DeleteApplicationsResponse)
-> Lens
DeleteApplicationsResponse DeleteApplicationsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteApplicationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteApplicationsResponse' :: DeleteApplicationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteApplicationsResponse
s@DeleteApplicationsResponse' {} Int
a -> DeleteApplicationsResponse
s {$sel:httpStatus:DeleteApplicationsResponse' :: Int
httpStatus = Int
a} :: DeleteApplicationsResponse)
instance Prelude.NFData DeleteApplicationsResponse