{-# 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.Proton.UpdateServiceTemplateVersion
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Update a major or minor version of a service template.
module Amazonka.Proton.UpdateServiceTemplateVersion
  ( -- * Creating a Request
    UpdateServiceTemplateVersion (..),
    newUpdateServiceTemplateVersion,

    -- * Request Lenses
    updateServiceTemplateVersion_status,
    updateServiceTemplateVersion_compatibleEnvironmentTemplates,
    updateServiceTemplateVersion_description,
    updateServiceTemplateVersion_majorVersion,
    updateServiceTemplateVersion_minorVersion,
    updateServiceTemplateVersion_templateName,

    -- * Destructuring the Response
    UpdateServiceTemplateVersionResponse (..),
    newUpdateServiceTemplateVersionResponse,

    -- * Response Lenses
    updateServiceTemplateVersionResponse_httpStatus,
    updateServiceTemplateVersionResponse_serviceTemplateVersion,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Proton.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateServiceTemplateVersion' smart constructor.
data UpdateServiceTemplateVersion = UpdateServiceTemplateVersion'
  { -- | The status of the service template minor version to update.
    UpdateServiceTemplateVersion -> Maybe TemplateVersionStatus
status :: Prelude.Maybe TemplateVersionStatus,
    -- | An array of compatible environment names for a service template major or
    -- minor version to update.
    UpdateServiceTemplateVersion
-> Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
compatibleEnvironmentTemplates :: Prelude.Maybe (Prelude.NonEmpty CompatibleEnvironmentTemplateInput),
    -- | A description of a service template version to update.
    UpdateServiceTemplateVersion -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | To update a major version of a service template, include @majorVersion@.
    UpdateServiceTemplateVersion -> Text
majorVersion :: Prelude.Text,
    -- | To update a minor version of a service template, include @minorVersion@.
    UpdateServiceTemplateVersion -> Text
minorVersion :: Prelude.Text,
    -- | The name of the service template.
    UpdateServiceTemplateVersion -> Text
templateName :: Prelude.Text
  }
  deriving (UpdateServiceTemplateVersion
-> UpdateServiceTemplateVersion -> Bool
(UpdateServiceTemplateVersion
 -> UpdateServiceTemplateVersion -> Bool)
-> (UpdateServiceTemplateVersion
    -> UpdateServiceTemplateVersion -> Bool)
-> Eq UpdateServiceTemplateVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServiceTemplateVersion
-> UpdateServiceTemplateVersion -> Bool
$c/= :: UpdateServiceTemplateVersion
-> UpdateServiceTemplateVersion -> Bool
== :: UpdateServiceTemplateVersion
-> UpdateServiceTemplateVersion -> Bool
$c== :: UpdateServiceTemplateVersion
-> UpdateServiceTemplateVersion -> Bool
Prelude.Eq, Int -> UpdateServiceTemplateVersion -> ShowS
[UpdateServiceTemplateVersion] -> ShowS
UpdateServiceTemplateVersion -> String
(Int -> UpdateServiceTemplateVersion -> ShowS)
-> (UpdateServiceTemplateVersion -> String)
-> ([UpdateServiceTemplateVersion] -> ShowS)
-> Show UpdateServiceTemplateVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServiceTemplateVersion] -> ShowS
$cshowList :: [UpdateServiceTemplateVersion] -> ShowS
show :: UpdateServiceTemplateVersion -> String
$cshow :: UpdateServiceTemplateVersion -> String
showsPrec :: Int -> UpdateServiceTemplateVersion -> ShowS
$cshowsPrec :: Int -> UpdateServiceTemplateVersion -> ShowS
Prelude.Show, (forall x.
 UpdateServiceTemplateVersion -> Rep UpdateServiceTemplateVersion x)
-> (forall x.
    Rep UpdateServiceTemplateVersion x -> UpdateServiceTemplateVersion)
-> Generic UpdateServiceTemplateVersion
forall x.
Rep UpdateServiceTemplateVersion x -> UpdateServiceTemplateVersion
forall x.
UpdateServiceTemplateVersion -> Rep UpdateServiceTemplateVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateServiceTemplateVersion x -> UpdateServiceTemplateVersion
$cfrom :: forall x.
UpdateServiceTemplateVersion -> Rep UpdateServiceTemplateVersion x
Prelude.Generic)

-- |
-- Create a value of 'UpdateServiceTemplateVersion' 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:
--
-- 'status', 'updateServiceTemplateVersion_status' - The status of the service template minor version to update.
--
-- 'compatibleEnvironmentTemplates', 'updateServiceTemplateVersion_compatibleEnvironmentTemplates' - An array of compatible environment names for a service template major or
-- minor version to update.
--
-- 'description', 'updateServiceTemplateVersion_description' - A description of a service template version to update.
--
-- 'majorVersion', 'updateServiceTemplateVersion_majorVersion' - To update a major version of a service template, include @majorVersion@.
--
-- 'minorVersion', 'updateServiceTemplateVersion_minorVersion' - To update a minor version of a service template, include @minorVersion@.
--
-- 'templateName', 'updateServiceTemplateVersion_templateName' - The name of the service template.
newUpdateServiceTemplateVersion ::
  -- | 'majorVersion'
  Prelude.Text ->
  -- | 'minorVersion'
  Prelude.Text ->
  -- | 'templateName'
  Prelude.Text ->
  UpdateServiceTemplateVersion
newUpdateServiceTemplateVersion :: Text -> Text -> Text -> UpdateServiceTemplateVersion
newUpdateServiceTemplateVersion
  Text
pMajorVersion_
  Text
pMinorVersion_
  Text
pTemplateName_ =
    UpdateServiceTemplateVersion' :: Maybe TemplateVersionStatus
-> Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
-> Maybe (Sensitive Text)
-> Text
-> Text
-> Text
-> UpdateServiceTemplateVersion
UpdateServiceTemplateVersion'
      { $sel:status:UpdateServiceTemplateVersion' :: Maybe TemplateVersionStatus
status =
          Maybe TemplateVersionStatus
forall a. Maybe a
Prelude.Nothing,
        $sel:compatibleEnvironmentTemplates:UpdateServiceTemplateVersion' :: Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
compatibleEnvironmentTemplates =
          Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
forall a. Maybe a
Prelude.Nothing,
        $sel:description:UpdateServiceTemplateVersion' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:majorVersion:UpdateServiceTemplateVersion' :: Text
majorVersion = Text
pMajorVersion_,
        $sel:minorVersion:UpdateServiceTemplateVersion' :: Text
minorVersion = Text
pMinorVersion_,
        $sel:templateName:UpdateServiceTemplateVersion' :: Text
templateName = Text
pTemplateName_
      }

-- | The status of the service template minor version to update.
updateServiceTemplateVersion_status :: Lens.Lens' UpdateServiceTemplateVersion (Prelude.Maybe TemplateVersionStatus)
updateServiceTemplateVersion_status :: (Maybe TemplateVersionStatus -> f (Maybe TemplateVersionStatus))
-> UpdateServiceTemplateVersion -> f UpdateServiceTemplateVersion
updateServiceTemplateVersion_status = (UpdateServiceTemplateVersion -> Maybe TemplateVersionStatus)
-> (UpdateServiceTemplateVersion
    -> Maybe TemplateVersionStatus -> UpdateServiceTemplateVersion)
-> Lens
     UpdateServiceTemplateVersion
     UpdateServiceTemplateVersion
     (Maybe TemplateVersionStatus)
     (Maybe TemplateVersionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceTemplateVersion' {Maybe TemplateVersionStatus
status :: Maybe TemplateVersionStatus
$sel:status:UpdateServiceTemplateVersion' :: UpdateServiceTemplateVersion -> Maybe TemplateVersionStatus
status} -> Maybe TemplateVersionStatus
status) (\s :: UpdateServiceTemplateVersion
s@UpdateServiceTemplateVersion' {} Maybe TemplateVersionStatus
a -> UpdateServiceTemplateVersion
s {$sel:status:UpdateServiceTemplateVersion' :: Maybe TemplateVersionStatus
status = Maybe TemplateVersionStatus
a} :: UpdateServiceTemplateVersion)

