{-# 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.Panorama.DeregisterPackageVersion
(
DeregisterPackageVersion (..),
newDeregisterPackageVersion,
deregisterPackageVersion_updatedLatestPatchVersion,
deregisterPackageVersion_ownerAccount,
deregisterPackageVersion_packageId,
deregisterPackageVersion_packageVersion,
deregisterPackageVersion_patchVersion,
DeregisterPackageVersionResponse (..),
newDeregisterPackageVersionResponse,
deregisterPackageVersionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Panorama.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeregisterPackageVersion = DeregisterPackageVersion'
{
DeregisterPackageVersion -> Maybe Text
updatedLatestPatchVersion :: Prelude.Maybe Prelude.Text,
DeregisterPackageVersion -> Maybe Text
ownerAccount :: Prelude.Maybe Prelude.Text,
DeregisterPackageVersion -> Text
packageId :: Prelude.Text,
DeregisterPackageVersion -> Text
packageVersion :: Prelude.Text,
DeregisterPackageVersion -> Text
patchVersion :: Prelude.Text
}
deriving (DeregisterPackageVersion -> DeregisterPackageVersion -> Bool
(DeregisterPackageVersion -> DeregisterPackageVersion -> Bool)
-> (DeregisterPackageVersion -> DeregisterPackageVersion -> Bool)
-> Eq DeregisterPackageVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterPackageVersion -> DeregisterPackageVersion -> Bool
$c/= :: DeregisterPackageVersion -> DeregisterPackageVersion -> Bool
== :: DeregisterPackageVersion -> DeregisterPackageVersion -> Bool
$c== :: DeregisterPackageVersion -> DeregisterPackageVersion -> Bool
Prelude.Eq, ReadPrec [DeregisterPackageVersion]
ReadPrec DeregisterPackageVersion
Int -> ReadS DeregisterPackageVersion
ReadS [DeregisterPackageVersion]
(Int -> ReadS DeregisterPackageVersion)
-> ReadS [DeregisterPackageVersion]
-> ReadPrec DeregisterPackageVersion
-> ReadPrec [DeregisterPackageVersion]
-> Read DeregisterPackageVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterPackageVersion]
$creadListPrec :: ReadPrec [DeregisterPackageVersion]
readPrec :: ReadPrec DeregisterPackageVersion
$creadPrec :: ReadPrec DeregisterPackageVersion
readList :: ReadS [DeregisterPackageVersion]
$creadList :: ReadS [DeregisterPackageVersion]
readsPrec :: Int -> ReadS DeregisterPackageVersion
$creadsPrec :: Int -> ReadS DeregisterPackageVersion
Prelude.Read, Int -> DeregisterPackageVersion -> ShowS
[DeregisterPackageVersion] -> ShowS
DeregisterPackageVersion -> String
(Int -> DeregisterPackageVersion -> ShowS)
-> (DeregisterPackageVersion -> String)
-> ([DeregisterPackageVersion] -> ShowS)
-> Show DeregisterPackageVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterPackageVersion] -> ShowS
$cshowList :: [DeregisterPackageVersion] -> ShowS
show :: DeregisterPackageVersion -> String
$cshow :: DeregisterPackageVersion -> String
showsPrec :: Int -> DeregisterPackageVersion -> ShowS
$cshowsPrec :: Int -> DeregisterPackageVersion -> ShowS
Prelude.Show, (forall x.
DeregisterPackageVersion -> Rep DeregisterPackageVersion x)
-> (forall x.
Rep DeregisterPackageVersion x -> DeregisterPackageVersion)
-> Generic DeregisterPackageVersion
forall x.
Rep DeregisterPackageVersion x -> DeregisterPackageVersion
forall x.
DeregisterPackageVersion -> Rep DeregisterPackageVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeregisterPackageVersion x -> DeregisterPackageVersion
$cfrom :: forall x.
DeregisterPackageVersion -> Rep DeregisterPackageVersion x
Prelude.Generic)
newDeregisterPackageVersion ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DeregisterPackageVersion
newDeregisterPackageVersion :: Text -> Text -> Text -> DeregisterPackageVersion
newDeregisterPackageVersion
Text
pPackageId_
Text
pPackageVersion_
Text
pPatchVersion_ =
DeregisterPackageVersion' :: Maybe Text
-> Maybe Text -> Text -> Text -> Text -> DeregisterPackageVersion
DeregisterPackageVersion'
{ $sel:updatedLatestPatchVersion:DeregisterPackageVersion' :: Maybe Text
updatedLatestPatchVersion =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ownerAccount:DeregisterPackageVersion' :: Maybe Text
ownerAccount = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:packageId:DeregisterPackageVersion' :: Text
packageId = Text
pPackageId_,
$sel:packageVersion:DeregisterPackageVersion' :: Text
packageVersion = Text
pPackageVersion_,
$sel:patchVersion:DeregisterPackageVersion' :: Text
patchVersion = Text
pPatchVersion_
}
deregisterPackageVersion_updatedLatestPatchVersion :: Lens.Lens' DeregisterPackageVersion (Prelude.Maybe Prelude.Text)
deregisterPackageVersion_updatedLatestPatchVersion :: (Maybe Text -> f (Maybe Text))
-> DeregisterPackageVersion -> f DeregisterPackageVersion
deregisterPackageVersion_updatedLatestPatchVersion = (DeregisterPackageVersion -> Maybe Text)
-> (DeregisterPackageVersion
-> Maybe Text -> DeregisterPackageVersion)
-> Lens
DeregisterPackageVersion
DeregisterPackageVersion
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterPackageVersion' {Maybe Text
updatedLatestPatchVersion :: Maybe Text
$sel:updatedLatestPatchVersion:DeregisterPackageVersion' :: DeregisterPackageVersion -> Maybe Text
updatedLatestPatchVersion} -> Maybe Text
updatedLatestPatchVersion) (\s :: DeregisterPackageVersion
s@DeregisterPackageVersion' {} Maybe Text
a -> DeregisterPackageVersion
s {$sel:updatedLatestPatchVersion:DeregisterPackageVersion' :: Maybe Text
updatedLatestPatchVersion = Maybe Text
a} :: DeregisterPackageVersion)
deregisterPackageVersion_ownerAccount :: Lens.Lens' DeregisterPackageVersion (Prelude.Maybe Prelude.Text)
deregisterPackageVersion_ownerAccount :: (Maybe Text -> f (Maybe Text))
-> DeregisterPackageVersion -> f DeregisterPackageVersion
deregisterPackageVersion_ownerAccount = (DeregisterPackageVersion -> Maybe Text)
-> (DeregisterPackageVersion
-> Maybe Text -> DeregisterPackageVersion)
-> Lens
DeregisterPackageVersion
DeregisterPackageVersion
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterPackageVersion' {Maybe Text
ownerAccount :: Maybe Text
$sel:ownerAccount:DeregisterPackageVersion' :: DeregisterPackageVersion -> Maybe Text
ownerAccount} -> Maybe Text
ownerAccount) (\s :: DeregisterPackageVersion
s@DeregisterPackageVersion' {} Maybe Text
a -> DeregisterPackageVersion
s {$sel:ownerAccount:DeregisterPackageVersion' :: Maybe Text
ownerAccount = Maybe Text
a} :: DeregisterPackageVersion)
deregisterPackageVersion_packageId :: Lens.Lens' DeregisterPackageVersion Prelude.Text
deregisterPackageVersion_packageId :: (Text -> f Text)
-> DeregisterPackageVersion -> f DeregisterPackageVersion
deregisterPackageVersion_packageId = (DeregisterPackageVersion -> Text)
-> (DeregisterPackageVersion -> Text -> DeregisterPackageVersion)
-> Lens DeregisterPackageVersion DeregisterPackageVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterPackageVersion' {Text
packageId :: Text
$sel:packageId:DeregisterPackageVersion' :: DeregisterPackageVersion -> Text
packageId} -> Text
packageId) (\s :: DeregisterPackageVersion
s@DeregisterPackageVersion' {} Text
a -> DeregisterPackageVersion
s {$sel:packageId:DeregisterPackageVersion' :: Text
packageId = Text
a} :: DeregisterPackageVersion)
deregisterPackageVersion_packageVersion :: Lens.Lens' DeregisterPackageVersion Prelude.Text
deregisterPackageVersion_packageVersion :: (Text -> f Text)
-> DeregisterPackageVersion -> f DeregisterPackageVersion
deregisterPackageVersion_packageVersion = (DeregisterPackageVersion -> Text)
-> (DeregisterPackageVersion -> Text -> DeregisterPackageVersion)
-> Lens DeregisterPackageVersion DeregisterPackageVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterPackageVersion' {Text
packageVersion :: Text
$sel:packageVersion:DeregisterPackageVersion' :: DeregisterPackageVersion -> Text
packageVersion} -> Text
packageVersion) (\s :: DeregisterPackageVersion
s@DeregisterPackageVersion' {} Text
a -> DeregisterPackageVersion
s {$sel:packageVersion:DeregisterPackageVersion' :: Text
packageVersion = Text
a} :: DeregisterPackageVersion)
deregisterPackageVersion_patchVersion :: Lens.Lens' DeregisterPackageVersion Prelude.Text
deregisterPackageVersion_patchVersion :: (Text -> f Text)
-> DeregisterPackageVersion -> f DeregisterPackageVersion
deregisterPackageVersion_patchVersion = (DeregisterPackageVersion -> Text)
-> (DeregisterPackageVersion -> Text -> DeregisterPackageVersion)
-> Lens DeregisterPackageVersion DeregisterPackageVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterPackageVersion' {Text
patchVersion :: Text
$sel:patchVersion:DeregisterPackageVersion' :: DeregisterPackageVersion -> Text
patchVersion} -> Text
patchVersion) (\s :: DeregisterPackageVersion
s@DeregisterPackageVersion' {} Text
a -> DeregisterPackageVersion
s {$sel:patchVersion:DeregisterPackageVersion' :: Text
patchVersion = Text
a} :: DeregisterPackageVersion)
instance Core.AWSRequest DeregisterPackageVersion where
type
AWSResponse DeregisterPackageVersion =
DeregisterPackageVersionResponse
request :: DeregisterPackageVersion -> Request DeregisterPackageVersion
request = Service
-> DeregisterPackageVersion -> Request DeregisterPackageVersion
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeregisterPackageVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeregisterPackageVersion)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeregisterPackageVersion))
-> Logger
-> Service
-> Proxy DeregisterPackageVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeregisterPackageVersion)))
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 -> DeregisterPackageVersionResponse
DeregisterPackageVersionResponse'
(Int -> DeregisterPackageVersionResponse)
-> Either String Int
-> Either String DeregisterPackageVersionResponse
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 DeregisterPackageVersion
instance Prelude.NFData DeregisterPackageVersion
instance Core.ToHeaders DeregisterPackageVersion where
toHeaders :: DeregisterPackageVersion -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeregisterPackageVersion -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath DeregisterPackageVersion where
toPath :: DeregisterPackageVersion -> ByteString
toPath DeregisterPackageVersion' {Maybe Text
Text
patchVersion :: Text
packageVersion :: Text
packageId :: Text
ownerAccount :: Maybe Text
updatedLatestPatchVersion :: Maybe Text
$sel:patchVersion:DeregisterPackageVersion' :: DeregisterPackageVersion -> Text
$sel:packageVersion:DeregisterPackageVersion' :: DeregisterPackageVersion -> Text
$sel:packageId:DeregisterPackageVersion' :: DeregisterPackageVersion -> Text
$sel:ownerAccount:DeregisterPackageVersion' :: DeregisterPackageVersion -> Maybe Text
$sel:updatedLatestPatchVersion:DeregisterPackageVersion' :: DeregisterPackageVersion -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/packages/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
packageId,
ByteString
"/versions/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
packageVersion,
ByteString
"/patch/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
patchVersion
]
instance Core.ToQuery DeregisterPackageVersion where
toQuery :: DeregisterPackageVersion -> QueryString
toQuery DeregisterPackageVersion' {Maybe Text
Text
patchVersion :: Text
packageVersion :: Text
packageId :: Text
ownerAccount :: Maybe Text
updatedLatestPatchVersion :: Maybe Text
$sel:patchVersion:DeregisterPackageVersion' :: DeregisterPackageVersion -> Text
$sel:packageVersion:DeregisterPackageVersion' :: DeregisterPackageVersion -> Text
$sel:packageId:DeregisterPackageVersion' :: DeregisterPackageVersion -> Text
$sel:ownerAccount:DeregisterPackageVersion' :: DeregisterPackageVersion -> Maybe Text
$sel:updatedLatestPatchVersion:DeregisterPackageVersion' :: DeregisterPackageVersion -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"UpdatedLatestPatchVersion"
ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
updatedLatestPatchVersion,
ByteString
"OwnerAccount" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
ownerAccount
]
data DeregisterPackageVersionResponse = DeregisterPackageVersionResponse'
{
DeregisterPackageVersionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeregisterPackageVersionResponse
-> DeregisterPackageVersionResponse -> Bool
(DeregisterPackageVersionResponse
-> DeregisterPackageVersionResponse -> Bool)
-> (DeregisterPackageVersionResponse
-> DeregisterPackageVersionResponse -> Bool)
-> Eq DeregisterPackageVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterPackageVersionResponse
-> DeregisterPackageVersionResponse -> Bool
$c/= :: DeregisterPackageVersionResponse
-> DeregisterPackageVersionResponse -> Bool
== :: DeregisterPackageVersionResponse
-> DeregisterPackageVersionResponse -> Bool
$c== :: DeregisterPackageVersionResponse
-> DeregisterPackageVersionResponse -> Bool
Prelude.Eq, ReadPrec [DeregisterPackageVersionResponse]
ReadPrec DeregisterPackageVersionResponse
Int -> ReadS DeregisterPackageVersionResponse
ReadS [DeregisterPackageVersionResponse]
(Int -> ReadS DeregisterPackageVersionResponse)
-> ReadS [DeregisterPackageVersionResponse]
-> ReadPrec DeregisterPackageVersionResponse
-> ReadPrec [DeregisterPackageVersionResponse]
-> Read DeregisterPackageVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterPackageVersionResponse]
$creadListPrec :: ReadPrec [DeregisterPackageVersionResponse]
readPrec :: ReadPrec DeregisterPackageVersionResponse
$creadPrec :: ReadPrec DeregisterPackageVersionResponse
readList :: ReadS [DeregisterPackageVersionResponse]
$creadList :: ReadS [DeregisterPackageVersionResponse]
readsPrec :: Int -> ReadS DeregisterPackageVersionResponse
$creadsPrec :: Int -> ReadS DeregisterPackageVersionResponse
Prelude.Read, Int -> DeregisterPackageVersionResponse -> ShowS
[DeregisterPackageVersionResponse] -> ShowS
DeregisterPackageVersionResponse -> String
(Int -> DeregisterPackageVersionResponse -> ShowS)
-> (DeregisterPackageVersionResponse -> String)
-> ([DeregisterPackageVersionResponse] -> ShowS)
-> Show DeregisterPackageVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterPackageVersionResponse] -> ShowS
$cshowList :: [DeregisterPackageVersionResponse] -> ShowS
show :: DeregisterPackageVersionResponse -> String
$cshow :: DeregisterPackageVersionResponse -> String
showsPrec :: Int -> DeregisterPackageVersionResponse -> ShowS
$cshowsPrec :: Int -> DeregisterPackageVersionResponse -> ShowS
Prelude.Show, (forall x.
DeregisterPackageVersionResponse
-> Rep DeregisterPackageVersionResponse x)
-> (forall x.
Rep DeregisterPackageVersionResponse x
-> DeregisterPackageVersionResponse)
-> Generic DeregisterPackageVersionResponse
forall x.
Rep DeregisterPackageVersionResponse x
-> DeregisterPackageVersionResponse
forall x.
DeregisterPackageVersionResponse
-> Rep DeregisterPackageVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeregisterPackageVersionResponse x
-> DeregisterPackageVersionResponse
$cfrom :: forall x.
DeregisterPackageVersionResponse
-> Rep DeregisterPackageVersionResponse x
Prelude.Generic)
newDeregisterPackageVersionResponse ::
Prelude.Int ->
DeregisterPackageVersionResponse
newDeregisterPackageVersionResponse :: Int -> DeregisterPackageVersionResponse
newDeregisterPackageVersionResponse Int
pHttpStatus_ =
DeregisterPackageVersionResponse' :: Int -> DeregisterPackageVersionResponse
DeregisterPackageVersionResponse'
{ $sel:httpStatus:DeregisterPackageVersionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deregisterPackageVersionResponse_httpStatus :: Lens.Lens' DeregisterPackageVersionResponse Prelude.Int
deregisterPackageVersionResponse_httpStatus :: (Int -> f Int)
-> DeregisterPackageVersionResponse
-> f DeregisterPackageVersionResponse
deregisterPackageVersionResponse_httpStatus = (DeregisterPackageVersionResponse -> Int)
-> (DeregisterPackageVersionResponse
-> Int -> DeregisterPackageVersionResponse)
-> Lens
DeregisterPackageVersionResponse
DeregisterPackageVersionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterPackageVersionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeregisterPackageVersionResponse' :: DeregisterPackageVersionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeregisterPackageVersionResponse
s@DeregisterPackageVersionResponse' {} Int
a -> DeregisterPackageVersionResponse
s {$sel:httpStatus:DeregisterPackageVersionResponse' :: Int
httpStatus = Int
a} :: DeregisterPackageVersionResponse)
instance
Prelude.NFData
DeregisterPackageVersionResponse