{-# 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.CreateStreamingSession
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a streaming session in a studio.
--
-- After invoking this operation, you must poll GetStreamingSession until
-- the streaming session is in the @READY@ state.
module Amazonka.Nimble.CreateStreamingSession
  ( -- * Creating a Request
    CreateStreamingSession (..),
    newCreateStreamingSession,

    -- * Request Lenses
    createStreamingSession_clientToken,
    createStreamingSession_ec2InstanceType,
    createStreamingSession_ownedBy,
    createStreamingSession_streamingImageId,
    createStreamingSession_tags,
    createStreamingSession_launchProfileId,
    createStreamingSession_studioId,

    -- * Destructuring the Response
    CreateStreamingSessionResponse (..),
    newCreateStreamingSessionResponse,

    -- * Response Lenses
    createStreamingSessionResponse_session,
    createStreamingSessionResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateStreamingSession' smart constructor.
data CreateStreamingSession = CreateStreamingSession'
  { -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request. If you don’t specify a client token, the
    -- Amazon Web Services SDK automatically generates a client token and uses
    -- it for the request to ensure idempotency.
    CreateStreamingSession -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The EC2 Instance type used for the streaming session.
    CreateStreamingSession -> Maybe StreamingInstanceType
ec2InstanceType :: Prelude.Maybe StreamingInstanceType,
    -- | The user ID of the user that owns the streaming session. The user that
    -- owns the session will be logging into the session and interacting with
    -- the virtual workstation.
    CreateStreamingSession -> Maybe Text
ownedBy :: Prelude.Maybe Prelude.Text,
    -- | The ID of the streaming image.
    CreateStreamingSession -> Maybe Text
streamingImageId :: Prelude.Maybe Prelude.Text,
    -- | A collection of labels, in the form of key-value pairs, that apply to
    -- this resource.
    CreateStreamingSession -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The ID of the launch profile used to control access from the streaming
    -- session.
    CreateStreamingSession -> Text
launchProfileId :: Prelude.Text,
    -- | The studio ID.
    CreateStreamingSession -> Text
studioId :: Prelude.Text
  }
  deriving (CreateStreamingSession -> CreateStreamingSession -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateStreamingSession -> CreateStreamingSession -> Bool
$c/= :: CreateStreamingSession -> CreateStreamingSession -> Bool
== :: CreateStreamingSession -> CreateStreamingSession -> Bool
$c== :: CreateStreamingSession -> CreateStreamingSession -> Bool
Prelude.Eq, ReadPrec [CreateStreamingSession]
ReadPrec CreateStreamingSession
Int -> ReadS CreateStreamingSession
ReadS [CreateStreamingSession]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateStreamingSession]
$creadListPrec :: ReadPrec [CreateStreamingSession]
readPrec :: ReadPrec CreateStreamingSession
$creadPrec :: ReadPrec CreateStreamingSession
readList :: ReadS [CreateStreamingSession]
$creadList :: ReadS [CreateStreamingSession]
readsPrec :: Int -> ReadS CreateStreamingSession
$creadsPrec :: Int -> ReadS CreateStreamingSession
Prelude.Read, Int -> CreateStreamingSession -> ShowS
[CreateStreamingSession] -> ShowS
CreateStreamingSession -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateStreamingSession] -> ShowS
$cshowList :: [CreateStreamingSession] -> ShowS
show :: CreateStreamingSession -> String
$cshow :: CreateStreamingSession -> String
showsPrec :: Int -> CreateStreamingSession -> ShowS
$cshowsPrec :: Int -> CreateStreamingSession -> ShowS
Prelude.Show, forall x. Rep CreateStreamingSession x -> CreateStreamingSession
forall x. CreateStreamingSession -> Rep CreateStreamingSession x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateStreamingSession x -> CreateStreamingSession
$cfrom :: forall x. CreateStreamingSession -> Rep CreateStreamingSession x
Prelude.Generic)

-- |
-- Create a value of 'CreateStreamingSession' 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', 'createStreamingSession_clientToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. If you don’t specify a client token, the
-- Amazon Web Services SDK automatically generates a client token and uses
-- it for the request to ensure idempotency.
--
-- 'ec2InstanceType', 'createStreamingSession_ec2InstanceType' - The EC2 Instance type used for the streaming session.
--
-- 'ownedBy', 'createStreamingSession_ownedBy' - The user ID of the user that owns the streaming session. The user that
-- owns the session will be logging into the session and interacting with
-- the virtual workstation.
--
-- 'streamingImageId', 'createStreamingSession_streamingImageId' - The ID of the streaming image.
--
-- 'tags', 'createStreamingSession_tags' - A collection of labels, in the form of key-value pairs, that apply to
-- this resource.
--
-- 'launchProfileId', 'createStreamingSession_launchProfileId' - The ID of the launch profile used to control access from the streaming
-- session.
--
-- 'studioId', 'createStreamingSession_studioId' - The studio ID.
newCreateStreamingSession ::
  -- | 'launchProfileId'
  Prelude.Text ->
  -- | 'studioId'
  Prelude.Text ->
  CreateStreamingSession
