{-# 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.Nimble.UpdateLaunchProfile
-- 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 launch profile.
module Amazonka.Nimble.UpdateLaunchProfile
  ( -- * Creating a Request
    UpdateLaunchProfile (..),
    newUpdateLaunchProfile,

    -- * Request Lenses
    updateLaunchProfile_clientToken,
    updateLaunchProfile_launchProfileProtocolVersions,
    updateLaunchProfile_streamConfiguration,
    updateLaunchProfile_name,
    updateLaunchProfile_description,
    updateLaunchProfile_studioComponentIds,
    updateLaunchProfile_studioId,
    updateLaunchProfile_launchProfileId,

    -- * Destructuring the Response
    UpdateLaunchProfileResponse (..),
    newUpdateLaunchProfileResponse,

    -- * Response Lenses
    updateLaunchProfileResponse_launchProfile,
    updateLaunchProfileResponse_httpStatus,
  )
where

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

-- | The launch profile ID.
--
-- /See:/ 'newUpdateLaunchProfile' smart constructor.
data UpdateLaunchProfile = UpdateLaunchProfile'
  { -- | To make an idempotent API request using one of these actions, specify a
    -- client token in the request. You should not reuse the same client token
    -- for other API requests. If you retry a request that completed
    -- successfully using the same client token and the same parameters, the
    -- retry succeeds without performing any further actions. If you retry a
    -- successful request using the same client token, but one or more of the
    -- parameters are different, the retry fails with a ValidationException
    -- error.
    UpdateLaunchProfile -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The version number of the protocol that is used by the launch profile.
    -- The only valid version is \"2021-03-31\".
    UpdateLaunchProfile -> Maybe [Text]
launchProfileProtocolVersions :: Prelude.Maybe [Prelude.Text],
    -- | A configuration for a streaming session.
    UpdateLaunchProfile -> Maybe StreamConfigurationCreate
streamConfiguration :: Prelude.Maybe StreamConfigurationCreate,
    -- | The name for the launch profile.
    UpdateLaunchProfile -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The description.
    UpdateLaunchProfile -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Unique identifiers for a collection of studio components that can be
    -- used with this launch profile.
    UpdateLaunchProfile -> Maybe (NonEmpty Text)
studioComponentIds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The studio ID.
    UpdateLaunchProfile -> Text
studioId :: Prelude.Text,
    -- | The launch profile ID.
    UpdateLaunchProfile -> Text
launchProfileId :: Prelude.Text
  }
  deriving (UpdateLaunchProfile -> UpdateLaunchProfile -> Bool
(UpdateLaunchProfile -> UpdateLaunchProfile -> Bool)
-> (UpdateLaunchProfile -> UpdateLaunchProfile -> Bool)
-> Eq UpdateLaunchProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLaunchProfile -> UpdateLaunchProfile -> Bool
$c/= :: UpdateLaunchProfile -> UpdateLaunchProfile -> Bool
== :: UpdateLaunchProfile -> UpdateLaunchProfile -> Bool
$c== :: UpdateLaunchProfile -> UpdateLaunchProfile -> Bool
Prelude.Eq, ReadPrec [UpdateLaunchProfile]
ReadPrec UpdateLaunchProfile
Int -> ReadS UpdateLaunchProfile
ReadS [UpdateLaunchProfile]
(Int -> ReadS UpdateLaunchProfile)
-> ReadS [UpdateLaunchProfile]
-> ReadPrec UpdateLaunchProfile
-> ReadPrec [UpdateLaunchProfile]
-> Read UpdateLaunchProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLaunchProfile]
$creadListPrec :: ReadPrec [UpdateLaunchProfile]
readPrec :: ReadPrec UpdateLaunchProfile
$creadPrec :: ReadPrec UpdateLaunchProfile
readList :: ReadS [UpdateLaunchProfile]
$creadList :: ReadS [UpdateLaunchProfile]
readsPrec :: Int -> ReadS UpdateLaunchProfile
$creadsPrec :: Int -> ReadS UpdateLaunchProfile
Prelude.Read, Int -> UpdateLaunchProfile -> ShowS
[UpdateLaunchProfile] -> ShowS
UpdateLaunchProfile -> String
(Int -> UpdateLaunchProfile -> ShowS)
-> (UpdateLaunchProfile -> String)
-> ([UpdateLaunchProfile] -> ShowS)
-> Show UpdateLaunchProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLaunchProfile] -> ShowS
$cshowList :: [UpdateLaunchProfile] -> ShowS
show :: UpdateLaunchProfile -> String
$cshow :: UpdateLaunchProfile -> String
showsPrec :: Int -> UpdateLaunchProfile -> ShowS
$cshowsPrec :: Int -> UpdateLaunchProfile -> ShowS
Prelude.Show, (forall x. UpdateLaunchProfile -> Rep UpdateLaunchProfile x)
-> (forall x. Rep UpdateLaunchProfile x -> UpdateLaunchProfile)
-> Generic UpdateLaunchProfile
forall x. Rep UpdateLaunchProfile x -> UpdateLaunchProfile
forall x. UpdateLaunchProfile -> Rep UpdateLaunchProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateLaunchProfile x -> UpdateLaunchProfile
$cfrom :: forall x. UpdateLaunchProfile -> Rep UpdateLaunchProfile x
Prelude.Generic)

