{-# 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.QuickSight.GetSessionEmbedUrl
-- 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)
--
-- Generates a session URL and authorization code that you can use to embed
-- the Amazon Amazon QuickSight console in your web server code. Use
-- @GetSessionEmbedUrl@ where you want to provide an authoring portal that
-- allows users to create data sources, datasets, analyses, and dashboards.
-- The users who access an embedded Amazon QuickSight console need belong
-- to the author or admin security cohort. If you want to restrict
-- permissions to some of these features, add a custom permissions profile
-- to the user with the @ UpdateUser @ API operation. Use @ RegisterUser @
-- API operation to add a new user with a custom permission profile
-- attached. For more information, see the following sections in the
-- /Amazon QuickSight User Guide/:
--
-- -   <https://docs.aws.amazon.com/quicksight/latest/user/embedded-analytics.html Embedding Analytics>
--
-- -   <https://docs.aws.amazon.com/quicksight/latest/user/customizing-permissions-to-the-quicksight-console.html Customizing Access to the Amazon QuickSight Console>
module Amazonka.QuickSight.GetSessionEmbedUrl
  ( -- * Creating a Request
    GetSessionEmbedUrl (..),
    newGetSessionEmbedUrl,

    -- * Request Lenses
    getSessionEmbedUrl_sessionLifetimeInMinutes,
    getSessionEmbedUrl_entryPoint,
    getSessionEmbedUrl_userArn,
    getSessionEmbedUrl_awsAccountId,

    -- * Destructuring the Response
    GetSessionEmbedUrlResponse (..),
    newGetSessionEmbedUrlResponse,

    -- * Response Lenses
    getSessionEmbedUrlResponse_requestId,
    getSessionEmbedUrlResponse_embedUrl,
    getSessionEmbedUrlResponse_status,
  )
where

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

-- | /See:/ 'newGetSessionEmbedUrl' smart constructor.
data GetSessionEmbedUrl = GetSessionEmbedUrl'
  { -- | How many minutes the session is valid. The session lifetime must be
    -- 15-600 minutes.
    GetSessionEmbedUrl -> Maybe Natural
sessionLifetimeInMinutes :: Prelude.Maybe Prelude.Natural,
    -- | The URL you use to access the embedded session. The entry point URL is
    -- constrained to the following paths:
    --
    -- -   @\/start@
    --
    -- -   @\/start\/analyses@
    --
    -- -   @\/start\/dashboards@
    --
    -- -   @\/start\/favorites@
    --
    -- -   @\/dashboards\/DashboardId @ - where @DashboardId@ is the actual ID
    --     key from the Amazon QuickSight console URL of the dashboard
    --
    -- -   @\/analyses\/AnalysisId @ - where @AnalysisId@ is the actual ID key
    --     from the Amazon QuickSight console URL of the analysis
    GetSessionEmbedUrl -> Maybe Text
entryPoint :: Prelude.Maybe Prelude.Text,
    -- | The Amazon QuickSight user\'s Amazon Resource Name (ARN), for use with
    -- @QUICKSIGHT@ identity type. You can use this for any type of Amazon
    -- QuickSight users in your account (readers, authors, or admins). They
    -- need to be authenticated as one of the following:
    --
    -- 1.  Active Directory (AD) users or group members
    --
    -- 2.  Invited nonfederated users
    --
    -- 3.  Identity and Access Management (IAM) users and IAM role-based
    --     sessions authenticated through Federated Single Sign-On using SAML,
    --     OpenID Connect, or IAM federation
    --
    -- Omit this parameter for users in the third group, IAM users and IAM
    -- role-based sessions.
    GetSessionEmbedUrl -> Maybe Text
userArn :: Prelude.Maybe Prelude.Text,
    -- | The ID for the Amazon Web Services account associated with your Amazon
    -- QuickSight subscription.
    GetSessionEmbedUrl -> Text
awsAccountId :: Prelude.Text
  }
  deriving (GetSessionEmbedUrl -> GetSessionEmbedUrl -> Bool
(GetSessionEmbedUrl -> GetSessionEmbedUrl -> Bool)
-> (GetSessionEmbedUrl -> GetSessionEmbedUrl -> Bool)
-> Eq GetSessionEmbedUrl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSessionEmbedUrl -> GetSessionEmbedUrl -> Bool
$c/= :: GetSessionEmbedUrl -> GetSessionEmbedUrl -> Bool
== :: GetSessionEmbedUrl -> GetSessionEmbedUrl -> Bool
$c== :: GetSessionEmbedUrl -> GetSessionEmbedUrl -> Bool
Prelude.Eq, ReadPrec [GetSessionEmbedUrl]
ReadPrec GetSessionEmbedUrl
Int -> ReadS GetSessionEmbedUrl
ReadS [GetSessionEmbedUrl]
(Int -> ReadS GetSessionEmbedUrl)
-> ReadS [GetSessionEmbedUrl]
-> ReadPrec GetSessionEmbedUrl
-> ReadPrec [GetSessionEmbedUrl]
-> Read GetSessionEmbedUrl
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSessionEmbedUrl]
$creadListPrec :: ReadPrec [GetSessionEmbedUrl]
readPrec :: ReadPrec GetSessionEmbedUrl
$creadPrec :: ReadPrec GetSessionEmbedUrl
readList :: ReadS [GetSessionEmbedUrl]
$creadList :: ReadS [GetSessionEmbedUrl]
readsPrec :: Int -> ReadS GetSessionEmbedUrl
$creadsPrec :: Int -> ReadS GetSessionEmbedUrl
Prelude.Read, Int -> GetSessionEmbedUrl -> ShowS
[GetSessionEmbedUrl] -> ShowS
GetSessionEmbedUrl -> String
(Int -> GetSessionEmbedUrl -> ShowS)
-> (GetSessionEmbedUrl -> String)
-> ([GetSessionEmbedUrl] -> ShowS)
-> Show GetSessionEmbedUrl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSessionEmbedUrl] -> ShowS
$cshowList :: [GetSessionEmbedUrl] -> ShowS
show :: GetSessionEmbedUrl -> String
$cshow :: GetSessionEmbedUrl -> String
showsPrec :: Int -> GetSessionEmbedUrl -> ShowS
$cshowsPrec :: Int -> GetSessionEmbedUrl -> ShowS
Prelude.Show, (forall x. GetSessionEmbedUrl -> Rep GetSessionEmbedUrl x)
-> (forall x. Rep GetSessionEmbedUrl x -> GetSessionEmbedUrl)
-> Generic GetSessionEmbedUrl
forall x. Rep GetSessionEmbedUrl x -> GetSessionEmbedUrl
forall x. GetSessionEmbedUrl -> Rep GetSessionEmbedUrl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSessionEmbedUrl x -> GetSessionEmbedUrl
$cfrom :: forall x. GetSessionEmbedUrl -> Rep GetSessionEmbedUrl x
Prelude.Generic)

-- |
-- Create a value of 'GetSessionEmbedUrl' 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:
--
-- 'sessionLifetimeInMinutes', 'getSessionEmbedUrl_sessionLifetimeInMinutes' - How many minutes the session is valid. The session lifetime must be
-- 15-600 minutes.
--
-- 'entryPoint', 'getSessionEmbedUrl_entryPoint' - The URL you use to access the embedded session. The entry point URL is
-- constrained to the following paths:
--
-- -   @\/start@
--
-- -   @\/start\/analyses@
--
-- -   @\/start\/dashboards@
--
-- -   @\/start\/favorites@
--
-- -   @\/dashboards\/DashboardId @ - where @DashboardId@ is the actual ID
--     key from the Amazon QuickSight console URL of the dashboard
--
-- -   @\/analyses\/AnalysisId @ - where @AnalysisId@ is the actual ID key
--     from the Amazon QuickSight console URL of the analysis
--
-- 'userArn', 'getSessionEmbedUrl_userArn' - The Amazon QuickSight user\'s Amazon Resource Name (ARN), for use with
-- @QUICKSIGHT@ identity type. You can use this for any type of Amazon
-- QuickSight users in your account (readers, authors, or admins). They
-- need to be authenticated as one of the following:
--
-- 1.  Active Directory (AD) users or group members
--
-- 2.  Invited nonfederated users
--
-- 3.  Identity and Access Management (IAM) users and IAM role-based
--     sessions authenticated through Federated Single Sign-On using SAML,
--     OpenID Connect, or IAM federation
--
-- Omit this parameter for users in the third group, IAM users and IAM
-- role-based sessions.
--
-- 'awsAccountId', 'getSessionEmbedUrl_awsAccountId' - The ID for the Amazon Web Services account associated with your Amazon
-- QuickSight subscription.
newGetSessionEmbedUrl ::
  -- | 'awsAccountId'
  Prelude.Text ->
  GetSessionEmbedUrl
newGetSessionEmbedUrl :: Text -> GetSessionEmbedUrl
newGetSessionEmbedUrl Text
pAwsAccountId_ =
  GetSessionEmbedUrl' :: Maybe Natural
-> Maybe Text -> Maybe Text -> Text -> GetSessionEmbedUrl
GetSessionEmbedUrl'
    { $sel:sessionLifetimeInMinutes:GetSessionEmbedUrl' :: Maybe Natural
sessionLifetimeInMinutes =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:entryPoint:GetSessionEmbedUrl' :: Maybe Text
entryPoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userArn:GetSessionEmbedUrl' :: Maybe Text
userArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:awsAccountId:GetSessionEmbedUrl' :: Text
awsAccountId = Text
pAwsAccountId_
    }

-- | How many minutes the session is valid. The session lifetime must be
-- 15-600 minutes.
getSessionEmbedUrl_sessionLifetimeInMinutes :: Lens.Lens' GetSessionEmbedUrl (Prelude.Maybe Prelude.Natural)
getSessionEmbedUrl_sessionLifetimeInMinutes :: (Maybe Natural -> f (Maybe Natural))
-> GetSessionEmbedUrl -> f GetSessionEmbedUrl
getSessionEmbedUrl_sessionLifetimeInMinutes = (GetSessionEmbedUrl -> Maybe Natural)
-> (GetSessionEmbedUrl -> Maybe Natural -> GetSessionEmbedUrl)
-> Lens
     GetSessionEmbedUrl
     GetSessionEmbedUrl
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSessionEmbedUrl' {Maybe Natural
sessionLifetimeInMinutes :: Maybe Natural
$sel:sessionLifetimeInMinutes:GetSessionEmbedUrl' :: GetSessionEmbedUrl -> Maybe Natural
sessionLifetimeInMinutes} -> Maybe Natural
sessionLifetimeInMinutes) (\s :: GetSessionEmbedUrl
s@GetSessionEmbedUrl' {} Maybe Natural
a -> GetSessionEmbedUrl
s {$sel:sessionLifetimeInMinutes:GetSessionEmbedUrl' :: Maybe Natural
sessionLifetimeInMinutes = Maybe Natural
a} :: GetSessionEmbedUrl)

-- | The URL you use to access the embedded session. The entry point URL is
-- constrained to the following paths:
--
-- -   @\/start@
--
-- -   @\/start\/analyses@
--
-- -   @\/start\/dashboards@
--
-- -   @\/start\/favorites@
--
-- -   @\/dashboards\/DashboardId @ - where @DashboardId@ is the actual ID
--     key from the Amazon QuickSight console URL of the dashboard
--
-- -   @\/analyses\/AnalysisId @ - where @AnalysisId@ is the actual ID key
--     from the Amazon QuickSight console URL of the analysis
getSessionEmbedUrl_entryPoint :: Lens.Lens' GetSessionEmbedUrl (Prelude.Maybe Prelude.Text)
getSessionEmbedUrl_entryPoint :: (Maybe Text -> f (Maybe Text))
-> GetSessionEmbedUrl -> f GetSessionEmbedUrl
getSessionEmbedUrl_entryPoint = (GetSessionEmbedUrl -> Maybe Text)
-> (GetSessionEmbedUrl -> Maybe Text -> GetSessionEmbedUrl)
-> Lens
     GetSessionEmbedUrl GetSessionEmbedUrl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSessionEmbedUrl' {Maybe Text
entryPoint :: Maybe Text
$sel:entryPoint:GetSessionEmbedUrl' :: GetSessionEmbedUrl -> Maybe Text
entryPoint} -> Maybe Text
entryPoint) (\s :: GetSessionEmbedUrl
s@GetSessionEmbedUrl' {} Maybe Text
a -> GetSessionEmbedUrl
s {$sel:entryPoint:GetSessionEmbedUrl' :: Maybe Text
entryPoint = Maybe Text
a} :: GetSessionEmbedUrl)

-- | The Amazon QuickSight user\'s Amazon Resource Name (ARN), for use with
-- @QUICKSIGHT@ identity type. You can use this for any type of Amazon
-- QuickSight users in your account (readers, authors, or admins). They
-- need to be authenticated as one of the following:
--
-- 1.  Active Directory (AD) users or group members
--
-- 2.  Invited nonfederated users
--
-- 3.  Identity and Access Management (IAM) users and IAM role-based
--     sessions authenticated through Federated Single Sign-On using SAML,
--     OpenID Connect, or IAM federation
--
-- Omit this parameter for users in the third group, IAM users and IAM
-- role-based sessions.
getSessionEmbedUrl_userArn :: Lens.Lens' GetSessionEmbedUrl (Prelude.Maybe Prelude.Text)
getSessionEmbedUrl_userArn :: (Maybe Text -> f (Maybe Text))
-> GetSessionEmbedUrl -> f GetSessionEmbedUrl
getSessionEmbedUrl_userArn = (GetSessionEmbedUrl -> Maybe Text)
-> (GetSessionEmbedUrl -> Maybe Text -> GetSessionEmbedUrl)
-> Lens
     GetSessionEmbedUrl GetSessionEmbedUrl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSessionEmbedUrl' {Maybe Text
userArn :: Maybe Text
$sel:userArn:GetSessionEmbedUrl' :: GetSessionEmbedUrl -> Maybe Text
userArn} -> Maybe Text
userArn) (\s :: GetSessionEmbedUrl
s@GetSessionEmbedUrl' {} Maybe Text
a -> GetSessionEmbedUrl
s {$sel:userArn:GetSessionEmbedUrl' :: Maybe Text
userArn = Maybe Text
a} :: GetSessionEmbedUrl)

-- | The ID for the Amazon Web Services account associated with your Amazon
-- QuickSight subscription.
getSessionEmbedUrl_awsAccountId :: Lens.Lens' GetSessionEmbedUrl Prelude.Text
getSessionEmbedUrl_awsAccountId :: (Text -> f Text) -> GetSessionEmbedUrl -> f GetSessionEmbedUrl
getSessionEmbedUrl_awsAccountId = (GetSessionEmbedUrl -> Text)
-> (GetSessionEmbedUrl -> Text -> GetSessionEmbedUrl)
-> Lens GetSessionEmbedUrl GetSessionEmbedUrl Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSessionEmbedUrl' {Text
awsAccountId :: Text
$sel:awsAccountId:GetSessionEmbedUrl' :: GetSessionEmbedUrl -> Text
awsAccountId} -> Text
awsAccountId) (\s :: GetSessionEmbedUrl
s@GetSessionEmbedUrl' {} Text
a -> GetSessionEmbedUrl
s {$sel:awsAccountId:GetSessionEmbedUrl' :: Text
awsAccountId = Text
a} :: GetSessionEmbedUrl)

