{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.WellArchitected.UpgradeLensReview
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Upgrade lens review.
module Amazonka.WellArchitected.UpgradeLensReview
  ( -- * Creating a Request
    UpgradeLensReview (..),
    newUpgradeLensReview,

    -- * Request Lenses
    upgradeLensReview_clientRequestToken,
    upgradeLensReview_workloadId,
    upgradeLensReview_lensAlias,
    upgradeLensReview_milestoneName,

    -- * Destructuring the Response
    UpgradeLensReviewResponse (..),
    newUpgradeLensReviewResponse,
  )
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.WellArchitected.Types

-- | /See:/ 'newUpgradeLensReview' smart constructor.
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
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]
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
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. 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)

-- |
-- Create a value of 'UpgradeLensReview' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'clientRequestToken', 'upgradeLensReview_clientRequestToken' - Undocumented member.
--
-- 'workloadId', 'upgradeLensReview_workloadId' - Undocumented member.
--
-- 'lensAlias', 'upgradeLensReview_lensAlias' - Undocumented member.
--
-- 'milestoneName', 'upgradeLensReview_milestoneName' - Undocumented member.
newUpgradeLensReview ::
  -- | 'workloadId'
  Prelude.Text ->
  -- | 'lensAlias'
  Prelude.Text ->
  -- | 'milestoneName'
  Prelude.Text ->
  UpgradeLensReview
newUpgradeLensReview :: Text -> Text -> Text -> UpgradeLensReview
newUpgradeLensReview
  Text
pWorkloadId_
  Text
pLensAlias_
  Text
pMilestoneName_ =
    UpgradeLensReview'
      { $sel:clientRequestToken:UpgradeLensReview' :: Maybe Text
clientRequestToken =
          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_
      }

-- | Undocumented member.
upgradeLensReview_clientRequestToken :: Lens.Lens' UpgradeLensReview (Prelude.Maybe Prelude.Text)
upgradeLensReview_clientRequestToken :: Lens' UpgradeLensReview (Maybe Text)
upgradeLensReview_clientRequestToken = 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)

-- | Undocumented member.
upgradeLensReview_workloadId :: Lens.Lens' UpgradeLensReview Prelude.Text
upgradeLensReview_workloadId :: Lens' UpgradeLensReview Text
upgradeLensReview_workloadId = 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)

-- | Undocumented member.
upgradeLensReview_lensAlias :: Lens.Lens' UpgradeLensReview Prelude.Text
upgradeLensReview_lensAlias :: Lens' UpgradeLensReview Text
upgradeLensReview_lensAlias = 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)

-- | Undocumented member.
upgradeLensReview_milestoneName :: Lens.Lens' UpgradeLensReview Prelude.Text
upgradeLensReview_milestoneName :: Lens' UpgradeLensReview Text
upgradeLensReview_milestoneName = 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 :: (Service -> Service)
-> UpgradeLensReview -> Request UpgradeLensReview
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpgradeLensReview
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpgradeLensReview)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull UpgradeLensReviewResponse
UpgradeLensReviewResponse'

instance Prelude.Hashable UpgradeLensReview where
  hashWithSalt :: Int -> UpgradeLensReview -> Int
hashWithSalt Int
_salt 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
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientRequestToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workloadId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
lensAlias
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
milestoneName

instance Prelude.NFData UpgradeLensReview where
  rnf :: UpgradeLensReview -> ()
rnf 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
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientRequestToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
workloadId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
lensAlias
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
milestoneName

instance Data.ToHeaders UpgradeLensReview where
  toHeaders :: UpgradeLensReview -> [Header]
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 -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.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
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ClientRequestToken" 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
clientRequestToken,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"MilestoneName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
milestoneName)
          ]
      )

instance Data.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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/workloads/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
workloadId,
        ByteString
"/lensReviews/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
lensAlias,
        ByteString
"/upgrade"
      ]

instance Data.ToQuery UpgradeLensReview where
  toQuery :: UpgradeLensReview -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpgradeLensReviewResponse' smart constructor.
data UpgradeLensReviewResponse = UpgradeLensReviewResponse'
  {
  }
  deriving (UpgradeLensReviewResponse -> UpgradeLensReviewResponse -> Bool
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]
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
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.
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)

-- |
-- Create a value of 'UpgradeLensReviewResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
newUpgradeLensReviewResponse ::
  UpgradeLensReviewResponse
newUpgradeLensReviewResponse :: UpgradeLensReviewResponse
newUpgradeLensReviewResponse =
  UpgradeLensReviewResponse
UpgradeLensReviewResponse'

instance Prelude.NFData UpgradeLensReviewResponse where
  rnf :: UpgradeLensReviewResponse -> ()
rnf UpgradeLensReviewResponse
_ = ()