-- |
-- Create a value of 'UpdateLaunchProfile' 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:
--
-- 'clientToken', 'updateLaunchProfile_clientToken' - To make an idempotent API request using one of these actions, specify a
-- client token in the request. You should not reuse the same client token
-- for other API requests. If you retry a request that completed
-- successfully using the same client token and the same parameters, the
-- retry succeeds without performing any further actions. If you retry a
-- successful request using the same client token, but one or more of the
-- parameters are different, the retry fails with a ValidationException
-- error.
--
-- 'launchProfileProtocolVersions', 'updateLaunchProfile_launchProfileProtocolVersions' - The version number of the protocol that is used by the launch profile.
-- The only valid version is \"2021-03-31\".
--
-- 'streamConfiguration', 'updateLaunchProfile_streamConfiguration' - A configuration for a streaming session.
--
-- 'name', 'updateLaunchProfile_name' - The name for the launch profile.
--
-- 'description', 'updateLaunchProfile_description' - The description.
--
-- 'studioComponentIds', 'updateLaunchProfile_studioComponentIds' - Unique identifiers for a collection of studio components that can be
-- used with this launch profile.
--
-- 'studioId', 'updateLaunchProfile_studioId' - The studio ID.
--
-- 'launchProfileId', 'updateLaunchProfile_launchProfileId' - The launch profile ID.
newUpdateLaunchProfile ::
  -- | 'studioId'
  Prelude.Text ->
  -- | 'launchProfileId'
  Prelude.Text ->
  UpdateLaunchProfile
newUpdateLaunchProfile :: Text -> Text -> UpdateLaunchProfile
newUpdateLaunchProfile Text
pStudioId_ Text
pLaunchProfileId_ =
  UpdateLaunchProfile' :: Maybe Text
-> Maybe [Text]
-> Maybe StreamConfigurationCreate
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Text
-> Text
-> UpdateLaunchProfile
UpdateLaunchProfile'
    { $sel:clientToken:UpdateLaunchProfile' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:launchProfileProtocolVersions:UpdateLaunchProfile' :: Maybe [Text]
launchProfileProtocolVersions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:streamConfiguration:UpdateLaunchProfile' :: Maybe StreamConfigurationCreate
streamConfiguration = Maybe StreamConfigurationCreate
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateLaunchProfile' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateLaunchProfile' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:studioComponentIds:UpdateLaunchProfile' :: Maybe (NonEmpty Text)
studioComponentIds = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:studioId:UpdateLaunchProfile' :: Text
studioId = Text
pStudioId_,
      $sel:launchProfileId:UpdateLaunchProfile' :: Text
launchProfileId = Text
pLaunchProfileId_
    }

