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

    -- * Request Lenses
    createLaunchProfile_clientToken,
    createLaunchProfile_description,
    createLaunchProfile_tags,
    createLaunchProfile_ec2SubnetIds,
    createLaunchProfile_studioComponentIds,
    createLaunchProfile_studioId,
    createLaunchProfile_launchProfileProtocolVersions,
    createLaunchProfile_name,
    createLaunchProfile_streamConfiguration,

    -- * Destructuring the Response
    CreateLaunchProfileResponse (..),
    newCreateLaunchProfileResponse,

    -- * Response Lenses
    createLaunchProfileResponse_launchProfile,
    createLaunchProfileResponse_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

-- | A collection of launch profiles.
--
-- /See:/ 'newCreateLaunchProfile' smart constructor.
data CreateLaunchProfile = CreateLaunchProfile'
  { -- | 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.
    CreateLaunchProfile -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The description.
    CreateLaunchProfile -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A collection of labels, in the form of key:value pairs, that apply to
    -- this resource.
    CreateLaunchProfile -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    CreateLaunchProfile -> [Text]
ec2SubnetIds :: [Prelude.Text],
    -- | Unique identifiers for a collection of studio components that can be
    -- used with this launch profile.
    CreateLaunchProfile -> NonEmpty Text
studioComponentIds :: Prelude.NonEmpty Prelude.Text,
    -- | The studio ID.
    CreateLaunchProfile -> Text
studioId :: Prelude.Text,
    -- | The version number of the protocol that is used by the launch profile.
    -- The only valid version is \"2021-03-31\".
    CreateLaunchProfile -> [Text]
launchProfileProtocolVersions :: [Prelude.Text],
    -- | The name for the launch profile.
    CreateLaunchProfile -> Text
name :: Prelude.Text,
    -- | A configuration for a streaming session.
    CreateLaunchProfile -> StreamConfigurationCreate
streamConfiguration :: StreamConfigurationCreate
  }
  deriving (CreateLaunchProfile -> CreateLaunchProfile -> Bool
(CreateLaunchProfile -> CreateLaunchProfile -> Bool)
-> (CreateLaunchProfile -> CreateLaunchProfile -> Bool)
-> Eq CreateLaunchProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLaunchProfile -> CreateLaunchProfile -> Bool
$c/= :: CreateLaunchProfile -> CreateLaunchProfile -> Bool
== :: CreateLaunchProfile -> CreateLaunchProfile -> Bool
$c== :: CreateLaunchProfile -> CreateLaunchProfile -> Bool
Prelude.Eq, ReadPrec [CreateLaunchProfile]
ReadPrec CreateLaunchProfile
Int -> ReadS CreateLaunchProfile
ReadS [CreateLaunchProfile]
(Int -> ReadS CreateLaunchProfile)
-> ReadS [CreateLaunchProfile]
-> ReadPrec CreateLaunchProfile
-> ReadPrec [CreateLaunchProfile]
-> Read CreateLaunchProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLaunchProfile]
$creadListPrec :: ReadPrec [CreateLaunchProfile]
readPrec :: ReadPrec CreateLaunchProfile
$creadPrec :: ReadPrec CreateLaunchProfile
readList :: ReadS [CreateLaunchProfile]
$creadList :: ReadS [CreateLaunchProfile]
readsPrec :: Int -> ReadS CreateLaunchProfile
$creadsPrec :: Int -> ReadS CreateLaunchProfile
Prelude.Read, Int -> CreateLaunchProfile -> ShowS
[CreateLaunchProfile] -> ShowS
CreateLaunchProfile -> String
(Int -> CreateLaunchProfile -> ShowS)
-> (CreateLaunchProfile -> String)
-> ([CreateLaunchProfile] -> ShowS)
-> Show CreateLaunchProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLaunchProfile] -> ShowS
$cshowList :: [CreateLaunchProfile] -> ShowS
show :: CreateLaunchProfile -> String
$cshow :: CreateLaunchProfile -> String
showsPrec :: Int -> CreateLaunchProfile -> ShowS
$cshowsPrec :: Int -> CreateLaunchProfile -> ShowS
Prelude.Show, (forall x. CreateLaunchProfile -> Rep CreateLaunchProfile x)
-> (forall x. Rep CreateLaunchProfile x -> CreateLaunchProfile)
-> Generic CreateLaunchProfile
forall x. Rep CreateLaunchProfile x -> CreateLaunchProfile
forall x. CreateLaunchProfile -> Rep CreateLaunchProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateLaunchProfile x -> CreateLaunchProfile
$cfrom :: forall x. CreateLaunchProfile -> Rep CreateLaunchProfile x
Prelude.Generic)