-- | An array of compatible environment names for a service template major or
-- minor version to update.
updateServiceTemplateVersion_compatibleEnvironmentTemplates :: Lens.Lens' UpdateServiceTemplateVersion (Prelude.Maybe (Prelude.NonEmpty CompatibleEnvironmentTemplateInput))
updateServiceTemplateVersion_compatibleEnvironmentTemplates :: (Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
 -> f (Maybe (NonEmpty CompatibleEnvironmentTemplateInput)))
-> UpdateServiceTemplateVersion -> f UpdateServiceTemplateVersion
updateServiceTemplateVersion_compatibleEnvironmentTemplates = (UpdateServiceTemplateVersion
 -> Maybe (NonEmpty CompatibleEnvironmentTemplateInput))
-> (UpdateServiceTemplateVersion
    -> Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
    -> UpdateServiceTemplateVersion)
-> Lens
     UpdateServiceTemplateVersion
     UpdateServiceTemplateVersion
     (Maybe (NonEmpty CompatibleEnvironmentTemplateInput))
     (Maybe (NonEmpty CompatibleEnvironmentTemplateInput))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceTemplateVersion' {Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
compatibleEnvironmentTemplates :: Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
$sel:compatibleEnvironmentTemplates:UpdateServiceTemplateVersion' :: UpdateServiceTemplateVersion
-> Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
compatibleEnvironmentTemplates} -> Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
compatibleEnvironmentTemplates) (\s :: UpdateServiceTemplateVersion
s@UpdateServiceTemplateVersion' {} Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
a -> UpdateServiceTemplateVersion
s {$sel:compatibleEnvironmentTemplates:UpdateServiceTemplateVersion' :: Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
compatibleEnvironmentTemplates = Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
a} :: UpdateServiceTemplateVersion) ((Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
  -> f (Maybe (NonEmpty CompatibleEnvironmentTemplateInput)))
 -> UpdateServiceTemplateVersion -> f UpdateServiceTemplateVersion)