-- | To make an idempotent API request using one of these actions, specify a
-- client token in the request. You should not reuse the same client token
-- for other API requests. If you retry a request that completed
-- successfully using the same client token and the same parameters, the
-- retry succeeds without performing any further actions. If you retry a
-- successful request using the same client token, but one or more of the
-- parameters are different, the retry fails with a ValidationException
-- error.
updateLaunchProfile_clientToken :: Lens.Lens' UpdateLaunchProfile (Prelude.Maybe Prelude.Text)
updateLaunchProfile_clientToken :: (Maybe Text -> f (Maybe Text))
-> UpdateLaunchProfile -> f UpdateLaunchProfile
updateLaunchProfile_clientToken = (UpdateLaunchProfile -> Maybe Text)
-> (UpdateLaunchProfile -> Maybe Text -> UpdateLaunchProfile)
-> Lens
     UpdateLaunchProfile UpdateLaunchProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLaunchProfile' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: UpdateLaunchProfile
s@UpdateLaunchProfile' {} Maybe Text
a -> UpdateLaunchProfile
s {$sel:clientToken:UpdateLaunchProfile' :: Maybe Text
clientToken = Maybe Text
a} :: UpdateLaunchProfile)

-- | The version number of the protocol that is used by the launch profile.
-- The only valid version is \"2021-03-31\".
updateLaunchProfile_launchProfileProtocolVersions :: Lens.Lens' UpdateLaunchProfile (Prelude.Maybe [Prelude.Text])
updateLaunchProfile_launchProfileProtocolVersions :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateLaunchProfile -> f UpdateLaunchProfile
updateLaunchProfile_launchProfileProtocolVersions = (UpdateLaunchProfile -> Maybe [Text])
-> (UpdateLaunchProfile -> Maybe [Text] -> UpdateLaunchProfile)
-> Lens
     UpdateLaunchProfile
     UpdateLaunchProfile
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLaunchProfile' {Maybe [Text]
launchProfileProtocolVersions :: Maybe [Text]
$sel:launchProfileProtocolVersions:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe [Text]
launchProfileProtocolVersions} -> Maybe [Text]
launchProfileProtocolVersions) (\s :: UpdateLaunchProfile
s@UpdateLaunchProfile' {} Maybe [Text]
a -> UpdateLaunchProfile
s {$sel:launchProfileProtocolVersions:UpdateLaunchProfile' :: Maybe [Text]
launchProfileProtocolVersions = Maybe [Text]
a} :: UpdateLaunchProfile) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateLaunchProfile -> f UpdateLaunchProfile)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateLaunchProfile
-> f UpdateLaunchProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A configuration for a streaming session.
updateLaunchProfile_streamConfiguration :: Lens.Lens' UpdateLaunchProfile (Prelude.Maybe StreamConfigurationCreate)
updateLaunchProfile_streamConfiguration :: (Maybe StreamConfigurationCreate
 -> f (Maybe StreamConfigurationCreate))
-> UpdateLaunchProfile -> f UpdateLaunchProfile
updateLaunchProfile_streamConfiguration = (UpdateLaunchProfile -> Maybe StreamConfigurationCreate)
-> (UpdateLaunchProfile
    -> Maybe StreamConfigurationCreate -> UpdateLaunchProfile)
-> Lens
     UpdateLaunchProfile
     UpdateLaunchProfile
     (Maybe StreamConfigurationCreate)
     (Maybe StreamConfigurationCreate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLaunchProfile' {Maybe StreamConfigurationCreate
streamConfiguration :: Maybe StreamConfigurationCreate
$sel:streamConfiguration:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe StreamConfigurationCreate
streamConfiguration} -> Maybe StreamConfigurationCreate
streamConfiguration) (\s :: UpdateLaunchProfile
s@UpdateLaunchProfile' {} Maybe StreamConfigurationCreate
a -> UpdateLaunchProfile
s {$sel:streamConfiguration:UpdateLaunchProfile' :: Maybe StreamConfigurationCreate
streamConfiguration = Maybe StreamConfigurationCreate
a} :: UpdateLaunchProfile)