instance Core.AWSRequest GetSessionEmbedUrl where
  type
    AWSResponse GetSessionEmbedUrl =
      GetSessionEmbedUrlResponse
  request :: GetSessionEmbedUrl -> Request GetSessionEmbedUrl
request = Service -> GetSessionEmbedUrl -> Request GetSessionEmbedUrl
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetSessionEmbedUrl
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetSessionEmbedUrl)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetSessionEmbedUrl))
-> Logger
-> Service
-> Proxy GetSessionEmbedUrl
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetSessionEmbedUrl)))
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 (Sensitive Text) -> Int -> GetSessionEmbedUrlResponse
GetSessionEmbedUrlResponse'
            (Maybe Text
 -> Maybe (Sensitive Text) -> Int -> GetSessionEmbedUrlResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (Sensitive Text) -> Int -> GetSessionEmbedUrlResponse)
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
"RequestId")
            Either
  String
  (Maybe (Sensitive Text) -> Int -> GetSessionEmbedUrlResponse)
-> Either String (Maybe (Sensitive Text))
-> Either String (Int -> GetSessionEmbedUrlResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EmbedUrl")
            Either String (Int -> GetSessionEmbedUrlResponse)
-> Either String Int -> Either String GetSessionEmbedUrlResponse
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 GetSessionEmbedUrl

instance Prelude.NFData GetSessionEmbedUrl

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

instance Core.ToPath GetSessionEmbedUrl where
  toPath :: GetSessionEmbedUrl -> ByteString
toPath GetSessionEmbedUrl' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
userArn :: Maybe Text
entryPoint :: Maybe Text
sessionLifetimeInMinutes :: Maybe Natural
$sel:awsAccountId:GetSessionEmbedUrl' :: GetSessionEmbedUrl -> Text
$sel:userArn:GetSessionEmbedUrl' :: GetSessionEmbedUrl -> Maybe Text
$sel:entryPoint:GetSessionEmbedUrl' :: GetSessionEmbedUrl -> Maybe Text
$sel:sessionLifetimeInMinutes:GetSessionEmbedUrl' :: GetSessionEmbedUrl -> Maybe Natural
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/accounts/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId,
        ByteString
"/session-embed-url"
      ]

instance Core.ToQuery GetSessionEmbedUrl where
  toQuery :: GetSessionEmbedUrl -> QueryString
toQuery GetSessionEmbedUrl' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
userArn :: Maybe Text
entryPoint :: Maybe Text
sessionLifetimeInMinutes :: Maybe Natural
$sel:awsAccountId:GetSessionEmbedUrl' :: GetSessionEmbedUrl -> Text
$sel:userArn:GetSessionEmbedUrl' :: GetSessionEmbedUrl -> Maybe Text
$sel:entryPoint:GetSessionEmbedUrl' :: GetSessionEmbedUrl -> Maybe Text
$sel:sessionLifetimeInMinutes:GetSessionEmbedUrl' :: GetSessionEmbedUrl -> Maybe Natural
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"session-lifetime" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
sessionLifetimeInMinutes,
        ByteString
"entry-point" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
entryPoint,
        ByteString
"user-arn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
userArn
      ]

