{-# 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.DisassociateIpGroups
(
DisassociateIpGroups (..),
newDisassociateIpGroups,
disassociateIpGroups_directoryId,
disassociateIpGroups_groupIds,
DisassociateIpGroupsResponse (..),
newDisassociateIpGroupsResponse,
disassociateIpGroupsResponse_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 DisassociateIpGroups = DisassociateIpGroups'
{
DisassociateIpGroups -> Text
directoryId :: Prelude.Text,
DisassociateIpGroups -> [Text]
groupIds :: [Prelude.Text]
}
deriving (DisassociateIpGroups -> DisassociateIpGroups -> Bool
(DisassociateIpGroups -> DisassociateIpGroups -> Bool)
-> (DisassociateIpGroups -> DisassociateIpGroups -> Bool)
-> Eq DisassociateIpGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateIpGroups -> DisassociateIpGroups -> Bool
$c/= :: DisassociateIpGroups -> DisassociateIpGroups -> Bool
== :: DisassociateIpGroups -> DisassociateIpGroups -> Bool
$c== :: DisassociateIpGroups -> DisassociateIpGroups -> Bool
Prelude.Eq, ReadPrec [DisassociateIpGroups]
ReadPrec DisassociateIpGroups
Int -> ReadS DisassociateIpGroups
ReadS [DisassociateIpGroups]
(Int -> ReadS DisassociateIpGroups)
-> ReadS [DisassociateIpGroups]
-> ReadPrec DisassociateIpGroups
-> ReadPrec [DisassociateIpGroups]
-> Read DisassociateIpGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateIpGroups]
$creadListPrec :: ReadPrec [DisassociateIpGroups]
readPrec :: ReadPrec DisassociateIpGroups
$creadPrec :: ReadPrec DisassociateIpGroups
readList :: ReadS [DisassociateIpGroups]
$creadList :: ReadS [DisassociateIpGroups]
readsPrec :: Int -> ReadS DisassociateIpGroups
$creadsPrec :: Int -> ReadS DisassociateIpGroups
Prelude.Read, Int -> DisassociateIpGroups -> ShowS
[DisassociateIpGroups] -> ShowS
DisassociateIpGroups -> String
(Int -> DisassociateIpGroups -> ShowS)
-> (DisassociateIpGroups -> String)
-> ([DisassociateIpGroups] -> ShowS)
-> Show DisassociateIpGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateIpGroups] -> ShowS
$cshowList :: [DisassociateIpGroups] -> ShowS
show :: DisassociateIpGroups -> String
$cshow :: DisassociateIpGroups -> String
showsPrec :: Int -> DisassociateIpGroups -> ShowS
$cshowsPrec :: Int -> DisassociateIpGroups -> ShowS
Prelude.Show, (forall x. DisassociateIpGroups -> Rep DisassociateIpGroups x)
-> (forall x. Rep DisassociateIpGroups x -> DisassociateIpGroups)
-> Generic DisassociateIpGroups
forall x. Rep DisassociateIpGroups x -> DisassociateIpGroups
forall x. DisassociateIpGroups -> Rep DisassociateIpGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisassociateIpGroups x -> DisassociateIpGroups
$cfrom :: forall x. DisassociateIpGroups -> Rep DisassociateIpGroups x
Prelude.Generic)
newDisassociateIpGroups ::
Prelude.Text ->
DisassociateIpGroups
newDisassociateIpGroups :: Text -> DisassociateIpGroups
newDisassociateIpGroups Text
pDirectoryId_ =
DisassociateIpGroups' :: Text -> [Text] -> DisassociateIpGroups
DisassociateIpGroups'
{ $sel:directoryId:DisassociateIpGroups' :: Text
directoryId = Text
pDirectoryId_,
$sel:groupIds:DisassociateIpGroups' :: [Text]
groupIds = [Text]
forall a. Monoid a => a
Prelude.mempty
}
disassociateIpGroups_directoryId :: Lens.Lens' DisassociateIpGroups Prelude.Text
disassociateIpGroups_directoryId :: (Text -> f Text) -> DisassociateIpGroups -> f DisassociateIpGroups
disassociateIpGroups_directoryId = (DisassociateIpGroups -> Text)
-> (DisassociateIpGroups -> Text -> DisassociateIpGroups)
-> Lens DisassociateIpGroups DisassociateIpGroups Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateIpGroups' {Text
directoryId :: Text
$sel:directoryId:DisassociateIpGroups' :: DisassociateIpGroups -> Text
directoryId} -> Text
directoryId) (\s :: DisassociateIpGroups
s@DisassociateIpGroups' {} Text
a -> DisassociateIpGroups
s {$sel:directoryId:DisassociateIpGroups' :: Text
directoryId = Text
a} :: DisassociateIpGroups)
disassociateIpGroups_groupIds :: Lens.Lens' DisassociateIpGroups [Prelude.Text]
disassociateIpGroups_groupIds :: ([Text] -> f [Text])
-> DisassociateIpGroups -> f DisassociateIpGroups
disassociateIpGroups_groupIds = (DisassociateIpGroups -> [Text])
-> (DisassociateIpGroups -> [Text] -> DisassociateIpGroups)
-> Lens DisassociateIpGroups DisassociateIpGroups [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateIpGroups' {[Text]
groupIds :: [Text]
$sel:groupIds:DisassociateIpGroups' :: DisassociateIpGroups -> [Text]
groupIds} -> [Text]
groupIds) (\s :: DisassociateIpGroups
s@DisassociateIpGroups' {} [Text]
a -> DisassociateIpGroups
s {$sel:groupIds:DisassociateIpGroups' :: [Text]
groupIds = [Text]
a} :: DisassociateIpGroups) (([Text] -> f [Text])
-> DisassociateIpGroups -> f DisassociateIpGroups)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DisassociateIpGroups
-> f DisassociateIpGroups
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 DisassociateIpGroups where
type
AWSResponse DisassociateIpGroups =
DisassociateIpGroupsResponse
request :: DisassociateIpGroups -> Request DisassociateIpGroups
request = Service -> DisassociateIpGroups -> Request DisassociateIpGroups
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DisassociateIpGroups
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateIpGroups)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DisassociateIpGroups))
-> Logger
-> Service
-> Proxy DisassociateIpGroups
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateIpGroups)))
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 -> DisassociateIpGroupsResponse
DisassociateIpGroupsResponse'
(Int -> DisassociateIpGroupsResponse)
-> Either String Int -> Either String DisassociateIpGroupsResponse
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 DisassociateIpGroups
instance Prelude.NFData DisassociateIpGroups
instance Core.ToHeaders DisassociateIpGroups where
toHeaders :: DisassociateIpGroups -> ResponseHeaders
toHeaders =
ResponseHeaders -> DisassociateIpGroups -> 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.DisassociateIpGroups" ::
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 DisassociateIpGroups where
toJSON :: DisassociateIpGroups -> Value
toJSON DisassociateIpGroups' {[Text]
Text
groupIds :: [Text]
directoryId :: Text
$sel:groupIds:DisassociateIpGroups' :: DisassociateIpGroups -> [Text]
$sel:directoryId:DisassociateIpGroups' :: DisassociateIpGroups -> 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
"DirectoryId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
directoryId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"GroupIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
groupIds)
]
)
instance Core.ToPath DisassociateIpGroups where
toPath :: DisassociateIpGroups -> ByteString
toPath = ByteString -> DisassociateIpGroups -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DisassociateIpGroups where
toQuery :: DisassociateIpGroups -> QueryString
toQuery = QueryString -> DisassociateIpGroups -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DisassociateIpGroupsResponse = DisassociateIpGroupsResponse'
{
DisassociateIpGroupsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociateIpGroupsResponse
-> DisassociateIpGroupsResponse -> Bool
(DisassociateIpGroupsResponse
-> DisassociateIpGroupsResponse -> Bool)
-> (DisassociateIpGroupsResponse
-> DisassociateIpGroupsResponse -> Bool)
-> Eq DisassociateIpGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateIpGroupsResponse
-> DisassociateIpGroupsResponse -> Bool
$c/= :: DisassociateIpGroupsResponse
-> DisassociateIpGroupsResponse -> Bool
== :: DisassociateIpGroupsResponse
-> DisassociateIpGroupsResponse -> Bool
$c== :: DisassociateIpGroupsResponse
-> DisassociateIpGroupsResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateIpGroupsResponse]
ReadPrec DisassociateIpGroupsResponse
Int -> ReadS DisassociateIpGroupsResponse
ReadS [DisassociateIpGroupsResponse]
(Int -> ReadS DisassociateIpGroupsResponse)
-> ReadS [DisassociateIpGroupsResponse]
-> ReadPrec DisassociateIpGroupsResponse
-> ReadPrec [DisassociateIpGroupsResponse]
-> Read DisassociateIpGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateIpGroupsResponse]
$creadListPrec :: ReadPrec [DisassociateIpGroupsResponse]
readPrec :: ReadPrec DisassociateIpGroupsResponse
$creadPrec :: ReadPrec DisassociateIpGroupsResponse
readList :: ReadS [DisassociateIpGroupsResponse]
$creadList :: ReadS [DisassociateIpGroupsResponse]
readsPrec :: Int -> ReadS DisassociateIpGroupsResponse
$creadsPrec :: Int -> ReadS DisassociateIpGroupsResponse
Prelude.Read, Int -> DisassociateIpGroupsResponse -> ShowS
[DisassociateIpGroupsResponse] -> ShowS
DisassociateIpGroupsResponse -> String
(Int -> DisassociateIpGroupsResponse -> ShowS)
-> (DisassociateIpGroupsResponse -> String)
-> ([DisassociateIpGroupsResponse] -> ShowS)
-> Show DisassociateIpGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateIpGroupsResponse] -> ShowS
$cshowList :: [DisassociateIpGroupsResponse] -> ShowS
show :: DisassociateIpGroupsResponse -> String
$cshow :: DisassociateIpGroupsResponse -> String
showsPrec :: Int -> DisassociateIpGroupsResponse -> ShowS
$cshowsPrec :: Int -> DisassociateIpGroupsResponse -> ShowS
Prelude.Show, (forall x.
DisassociateIpGroupsResponse -> Rep DisassociateIpGroupsResponse x)
-> (forall x.
Rep DisassociateIpGroupsResponse x -> DisassociateIpGroupsResponse)
-> Generic DisassociateIpGroupsResponse
forall x.
Rep DisassociateIpGroupsResponse x -> DisassociateIpGroupsResponse
forall x.
DisassociateIpGroupsResponse -> Rep DisassociateIpGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateIpGroupsResponse x -> DisassociateIpGroupsResponse
$cfrom :: forall x.
DisassociateIpGroupsResponse -> Rep DisassociateIpGroupsResponse x
Prelude.Generic)
newDisassociateIpGroupsResponse ::
Prelude.Int ->
DisassociateIpGroupsResponse
newDisassociateIpGroupsResponse :: Int -> DisassociateIpGroupsResponse
newDisassociateIpGroupsResponse Int
pHttpStatus_ =
DisassociateIpGroupsResponse' :: Int -> DisassociateIpGroupsResponse
DisassociateIpGroupsResponse'
{ $sel:httpStatus:DisassociateIpGroupsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
disassociateIpGroupsResponse_httpStatus :: Lens.Lens' DisassociateIpGroupsResponse Prelude.Int
disassociateIpGroupsResponse_httpStatus :: (Int -> f Int)
-> DisassociateIpGroupsResponse -> f DisassociateIpGroupsResponse
disassociateIpGroupsResponse_httpStatus = (DisassociateIpGroupsResponse -> Int)
-> (DisassociateIpGroupsResponse
-> Int -> DisassociateIpGroupsResponse)
-> Lens
DisassociateIpGroupsResponse DisassociateIpGroupsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateIpGroupsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateIpGroupsResponse' :: DisassociateIpGroupsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateIpGroupsResponse
s@DisassociateIpGroupsResponse' {} Int
a -> DisassociateIpGroupsResponse
s {$sel:httpStatus:DisassociateIpGroupsResponse' :: Int
httpStatus = Int
a} :: DisassociateIpGroupsResponse)
instance Prelude.NFData DisassociateIpGroupsResponse