newCreateStreamingSession :: Text -> Text -> CreateStreamingSession
newCreateStreamingSession
  Text
pLaunchProfileId_
  Text
pStudioId_ =
    CreateStreamingSession'
      { $sel:clientToken:CreateStreamingSession' :: Maybe Text
clientToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:ec2InstanceType:CreateStreamingSession' :: Maybe StreamingInstanceType
ec2InstanceType = forall a. Maybe a
Prelude.Nothing,
        $sel:ownedBy:CreateStreamingSession' :: Maybe Text
ownedBy = forall a. Maybe a
Prelude.Nothing,
        $sel:streamingImageId:CreateStreamingSession' :: Maybe Text
streamingImageId = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateStreamingSession' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:launchProfileId:CreateStreamingSession' :: Text
launchProfileId = Text
pLaunchProfileId_,
        $sel:studioId:CreateStreamingSession' :: Text
studioId = Text
pStudioId_
      }

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. If you don’t specify a client token, the
-- Amazon Web Services SDK automatically generates a client token and uses
-- it for the request to ensure idempotency.
createStreamingSession_clientToken :: Lens.Lens' CreateStreamingSession (Prelude.Maybe Prelude.Text)
createStreamingSession_clientToken :: Lens' CreateStreamingSession (Maybe Text)
createStreamingSession_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamingSession' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateStreamingSession
s@CreateStreamingSession' {} Maybe Text
a -> CreateStreamingSession
s {$sel:clientToken:CreateStreamingSession' :: Maybe Text
clientToken = Maybe Text
a} :: CreateStreamingSession)

-- | The EC2 Instance type used for the streaming session.
createStreamingSession_ec2InstanceType :: Lens.Lens' CreateStreamingSession (Prelude.Maybe StreamingInstanceType)
createStreamingSession_ec2InstanceType :: Lens' CreateStreamingSession (Maybe StreamingInstanceType)
createStreamingSession_ec2InstanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamingSession' {Maybe StreamingInstanceType
ec2InstanceType :: Maybe StreamingInstanceType
$sel:ec2InstanceType:CreateStreamingSession' :: CreateStreamingSession -> Maybe StreamingInstanceType
ec2InstanceType} -> Maybe StreamingInstanceType
ec2InstanceType) (\s :: CreateStreamingSession
s@CreateStreamingSession' {} Maybe StreamingInstanceType
a -> CreateStreamingSession
s {$sel:ec2InstanceType:CreateStreamingSession' :: Maybe StreamingInstanceType
ec2InstanceType = Maybe StreamingInstanceType
a} :: CreateStreamingSession)

-- | The user ID of the user that owns the streaming session. The user that
-- owns the session will be logging into the session and interacting with
-- the virtual workstation.
createStreamingSession_ownedBy :: Lens.Lens' CreateStreamingSession (Prelude.Maybe Prelude.Text)
createStreamingSession_ownedBy :: Lens' CreateStreamingSession (Maybe Text)
createStreamingSession_ownedBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamingSession' {Maybe Text
ownedBy :: Maybe Text
$sel:ownedBy:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
ownedBy} -> Maybe Text
ownedBy) (\s :: CreateStreamingSession
s@CreateStreamingSession' {} Maybe Text
a -> CreateStreamingSession
s {$sel:ownedBy:CreateStreamingSession' :: Maybe Text
ownedBy = Maybe Text
a} :: CreateStreamingSession)

-- | The ID of the streaming image.
createStreamingSession_streamingImageId :: Lens.Lens' CreateStreamingSession (Prelude.Maybe Prelude.Text)
createStreamingSession_streamingImageId :: Lens' CreateStreamingSession (Maybe Text)
createStreamingSession_streamingImageId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamingSession' {Maybe Text
streamingImageId :: Maybe Text
$sel:streamingImageId:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
streamingImageId} -> Maybe Text
streamingImageId) (\s :: CreateStreamingSession
s@CreateStreamingSession' {} Maybe Text
a -> CreateStreamingSession
s {$sel:streamingImageId:CreateStreamingSession' :: Maybe Text
streamingImageId = Maybe Text
a} :: CreateStreamingSession)

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

-- | The ID of the launch profile used to control access from the streaming
-- session.
createStreamingSession_launchProfileId :: Lens.Lens' CreateStreamingSession Prelude.Text
createStreamingSession_launchProfileId :: Lens' CreateStreamingSession Text
createStreamingSession_launchProfileId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamingSession' {Text
launchProfileId :: Text
$sel:launchProfileId:CreateStreamingSession' :: CreateStreamingSession -> Text
launchProfileId} -> Text
launchProfileId) (\s :: CreateStreamingSession
s@CreateStreamingSession' {} Text
a -> CreateStreamingSession
s {$sel:launchProfileId:CreateStreamingSession' :: Text
launchProfileId = Text
a} :: CreateStreamingSession)

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

instance Core.AWSRequest CreateStreamingSession where
  type
    AWSResponse CreateStreamingSession =
      CreateStreamingSessionResponse
  request :: (Service -> Service)
-> CreateStreamingSession -> Request CreateStreamingSession
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateStreamingSession
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateStreamingSession)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe StreamingSession -> Int -> CreateStreamingSessionResponse
CreateStreamingSessionResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"session")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateStreamingSession where
  hashWithSalt :: Int -> CreateStreamingSession -> Int
hashWithSalt Int
_salt CreateStreamingSession' {Maybe Text
Maybe (HashMap Text Text)
Maybe StreamingInstanceType
Text
studioId :: Text
launchProfileId :: Text
tags :: Maybe (HashMap Text Text)
streamingImageId :: Maybe Text
ownedBy :: Maybe Text
ec2InstanceType :: Maybe StreamingInstanceType
clientToken :: Maybe Text
$sel:studioId:CreateStreamingSession' :: CreateStreamingSession -> Text
$sel:launchProfileId:CreateStreamingSession' :: CreateStreamingSession -> Text
$sel:tags:CreateStreamingSession' :: CreateStreamingSession -> Maybe (HashMap Text Text)
$sel:streamingImageId:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
$sel:ownedBy:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
$sel:ec2InstanceType:CreateStreamingSession' :: CreateStreamingSession -> Maybe StreamingInstanceType
$sel:clientToken:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StreamingInstanceType
ec2InstanceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ownedBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
streamingImageId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
launchProfileId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
studioId

instance Prelude.NFData CreateStreamingSession where
  rnf :: CreateStreamingSession -> ()
rnf CreateStreamingSession' {Maybe Text
Maybe (HashMap Text Text)
Maybe StreamingInstanceType
Text
studioId :: Text
launchProfileId :: Text
tags :: Maybe (HashMap Text Text)
streamingImageId :: Maybe Text
ownedBy :: Maybe Text
ec2InstanceType :: Maybe StreamingInstanceType
clientToken :: Maybe Text
$sel:studioId:CreateStreamingSession' :: CreateStreamingSession -> Text
$sel:launchProfileId:CreateStreamingSession' :: CreateStreamingSession -> Text
$sel:tags:CreateStreamingSession' :: CreateStreamingSession -> Maybe (HashMap Text Text)
$sel:streamingImageId:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
$sel:ownedBy:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
$sel:ec2InstanceType:CreateStreamingSession' :: CreateStreamingSession -> Maybe StreamingInstanceType
$sel:clientToken:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StreamingInstanceType
ec2InstanceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ownedBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
streamingImageId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
launchProfileId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
studioId

instance Data.ToHeaders CreateStreamingSession where
  toHeaders :: CreateStreamingSession -> ResponseHeaders
toHeaders CreateStreamingSession' {Maybe Text
Maybe (HashMap Text Text)
Maybe StreamingInstanceType
Text
studioId :: Text
launchProfileId :: Text
tags :: Maybe (HashMap Text Text)
streamingImageId :: Maybe Text
ownedBy :: Maybe Text
ec2InstanceType :: Maybe StreamingInstanceType
clientToken :: Maybe Text
$sel:studioId:CreateStreamingSession' :: CreateStreamingSession -> Text
$sel:launchProfileId:CreateStreamingSession' :: CreateStreamingSession -> Text
$sel:tags:CreateStreamingSession' :: CreateStreamingSession -> Maybe (HashMap Text Text)
$sel:streamingImageId:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
$sel:ownedBy:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
$sel:ec2InstanceType:CreateStreamingSession' :: CreateStreamingSession -> Maybe StreamingInstanceType
$sel:clientToken:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"X-Amz-Client-Token" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
clientToken,
        HeaderName