-> ((Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
     -> f (Maybe (NonEmpty CompatibleEnvironmentTemplateInput)))
    -> Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
    -> f (Maybe (NonEmpty CompatibleEnvironmentTemplateInput)))
-> (Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
    -> f (Maybe (NonEmpty CompatibleEnvironmentTemplateInput)))
-> UpdateServiceTemplateVersion
-> f UpdateServiceTemplateVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty CompatibleEnvironmentTemplateInput)
  (NonEmpty CompatibleEnvironmentTemplateInput)
  (NonEmpty CompatibleEnvironmentTemplateInput)
  (NonEmpty CompatibleEnvironmentTemplateInput)
-> Iso
     (Maybe (NonEmpty CompatibleEnvironmentTemplateInput))
     (Maybe (NonEmpty CompatibleEnvironmentTemplateInput))
     (Maybe (NonEmpty CompatibleEnvironmentTemplateInput))
     (Maybe (NonEmpty CompatibleEnvironmentTemplateInput))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty CompatibleEnvironmentTemplateInput)
  (NonEmpty CompatibleEnvironmentTemplateInput)
  (NonEmpty CompatibleEnvironmentTemplateInput)
  (NonEmpty CompatibleEnvironmentTemplateInput)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A description of a service template version to update.
updateServiceTemplateVersion_description :: Lens.Lens' UpdateServiceTemplateVersion (Prelude.Maybe Prelude.Text)
updateServiceTemplateVersion_description :: (Maybe Text -> f (Maybe Text))
-> UpdateServiceTemplateVersion -> f UpdateServiceTemplateVersion
updateServiceTemplateVersion_description = (UpdateServiceTemplateVersion -> Maybe (Sensitive Text))
-> (UpdateServiceTemplateVersion
    -> Maybe (Sensitive Text) -> UpdateServiceTemplateVersion)
-> Lens
     UpdateServiceTemplateVersion
     UpdateServiceTemplateVersion
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceTemplateVersion' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:UpdateServiceTemplateVersion' :: UpdateServiceTemplateVersion -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: UpdateServiceTemplateVersion
s@UpdateServiceTemplateVersion' {} Maybe (Sensitive Text)
a -> UpdateServiceTemplateVersion
s {$sel:description:UpdateServiceTemplateVersion' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: UpdateServiceTemplateVersion) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateServiceTemplateVersion -> f UpdateServiceTemplateVersion)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateServiceTemplateVersion
-> f UpdateServiceTemplateVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | To update a major version of a service template, include @majorVersion@.
updateServiceTemplateVersion_majorVersion :: Lens.Lens' UpdateServiceTemplateVersion Prelude.Text
updateServiceTemplateVersion_majorVersion :: (Text -> f Text)
-> UpdateServiceTemplateVersion -> f UpdateServiceTemplateVersion
updateServiceTemplateVersion_majorVersion = (UpdateServiceTemplateVersion -> Text)
-> (UpdateServiceTemplateVersion
    -> Text -> UpdateServiceTemplateVersion)
-> Lens
     UpdateServiceTemplateVersion UpdateServiceTemplateVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceTemplateVersion' {Text
majorVersion :: Text
$sel:majorVersion:UpdateServiceTemplateVersion' :: UpdateServiceTemplateVersion -> Text
majorVersion} -> Text
majorVersion) (\s :: UpdateServiceTemplateVersion
s@UpdateServiceTemplateVersion' {} Text
a -> UpdateServiceTemplateVersion
s {$sel:majorVersion:UpdateServiceTemplateVersion' :: Text
majorVersion = Text
a} :: UpdateServiceTemplateVersion)

-- | To update a minor version of a service template, include @minorVersion@.
updateServiceTemplateVersion_minorVersion :: Lens.Lens' UpdateServiceTemplateVersion Prelude.Text
updateServiceTemplateVersion_minorVersion :: (Text -> f Text)
-> UpdateServiceTemplateVersion -> f UpdateServiceTemplateVersion
updateServiceTemplateVersion_minorVersion = (UpdateServiceTemplateVersion -> Text)
-> (UpdateServiceTemplateVersion
    -> Text -> UpdateServiceTemplateVersion)
-> Lens
     UpdateServiceTemplateVersion UpdateServiceTemplateVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceTemplateVersion' {Text
minorVersion :: Text
$sel:minorVersion:UpdateServiceTemplateVersion' :: UpdateServiceTemplateVersion -> Text
minorVersion} -> Text
minorVersion) (\s :: UpdateServiceTemplateVersion
s@UpdateServiceTemplateVersion' {} Text
a -> UpdateServiceTemplateVersion
s {$sel:minorVersion:UpdateServiceTemplateVersion' :: Text
minorVersion = Text
a} :: UpdateServiceTemplateVersion)

-- | The name of the service template.
updateServiceTemplateVersion_templateName :: Lens.Lens' UpdateServiceTemplateVersion Prelude.Text
updateServiceTemplateVersion_templateName :: (Text -> f Text)
-> UpdateServiceTemplateVersion -> f UpdateServiceTemplateVersion
updateServiceTemplateVersion_templateName = (UpdateServiceTemplateVersion -> Text)
-> (UpdateServiceTemplateVersion
    -> Text -> UpdateServiceTemplateVersion)
-> Lens
     UpdateServiceTemplateVersion UpdateServiceTemplateVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceTemplateVersion' {Text
templateName :: Text
$sel:templateName:UpdateServiceTemplateVersion' :: UpdateServiceTemplateVersion -> Text
templateName} -> Text
templateName) (\s :: UpdateServiceTemplateVersion
s@UpdateServiceTemplateVersion' {} Text
a -> UpdateServiceTemplateVersion
s {$sel:templateName:UpdateServiceTemplateVersion' :: Text
templateName = Text
a} :: UpdateServiceTemplateVersion)

instance Core.AWSRequest UpdateServiceTemplateVersion where
  type
    AWSResponse UpdateServiceTemplateVersion =
      UpdateServiceTemplateVersionResponse
  request :: UpdateServiceTemplateVersion
-> Request UpdateServiceTemplateVersion
request = Service
-> UpdateServiceTemplateVersion
-> Request UpdateServiceTemplateVersion
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateServiceTemplateVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateServiceTemplateVersion)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateServiceTemplateVersion))
-> Logger
-> Service
-> Proxy UpdateServiceTemplateVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateServiceTemplateVersion)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int
-> ServiceTemplateVersion -> UpdateServiceTemplateVersionResponse
UpdateServiceTemplateVersionResponse'
            (Int
 -> ServiceTemplateVersion -> UpdateServiceTemplateVersionResponse)
-> Either String Int
-> Either
     String
     (ServiceTemplateVersion -> UpdateServiceTemplateVersionResponse)
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))
            Either
  String
  (ServiceTemplateVersion -> UpdateServiceTemplateVersionResponse)
-> Either String ServiceTemplateVersion
-> Either String UpdateServiceTemplateVersionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String ServiceTemplateVersion
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"serviceTemplateVersion")
      )

instance
  Prelude.Hashable
    UpdateServiceTemplateVersion

instance Prelude.NFData UpdateServiceTemplateVersion

instance Core.ToHeaders UpdateServiceTemplateVersion where
  toHeaders :: UpdateServiceTemplateVersion -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateServiceTemplateVersion -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AwsProton20200720.UpdateServiceTemplateVersion" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateServiceTemplateVersion where
  toJSON :: UpdateServiceTemplateVersion -> Value
toJSON UpdateServiceTemplateVersion' {Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
Maybe (Sensitive Text)
Maybe TemplateVersionStatus
Text
templateName :: Text
minorVersion :: Text
majorVersion :: Text
description :: Maybe (Sensitive Text)
compatibleEnvironmentTemplates :: Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
status :: Maybe TemplateVersionStatus
$sel:templateName:UpdateServiceTemplateVersion' :: UpdateServiceTemplateVersion -> Text
$sel:minorVersion:UpdateServiceTemplateVersion' :: UpdateServiceTemplateVersion -> Text
$sel:majorVersion:UpdateServiceTemplateVersion' :: UpdateServiceTemplateVersion -> Text
$sel:description:UpdateServiceTemplateVersion' :: UpdateServiceTemplateVersion -> Maybe (Sensitive Text)
$sel:compatibleEnvironmentTemplates:UpdateServiceTemplateVersion' :: UpdateServiceTemplateVersion
-> Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
$sel:status:UpdateServiceTemplateVersion' :: UpdateServiceTemplateVersion -> Maybe TemplateVersionStatus
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"status" Text -> TemplateVersionStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TemplateVersionStatus -> Pair)
-> Maybe TemplateVersionStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TemplateVersionStatus
status,
            (Text
"compatibleEnvironmentTemplates" Text -> NonEmpty CompatibleEnvironmentTemplateInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NonEmpty CompatibleEnvironmentTemplateInput -> Pair)
-> Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
-> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty CompatibleEnvironmentTemplateInput)
compatibleEnvironmentTemplates,
            (Text
"description" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
description,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"majorVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
majorVersion),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"minorVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
minorVersion),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"templateName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
templateName)
          ]
      )

instance Core.ToPath UpdateServiceTemplateVersion where
  toPath :: UpdateServiceTemplateVersion -> ByteString
toPath = ByteString -> UpdateServiceTemplateVersion -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newUpdateServiceTemplateVersionResponse' smart constructor.
data UpdateServiceTemplateVersionResponse = UpdateServiceTemplateVersionResponse'
  { -- | The response's http status code.
    UpdateServiceTemplateVersionResponse -> Int
httpStatus :: Prelude.Int,
    -- | The service template version detail data that\'s returned by AWS Proton.
    UpdateServiceTemplateVersionResponse -> ServiceTemplateVersion
serviceTemplateVersion :: ServiceTemplateVersion
  }
  deriving (UpdateServiceTemplateVersionResponse
-> UpdateServiceTemplateVersionResponse -> Bool
(UpdateServiceTemplateVersionResponse
 -> UpdateServiceTemplateVersionResponse -> Bool)
-> (UpdateServiceTemplateVersionResponse
    -> UpdateServiceTemplateVersionResponse -> Bool)
-> Eq UpdateServiceTemplateVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServiceTemplateVersionResponse
-> UpdateServiceTemplateVersionResponse -> Bool
$c/= :: UpdateServiceTemplateVersionResponse
-> UpdateServiceTemplateVersionResponse -> Bool
== :: UpdateServiceTemplateVersionResponse
-> UpdateServiceTemplateVersionResponse -> Bool
$c== :: UpdateServiceTemplateVersionResponse
-> UpdateServiceTemplateVersionResponse -> Bool
Prelude.Eq, Int -> UpdateServiceTemplateVersionResponse -> ShowS
[UpdateServiceTemplateVersionResponse] -> ShowS
UpdateServiceTemplateVersionResponse -> String
(Int -> UpdateServiceTemplateVersionResponse -> ShowS)
-> (UpdateServiceTemplateVersionResponse -> String)
-> ([UpdateServiceTemplateVersionResponse] -> ShowS)
-> Show UpdateServiceTemplateVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServiceTemplateVersionResponse] -> ShowS
$cshowList :: [UpdateServiceTemplateVersionResponse] -> ShowS
show :: UpdateServiceTemplateVersionResponse -> String
$cshow :: UpdateServiceTemplateVersionResponse -> String
showsPrec :: Int -> UpdateServiceTemplateVersionResponse -> ShowS
$cshowsPrec :: Int -> UpdateServiceTemplateVersionResponse -> ShowS
Prelude.Show, (forall x.
 UpdateServiceTemplateVersionResponse
 -> Rep UpdateServiceTemplateVersionResponse x)
-> (forall x.
    Rep UpdateServiceTemplateVersionResponse x
    -> UpdateServiceTemplateVersionResponse)
-> Generic UpdateServiceTemplateVersionResponse
forall x.
Rep UpdateServiceTemplateVersionResponse x
-> UpdateServiceTemplateVersionResponse
forall x.
UpdateServiceTemplateVersionResponse
-> Rep UpdateServiceTemplateVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateServiceTemplateVersionResponse x
-> UpdateServiceTemplateVersionResponse
$cfrom :: forall x.
UpdateServiceTemplateVersionResponse
-> Rep UpdateServiceTemplateVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateServiceTemplateVersionResponse' 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:
--
-- 'httpStatus', 'updateServiceTemplateVersionResponse_httpStatus' - The response's http status code.
--
-- 'serviceTemplateVersion', 'updateServiceTemplateVersionResponse_serviceTemplateVersion' - The service template version detail data that\'s returned by AWS Proton.
newUpdateServiceTemplateVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'serviceTemplateVersion'
  ServiceTemplateVersion ->
  UpdateServiceTemplateVersionResponse
newUpdateServiceTemplateVersionResponse :: Int
-> ServiceTemplateVersion -> UpdateServiceTemplateVersionResponse
newUpdateServiceTemplateVersionResponse
  Int
pHttpStatus_
  ServiceTemplateVersion
pServiceTemplateVersion_ =
    UpdateServiceTemplateVersionResponse' :: Int
-> ServiceTemplateVersion -> UpdateServiceTemplateVersionResponse
UpdateServiceTemplateVersionResponse'
      { $sel:httpStatus:UpdateServiceTemplateVersionResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:serviceTemplateVersion:UpdateServiceTemplateVersionResponse' :: ServiceTemplateVersion
serviceTemplateVersion =
          ServiceTemplateVersion
pServiceTemplateVersion_
      }

-- | The response's http status code.
updateServiceTemplateVersionResponse_httpStatus :: Lens.Lens' UpdateServiceTemplateVersionResponse Prelude.Int
updateServiceTemplateVersionResponse_httpStatus :: (Int -> f Int)
-> UpdateServiceTemplateVersionResponse
-> f UpdateServiceTemplateVersionResponse
updateServiceTemplateVersionResponse_httpStatus = (UpdateServiceTemplateVersionResponse -> Int)
-> (UpdateServiceTemplateVersionResponse
    -> Int -> UpdateServiceTemplateVersionResponse)
-> Lens
     UpdateServiceTemplateVersionResponse
     UpdateServiceTemplateVersionResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceTemplateVersionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateServiceTemplateVersionResponse' :: UpdateServiceTemplateVersionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateServiceTemplateVersionResponse
s@UpdateServiceTemplateVersionResponse' {} Int
a -> UpdateServiceTemplateVersionResponse
s {$sel:httpStatus:UpdateServiceTemplateVersionResponse' :: Int
httpStatus = Int
a} :: UpdateServiceTemplateVersionResponse)

-- | The service template version detail data that\'s returned by AWS Proton.
updateServiceTemplateVersionResponse_serviceTemplateVersion :: Lens.Lens' UpdateServiceTemplateVersionResponse ServiceTemplateVersion
updateServiceTemplateVersionResponse_serviceTemplateVersion :: (ServiceTemplateVersion -> f ServiceTemplateVersion)
-> UpdateServiceTemplateVersionResponse
-> f UpdateServiceTemplateVersionResponse
updateServiceTemplateVersionResponse_serviceTemplateVersion = (UpdateServiceTemplateVersionResponse -> ServiceTemplateVersion)
-> (UpdateServiceTemplateVersionResponse
    -> ServiceTemplateVersion -> UpdateServiceTemplateVersionResponse)
-> Lens
     UpdateServiceTemplateVersionResponse
     UpdateServiceTemplateVersionResponse
     ServiceTemplateVersion
     ServiceTemplateVersion
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceTemplateVersionResponse' {ServiceTemplateVersion
serviceTemplateVersion :: ServiceTemplateVersion
$sel:serviceTemplateVersion:UpdateServiceTemplateVersionResponse' :: UpdateServiceTemplateVersionResponse -> ServiceTemplateVersion
serviceTemplateVersion} -> ServiceTemplateVersion
serviceTemplateVersion) (\s :: UpdateServiceTemplateVersionResponse
s@UpdateServiceTemplateVersionResponse' {} ServiceTemplateVersion
a -> UpdateServiceTemplateVersionResponse
s {$sel:serviceTemplateVersion:UpdateServiceTemplateVersionResponse' :: ServiceTemplateVersion
serviceTemplateVersion = ServiceTemplateVersion
a} :: UpdateServiceTemplateVersionResponse)

instance
  Prelude.NFData
    UpdateServiceTemplateVersionResponse