-- | The name for the launch profile.
updateLaunchProfile_name :: Lens.Lens' UpdateLaunchProfile (Prelude.Maybe Prelude.Text)
updateLaunchProfile_name :: (Maybe Text -> f (Maybe Text))
-> UpdateLaunchProfile -> f UpdateLaunchProfile
updateLaunchProfile_name = (UpdateLaunchProfile -> Maybe Text)
-> (UpdateLaunchProfile -> Maybe Text -> UpdateLaunchProfile)
-> Lens
     UpdateLaunchProfile UpdateLaunchProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLaunchProfile' {Maybe Text
name :: Maybe Text
$sel:name:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateLaunchProfile
s@UpdateLaunchProfile' {} Maybe Text
a -> UpdateLaunchProfile
s {$sel:name:UpdateLaunchProfile' :: Maybe Text
name = Maybe Text
a} :: UpdateLaunchProfile)

-- | The description.
updateLaunchProfile_description :: Lens.Lens' UpdateLaunchProfile (Prelude.Maybe Prelude.Text)
updateLaunchProfile_description :: (Maybe Text -> f (Maybe Text))
-> UpdateLaunchProfile -> f UpdateLaunchProfile
updateLaunchProfile_description = (UpdateLaunchProfile -> Maybe Text)
-> (UpdateLaunchProfile -> Maybe Text -> UpdateLaunchProfile)
-> Lens
     UpdateLaunchProfile UpdateLaunchProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLaunchProfile' {Maybe Text
description :: Maybe Text
$sel:description:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateLaunchProfile
s@UpdateLaunchProfile' {} Maybe Text
a -> UpdateLaunchProfile
s {$sel:description:UpdateLaunchProfile' :: Maybe Text
description = Maybe Text
a} :: UpdateLaunchProfile)

-- | Unique identifiers for a collection of studio components that can be
-- used with this launch profile.
updateLaunchProfile_studioComponentIds :: Lens.Lens' UpdateLaunchProfile (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
updateLaunchProfile_studioComponentIds :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> UpdateLaunchProfile -> f UpdateLaunchProfile
updateLaunchProfile_studioComponentIds = (UpdateLaunchProfile -> Maybe (NonEmpty Text))
-> (UpdateLaunchProfile
    -> Maybe (NonEmpty Text) -> UpdateLaunchProfile)
-> Lens
     UpdateLaunchProfile
     UpdateLaunchProfile
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLaunchProfile' {Maybe (NonEmpty Text)
studioComponentIds :: Maybe (NonEmpty Text)
$sel:studioComponentIds:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe (NonEmpty Text)
studioComponentIds} -> Maybe (NonEmpty Text)
studioComponentIds) (\s :: UpdateLaunchProfile
s@UpdateLaunchProfile' {} Maybe (NonEmpty Text)
a -> UpdateLaunchProfile
s {$sel:studioComponentIds:UpdateLaunchProfile' :: Maybe (NonEmpty Text)
studioComponentIds = Maybe (NonEmpty Text)
a} :: UpdateLaunchProfile) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> UpdateLaunchProfile -> f UpdateLaunchProfile)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> UpdateLaunchProfile
-> f UpdateLaunchProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty 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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The studio ID.
updateLaunchProfile_studioId :: Lens.Lens' UpdateLaunchProfile Prelude.Text
updateLaunchProfile_studioId :: (Text -> f Text) -> UpdateLaunchProfile -> f UpdateLaunchProfile
updateLaunchProfile_studioId = (UpdateLaunchProfile -> Text)
-> (UpdateLaunchProfile -> Text -> UpdateLaunchProfile)
-> Lens UpdateLaunchProfile UpdateLaunchProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLaunchProfile' {Text
studioId :: Text
$sel:studioId:UpdateLaunchProfile' :: UpdateLaunchProfile -> Text
studioId} -> Text
studioId) (\s :: UpdateLaunchProfile
s@UpdateLaunchProfile' {} Text
a -> UpdateLaunchProfile
s {$sel:studioId:UpdateLaunchProfile' :: Text
studioId = Text
a} :: UpdateLaunchProfile)