"Content-Type"
          forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"application/x-amz-json-1.1" :: Prelude.ByteString)
      ]

instance Data.ToJSON CreateStreamingSession where
  toJSON :: CreateStreamingSession -> Value
toJSON CreateStreamingSession' {Maybe Text
Maybe (HashMap Text Text)
Maybe StreamingInstanceType
Text
studioId :: Text
launchProfileId :: Text
tags :: Maybe (HashMap Text Text)
streamingImageId :: Maybe Text
ownedBy :: Maybe Text
ec2InstanceType :: Maybe StreamingInstanceType
clientToken :: Maybe Text
$sel:studioId:CreateStreamingSession' :: CreateStreamingSession -> Text
$sel:launchProfileId:CreateStreamingSession' :: CreateStreamingSession -> Text
$sel:tags:CreateStreamingSession' :: CreateStreamingSession -> Maybe (HashMap Text Text)
$sel:streamingImageId:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
$sel:ownedBy:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
$sel:ec2InstanceType:CreateStreamingSession' :: CreateStreamingSession -> Maybe StreamingInstanceType
$sel:clientToken:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ec2InstanceType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StreamingInstanceType
ec2InstanceType,
            (Key
"ownedBy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
ownedBy,
            (Key
"streamingImageId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
streamingImageId,
            (Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"launchProfileId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
launchProfileId)
          ]
      )

instance Data.ToPath CreateStreamingSession where
  toPath :: CreateStreamingSession -> ByteString
toPath CreateStreamingSession' {Maybe Text
Maybe (HashMap Text Text)
Maybe StreamingInstanceType
Text
studioId :: Text
launchProfileId :: Text
tags :: Maybe (HashMap Text Text)
streamingImageId :: Maybe Text
ownedBy :: Maybe Text
ec2InstanceType :: Maybe StreamingInstanceType
clientToken :: Maybe Text
$sel:studioId:CreateStreamingSession' :: CreateStreamingSession -> Text
$sel:launchProfileId:CreateStreamingSession' :: CreateStreamingSession -> Text
$sel:tags:CreateStreamingSession' :: CreateStreamingSession -> Maybe (HashMap Text Text)
$sel:streamingImageId:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
$sel:ownedBy:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
$sel:ec2InstanceType:CreateStreamingSession' :: CreateStreamingSession -> Maybe StreamingInstanceType
$sel:clientToken:CreateStreamingSession' :: CreateStreamingSession -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2020-08-01/studios/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
studioId,
        ByteString
"/streaming-sessions"
      ]

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

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

-- |
-- Create a value of 'CreateStreamingSessionResponse' 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:
--
-- 'session', 'createStreamingSessionResponse_session' - The session.
--
-- 'httpStatus', 'createStreamingSessionResponse_httpStatus' - The response's http status code.
newCreateStreamingSessionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateStreamingSessionResponse
newCreateStreamingSessionResponse :: Int -> CreateStreamingSessionResponse
newCreateStreamingSessionResponse Int
pHttpStatus_ =
  CreateStreamingSessionResponse'
    { $sel:session:CreateStreamingSessionResponse' :: Maybe StreamingSession
session =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateStreamingSessionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The session.
createStreamingSessionResponse_session :: Lens.Lens' CreateStreamingSessionResponse (Prelude.Maybe StreamingSession)
createStreamingSessionResponse_session :: Lens' CreateStreamingSessionResponse (Maybe StreamingSession)
createStreamingSessionResponse_session = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamingSessionResponse' {Maybe StreamingSession
session :: Maybe StreamingSession
$sel:session:CreateStreamingSessionResponse' :: CreateStreamingSessionResponse -> Maybe StreamingSession
session} -> Maybe StreamingSession
session) (\s :: CreateStreamingSessionResponse
s@CreateStreamingSessionResponse' {} Maybe StreamingSession
a -> CreateStreamingSessionResponse
s {$sel:session:CreateStreamingSessionResponse' :: Maybe StreamingSession
session = Maybe StreamingSession
a} :: CreateStreamingSessionResponse)

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

instance
  Prelude.NFData
    CreateStreamingSessionResponse
  where
  rnf :: CreateStreamingSessionResponse -> ()
rnf CreateStreamingSessionResponse' {Int
Maybe StreamingSession
httpStatus :: Int
session :: Maybe StreamingSession
$sel:httpStatus:CreateStreamingSessionResponse' :: CreateStreamingSessionResponse -> Int
$sel:session:CreateStreamingSessionResponse' :: CreateStreamingSessionResponse -> Maybe StreamingSession
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe StreamingSession
session
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus