{-# 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.Synthetics.DisassociateResource
(
DisassociateResource (..),
newDisassociateResource,
disassociateResource_groupIdentifier,
disassociateResource_resourceArn,
DisassociateResourceResponse (..),
newDisassociateResourceResponse,
disassociateResourceResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Synthetics.Types
data DisassociateResource = DisassociateResource'
{
DisassociateResource -> Text
groupIdentifier :: Prelude.Text,
DisassociateResource -> Text
resourceArn :: Prelude.Text
}
deriving (DisassociateResource -> DisassociateResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateResource -> DisassociateResource -> Bool
$c/= :: DisassociateResource -> DisassociateResource -> Bool
== :: DisassociateResource -> DisassociateResource -> Bool
$c== :: DisassociateResource -> DisassociateResource -> Bool
Prelude.Eq, ReadPrec [DisassociateResource]
ReadPrec DisassociateResource
Int -> ReadS DisassociateResource
ReadS [DisassociateResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateResource]
$creadListPrec :: ReadPrec [DisassociateResource]
readPrec :: ReadPrec DisassociateResource
$creadPrec :: ReadPrec DisassociateResource
readList :: ReadS [DisassociateResource]
$creadList :: ReadS [DisassociateResource]
readsPrec :: Int -> ReadS DisassociateResource
$creadsPrec :: Int -> ReadS DisassociateResource
Prelude.Read, Int -> DisassociateResource -> ShowS
[DisassociateResource] -> ShowS
DisassociateResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateResource] -> ShowS
$cshowList :: [DisassociateResource] -> ShowS
show :: DisassociateResource -> String
$cshow :: DisassociateResource -> String
showsPrec :: Int -> DisassociateResource -> ShowS
$cshowsPrec :: Int -> DisassociateResource -> ShowS
Prelude.Show, forall x. Rep DisassociateResource x -> DisassociateResource
forall x. DisassociateResource -> Rep DisassociateResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisassociateResource x -> DisassociateResource
$cfrom :: forall x. DisassociateResource -> Rep DisassociateResource x
Prelude.Generic)
newDisassociateResource ::
Prelude.Text ->
Prelude.Text ->
DisassociateResource
newDisassociateResource :: Text -> Text -> DisassociateResource
newDisassociateResource
Text
pGroupIdentifier_
Text
pResourceArn_ =
DisassociateResource'
{ $sel:groupIdentifier:DisassociateResource' :: Text
groupIdentifier =
Text
pGroupIdentifier_,
$sel:resourceArn:DisassociateResource' :: Text
resourceArn = Text
pResourceArn_
}
disassociateResource_groupIdentifier :: Lens.Lens' DisassociateResource Prelude.Text
disassociateResource_groupIdentifier :: Lens' DisassociateResource Text
disassociateResource_groupIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateResource' {Text
groupIdentifier :: Text
$sel:groupIdentifier:DisassociateResource' :: DisassociateResource -> Text
groupIdentifier} -> Text
groupIdentifier) (\s :: DisassociateResource
s@DisassociateResource' {} Text
a -> DisassociateResource
s {$sel:groupIdentifier:DisassociateResource' :: Text
groupIdentifier = Text
a} :: DisassociateResource)
disassociateResource_resourceArn :: Lens.Lens' DisassociateResource Prelude.Text
disassociateResource_resourceArn :: Lens' DisassociateResource Text
disassociateResource_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateResource' {Text
resourceArn :: Text
$sel:resourceArn:DisassociateResource' :: DisassociateResource -> Text
resourceArn} -> Text
resourceArn) (\s :: DisassociateResource
s@DisassociateResource' {} Text
a -> DisassociateResource
s {$sel:resourceArn:DisassociateResource' :: Text
resourceArn = Text
a} :: DisassociateResource)
instance Core.AWSRequest DisassociateResource where
type
AWSResponse DisassociateResource =
DisassociateResourceResponse
request :: (Service -> Service)
-> DisassociateResource -> Request DisassociateResource
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DisassociateResource
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateResource)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DisassociateResourceResponse
DisassociateResourceResponse'
forall (f :: * -> *) a b. Functor 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 DisassociateResource where
hashWithSalt :: Int -> DisassociateResource -> Int
hashWithSalt Int
_salt DisassociateResource' {Text
resourceArn :: Text
groupIdentifier :: Text
$sel:resourceArn:DisassociateResource' :: DisassociateResource -> Text
$sel:groupIdentifier:DisassociateResource' :: DisassociateResource -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
groupIdentifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceArn
instance Prelude.NFData DisassociateResource where
rnf :: DisassociateResource -> ()
rnf DisassociateResource' {Text
resourceArn :: Text
groupIdentifier :: Text
$sel:resourceArn:DisassociateResource' :: DisassociateResource -> Text
$sel:groupIdentifier:DisassociateResource' :: DisassociateResource -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
groupIdentifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceArn
instance Data.ToHeaders DisassociateResource where
toHeaders :: DisassociateResource -> 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.ToJSON DisassociateResource where
toJSON :: DisassociateResource -> Value
toJSON DisassociateResource' {Text
resourceArn :: Text
groupIdentifier :: Text
$sel:resourceArn:DisassociateResource' :: DisassociateResource -> Text
$sel:groupIdentifier:DisassociateResource' :: DisassociateResource -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"ResourceArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
resourceArn)]
)
instance Data.ToPath DisassociateResource where
toPath :: DisassociateResource -> ByteString
toPath DisassociateResource' {Text
resourceArn :: Text
groupIdentifier :: Text
$sel:resourceArn:DisassociateResource' :: DisassociateResource -> Text
$sel:groupIdentifier:DisassociateResource' :: DisassociateResource -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/group/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
groupIdentifier,
ByteString
"/disassociate"
]
instance Data.ToQuery DisassociateResource where
toQuery :: DisassociateResource -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DisassociateResourceResponse = DisassociateResourceResponse'
{
DisassociateResourceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociateResourceResponse
-> DisassociateResourceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateResourceResponse
-> DisassociateResourceResponse -> Bool
$c/= :: DisassociateResourceResponse
-> DisassociateResourceResponse -> Bool
== :: DisassociateResourceResponse
-> DisassociateResourceResponse -> Bool
$c== :: DisassociateResourceResponse
-> DisassociateResourceResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateResourceResponse]
ReadPrec DisassociateResourceResponse
Int -> ReadS DisassociateResourceResponse
ReadS [DisassociateResourceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateResourceResponse]
$creadListPrec :: ReadPrec [DisassociateResourceResponse]
readPrec :: ReadPrec DisassociateResourceResponse
$creadPrec :: ReadPrec DisassociateResourceResponse
readList :: ReadS [DisassociateResourceResponse]
$creadList :: ReadS [DisassociateResourceResponse]
readsPrec :: Int -> ReadS DisassociateResourceResponse
$creadsPrec :: Int -> ReadS DisassociateResourceResponse
Prelude.Read, Int -> DisassociateResourceResponse -> ShowS
[DisassociateResourceResponse] -> ShowS
DisassociateResourceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateResourceResponse] -> ShowS
$cshowList :: [DisassociateResourceResponse] -> ShowS
show :: DisassociateResourceResponse -> String
$cshow :: DisassociateResourceResponse -> String
showsPrec :: Int -> DisassociateResourceResponse -> ShowS
$cshowsPrec :: Int -> DisassociateResourceResponse -> ShowS
Prelude.Show, forall x.
Rep DisassociateResourceResponse x -> DisassociateResourceResponse
forall x.
DisassociateResourceResponse -> Rep DisassociateResourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateResourceResponse x -> DisassociateResourceResponse
$cfrom :: forall x.
DisassociateResourceResponse -> Rep DisassociateResourceResponse x
Prelude.Generic)
newDisassociateResourceResponse ::
Prelude.Int ->
DisassociateResourceResponse
newDisassociateResourceResponse :: Int -> DisassociateResourceResponse
newDisassociateResourceResponse Int
pHttpStatus_ =
DisassociateResourceResponse'
{ $sel:httpStatus:DisassociateResourceResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
disassociateResourceResponse_httpStatus :: Lens.Lens' DisassociateResourceResponse Prelude.Int
disassociateResourceResponse_httpStatus :: Lens' DisassociateResourceResponse Int
disassociateResourceResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateResourceResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateResourceResponse' :: DisassociateResourceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateResourceResponse
s@DisassociateResourceResponse' {} Int
a -> DisassociateResourceResponse
s {$sel:httpStatus:DisassociateResourceResponse' :: Int
httpStatus = Int
a} :: DisassociateResourceResponse)
instance Prelude.NFData DisassociateResourceResponse where
rnf :: DisassociateResourceResponse -> ()
rnf DisassociateResourceResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateResourceResponse' :: DisassociateResourceResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus