{-# 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.WellArchitected.UpgradeLensReview
(
UpgradeLensReview (..),
newUpgradeLensReview,
upgradeLensReview_clientRequestToken,
upgradeLensReview_workloadId,
upgradeLensReview_lensAlias,
upgradeLensReview_milestoneName,
UpgradeLensReviewResponse (..),
newUpgradeLensReviewResponse,
)
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.WellArchitected.Types
data UpgradeLensReview = UpgradeLensReview'
{ UpgradeLensReview -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
UpgradeLensReview -> Text
workloadId :: Prelude.Text,
UpgradeLensReview -> Text
lensAlias :: Prelude.Text,
UpgradeLensReview -> Text
milestoneName :: Prelude.Text
}
deriving (UpgradeLensReview -> UpgradeLensReview -> Bool
(UpgradeLensReview -> UpgradeLensReview -> Bool)
-> (UpgradeLensReview -> UpgradeLensReview -> Bool)
-> Eq UpgradeLensReview
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpgradeLensReview -> UpgradeLensReview -> Bool
$c/= :: UpgradeLensReview -> UpgradeLensReview -> Bool
== :: UpgradeLensReview -> UpgradeLensReview -> Bool
$c== :: UpgradeLensReview -> UpgradeLensReview -> Bool
Prelude.Eq, ReadPrec [UpgradeLensReview]
ReadPrec UpgradeLensReview
Int -> ReadS UpgradeLensReview
ReadS [UpgradeLensReview]
(Int -> ReadS UpgradeLensReview)
-> ReadS [UpgradeLensReview]
-> ReadPrec UpgradeLensReview
-> ReadPrec [UpgradeLensReview]
-> Read UpgradeLensReview
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpgradeLensReview]
$creadListPrec :: ReadPrec [UpgradeLensReview]
readPrec :: ReadPrec UpgradeLensReview
$creadPrec :: ReadPrec UpgradeLensReview
readList :: ReadS [UpgradeLensReview]
$creadList :: ReadS [UpgradeLensReview]
readsPrec :: Int -> ReadS UpgradeLensReview
$creadsPrec :: Int -> ReadS UpgradeLensReview
Prelude.Read, Int -> UpgradeLensReview -> ShowS
[UpgradeLensReview] -> ShowS
UpgradeLensReview -> String
(Int -> UpgradeLensReview -> ShowS)
-> (UpgradeLensReview -> String)
-> ([UpgradeLensReview] -> ShowS)
-> Show UpgradeLensReview
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpgradeLensReview] -> ShowS
$cshowList :: [UpgradeLensReview] -> ShowS
show :: UpgradeLensReview -> String
$cshow :: UpgradeLensReview -> String
showsPrec :: Int -> UpgradeLensReview -> ShowS
$cshowsPrec :: Int -> UpgradeLensReview -> ShowS
Prelude.Show, (forall x. UpgradeLensReview -> Rep UpgradeLensReview x)
-> (forall x. Rep UpgradeLensReview x -> UpgradeLensReview)
-> Generic UpgradeLensReview
forall x. Rep UpgradeLensReview x -> UpgradeLensReview
forall x. UpgradeLensReview -> Rep UpgradeLensReview x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpgradeLensReview x -> UpgradeLensReview
$cfrom :: forall x. UpgradeLensReview -> Rep UpgradeLensReview x
Prelude.Generic)
newUpgradeLensReview ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
UpgradeLensReview
newUpgradeLensReview :: Text -> Text -> Text -> UpgradeLensReview
newUpgradeLensReview
Text
pWorkloadId_
Text
pLensAlias_
Text
pMilestoneName_ =
UpgradeLensReview' :: Maybe Text -> Text -> Text -> Text -> UpgradeLensReview
UpgradeLensReview'
{ $sel:clientRequestToken:UpgradeLensReview' :: Maybe Text
clientRequestToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:workloadId:UpgradeLensReview' :: Text
workloadId = Text
pWorkloadId_,
$sel:lensAlias:UpgradeLensReview' :: Text
lensAlias = Text
pLensAlias_,
$sel:milestoneName:UpgradeLensReview' :: Text
milestoneName = Text
pMilestoneName_
}
upgradeLensReview_clientRequestToken :: Lens.Lens' UpgradeLensReview (Prelude.Maybe Prelude.Text)
upgradeLensReview_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> UpgradeLensReview -> f UpgradeLensReview
upgradeLensReview_clientRequestToken = (UpgradeLensReview -> Maybe Text)
-> (UpgradeLensReview -> Maybe Text -> UpgradeLensReview)
-> Lens
UpgradeLensReview UpgradeLensReview (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpgradeLensReview' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:UpgradeLensReview' :: UpgradeLensReview -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: UpgradeLensReview
s@UpgradeLensReview' {} Maybe Text
a -> UpgradeLensReview
s {$sel:clientRequestToken:UpgradeLensReview' :: Maybe Text
clientRequestToken = Maybe Text
a} :: UpgradeLensReview)
upgradeLensReview_workloadId :: Lens.Lens' UpgradeLensReview Prelude.Text
upgradeLensReview_workloadId :: (Text -> f Text) -> UpgradeLensReview -> f UpgradeLensReview
upgradeLensReview_workloadId = (UpgradeLensReview -> Text)
-> (UpgradeLensReview -> Text -> UpgradeLensReview)
-> Lens UpgradeLensReview UpgradeLensReview Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpgradeLensReview' {Text
workloadId :: Text
$sel:workloadId:UpgradeLensReview' :: UpgradeLensReview -> Text
workloadId} -> Text
workloadId) (\s :: UpgradeLensReview
s@UpgradeLensReview' {} Text
a -> UpgradeLensReview
s {$sel:workloadId:UpgradeLensReview' :: Text
workloadId = Text
a} :: UpgradeLensReview)
upgradeLensReview_lensAlias :: Lens.Lens' UpgradeLensReview Prelude.Text
upgradeLensReview_lensAlias :: (Text -> f Text) -> UpgradeLensReview -> f UpgradeLensReview
upgradeLensReview_lensAlias = (UpgradeLensReview -> Text)
-> (UpgradeLensReview -> Text -> UpgradeLensReview)
-> Lens UpgradeLensReview UpgradeLensReview Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpgradeLensReview' {Text
lensAlias :: Text
$sel:lensAlias:UpgradeLensReview' :: UpgradeLensReview -> Text
lensAlias} -> Text
lensAlias) (\s :: UpgradeLensReview
s@UpgradeLensReview' {} Text
a -> UpgradeLensReview
s {$sel:lensAlias:UpgradeLensReview' :: Text
lensAlias = Text
a} :: UpgradeLensReview)
upgradeLensReview_milestoneName :: Lens.Lens' UpgradeLensReview Prelude.Text
upgradeLensReview_milestoneName :: (Text -> f Text) -> UpgradeLensReview -> f UpgradeLensReview
upgradeLensReview_milestoneName = (UpgradeLensReview -> Text)
-> (UpgradeLensReview -> Text -> UpgradeLensReview)
-> Lens UpgradeLensReview UpgradeLensReview Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpgradeLensReview' {Text
milestoneName :: Text
$sel:milestoneName:UpgradeLensReview' :: UpgradeLensReview -> Text
milestoneName} -> Text
milestoneName) (\s :: UpgradeLensReview
s@UpgradeLensReview' {} Text
a -> UpgradeLensReview
s {$sel:milestoneName:UpgradeLensReview' :: Text
milestoneName = Text
a} :: UpgradeLensReview)
instance Core.AWSRequest UpgradeLensReview where
type
AWSResponse UpgradeLensReview =
UpgradeLensReviewResponse
request :: UpgradeLensReview -> Request UpgradeLensReview
request = Service -> UpgradeLensReview -> Request UpgradeLensReview
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpgradeLensReview
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpgradeLensReview)))
response =
AWSResponse UpgradeLensReview
-> Logger
-> Service
-> Proxy UpgradeLensReview
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpgradeLensReview)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse UpgradeLensReview
UpgradeLensReviewResponse
UpgradeLensReviewResponse'
instance Prelude.Hashable UpgradeLensReview
instance Prelude.NFData UpgradeLensReview
instance Core.ToHeaders UpgradeLensReview where
toHeaders :: UpgradeLensReview -> [Header]
toHeaders =
[Header] -> UpgradeLensReview -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpgradeLensReview where
toJSON :: UpgradeLensReview -> Value
toJSON UpgradeLensReview' {Maybe Text
Text
milestoneName :: Text
lensAlias :: Text
workloadId :: Text
clientRequestToken :: Maybe Text
$sel:milestoneName:UpgradeLensReview' :: UpgradeLensReview -> Text
$sel:lensAlias:UpgradeLensReview' :: UpgradeLensReview -> Text
$sel:workloadId:UpgradeLensReview' :: UpgradeLensReview -> Text
$sel:clientRequestToken:UpgradeLensReview' :: UpgradeLensReview -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ClientRequestToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientRequestToken,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"MilestoneName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
milestoneName)
]
)
instance Core.ToPath UpgradeLensReview where
toPath :: UpgradeLensReview -> ByteString
toPath UpgradeLensReview' {Maybe Text
Text
milestoneName :: Text
lensAlias :: Text
workloadId :: Text
clientRequestToken :: Maybe Text
$sel:milestoneName:UpgradeLensReview' :: UpgradeLensReview -> Text
$sel:lensAlias:UpgradeLensReview' :: UpgradeLensReview -> Text
$sel:workloadId:UpgradeLensReview' :: UpgradeLensReview -> Text
$sel:clientRequestToken:UpgradeLensReview' :: UpgradeLensReview -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/workloads/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
workloadId,
ByteString
"/lensReviews/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
lensAlias,
ByteString
"/upgrade"
]
instance Core.ToQuery UpgradeLensReview where
toQuery :: UpgradeLensReview -> QueryString
toQuery = QueryString -> UpgradeLensReview -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpgradeLensReviewResponse = UpgradeLensReviewResponse'
{
}
deriving (UpgradeLensReviewResponse -> UpgradeLensReviewResponse -> Bool
(UpgradeLensReviewResponse -> UpgradeLensReviewResponse -> Bool)
-> (UpgradeLensReviewResponse -> UpgradeLensReviewResponse -> Bool)
-> Eq UpgradeLensReviewResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpgradeLensReviewResponse -> UpgradeLensReviewResponse -> Bool
$c/= :: UpgradeLensReviewResponse -> UpgradeLensReviewResponse -> Bool
== :: UpgradeLensReviewResponse -> UpgradeLensReviewResponse -> Bool
$c== :: UpgradeLensReviewResponse -> UpgradeLensReviewResponse -> Bool
Prelude.Eq, ReadPrec [UpgradeLensReviewResponse]
ReadPrec UpgradeLensReviewResponse
Int -> ReadS UpgradeLensReviewResponse
ReadS [UpgradeLensReviewResponse]
(Int -> ReadS UpgradeLensReviewResponse)
-> ReadS [UpgradeLensReviewResponse]
-> ReadPrec UpgradeLensReviewResponse
-> ReadPrec [UpgradeLensReviewResponse]
-> Read UpgradeLensReviewResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpgradeLensReviewResponse]
$creadListPrec :: ReadPrec [UpgradeLensReviewResponse]
readPrec :: ReadPrec UpgradeLensReviewResponse
$creadPrec :: ReadPrec UpgradeLensReviewResponse
readList :: ReadS [UpgradeLensReviewResponse]
$creadList :: ReadS [UpgradeLensReviewResponse]
readsPrec :: Int -> ReadS UpgradeLensReviewResponse
$creadsPrec :: Int -> ReadS UpgradeLensReviewResponse
Prelude.Read, Int -> UpgradeLensReviewResponse -> ShowS
[UpgradeLensReviewResponse] -> ShowS
UpgradeLensReviewResponse -> String
(Int -> UpgradeLensReviewResponse -> ShowS)
-> (UpgradeLensReviewResponse -> String)
-> ([UpgradeLensReviewResponse] -> ShowS)
-> Show UpgradeLensReviewResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpgradeLensReviewResponse] -> ShowS
$cshowList :: [UpgradeLensReviewResponse] -> ShowS
show :: UpgradeLensReviewResponse -> String
$cshow :: UpgradeLensReviewResponse -> String
showsPrec :: Int -> UpgradeLensReviewResponse -> ShowS
$cshowsPrec :: Int -> UpgradeLensReviewResponse -> ShowS
Prelude.Show, (forall x.
UpgradeLensReviewResponse -> Rep UpgradeLensReviewResponse x)
-> (forall x.
Rep UpgradeLensReviewResponse x -> UpgradeLensReviewResponse)
-> Generic UpgradeLensReviewResponse
forall x.
Rep UpgradeLensReviewResponse x -> UpgradeLensReviewResponse
forall x.
UpgradeLensReviewResponse -> Rep UpgradeLensReviewResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpgradeLensReviewResponse x -> UpgradeLensReviewResponse
$cfrom :: forall x.
UpgradeLensReviewResponse -> Rep UpgradeLensReviewResponse x
Prelude.Generic)
newUpgradeLensReviewResponse ::
UpgradeLensReviewResponse
newUpgradeLensReviewResponse :: UpgradeLensReviewResponse
newUpgradeLensReviewResponse =
UpgradeLensReviewResponse
UpgradeLensReviewResponse'
instance Prelude.NFData UpgradeLensReviewResponse