{-# 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.ServiceCatalog.DisassociateProductFromPortfolio
(
DisassociateProductFromPortfolio (..),
newDisassociateProductFromPortfolio,
disassociateProductFromPortfolio_acceptLanguage,
disassociateProductFromPortfolio_productId,
disassociateProductFromPortfolio_portfolioId,
DisassociateProductFromPortfolioResponse (..),
newDisassociateProductFromPortfolioResponse,
disassociateProductFromPortfolioResponse_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.ServiceCatalog.Types
data DisassociateProductFromPortfolio = DisassociateProductFromPortfolio'
{
DisassociateProductFromPortfolio -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
DisassociateProductFromPortfolio -> Text
productId :: Prelude.Text,
DisassociateProductFromPortfolio -> Text
portfolioId :: Prelude.Text
}
deriving (DisassociateProductFromPortfolio
-> DisassociateProductFromPortfolio -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateProductFromPortfolio
-> DisassociateProductFromPortfolio -> Bool
$c/= :: DisassociateProductFromPortfolio
-> DisassociateProductFromPortfolio -> Bool
== :: DisassociateProductFromPortfolio
-> DisassociateProductFromPortfolio -> Bool
$c== :: DisassociateProductFromPortfolio
-> DisassociateProductFromPortfolio -> Bool
Prelude.Eq, ReadPrec [DisassociateProductFromPortfolio]
ReadPrec DisassociateProductFromPortfolio
Int -> ReadS DisassociateProductFromPortfolio
ReadS [DisassociateProductFromPortfolio]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateProductFromPortfolio]
$creadListPrec :: ReadPrec [DisassociateProductFromPortfolio]
readPrec :: ReadPrec DisassociateProductFromPortfolio
$creadPrec :: ReadPrec DisassociateProductFromPortfolio
readList :: ReadS [DisassociateProductFromPortfolio]
$creadList :: ReadS [DisassociateProductFromPortfolio]
readsPrec :: Int -> ReadS DisassociateProductFromPortfolio
$creadsPrec :: Int -> ReadS DisassociateProductFromPortfolio
Prelude.Read, Int -> DisassociateProductFromPortfolio -> ShowS
[DisassociateProductFromPortfolio] -> ShowS
DisassociateProductFromPortfolio -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateProductFromPortfolio] -> ShowS
$cshowList :: [DisassociateProductFromPortfolio] -> ShowS
show :: DisassociateProductFromPortfolio -> String
$cshow :: DisassociateProductFromPortfolio -> String
showsPrec :: Int -> DisassociateProductFromPortfolio -> ShowS
$cshowsPrec :: Int -> DisassociateProductFromPortfolio -> ShowS
Prelude.Show, forall x.
Rep DisassociateProductFromPortfolio x
-> DisassociateProductFromPortfolio
forall x.
DisassociateProductFromPortfolio
-> Rep DisassociateProductFromPortfolio x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateProductFromPortfolio x
-> DisassociateProductFromPortfolio
$cfrom :: forall x.
DisassociateProductFromPortfolio
-> Rep DisassociateProductFromPortfolio x
Prelude.Generic)
newDisassociateProductFromPortfolio ::
Prelude.Text ->
Prelude.Text ->
DisassociateProductFromPortfolio
newDisassociateProductFromPortfolio :: Text -> Text -> DisassociateProductFromPortfolio
newDisassociateProductFromPortfolio
Text
pProductId_
Text
pPortfolioId_ =
DisassociateProductFromPortfolio'
{ $sel:acceptLanguage:DisassociateProductFromPortfolio' :: Maybe Text
acceptLanguage =
forall a. Maybe a
Prelude.Nothing,
$sel:productId:DisassociateProductFromPortfolio' :: Text
productId = Text
pProductId_,
$sel:portfolioId:DisassociateProductFromPortfolio' :: Text
portfolioId = Text
pPortfolioId_
}
disassociateProductFromPortfolio_acceptLanguage :: Lens.Lens' DisassociateProductFromPortfolio (Prelude.Maybe Prelude.Text)
disassociateProductFromPortfolio_acceptLanguage :: Lens' DisassociateProductFromPortfolio (Maybe Text)
disassociateProductFromPortfolio_acceptLanguage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateProductFromPortfolio' {Maybe Text
acceptLanguage :: Maybe Text
$sel:acceptLanguage:DisassociateProductFromPortfolio' :: DisassociateProductFromPortfolio -> Maybe Text
acceptLanguage} -> Maybe Text
acceptLanguage) (\s :: DisassociateProductFromPortfolio
s@DisassociateProductFromPortfolio' {} Maybe Text
a -> DisassociateProductFromPortfolio
s {$sel:acceptLanguage:DisassociateProductFromPortfolio' :: Maybe Text
acceptLanguage = Maybe Text
a} :: DisassociateProductFromPortfolio)
disassociateProductFromPortfolio_productId :: Lens.Lens' DisassociateProductFromPortfolio Prelude.Text
disassociateProductFromPortfolio_productId :: Lens' DisassociateProductFromPortfolio Text
disassociateProductFromPortfolio_productId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateProductFromPortfolio' {Text
productId :: Text
$sel:productId:DisassociateProductFromPortfolio' :: DisassociateProductFromPortfolio -> Text
productId} -> Text
productId) (\s :: DisassociateProductFromPortfolio
s@DisassociateProductFromPortfolio' {} Text
a -> DisassociateProductFromPortfolio
s {$sel:productId:DisassociateProductFromPortfolio' :: Text
productId = Text
a} :: DisassociateProductFromPortfolio)
disassociateProductFromPortfolio_portfolioId :: Lens.Lens' DisassociateProductFromPortfolio Prelude.Text
disassociateProductFromPortfolio_portfolioId :: Lens' DisassociateProductFromPortfolio Text
disassociateProductFromPortfolio_portfolioId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateProductFromPortfolio' {Text
portfolioId :: Text
$sel:portfolioId:DisassociateProductFromPortfolio' :: DisassociateProductFromPortfolio -> Text
portfolioId} -> Text
portfolioId) (\s :: DisassociateProductFromPortfolio
s@DisassociateProductFromPortfolio' {} Text
a -> DisassociateProductFromPortfolio
s {$sel:portfolioId:DisassociateProductFromPortfolio' :: Text
portfolioId = Text
a} :: DisassociateProductFromPortfolio)
instance
Core.AWSRequest
DisassociateProductFromPortfolio
where
type
AWSResponse DisassociateProductFromPortfolio =
DisassociateProductFromPortfolioResponse
request :: (Service -> Service)
-> DisassociateProductFromPortfolio
-> Request DisassociateProductFromPortfolio
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DisassociateProductFromPortfolio
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DisassociateProductFromPortfolio)))
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 -> DisassociateProductFromPortfolioResponse
DisassociateProductFromPortfolioResponse'
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
DisassociateProductFromPortfolio
where
hashWithSalt :: Int -> DisassociateProductFromPortfolio -> Int
hashWithSalt
Int
_salt
DisassociateProductFromPortfolio' {Maybe Text
Text
portfolioId :: Text
productId :: Text
acceptLanguage :: Maybe Text
$sel:portfolioId:DisassociateProductFromPortfolio' :: DisassociateProductFromPortfolio -> Text
$sel:productId:DisassociateProductFromPortfolio' :: DisassociateProductFromPortfolio -> Text
$sel:acceptLanguage:DisassociateProductFromPortfolio' :: DisassociateProductFromPortfolio -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
acceptLanguage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
productId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
portfolioId
instance
Prelude.NFData
DisassociateProductFromPortfolio
where
rnf :: DisassociateProductFromPortfolio -> ()
rnf DisassociateProductFromPortfolio' {Maybe Text
Text
portfolioId :: Text
productId :: Text
acceptLanguage :: Maybe Text
$sel:portfolioId:DisassociateProductFromPortfolio' :: DisassociateProductFromPortfolio -> Text
$sel:productId:DisassociateProductFromPortfolio' :: DisassociateProductFromPortfolio -> Text
$sel:acceptLanguage:DisassociateProductFromPortfolio' :: DisassociateProductFromPortfolio -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
acceptLanguage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
productId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
portfolioId
instance
Data.ToHeaders
DisassociateProductFromPortfolio
where
toHeaders :: DisassociateProductFromPortfolio -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWS242ServiceCatalogService.DisassociateProductFromPortfolio" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DisassociateProductFromPortfolio where
toJSON :: DisassociateProductFromPortfolio -> Value
toJSON DisassociateProductFromPortfolio' {Maybe Text
Text
portfolioId :: Text
productId :: Text
acceptLanguage :: Maybe Text
$sel:portfolioId:DisassociateProductFromPortfolio' :: DisassociateProductFromPortfolio -> Text
$sel:productId:DisassociateProductFromPortfolio' :: DisassociateProductFromPortfolio -> Text
$sel:acceptLanguage:DisassociateProductFromPortfolio' :: DisassociateProductFromPortfolio -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AcceptLanguage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
acceptLanguage,
forall a. a -> Maybe a
Prelude.Just (Key
"ProductId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
productId),
forall a. a -> Maybe a
Prelude.Just (Key
"PortfolioId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
portfolioId)
]
)
instance Data.ToPath DisassociateProductFromPortfolio where
toPath :: DisassociateProductFromPortfolio -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Data.ToQuery
DisassociateProductFromPortfolio
where
toQuery :: DisassociateProductFromPortfolio -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DisassociateProductFromPortfolioResponse = DisassociateProductFromPortfolioResponse'
{
DisassociateProductFromPortfolioResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociateProductFromPortfolioResponse
-> DisassociateProductFromPortfolioResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateProductFromPortfolioResponse
-> DisassociateProductFromPortfolioResponse -> Bool
$c/= :: DisassociateProductFromPortfolioResponse
-> DisassociateProductFromPortfolioResponse -> Bool
== :: DisassociateProductFromPortfolioResponse
-> DisassociateProductFromPortfolioResponse -> Bool
$c== :: DisassociateProductFromPortfolioResponse
-> DisassociateProductFromPortfolioResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateProductFromPortfolioResponse]
ReadPrec DisassociateProductFromPortfolioResponse
Int -> ReadS DisassociateProductFromPortfolioResponse
ReadS [DisassociateProductFromPortfolioResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateProductFromPortfolioResponse]
$creadListPrec :: ReadPrec [DisassociateProductFromPortfolioResponse]
readPrec :: ReadPrec DisassociateProductFromPortfolioResponse
$creadPrec :: ReadPrec DisassociateProductFromPortfolioResponse
readList :: ReadS [DisassociateProductFromPortfolioResponse]
$creadList :: ReadS [DisassociateProductFromPortfolioResponse]
readsPrec :: Int -> ReadS DisassociateProductFromPortfolioResponse
$creadsPrec :: Int -> ReadS DisassociateProductFromPortfolioResponse
Prelude.Read, Int -> DisassociateProductFromPortfolioResponse -> ShowS
[DisassociateProductFromPortfolioResponse] -> ShowS
DisassociateProductFromPortfolioResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateProductFromPortfolioResponse] -> ShowS
$cshowList :: [DisassociateProductFromPortfolioResponse] -> ShowS
show :: DisassociateProductFromPortfolioResponse -> String
$cshow :: DisassociateProductFromPortfolioResponse -> String
showsPrec :: Int -> DisassociateProductFromPortfolioResponse -> ShowS
$cshowsPrec :: Int -> DisassociateProductFromPortfolioResponse -> ShowS
Prelude.Show, forall x.
Rep DisassociateProductFromPortfolioResponse x
-> DisassociateProductFromPortfolioResponse
forall x.
DisassociateProductFromPortfolioResponse
-> Rep DisassociateProductFromPortfolioResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateProductFromPortfolioResponse x
-> DisassociateProductFromPortfolioResponse
$cfrom :: forall x.
DisassociateProductFromPortfolioResponse
-> Rep DisassociateProductFromPortfolioResponse x
Prelude.Generic)
newDisassociateProductFromPortfolioResponse ::
Prelude.Int ->
DisassociateProductFromPortfolioResponse
newDisassociateProductFromPortfolioResponse :: Int -> DisassociateProductFromPortfolioResponse
newDisassociateProductFromPortfolioResponse
Int
pHttpStatus_ =
DisassociateProductFromPortfolioResponse'
{ $sel:httpStatus:DisassociateProductFromPortfolioResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
disassociateProductFromPortfolioResponse_httpStatus :: Lens.Lens' DisassociateProductFromPortfolioResponse Prelude.Int
disassociateProductFromPortfolioResponse_httpStatus :: Lens' DisassociateProductFromPortfolioResponse Int
disassociateProductFromPortfolioResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateProductFromPortfolioResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateProductFromPortfolioResponse' :: DisassociateProductFromPortfolioResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateProductFromPortfolioResponse
s@DisassociateProductFromPortfolioResponse' {} Int
a -> DisassociateProductFromPortfolioResponse
s {$sel:httpStatus:DisassociateProductFromPortfolioResponse' :: Int
httpStatus = Int
a} :: DisassociateProductFromPortfolioResponse)
instance
Prelude.NFData
DisassociateProductFromPortfolioResponse
where
rnf :: DisassociateProductFromPortfolioResponse -> ()
rnf DisassociateProductFromPortfolioResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateProductFromPortfolioResponse' :: DisassociateProductFromPortfolioResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus