{-# 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.AppStream.CreateStreamingURL
-- 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)
--
-- Creates a temporary URL to start an AppStream 2.0 streaming session for
-- the specified user. A streaming URL enables application streaming to be
-- tested without user setup.
module Amazonka.AppStream.CreateStreamingURL
  ( -- * Creating a Request
    CreateStreamingURL (..),
    newCreateStreamingURL,

    -- * Request Lenses
    createStreamingURL_sessionContext,
    createStreamingURL_applicationId,
    createStreamingURL_validity,
    createStreamingURL_stackName,
    createStreamingURL_fleetName,
    createStreamingURL_userId,

    -- * Destructuring the Response
    CreateStreamingURLResponse (..),
    newCreateStreamingURLResponse,

    -- * Response Lenses
    createStreamingURLResponse_streamingURL,
    createStreamingURLResponse_expires,
    createStreamingURLResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateStreamingURL' smart constructor.
data CreateStreamingURL = CreateStreamingURL'
  { -- | The session context. For more information, see
    -- <https://docs.aws.amazon.com/appstream2/latest/developerguide/managing-stacks-fleets.html#managing-stacks-fleets-parameters Session Context>
    -- in the /Amazon AppStream 2.0 Administration Guide/.
    CreateStreamingURL -> Maybe Text
sessionContext :: Prelude.Maybe Prelude.Text,
    -- | The name of the application to launch after the session starts. This is
    -- the name that you specified as __Name__ in the Image Assistant. If your
    -- fleet is enabled for the __Desktop__ stream view, you can also choose to
    -- launch directly to the operating system desktop. To do so, specify
    -- __Desktop__.
    CreateStreamingURL -> Maybe Text
applicationId :: Prelude.Maybe Prelude.Text,
    -- | The time that the streaming URL will be valid, in seconds. Specify a
    -- value between 1 and 604800 seconds. The default is 60 seconds.
    CreateStreamingURL -> Maybe Integer
validity :: Prelude.Maybe Prelude.Integer,
    -- | The name of the stack.
    CreateStreamingURL -> Text
stackName :: Prelude.Text,
    -- | The name of the fleet.
    CreateStreamingURL -> Text
fleetName :: Prelude.Text,
    -- | The identifier of the user.
    CreateStreamingURL -> Text
userId :: Prelude.Text
  }
  deriving (CreateStreamingURL -> CreateStreamingURL -> Bool
(CreateStreamingURL -> CreateStreamingURL -> Bool)
-> (CreateStreamingURL -> CreateStreamingURL -> Bool)
-> Eq CreateStreamingURL
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateStreamingURL -> CreateStreamingURL -> Bool
$c/= :: CreateStreamingURL -> CreateStreamingURL -> Bool
== :: CreateStreamingURL -> CreateStreamingURL -> Bool
$c== :: CreateStreamingURL -> CreateStreamingURL -> Bool
Prelude.Eq, ReadPrec [CreateStreamingURL]
ReadPrec CreateStreamingURL
Int -> ReadS CreateStreamingURL
ReadS [CreateStreamingURL]
(Int -> ReadS CreateStreamingURL)
-> ReadS [CreateStreamingURL]
-> ReadPrec CreateStreamingURL
-> ReadPrec [CreateStreamingURL]
-> Read CreateStreamingURL
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateStreamingURL]
$creadListPrec :: ReadPrec [CreateStreamingURL]
readPrec :: ReadPrec CreateStreamingURL
$creadPrec :: ReadPrec CreateStreamingURL
readList :: ReadS [CreateStreamingURL]
$creadList :: ReadS [CreateStreamingURL]
readsPrec :: Int -> ReadS CreateStreamingURL
$creadsPrec :: Int -> ReadS CreateStreamingURL
Prelude.Read, Int -> CreateStreamingURL -> ShowS
[CreateStreamingURL] -> ShowS
CreateStreamingURL -> String
(Int -> CreateStreamingURL -> ShowS)
-> (CreateStreamingURL -> String)
-> ([CreateStreamingURL] -> ShowS)
-> Show CreateStreamingURL
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateStreamingURL] -> ShowS
$cshowList :: [CreateStreamingURL] -> ShowS
show :: CreateStreamingURL -> String
$cshow :: CreateStreamingURL -> String
showsPrec :: Int -> CreateStreamingURL -> ShowS
$cshowsPrec :: Int -> CreateStreamingURL -> ShowS
Prelude.Show, (forall x. CreateStreamingURL -> Rep CreateStreamingURL x)
-> (forall x. Rep CreateStreamingURL x -> CreateStreamingURL)
-> Generic CreateStreamingURL
forall x. Rep CreateStreamingURL x -> CreateStreamingURL
forall x. CreateStreamingURL -> Rep CreateStreamingURL x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateStreamingURL x -> CreateStreamingURL
$cfrom :: forall x. CreateStreamingURL -> Rep CreateStreamingURL x
Prelude.Generic)

