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