-- | /See:/ 'newGetSessionEmbedUrlResponse' smart constructor.
data GetSessionEmbedUrlResponse = GetSessionEmbedUrlResponse'
  { -- | The Amazon Web Services request ID for this operation.
    GetSessionEmbedUrlResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | A single-use URL that you can put into your server-side web page to
    -- embed your Amazon QuickSight session. This URL is valid for 5 minutes.
    -- The API operation provides the URL with an @auth_code@ value that
    -- enables one (and only one) sign-on to a user session that is valid for
    -- 10 hours.
    GetSessionEmbedUrlResponse -> Maybe (Sensitive Text)
embedUrl :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The HTTP status of the request.
    GetSessionEmbedUrlResponse -> Int
status :: Prelude.Int
  }
  deriving (GetSessionEmbedUrlResponse -> GetSessionEmbedUrlResponse -> Bool
(GetSessionEmbedUrlResponse -> GetSessionEmbedUrlResponse -> Bool)
-> (GetSessionEmbedUrlResponse
    -> GetSessionEmbedUrlResponse -> Bool)
-> Eq GetSessionEmbedUrlResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSessionEmbedUrlResponse -> GetSessionEmbedUrlResponse -> Bool
$c/= :: GetSessionEmbedUrlResponse -> GetSessionEmbedUrlResponse -> Bool
== :: GetSessionEmbedUrlResponse -> GetSessionEmbedUrlResponse -> Bool
$c== :: GetSessionEmbedUrlResponse -> GetSessionEmbedUrlResponse -> Bool
Prelude.Eq, Int -> GetSessionEmbedUrlResponse -> ShowS
[GetSessionEmbedUrlResponse] -> ShowS
GetSessionEmbedUrlResponse -> String
(Int -> GetSessionEmbedUrlResponse -> ShowS)
-> (GetSessionEmbedUrlResponse -> String)
-> ([GetSessionEmbedUrlResponse] -> ShowS)
-> Show GetSessionEmbedUrlResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSessionEmbedUrlResponse] -> ShowS
$cshowList :: [GetSessionEmbedUrlResponse] -> ShowS
show :: GetSessionEmbedUrlResponse -> String
$cshow :: GetSessionEmbedUrlResponse -> String
showsPrec :: Int -> GetSessionEmbedUrlResponse -> ShowS
$cshowsPrec :: Int -> GetSessionEmbedUrlResponse -> ShowS
Prelude.Show, (forall x.
 GetSessionEmbedUrlResponse -> Rep GetSessionEmbedUrlResponse x)
-> (forall x.
    Rep GetSessionEmbedUrlResponse x -> GetSessionEmbedUrlResponse)
-> Generic GetSessionEmbedUrlResponse
forall x.
Rep GetSessionEmbedUrlResponse x -> GetSessionEmbedUrlResponse
forall x.
GetSessionEmbedUrlResponse -> Rep GetSessionEmbedUrlResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSessionEmbedUrlResponse x -> GetSessionEmbedUrlResponse
$cfrom :: forall x.
GetSessionEmbedUrlResponse -> Rep GetSessionEmbedUrlResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetSessionEmbedUrlResponse' 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:
--
-- 'requestId', 'getSessionEmbedUrlResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'embedUrl', 'getSessionEmbedUrlResponse_embedUrl' - A single-use URL that you can put into your server-side web page to
-- embed your Amazon QuickSight session. This URL is valid for 5 minutes.
-- The API operation provides the URL with an @auth_code@ value that
-- enables one (and only one) sign-on to a user session that is valid for
-- 10 hours.
--
-- 'status', 'getSessionEmbedUrlResponse_status' - The HTTP status of the request.
newGetSessionEmbedUrlResponse ::
  -- | 'status'
  Prelude.Int ->
  GetSessionEmbedUrlResponse
newGetSessionEmbedUrlResponse :: Int -> GetSessionEmbedUrlResponse
newGetSessionEmbedUrlResponse Int
pStatus_ =
  GetSessionEmbedUrlResponse' :: Maybe Text
-> Maybe (Sensitive Text) -> Int -> GetSessionEmbedUrlResponse
GetSessionEmbedUrlResponse'
    { $sel:requestId:GetSessionEmbedUrlResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:embedUrl:GetSessionEmbedUrlResponse' :: Maybe (Sensitive Text)
embedUrl = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:status:GetSessionEmbedUrlResponse' :: Int
status = Int
pStatus_
    }

-- | The Amazon Web Services request ID for this operation.
getSessionEmbedUrlResponse_requestId :: Lens.Lens' GetSessionEmbedUrlResponse (Prelude.Maybe Prelude.Text)
getSessionEmbedUrlResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> GetSessionEmbedUrlResponse -> f GetSessionEmbedUrlResponse
getSessionEmbedUrlResponse_requestId = (GetSessionEmbedUrlResponse -> Maybe Text)
-> (GetSessionEmbedUrlResponse
    -> Maybe Text -> GetSessionEmbedUrlResponse)
-> Lens
     GetSessionEmbedUrlResponse
     GetSessionEmbedUrlResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSessionEmbedUrlResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:GetSessionEmbedUrlResponse' :: GetSessionEmbedUrlResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: GetSessionEmbedUrlResponse
s@GetSessionEmbedUrlResponse' {} Maybe Text
a -> GetSessionEmbedUrlResponse
s {$sel:requestId:GetSessionEmbedUrlResponse' :: Maybe Text
requestId = Maybe Text
a} :: GetSessionEmbedUrlResponse)

-- | A single-use URL that you can put into your server-side web page to
-- embed your Amazon QuickSight session. This URL is valid for 5 minutes.
-- The API operation provides the URL with an @auth_code@ value that
-- enables one (and only one) sign-on to a user session that is valid for
-- 10 hours.
getSessionEmbedUrlResponse_embedUrl :: Lens.Lens' GetSessionEmbedUrlResponse (Prelude.Maybe Prelude.Text)
getSessionEmbedUrlResponse_embedUrl :: (Maybe Text -> f (Maybe Text))
-> GetSessionEmbedUrlResponse -> f GetSessionEmbedUrlResponse
getSessionEmbedUrlResponse_embedUrl = (GetSessionEmbedUrlResponse -> Maybe (Sensitive Text))
-> (GetSessionEmbedUrlResponse
    -> Maybe (Sensitive Text) -> GetSessionEmbedUrlResponse)
-> Lens
     GetSessionEmbedUrlResponse
     GetSessionEmbedUrlResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSessionEmbedUrlResponse' {Maybe (Sensitive Text)
embedUrl :: Maybe (Sensitive Text)
$sel:embedUrl:GetSessionEmbedUrlResponse' :: GetSessionEmbedUrlResponse -> Maybe (Sensitive Text)
embedUrl} -> Maybe (Sensitive Text)
embedUrl) (\s :: GetSessionEmbedUrlResponse
s@GetSessionEmbedUrlResponse' {} Maybe (Sensitive Text)
a -> GetSessionEmbedUrlResponse
s {$sel:embedUrl:GetSessionEmbedUrlResponse' :: Maybe (Sensitive Text)
embedUrl = Maybe (Sensitive Text)
a} :: GetSessionEmbedUrlResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> GetSessionEmbedUrlResponse -> f GetSessionEmbedUrlResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> GetSessionEmbedUrlResponse
-> f GetSessionEmbedUrlResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The HTTP status of the request.
getSessionEmbedUrlResponse_status :: Lens.Lens' GetSessionEmbedUrlResponse Prelude.Int
getSessionEmbedUrlResponse_status :: (Int -> f Int)
-> GetSessionEmbedUrlResponse -> f GetSessionEmbedUrlResponse
getSessionEmbedUrlResponse_status = (GetSessionEmbedUrlResponse -> Int)
-> (GetSessionEmbedUrlResponse
    -> Int -> GetSessionEmbedUrlResponse)
-> Lens
     GetSessionEmbedUrlResponse GetSessionEmbedUrlResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSessionEmbedUrlResponse' {Int
status :: Int
$sel:status:GetSessionEmbedUrlResponse' :: GetSessionEmbedUrlResponse -> Int
status} -> Int
status) (\s :: GetSessionEmbedUrlResponse
s@GetSessionEmbedUrlResponse' {} Int
a -> GetSessionEmbedUrlResponse
s {$sel:status:GetSessionEmbedUrlResponse' :: Int
status = Int
a} :: GetSessionEmbedUrlResponse)

instance Prelude.NFData GetSessionEmbedUrlResponse