-- |
-- Create a value of 'CreateStreamingURL' 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:
--
-- 'sessionContext', 'createStreamingURL_sessionContext' - The session context. For more information, see
-- <https://docs.aws.amazon.com/appstream2/latest/developerguide/managing-stacks-fleets.html#managing-stacks-fleets-parameters Session Context>
-- in the /Amazon AppStream 2.0 Administration Guide/.
--
-- 'applicationId', 'createStreamingURL_applicationId' - The name of the application to launch after the session starts. This is
-- the name that you specified as __Name__ in the Image Assistant. If your
-- fleet is enabled for the __Desktop__ stream view, you can also choose to
-- launch directly to the operating system desktop. To do so, specify
-- __Desktop__.
--
-- 'validity', 'createStreamingURL_validity' - The time that the streaming URL will be valid, in seconds. Specify a
-- value between 1 and 604800 seconds. The default is 60 seconds.
--
-- 'stackName', 'createStreamingURL_stackName' - The name of the stack.
--
-- 'fleetName', 'createStreamingURL_fleetName' - The name of the fleet.
--
-- 'userId', 'createStreamingURL_userId' - The identifier of the user.
newCreateStreamingURL ::
  -- | 'stackName'
  Prelude.Text ->
  -- | 'fleetName'
  Prelude.Text ->
  -- | 'userId'
  Prelude.Text ->
  CreateStreamingURL
newCreateStreamingURL :: Text -> Text -> Text -> CreateStreamingURL
newCreateStreamingURL
  Text
pStackName_
  Text
pFleetName_
  Text
pUserId_ =
    CreateStreamingURL' :: Maybe Text
-> Maybe Text
-> Maybe Integer
-> Text
-> Text
-> Text
-> CreateStreamingURL
CreateStreamingURL'
      { $sel:sessionContext:CreateStreamingURL' :: Maybe Text
sessionContext =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:applicationId:CreateStreamingURL' :: Maybe Text
applicationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:validity:CreateStreamingURL' :: Maybe Integer
validity = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
        $sel:stackName:CreateStreamingURL' :: Text
stackName = Text
pStackName_,
        $sel:fleetName:CreateStreamingURL' :: Text
fleetName = Text
pFleetName_,
        $sel:userId:CreateStreamingURL' :: Text
userId = Text
pUserId_
      }

-- | The session context. For more information, see
-- <https://docs.aws.amazon.com/appstream2/latest/developerguide/managing-stacks-fleets.html#managing-stacks-fleets-parameters Session Context>
-- in the /Amazon AppStream 2.0 Administration Guide/.
createStreamingURL_sessionContext :: Lens.Lens' CreateStreamingURL (Prelude.Maybe Prelude.Text)
createStreamingURL_sessionContext :: (Maybe Text -> f (Maybe Text))
-> CreateStreamingURL -> f CreateStreamingURL
createStreamingURL_sessionContext = (CreateStreamingURL -> Maybe Text)
-> (CreateStreamingURL -> Maybe Text -> CreateStreamingURL)
-> Lens
     CreateStreamingURL CreateStreamingURL (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamingURL' {Maybe Text
sessionContext :: Maybe Text
$sel:sessionContext:CreateStreamingURL' :: CreateStreamingURL -> Maybe Text
sessionContext} -> Maybe Text
sessionContext) (\s :: CreateStreamingURL
s@CreateStreamingURL' {} Maybe Text
a -> CreateStreamingURL
s {$sel:sessionContext:CreateStreamingURL' :: Maybe Text
sessionContext = Maybe Text
a} :: CreateStreamingURL)

