{-# 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.Grafana.DisassociateLicense
(
DisassociateLicense (..),
newDisassociateLicense,
disassociateLicense_licenseType,
disassociateLicense_workspaceId,
DisassociateLicenseResponse (..),
newDisassociateLicenseResponse,
disassociateLicenseResponse_httpStatus,
disassociateLicenseResponse_workspace,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Grafana.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DisassociateLicense = DisassociateLicense'
{
DisassociateLicense -> LicenseType
licenseType :: LicenseType,
DisassociateLicense -> Text
workspaceId :: Prelude.Text
}
deriving (DisassociateLicense -> DisassociateLicense -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateLicense -> DisassociateLicense -> Bool
$c/= :: DisassociateLicense -> DisassociateLicense -> Bool
== :: DisassociateLicense -> DisassociateLicense -> Bool
$c== :: DisassociateLicense -> DisassociateLicense -> Bool
Prelude.Eq, ReadPrec [DisassociateLicense]
ReadPrec DisassociateLicense
Int -> ReadS DisassociateLicense
ReadS [DisassociateLicense]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateLicense]
$creadListPrec :: ReadPrec [DisassociateLicense]
readPrec :: ReadPrec DisassociateLicense
$creadPrec :: ReadPrec DisassociateLicense
readList :: ReadS [DisassociateLicense]
$creadList :: ReadS [DisassociateLicense]
readsPrec :: Int -> ReadS DisassociateLicense
$creadsPrec :: Int -> ReadS DisassociateLicense
Prelude.Read, Int -> DisassociateLicense -> ShowS
[DisassociateLicense] -> ShowS
DisassociateLicense -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateLicense] -> ShowS
$cshowList :: [DisassociateLicense] -> ShowS
show :: DisassociateLicense -> String
$cshow :: DisassociateLicense -> String
showsPrec :: Int -> DisassociateLicense -> ShowS
$cshowsPrec :: Int -> DisassociateLicense -> ShowS
Prelude.Show, forall x. Rep DisassociateLicense x -> DisassociateLicense
forall x. DisassociateLicense -> Rep DisassociateLicense x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisassociateLicense x -> DisassociateLicense
$cfrom :: forall x. DisassociateLicense -> Rep DisassociateLicense x
Prelude.Generic)
newDisassociateLicense ::
LicenseType ->
Prelude.Text ->
DisassociateLicense
newDisassociateLicense :: LicenseType -> Text -> DisassociateLicense
newDisassociateLicense LicenseType
pLicenseType_ Text
pWorkspaceId_ =
DisassociateLicense'
{ $sel:licenseType:DisassociateLicense' :: LicenseType
licenseType = LicenseType
pLicenseType_,
$sel:workspaceId:DisassociateLicense' :: Text
workspaceId = Text
pWorkspaceId_
}
disassociateLicense_licenseType :: Lens.Lens' DisassociateLicense LicenseType
disassociateLicense_licenseType :: Lens' DisassociateLicense LicenseType
disassociateLicense_licenseType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateLicense' {LicenseType
licenseType :: LicenseType
$sel:licenseType:DisassociateLicense' :: DisassociateLicense -> LicenseType
licenseType} -> LicenseType
licenseType) (\s :: DisassociateLicense
s@DisassociateLicense' {} LicenseType
a -> DisassociateLicense
s {$sel:licenseType:DisassociateLicense' :: LicenseType
licenseType = LicenseType
a} :: DisassociateLicense)
disassociateLicense_workspaceId :: Lens.Lens' DisassociateLicense Prelude.Text
disassociateLicense_workspaceId :: Lens' DisassociateLicense Text
disassociateLicense_workspaceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateLicense' {Text
workspaceId :: Text
$sel:workspaceId:DisassociateLicense' :: DisassociateLicense -> Text
workspaceId} -> Text
workspaceId) (\s :: DisassociateLicense
s@DisassociateLicense' {} Text
a -> DisassociateLicense
s {$sel:workspaceId:DisassociateLicense' :: Text
workspaceId = Text
a} :: DisassociateLicense)
instance Core.AWSRequest DisassociateLicense where
type
AWSResponse DisassociateLicense =
DisassociateLicenseResponse
request :: (Service -> Service)
-> DisassociateLicense -> Request DisassociateLicense
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DisassociateLicense
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateLicense)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> WorkspaceDescription -> DisassociateLicenseResponse
DisassociateLicenseResponse'
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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"workspace")
)
instance Prelude.Hashable DisassociateLicense where
hashWithSalt :: Int -> DisassociateLicense -> Int
hashWithSalt Int
_salt DisassociateLicense' {Text
LicenseType
workspaceId :: Text
licenseType :: LicenseType
$sel:workspaceId:DisassociateLicense' :: DisassociateLicense -> Text
$sel:licenseType:DisassociateLicense' :: DisassociateLicense -> LicenseType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` LicenseType
licenseType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workspaceId
instance Prelude.NFData DisassociateLicense where
rnf :: DisassociateLicense -> ()
rnf DisassociateLicense' {Text
LicenseType
workspaceId :: Text
licenseType :: LicenseType
$sel:workspaceId:DisassociateLicense' :: DisassociateLicense -> Text
$sel:licenseType:DisassociateLicense' :: DisassociateLicense -> LicenseType
..} =
forall a. NFData a => a -> ()
Prelude.rnf LicenseType
licenseType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
workspaceId
instance Data.ToHeaders DisassociateLicense where
toHeaders :: DisassociateLicense -> 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.ToPath DisassociateLicense where
toPath :: DisassociateLicense -> ByteString
toPath DisassociateLicense' {Text
LicenseType
workspaceId :: Text
licenseType :: LicenseType
$sel:workspaceId:DisassociateLicense' :: DisassociateLicense -> Text
$sel:licenseType:DisassociateLicense' :: DisassociateLicense -> LicenseType
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/workspaces/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
workspaceId,
ByteString
"/licenses/",
forall a. ToByteString a => a -> ByteString
Data.toBS LicenseType
licenseType
]
instance Data.ToQuery DisassociateLicense where
toQuery :: DisassociateLicense -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DisassociateLicenseResponse = DisassociateLicenseResponse'
{
DisassociateLicenseResponse -> Int
httpStatus :: Prelude.Int,
DisassociateLicenseResponse -> WorkspaceDescription
workspace :: WorkspaceDescription
}
deriving (DisassociateLicenseResponse -> DisassociateLicenseResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateLicenseResponse -> DisassociateLicenseResponse -> Bool
$c/= :: DisassociateLicenseResponse -> DisassociateLicenseResponse -> Bool
== :: DisassociateLicenseResponse -> DisassociateLicenseResponse -> Bool
$c== :: DisassociateLicenseResponse -> DisassociateLicenseResponse -> Bool
Prelude.Eq, Int -> DisassociateLicenseResponse -> ShowS
[DisassociateLicenseResponse] -> ShowS
DisassociateLicenseResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateLicenseResponse] -> ShowS
$cshowList :: [DisassociateLicenseResponse] -> ShowS
show :: DisassociateLicenseResponse -> String
$cshow :: DisassociateLicenseResponse -> String
showsPrec :: Int -> DisassociateLicenseResponse -> ShowS
$cshowsPrec :: Int -> DisassociateLicenseResponse -> ShowS
Prelude.Show, forall x.
Rep DisassociateLicenseResponse x -> DisassociateLicenseResponse
forall x.
DisassociateLicenseResponse -> Rep DisassociateLicenseResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateLicenseResponse x -> DisassociateLicenseResponse
$cfrom :: forall x.
DisassociateLicenseResponse -> Rep DisassociateLicenseResponse x
Prelude.Generic)
newDisassociateLicenseResponse ::
Prelude.Int ->
WorkspaceDescription ->
DisassociateLicenseResponse
newDisassociateLicenseResponse :: Int -> WorkspaceDescription -> DisassociateLicenseResponse
newDisassociateLicenseResponse
Int
pHttpStatus_
WorkspaceDescription
pWorkspace_ =
DisassociateLicenseResponse'
{ $sel:httpStatus:DisassociateLicenseResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:workspace:DisassociateLicenseResponse' :: WorkspaceDescription
workspace = WorkspaceDescription
pWorkspace_
}
disassociateLicenseResponse_httpStatus :: Lens.Lens' DisassociateLicenseResponse Prelude.Int
disassociateLicenseResponse_httpStatus :: Lens' DisassociateLicenseResponse Int
disassociateLicenseResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateLicenseResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateLicenseResponse' :: DisassociateLicenseResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateLicenseResponse
s@DisassociateLicenseResponse' {} Int
a -> DisassociateLicenseResponse
s {$sel:httpStatus:DisassociateLicenseResponse' :: Int
httpStatus = Int
a} :: DisassociateLicenseResponse)
disassociateLicenseResponse_workspace :: Lens.Lens' DisassociateLicenseResponse WorkspaceDescription
disassociateLicenseResponse_workspace :: Lens' DisassociateLicenseResponse WorkspaceDescription
disassociateLicenseResponse_workspace = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateLicenseResponse' {WorkspaceDescription
workspace :: WorkspaceDescription
$sel:workspace:DisassociateLicenseResponse' :: DisassociateLicenseResponse -> WorkspaceDescription
workspace} -> WorkspaceDescription
workspace) (\s :: DisassociateLicenseResponse
s@DisassociateLicenseResponse' {} WorkspaceDescription
a -> DisassociateLicenseResponse
s {$sel:workspace:DisassociateLicenseResponse' :: WorkspaceDescription
workspace = WorkspaceDescription
a} :: DisassociateLicenseResponse)
instance Prelude.NFData DisassociateLicenseResponse where
rnf :: DisassociateLicenseResponse -> ()
rnf DisassociateLicenseResponse' {Int
WorkspaceDescription
workspace :: WorkspaceDescription
httpStatus :: Int
$sel:workspace:DisassociateLicenseResponse' :: DisassociateLicenseResponse -> WorkspaceDescription
$sel:httpStatus:DisassociateLicenseResponse' :: DisassociateLicenseResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf WorkspaceDescription
workspace