-- |
-- Create a value of 'CreateLaunchProfile' 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', 'createLaunchProfile_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.
--
-- 'description', 'createLaunchProfile_description' - The description.
--
-- 'tags', 'createLaunchProfile_tags' - A collection of labels, in the form of key:value pairs, that apply to
-- this resource.
--
-- 'ec2SubnetIds', 'createLaunchProfile_ec2SubnetIds' -
--
-- 'studioComponentIds', 'createLaunchProfile_studioComponentIds' - Unique identifiers for a collection of studio components that can be
-- used with this launch profile.
--
-- 'studioId', 'createLaunchProfile_studioId' - The studio ID.
--
-- 'launchProfileProtocolVersions', 'createLaunchProfile_launchProfileProtocolVersions' - The version number of the protocol that is used by the launch profile.
-- The only valid version is \"2021-03-31\".
--
-- 'name', 'createLaunchProfile_name' - The name for the launch profile.
--
-- 'streamConfiguration', 'createLaunchProfile_streamConfiguration' - A configuration for a streaming session.
newCreateLaunchProfile ::
  -- | 'studioComponentIds'
  Prelude.NonEmpty Prelude.Text ->
  -- | 'studioId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'streamConfiguration'
  StreamConfigurationCreate ->
  CreateLaunchProfile
newCreateLaunchProfile :: NonEmpty Text
-> Text -> Text -> StreamConfigurationCreate -> CreateLaunchProfile
newCreateLaunchProfile
  NonEmpty Text
pStudioComponentIds_
  Text
pStudioId_
  Text
pName_
  StreamConfigurationCreate
pStreamConfiguration_ =
    CreateLaunchProfile' :: Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> [Text]
-> NonEmpty Text
-> Text
-> [Text]
-> Text
-> StreamConfigurationCreate
-> CreateLaunchProfile
CreateLaunchProfile'
      { $sel:clientToken:CreateLaunchProfile' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateLaunchProfile' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateLaunchProfile' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:ec2SubnetIds:CreateLaunchProfile' :: [Text]
ec2SubnetIds = [Text]
forall a. Monoid a => a
Prelude.mempty,
        $sel:studioComponentIds:CreateLaunchProfile' :: NonEmpty Text
studioComponentIds =
          Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pStudioComponentIds_,
        $sel:studioId:CreateLaunchProfile' :: Text
studioId = Text
pStudioId_,
        $sel:launchProfileProtocolVersions:CreateLaunchProfile' :: [Text]
launchProfileProtocolVersions = [Text]
forall a. Monoid a => a
Prelude.mempty,
        $sel:name:CreateLaunchProfile' :: Text
name = Text
pName_,
        $sel:streamConfiguration:CreateLaunchProfile' :: StreamConfigurationCreate
streamConfiguration = StreamConfigurationCreate
pStreamConfiguration_
      }

-- | 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.
createLaunchProfile_clientToken :: Lens.Lens' CreateLaunchProfile (Prelude.Maybe Prelude.Text)
createLaunchProfile_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreateLaunchProfile -> f CreateLaunchProfile
createLaunchProfile_clientToken = (CreateLaunchProfile -> Maybe Text)
-> (CreateLaunchProfile -> Maybe Text -> CreateLaunchProfile)
-> Lens
     CreateLaunchProfile CreateLaunchProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLaunchProfile' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateLaunchProfile' :: CreateLaunchProfile -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateLaunchProfile
s@CreateLaunchProfile' {} Maybe Text
a -> CreateLaunchProfile
s {$sel:clientToken:CreateLaunchProfile' :: Maybe Text
clientToken = Maybe Text
a} :: CreateLaunchProfile)

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

-- | A collection of labels, in the form of key:value pairs, that apply to
-- this resource.
createLaunchProfile_tags :: Lens.Lens' CreateLaunchProfile (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createLaunchProfile_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateLaunchProfile -> f CreateLaunchProfile
createLaunchProfile_tags = (CreateLaunchProfile -> Maybe (HashMap Text Text))
-> (CreateLaunchProfile
    -> Maybe (HashMap Text Text) -> CreateLaunchProfile)
-> Lens
     CreateLaunchProfile
     CreateLaunchProfile
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLaunchProfile' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateLaunchProfile' :: CreateLaunchProfile -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateLaunchProfile
s@CreateLaunchProfile' {} Maybe (HashMap Text Text)
a -> CreateLaunchProfile
s {$sel:tags:CreateLaunchProfile' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateLaunchProfile) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateLaunchProfile -> f CreateLaunchProfile)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateLaunchProfile
-> f CreateLaunchProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- |
createLaunchProfile_ec2SubnetIds :: Lens.Lens' CreateLaunchProfile [Prelude.Text]
createLaunchProfile_ec2SubnetIds :: ([Text] -> f [Text])
-> CreateLaunchProfile -> f CreateLaunchProfile
createLaunchProfile_ec2SubnetIds = (CreateLaunchProfile -> [Text])
-> (CreateLaunchProfile -> [Text] -> CreateLaunchProfile)
-> Lens CreateLaunchProfile CreateLaunchProfile [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLaunchProfile' {[Text]
ec2SubnetIds :: [Text]
$sel:ec2SubnetIds:CreateLaunchProfile' :: CreateLaunchProfile -> [Text]
ec2SubnetIds} -> [Text]
ec2SubnetIds) (\s :: CreateLaunchProfile
s@CreateLaunchProfile' {} [Text]
a -> CreateLaunchProfile
s {$sel:ec2SubnetIds:CreateLaunchProfile' :: [Text]
ec2SubnetIds = [Text]
a} :: CreateLaunchProfile) (([Text] -> f [Text])
 -> CreateLaunchProfile -> f CreateLaunchProfile)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> CreateLaunchProfile
-> f CreateLaunchProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

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

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

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

instance Core.AWSRequest CreateLaunchProfile where
  type
    AWSResponse CreateLaunchProfile =
      CreateLaunchProfileResponse
  request :: CreateLaunchProfile -> Request CreateLaunchProfile
request = Service -> CreateLaunchProfile -> Request CreateLaunchProfile
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateLaunchProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateLaunchProfile)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateLaunchProfile))
-> Logger
-> Service
-> Proxy CreateLaunchProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateLaunchProfile)))
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 -> CreateLaunchProfileResponse
CreateLaunchProfileResponse'
            (Maybe LaunchProfile -> Int -> CreateLaunchProfileResponse)
-> Either String (Maybe LaunchProfile)
-> Either String (Int -> CreateLaunchProfileResponse)
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 -> CreateLaunchProfileResponse)
-> Either String Int -> Either String CreateLaunchProfileResponse
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 CreateLaunchProfile

instance Prelude.NFData CreateLaunchProfile

instance Core.ToHeaders CreateLaunchProfile where
  toHeaders :: CreateLaunchProfile -> ResponseHeaders
toHeaders CreateLaunchProfile' {[Text]
Maybe Text
Maybe (HashMap Text Text)
NonEmpty Text
Text
StreamConfigurationCreate
streamConfiguration :: StreamConfigurationCreate
name :: Text
launchProfileProtocolVersions :: [Text]
studioId :: Text
studioComponentIds :: NonEmpty Text
ec2SubnetIds :: [Text]
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
clientToken :: Maybe Text
$sel:streamConfiguration:CreateLaunchProfile' :: CreateLaunchProfile -> StreamConfigurationCreate
$sel:name:CreateLaunchProfile' :: CreateLaunchProfile -> Text
$sel:launchProfileProtocolVersions:CreateLaunchProfile' :: CreateLaunchProfile -> [Text]
$sel:studioId:CreateLaunchProfile' :: CreateLaunchProfile -> Text
$sel:studioComponentIds:CreateLaunchProfile' :: CreateLaunchProfile -> NonEmpty Text
$sel:ec2SubnetIds:CreateLaunchProfile' :: CreateLaunchProfile -> [Text]
$sel:tags:CreateLaunchProfile' :: CreateLaunchProfile -> Maybe (HashMap Text Text)
$sel:description:CreateLaunchProfile' :: CreateLaunchProfile -> Maybe Text
$sel:clientToken:CreateLaunchProfile' :: CreateLaunchProfile -> 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 CreateLaunchProfile where
  toJSON :: CreateLaunchProfile -> Value
toJSON CreateLaunchProfile' {[Text]
Maybe Text
Maybe (HashMap Text Text)
NonEmpty Text
Text
StreamConfigurationCreate
streamConfiguration :: StreamConfigurationCreate
name :: Text
launchProfileProtocolVersions :: [Text]
studioId :: Text
studioComponentIds :: NonEmpty Text
ec2SubnetIds :: [Text]
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
clientToken :: Maybe Text
$sel:streamConfiguration:CreateLaunchProfile' :: CreateLaunchProfile -> StreamConfigurationCreate
$sel:name:CreateLaunchProfile' :: CreateLaunchProfile -> Text
$sel:launchProfileProtocolVersions:CreateLaunchProfile' :: CreateLaunchProfile -> [Text]
$sel:studioId:CreateLaunchProfile' :: CreateLaunchProfile -> Text
$sel:studioComponentIds:CreateLaunchProfile' :: CreateLaunchProfile -> NonEmpty Text
$sel:ec2SubnetIds:CreateLaunchProfile' :: CreateLaunchProfile -> [Text]
$sel:tags:CreateLaunchProfile' :: CreateLaunchProfile -> Maybe (HashMap Text Text)
$sel:description:CreateLaunchProfile' :: CreateLaunchProfile -> Maybe Text
$sel:clientToken:CreateLaunchProfile' :: CreateLaunchProfile -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ec2SubnetIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
ec2SubnetIds),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"studioComponentIds" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
studioComponentIds),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"launchProfileProtocolVersions"
                  Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
launchProfileProtocolVersions
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"streamConfiguration" Text -> StreamConfigurationCreate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= StreamConfigurationCreate
streamConfiguration)
          ]
      )

instance Core.ToPath CreateLaunchProfile where
  toPath :: CreateLaunchProfile -> ByteString
toPath CreateLaunchProfile' {[Text]
Maybe Text
Maybe (HashMap Text Text)
NonEmpty Text
Text
StreamConfigurationCreate
streamConfiguration :: StreamConfigurationCreate
name :: Text
launchProfileProtocolVersions :: [Text]
studioId :: Text
studioComponentIds :: NonEmpty Text
ec2SubnetIds :: [Text]
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
clientToken :: Maybe Text
$sel:streamConfiguration:CreateLaunchProfile' :: CreateLaunchProfile -> StreamConfigurationCreate
$sel:name:CreateLaunchProfile' :: CreateLaunchProfile -> Text
$sel:launchProfileProtocolVersions:CreateLaunchProfile' :: CreateLaunchProfile -> [Text]
$sel:studioId:CreateLaunchProfile' :: CreateLaunchProfile -> Text
$sel:studioComponentIds:CreateLaunchProfile' :: CreateLaunchProfile -> NonEmpty Text
$sel:ec2SubnetIds:CreateLaunchProfile' :: CreateLaunchProfile -> [Text]
$sel:tags:CreateLaunchProfile' :: CreateLaunchProfile -> Maybe (HashMap Text Text)
$sel:description:CreateLaunchProfile' :: CreateLaunchProfile -> Maybe Text
$sel:clientToken:CreateLaunchProfile' :: CreateLaunchProfile -> 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"
      ]

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

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

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

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

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

instance Prelude.NFData CreateLaunchProfileResponse