-- | The name of the application to launch after the session starts. This is
-- the name that you specified as __Name__ in the Image Assistant. If your
-- fleet is enabled for the __Desktop__ stream view, you can also choose to
-- launch directly to the operating system desktop. To do so, specify
-- __Desktop__.
createStreamingURL_applicationId :: Lens.Lens' CreateStreamingURL (Prelude.Maybe Prelude.Text)
createStreamingURL_applicationId :: (Maybe Text -> f (Maybe Text))
-> CreateStreamingURL -> f CreateStreamingURL
createStreamingURL_applicationId = (CreateStreamingURL -> Maybe Text)
-> (CreateStreamingURL -> Maybe Text -> CreateStreamingURL)
-> Lens
     CreateStreamingURL CreateStreamingURL (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamingURL' {Maybe Text
applicationId :: Maybe Text
$sel:applicationId:CreateStreamingURL' :: CreateStreamingURL -> Maybe Text
applicationId} -> Maybe Text
applicationId) (\s :: CreateStreamingURL
s@CreateStreamingURL' {} Maybe Text
a -> CreateStreamingURL
s {$sel:applicationId:CreateStreamingURL' :: Maybe Text
applicationId = Maybe Text
a} :: CreateStreamingURL)

-- | The time that the streaming URL will be valid, in seconds. Specify a
-- value between 1 and 604800 seconds. The default is 60 seconds.
createStreamingURL_validity :: Lens.Lens' CreateStreamingURL (Prelude.Maybe Prelude.Integer)
createStreamingURL_validity :: (Maybe Integer -> f (Maybe Integer))
-> CreateStreamingURL -> f CreateStreamingURL
createStreamingURL_validity = (CreateStreamingURL -> Maybe Integer)
-> (CreateStreamingURL -> Maybe Integer -> CreateStreamingURL)
-> Lens
     CreateStreamingURL
     CreateStreamingURL
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamingURL' {Maybe Integer
validity :: Maybe Integer
$sel:validity:CreateStreamingURL' :: CreateStreamingURL -> Maybe Integer
validity} -> Maybe Integer
validity) (\s :: CreateStreamingURL
s@CreateStreamingURL' {} Maybe Integer
a -> CreateStreamingURL
s {$sel:validity:CreateStreamingURL' :: Maybe Integer
validity = Maybe Integer
a} :: CreateStreamingURL)

-- | The name of the stack.
createStreamingURL_stackName :: Lens.Lens' CreateStreamingURL Prelude.Text
createStreamingURL_stackName :: (Text -> f Text) -> CreateStreamingURL -> f CreateStreamingURL
createStreamingURL_stackName = (CreateStreamingURL -> Text)
-> (CreateStreamingURL -> Text -> CreateStreamingURL)
-> Lens CreateStreamingURL CreateStreamingURL Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamingURL' {Text
stackName :: Text
$sel:stackName:CreateStreamingURL' :: CreateStreamingURL -> Text
stackName} -> Text
stackName) (\s :: CreateStreamingURL
s@CreateStreamingURL' {} Text
a -> CreateStreamingURL
s {$sel:stackName:CreateStreamingURL' :: Text
stackName = Text
a} :: CreateStreamingURL)

-- | The name of the fleet.
createStreamingURL_fleetName :: Lens.Lens' CreateStreamingURL Prelude.Text
createStreamingURL_fleetName :: (Text -> f Text) -> CreateStreamingURL -> f CreateStreamingURL
createStreamingURL_fleetName = (CreateStreamingURL -> Text)
-> (CreateStreamingURL -> Text -> CreateStreamingURL)
-> Lens CreateStreamingURL CreateStreamingURL Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamingURL' {Text
fleetName :: Text
$sel:fleetName:CreateStreamingURL' :: CreateStreamingURL -> Text
fleetName} -> Text
fleetName) (\s :: CreateStreamingURL
s@CreateStreamingURL' {} Text
a -> CreateStreamingURL
s {$sel:fleetName:CreateStreamingURL' :: Text
fleetName = Text
a} :: CreateStreamingURL)

-- | The identifier of the user.
createStreamingURL_userId :: Lens.Lens' CreateStreamingURL Prelude.Text
createStreamingURL_userId :: (Text -> f Text) -> CreateStreamingURL -> f CreateStreamingURL
createStreamingURL_userId = (CreateStreamingURL -> Text)
-> (CreateStreamingURL -> Text -> CreateStreamingURL)
-> Lens CreateStreamingURL CreateStreamingURL Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamingURL' {Text
userId :: Text
$sel:userId:CreateStreamingURL' :: CreateStreamingURL -> Text
userId} -> Text
userId) (\s :: CreateStreamingURL
s@CreateStreamingURL' {} Text
a -> CreateStreamingURL
s {$sel:userId:CreateStreamingURL' :: Text
userId = Text
a} :: CreateStreamingURL)

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

instance Prelude.NFData CreateStreamingURL

instance Core.ToHeaders CreateStreamingURL where
  toHeaders :: CreateStreamingURL -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateStreamingURL -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"PhotonAdminProxyService.CreateStreamingURL" ::
                          Prelude.ByteString
                      ),
            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 CreateStreamingURL where
  toJSON :: CreateStreamingURL -> Value
toJSON CreateStreamingURL' {Maybe Integer
Maybe Text
Text
userId :: Text
fleetName :: Text
stackName :: Text
validity :: Maybe Integer
applicationId :: Maybe Text
sessionContext :: Maybe Text
$sel:userId:CreateStreamingURL' :: CreateStreamingURL -> Text
$sel:fleetName:CreateStreamingURL' :: CreateStreamingURL -> Text
$sel:stackName:CreateStreamingURL' :: CreateStreamingURL -> Text
$sel:validity:CreateStreamingURL' :: CreateStreamingURL -> Maybe Integer
$sel:applicationId:CreateStreamingURL' :: CreateStreamingURL -> Maybe Text
$sel:sessionContext:CreateStreamingURL' :: CreateStreamingURL -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SessionContext" 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
sessionContext,
            (Text
"ApplicationId" 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
applicationId,
            (Text
"Validity" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
validity,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StackName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
stackName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FleetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fleetName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userId)
          ]
      )

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

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

-- | /See:/ 'newCreateStreamingURLResponse' smart constructor.
data CreateStreamingURLResponse = CreateStreamingURLResponse'
  { -- | The URL to start the AppStream 2.0 streaming session.
    CreateStreamingURLResponse -> Maybe Text
streamingURL :: Prelude.Maybe Prelude.Text,
    -- | The elapsed time, in seconds after the Unix epoch, when this URL
    -- expires.
    CreateStreamingURLResponse -> Maybe POSIX
expires :: Prelude.Maybe Core.POSIX,
    -- | The response's http status code.
    CreateStreamingURLResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateStreamingURLResponse -> CreateStreamingURLResponse -> Bool
(CreateStreamingURLResponse -> CreateStreamingURLResponse -> Bool)
-> (CreateStreamingURLResponse
    -> CreateStreamingURLResponse -> Bool)
-> Eq CreateStreamingURLResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateStreamingURLResponse -> CreateStreamingURLResponse -> Bool
$c/= :: CreateStreamingURLResponse -> CreateStreamingURLResponse -> Bool
== :: CreateStreamingURLResponse -> CreateStreamingURLResponse -> Bool
$c== :: CreateStreamingURLResponse -> CreateStreamingURLResponse -> Bool
Prelude.Eq, ReadPrec [CreateStreamingURLResponse]
ReadPrec CreateStreamingURLResponse
Int -> ReadS CreateStreamingURLResponse
ReadS [CreateStreamingURLResponse]
(Int -> ReadS CreateStreamingURLResponse)
-> ReadS [CreateStreamingURLResponse]
-> ReadPrec CreateStreamingURLResponse
-> ReadPrec [CreateStreamingURLResponse]
-> Read CreateStreamingURLResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateStreamingURLResponse]
$creadListPrec :: ReadPrec [CreateStreamingURLResponse]
readPrec :: ReadPrec CreateStreamingURLResponse
$creadPrec :: ReadPrec CreateStreamingURLResponse
readList :: ReadS [CreateStreamingURLResponse]
$creadList :: ReadS [CreateStreamingURLResponse]
readsPrec :: Int -> ReadS CreateStreamingURLResponse
$creadsPrec :: Int -> ReadS CreateStreamingURLResponse
Prelude.Read, Int -> CreateStreamingURLResponse -> ShowS
[CreateStreamingURLResponse] -> ShowS
CreateStreamingURLResponse -> String
(Int -> CreateStreamingURLResponse -> ShowS)
-> (CreateStreamingURLResponse -> String)
-> ([CreateStreamingURLResponse] -> ShowS)
-> Show CreateStreamingURLResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateStreamingURLResponse] -> ShowS
$cshowList :: [CreateStreamingURLResponse] -> ShowS
show :: CreateStreamingURLResponse -> String
$cshow :: CreateStreamingURLResponse -> String
showsPrec :: Int -> CreateStreamingURLResponse -> ShowS
$cshowsPrec :: Int -> CreateStreamingURLResponse -> ShowS
Prelude.Show, (forall x.
 CreateStreamingURLResponse -> Rep CreateStreamingURLResponse x)
