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