-- | The launch profile ID.
updateLaunchProfile_launchProfileId :: Lens.Lens' UpdateLaunchProfile Prelude.Text
updateLaunchProfile_launchProfileId :: (Text -> f Text) -> UpdateLaunchProfile -> f UpdateLaunchProfile
updateLaunchProfile_launchProfileId = (UpdateLaunchProfile -> Text)
-> (UpdateLaunchProfile -> Text -> UpdateLaunchProfile)
-> Lens UpdateLaunchProfile UpdateLaunchProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLaunchProfile' {Text
launchProfileId :: Text
$sel:launchProfileId:UpdateLaunchProfile' :: UpdateLaunchProfile -> Text
launchProfileId} -> Text
launchProfileId) (\s :: UpdateLaunchProfile
s@UpdateLaunchProfile' {} Text
a -> UpdateLaunchProfile
s {$sel:launchProfileId:UpdateLaunchProfile' :: Text
launchProfileId = Text
a} :: UpdateLaunchProfile)

instance Core.AWSRequest UpdateLaunchProfile where
  type
    AWSResponse UpdateLaunchProfile =
      UpdateLaunchProfileResponse
  request :: UpdateLaunchProfile -> Request UpdateLaunchProfile
request = Service -> UpdateLaunchProfile -> Request UpdateLaunchProfile
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateLaunchProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateLaunchProfile)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateLaunchProfile))
-> Logger
-> Service
-> Proxy UpdateLaunchProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateLaunchProfile)))
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 ->
          Maybe LaunchProfile -> Int -> UpdateLaunchProfileResponse
UpdateLaunchProfileResponse'
            (Maybe LaunchProfile -> Int -> UpdateLaunchProfileResponse)
-> Either String (Maybe LaunchProfile)
-> Either String (Int -> UpdateLaunchProfileResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe LaunchProfile)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"launchProfile")
            Either String (Int -> UpdateLaunchProfileResponse)
-> Either String Int -> Either String UpdateLaunchProfileResponse
forall (f :: * -> *) a b. Applicative f => 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 UpdateLaunchProfile

instance Prelude.NFData UpdateLaunchProfile

instance Core.ToHeaders UpdateLaunchProfile where
  toHeaders :: UpdateLaunchProfile -> ResponseHeaders
toHeaders UpdateLaunchProfile' {Maybe [Text]
Maybe (NonEmpty Text)
Maybe Text
Maybe StreamConfigurationCreate
Text
launchProfileId :: Text
studioId :: Text
studioComponentIds :: Maybe (NonEmpty Text)
description :: Maybe Text
name :: Maybe Text
streamConfiguration :: Maybe StreamConfigurationCreate
launchProfileProtocolVersions :: Maybe [Text]
clientToken :: Maybe Text
$sel:launchProfileId:UpdateLaunchProfile' :: UpdateLaunchProfile -> Text
$sel:studioId:UpdateLaunchProfile' :: UpdateLaunchProfile -> Text
$sel:studioComponentIds:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe (NonEmpty Text)
$sel:description:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe Text
$sel:name:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe Text
$sel:streamConfiguration:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe StreamConfigurationCreate
$sel:launchProfileProtocolVersions:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe [Text]
$sel:clientToken:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe Text
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"X-Amz-Client-Token" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
clientToken,
        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.ToJSON UpdateLaunchProfile where
  toJSON :: UpdateLaunchProfile -> Value
toJSON UpdateLaunchProfile' {Maybe [Text]
Maybe (NonEmpty Text)
Maybe Text
Maybe StreamConfigurationCreate
Text
launchProfileId :: Text
studioId :: Text
studioComponentIds :: Maybe (NonEmpty Text)
description :: Maybe Text
name :: Maybe Text
streamConfiguration :: Maybe StreamConfigurationCreate
launchProfileProtocolVersions :: Maybe [Text]
clientToken :: Maybe Text
$sel:launchProfileId:UpdateLaunchProfile' :: UpdateLaunchProfile -> Text
$sel:studioId:UpdateLaunchProfile' :: UpdateLaunchProfile -> Text
$sel:studioComponentIds:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe (NonEmpty Text)
$sel:description:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe Text
$sel:name:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe Text
$sel:streamConfiguration:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe StreamConfigurationCreate
$sel:launchProfileProtocolVersions:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe [Text]
$sel:clientToken:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"launchProfileProtocolVersions" 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]
launchProfileProtocolVersions,
            (Text
"streamConfiguration" Text -> StreamConfigurationCreate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (StreamConfigurationCreate -> Pair)
-> Maybe StreamConfigurationCreate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StreamConfigurationCreate
streamConfiguration,
            (Text
"name" 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
name,
            (Text
"description" 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
description,
            (Text
"studioComponentIds" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
studioComponentIds
          ]
      )

instance Core.ToPath UpdateLaunchProfile where
  toPath :: UpdateLaunchProfile -> ByteString
toPath UpdateLaunchProfile' {Maybe [Text]
Maybe (NonEmpty Text)
Maybe Text
Maybe StreamConfigurationCreate
Text
launchProfileId :: Text
studioId :: Text
studioComponentIds :: Maybe (NonEmpty Text)
description :: Maybe Text
name :: Maybe Text
streamConfiguration :: Maybe StreamConfigurationCreate
launchProfileProtocolVersions :: Maybe [Text]
clientToken :: Maybe Text
$sel:launchProfileId:UpdateLaunchProfile' :: UpdateLaunchProfile -> Text
$sel:studioId:UpdateLaunchProfile' :: UpdateLaunchProfile -> Text
$sel:studioComponentIds:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe (NonEmpty Text)
$sel:description:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe Text
$sel:name:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe Text
$sel:streamConfiguration:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe StreamConfigurationCreate
$sel:launchProfileProtocolVersions:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe [Text]
$sel:clientToken:UpdateLaunchProfile' :: UpdateLaunchProfile -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2020-08-01/studios/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
studioId,
        ByteString
"/launch-profiles/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
launchProfileId
      ]

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

-- | /See:/ 'newUpdateLaunchProfileResponse' smart constructor.
data UpdateLaunchProfileResponse = UpdateLaunchProfileResponse'
  { -- | The launch profile.
    UpdateLaunchProfileResponse -> Maybe LaunchProfile
launchProfile :: Prelude.Maybe LaunchProfile,
    -- | The response's http status code.
    UpdateLaunchProfileResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateLaunchProfileResponse -> UpdateLaunchProfileResponse -> Bool
(UpdateLaunchProfileResponse
 -> UpdateLaunchProfileResponse -> Bool)
-> (UpdateLaunchProfileResponse
    -> UpdateLaunchProfileResponse -> Bool)
-> Eq UpdateLaunchProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLaunchProfileResponse -> UpdateLaunchProfileResponse -> Bool
$c/= :: UpdateLaunchProfileResponse -> UpdateLaunchProfileResponse -> Bool
== :: UpdateLaunchProfileResponse -> UpdateLaunchProfileResponse -> Bool
$c== :: UpdateLaunchProfileResponse -> UpdateLaunchProfileResponse -> Bool
Prelude.Eq, ReadPrec [UpdateLaunchProfileResponse]
ReadPrec UpdateLaunchProfileResponse
Int -> ReadS UpdateLaunchProfileResponse
ReadS [UpdateLaunchProfileResponse]
(Int -> ReadS UpdateLaunchProfileResponse)
-> ReadS [UpdateLaunchProfileResponse]
-> ReadPrec UpdateLaunchProfileResponse
-> ReadPrec [UpdateLaunchProfileResponse]
-> Read UpdateLaunchProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLaunchProfileResponse]
$creadListPrec :: ReadPrec [UpdateLaunchProfileResponse]
readPrec :: ReadPrec UpdateLaunchProfileResponse
$creadPrec :: ReadPrec UpdateLaunchProfileResponse
readList :: ReadS [UpdateLaunchProfileResponse]
$creadList :: ReadS [UpdateLaunchProfileResponse]
readsPrec :: Int -> ReadS UpdateLaunchProfileResponse
$creadsPrec :: Int -> ReadS UpdateLaunchProfileResponse
Prelude.Read, Int -> UpdateLaunchProfileResponse -> ShowS
[UpdateLaunchProfileResponse] -> ShowS
UpdateLaunchProfileResponse -> String
(Int -> UpdateLaunchProfileResponse -> ShowS)
-> (UpdateLaunchProfileResponse -> String)
-> ([UpdateLaunchProfileResponse] -> ShowS)
-> Show UpdateLaunchProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLaunchProfileResponse] -> ShowS
$cshowList :: [UpdateLaunchProfileResponse] -> ShowS
show :: UpdateLaunchProfileResponse -> String
$cshow :: UpdateLaunchProfileResponse -> String
showsPrec :: Int -> UpdateLaunchProfileResponse -> ShowS
$cshowsPrec :: Int -> UpdateLaunchProfileResponse -> ShowS
Prelude.Show, (forall x.
 UpdateLaunchProfileResponse -> Rep UpdateLaunchProfileResponse x)
-> (forall x.
    Rep UpdateLaunchProfileResponse x -> UpdateLaunchProfileResponse)
-> Generic UpdateLaunchProfileResponse
forall x.
Rep UpdateLaunchProfileResponse x -> UpdateLaunchProfileResponse
forall x.
UpdateLaunchProfileResponse -> Rep UpdateLaunchProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateLaunchProfileResponse x -> UpdateLaunchProfileResponse
$cfrom :: forall x.
UpdateLaunchProfileResponse -> Rep UpdateLaunchProfileResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateLaunchProfileResponse' 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:
--
-- 'launchProfile', 'updateLaunchProfileResponse_launchProfile' - The launch profile.
--
-- 'httpStatus', 'updateLaunchProfileResponse_httpStatus' - The response's http status code.
newUpdateLaunchProfileResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateLaunchProfileResponse
newUpdateLaunchProfileResponse :: Int -> UpdateLaunchProfileResponse
newUpdateLaunchProfileResponse Int
pHttpStatus_ =
  UpdateLaunchProfileResponse' :: Maybe LaunchProfile -> Int -> UpdateLaunchProfileResponse
UpdateLaunchProfileResponse'
    { $sel:launchProfile:UpdateLaunchProfileResponse' :: Maybe LaunchProfile
launchProfile =
        Maybe LaunchProfile
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateLaunchProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The launch profile.
updateLaunchProfileResponse_launchProfile :: Lens.Lens' UpdateLaunchProfileResponse (Prelude.Maybe LaunchProfile)
updateLaunchProfileResponse_launchProfile :: (Maybe LaunchProfile -> f (Maybe LaunchProfile))
-> UpdateLaunchProfileResponse -> f UpdateLaunchProfileResponse
updateLaunchProfileResponse_launchProfile = (UpdateLaunchProfileResponse -> Maybe LaunchProfile)
-> (UpdateLaunchProfileResponse
    -> Maybe LaunchProfile -> UpdateLaunchProfileResponse)
-> Lens
     UpdateLaunchProfileResponse
     UpdateLaunchProfileResponse
     (Maybe LaunchProfile)
     (Maybe LaunchProfile)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLaunchProfileResponse' {Maybe LaunchProfile
launchProfile :: Maybe LaunchProfile
$sel:launchProfile:UpdateLaunchProfileResponse' :: UpdateLaunchProfileResponse -> Maybe LaunchProfile
launchProfile} -> Maybe LaunchProfile
launchProfile) (\s :: UpdateLaunchProfileResponse
s@UpdateLaunchProfileResponse' {} Maybe LaunchProfile
a -> UpdateLaunchProfileResponse
s {$sel:launchProfile:UpdateLaunchProfileResponse' :: Maybe LaunchProfile
launchProfile = Maybe LaunchProfile
a} :: UpdateLaunchProfileResponse)

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

instance Prelude.NFData UpdateLaunchProfileResponse