-> (forall x.
    Rep CreateStreamingURLResponse x -> CreateStreamingURLResponse)
-> Generic CreateStreamingURLResponse
forall x.
Rep CreateStreamingURLResponse x -> CreateStreamingURLResponse
forall x.
CreateStreamingURLResponse -> Rep CreateStreamingURLResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateStreamingURLResponse x -> CreateStreamingURLResponse
$cfrom :: forall x.
CreateStreamingURLResponse -> Rep CreateStreamingURLResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateStreamingURLResponse' 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:
--
-- 'streamingURL', 'createStreamingURLResponse_streamingURL' - The URL to start the AppStream 2.0 streaming session.
--
-- 'expires', 'createStreamingURLResponse_expires' - The elapsed time, in seconds after the Unix epoch, when this URL
-- expires.
--
-- 'httpStatus', 'createStreamingURLResponse_httpStatus' - The response's http status code.
newCreateStreamingURLResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateStreamingURLResponse
newCreateStreamingURLResponse :: Int -> CreateStreamingURLResponse
newCreateStreamingURLResponse Int
pHttpStatus_ =
  CreateStreamingURLResponse' :: Maybe Text -> Maybe POSIX -> Int -> CreateStreamingURLResponse
CreateStreamingURLResponse'
    { $sel:streamingURL:CreateStreamingURLResponse' :: Maybe Text
streamingURL =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:expires:CreateStreamingURLResponse' :: Maybe POSIX
expires = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateStreamingURLResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The URL to start the AppStream 2.0 streaming session.
createStreamingURLResponse_streamingURL :: Lens.Lens' CreateStreamingURLResponse (Prelude.Maybe Prelude.Text)
createStreamingURLResponse_streamingURL :: (Maybe Text -> f (Maybe Text))
-> CreateStreamingURLResponse -> f CreateStreamingURLResponse
createStreamingURLResponse_streamingURL = (CreateStreamingURLResponse -> Maybe Text)
-> (CreateStreamingURLResponse
    -> Maybe Text -> CreateStreamingURLResponse)
-> Lens
     CreateStreamingURLResponse
     CreateStreamingURLResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamingURLResponse' {Maybe Text
streamingURL :: Maybe Text
$sel:streamingURL:CreateStreamingURLResponse' :: CreateStreamingURLResponse -> Maybe Text
streamingURL} -> Maybe Text
streamingURL) (\s :: CreateStreamingURLResponse
s@CreateStreamingURLResponse' {} Maybe Text
a -> CreateStreamingURLResponse
s {$sel:streamingURL:CreateStreamingURLResponse' :: Maybe Text
streamingURL = Maybe Text
a} :: CreateStreamingURLResponse)

-- | The elapsed time, in seconds after the Unix epoch, when this URL
-- expires.
createStreamingURLResponse_expires :: Lens.Lens' CreateStreamingURLResponse (Prelude.Maybe Prelude.UTCTime)
createStreamingURLResponse_expires :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateStreamingURLResponse -> f CreateStreamingURLResponse
createStreamingURLResponse_expires = (CreateStreamingURLResponse -> Maybe POSIX)
-> (CreateStreamingURLResponse
    -> Maybe POSIX -> CreateStreamingURLResponse)
-> Lens
     CreateStreamingURLResponse
     CreateStreamingURLResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStreamingURLResponse' {Maybe POSIX
expires :: Maybe POSIX
$sel:expires:CreateStreamingURLResponse' :: CreateStreamingURLResponse -> Maybe POSIX
expires} -> Maybe POSIX
expires) (\s :: CreateStreamingURLResponse
s@CreateStreamingURLResponse' {} Maybe POSIX
a -> CreateStreamingURLResponse
s {$sel:expires:CreateStreamingURLResponse' :: Maybe POSIX
expires = Maybe POSIX
a} :: CreateStreamingURLResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> CreateStreamingURLResponse -> f CreateStreamingURLResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateStreamingURLResponse
-> f CreateStreamingURLResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

instance Prelude.NFData CreateStreamingURLResponse