{-# 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.GenerateEmbedUrlForRegisteredUser
-- 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 an embed URL that you can use to embed an Amazon QuickSight
-- experience in your website. This action can be used for any type of user
-- registered in an Amazon QuickSight account. Before you use this action,
-- make sure that you have configured the relevant Amazon QuickSight
-- resource and permissions.
--
-- The following rules apply to the generated URL:
--
-- -   It contains a temporary bearer token. It is valid for 5 minutes
--     after it is generated. Once redeemed within this period, it cannot
--     be re-used again.
--
-- -   The URL validity period should not be confused with the actual
--     session lifetime that can be customized using the
--     @ SessionLifetimeInMinutes @ parameter.
--
--     The resulting user session is valid for 15 minutes (default) to 10
--     hours (maximum).
--
-- -   You are charged only when the URL is used or there is interaction
--     with Amazon QuickSight.
--
-- For more information, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/embedded-analytics.html Embedded Analytics>
-- in the /Amazon QuickSight User Guide/.
--
-- For more information about the high-level steps for embedding and for an
-- interactive demo of the ways you can customize embedding, visit the
-- <https://docs.aws.amazon.com/quicksight/latest/user/quicksight-dev-portal.html Amazon QuickSight Developer Portal>.
module Amazonka.QuickSight.GenerateEmbedUrlForRegisteredUser
  ( -- * Creating a Request
    GenerateEmbedUrlForRegisteredUser (..),
    newGenerateEmbedUrlForRegisteredUser,

    -- * Request Lenses
    generateEmbedUrlForRegisteredUser_sessionLifetimeInMinutes,
    generateEmbedUrlForRegisteredUser_awsAccountId,
    generateEmbedUrlForRegisteredUser_userArn,
    generateEmbedUrlForRegisteredUser_experienceConfiguration,

    -- * Destructuring the Response
    GenerateEmbedUrlForRegisteredUserResponse (..),
    newGenerateEmbedUrlForRegisteredUserResponse,

    -- * Response Lenses
    generateEmbedUrlForRegisteredUserResponse_status,
    generateEmbedUrlForRegisteredUserResponse_embedUrl,
    generateEmbedUrlForRegisteredUserResponse_requestId,
  )
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:/ 'newGenerateEmbedUrlForRegisteredUser' smart constructor.
data GenerateEmbedUrlForRegisteredUser = GenerateEmbedUrlForRegisteredUser'
  { -- | How many minutes the session is valid. The session lifetime must be in
    -- [15-600] minutes range.
    GenerateEmbedUrlForRegisteredUser -> Maybe Natural
sessionLifetimeInMinutes :: Prelude.Maybe Prelude.Natural,
    -- | The ID for the Amazon Web Services account that contains the dashboard
    -- that you\'re embedding.
    GenerateEmbedUrlForRegisteredUser -> Text
awsAccountId :: Prelude.Text,
    -- | The Amazon Resource Name for the registered user.
    GenerateEmbedUrlForRegisteredUser -> Text
userArn :: Prelude.Text,
    -- | The experience you are embedding. For registered users, you can embed
    -- Amazon QuickSight dashboards, the entire Amazon QuickSight console, or
    -- the Amazon QuickSight Q search bar.
    GenerateEmbedUrlForRegisteredUser
-> RegisteredUserEmbeddingExperienceConfiguration
experienceConfiguration :: RegisteredUserEmbeddingExperienceConfiguration
  }
  deriving (GenerateEmbedUrlForRegisteredUser
-> GenerateEmbedUrlForRegisteredUser -> Bool
(GenerateEmbedUrlForRegisteredUser
 -> GenerateEmbedUrlForRegisteredUser -> Bool)
-> (GenerateEmbedUrlForRegisteredUser
    -> GenerateEmbedUrlForRegisteredUser -> Bool)
-> Eq GenerateEmbedUrlForRegisteredUser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GenerateEmbedUrlForRegisteredUser
-> GenerateEmbedUrlForRegisteredUser -> Bool
$c/= :: GenerateEmbedUrlForRegisteredUser
-> GenerateEmbedUrlForRegisteredUser -> Bool
== :: GenerateEmbedUrlForRegisteredUser
-> GenerateEmbedUrlForRegisteredUser -> Bool
$c== :: GenerateEmbedUrlForRegisteredUser
-> GenerateEmbedUrlForRegisteredUser -> Bool
Prelude.Eq, ReadPrec [GenerateEmbedUrlForRegisteredUser]
ReadPrec GenerateEmbedUrlForRegisteredUser
Int -> ReadS GenerateEmbedUrlForRegisteredUser
ReadS [GenerateEmbedUrlForRegisteredUser]
(Int -> ReadS GenerateEmbedUrlForRegisteredUser)
-> ReadS [GenerateEmbedUrlForRegisteredUser]
-> ReadPrec GenerateEmbedUrlForRegisteredUser
-> ReadPrec [GenerateEmbedUrlForRegisteredUser]
-> Read GenerateEmbedUrlForRegisteredUser
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GenerateEmbedUrlForRegisteredUser]
$creadListPrec :: ReadPrec [GenerateEmbedUrlForRegisteredUser]
readPrec :: ReadPrec GenerateEmbedUrlForRegisteredUser
$creadPrec :: ReadPrec GenerateEmbedUrlForRegisteredUser
readList :: ReadS [GenerateEmbedUrlForRegisteredUser]
$creadList :: ReadS [GenerateEmbedUrlForRegisteredUser]
readsPrec :: Int -> ReadS GenerateEmbedUrlForRegisteredUser
$creadsPrec :: Int -> ReadS GenerateEmbedUrlForRegisteredUser
Prelude.Read, Int -> GenerateEmbedUrlForRegisteredUser -> ShowS
[GenerateEmbedUrlForRegisteredUser] -> ShowS
GenerateEmbedUrlForRegisteredUser -> String
(Int -> GenerateEmbedUrlForRegisteredUser -> ShowS)
-> (GenerateEmbedUrlForRegisteredUser -> String)
-> ([GenerateEmbedUrlForRegisteredUser] -> ShowS)
-> Show GenerateEmbedUrlForRegisteredUser
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GenerateEmbedUrlForRegisteredUser] -> ShowS
$cshowList :: [GenerateEmbedUrlForRegisteredUser] -> ShowS
show :: GenerateEmbedUrlForRegisteredUser -> String
$cshow :: GenerateEmbedUrlForRegisteredUser -> String
showsPrec :: Int -> GenerateEmbedUrlForRegisteredUser -> ShowS
$cshowsPrec :: Int -> GenerateEmbedUrlForRegisteredUser -> ShowS
Prelude.Show, (forall x.
 GenerateEmbedUrlForRegisteredUser
 -> Rep GenerateEmbedUrlForRegisteredUser x)
-> (forall x.
    Rep GenerateEmbedUrlForRegisteredUser x
    -> GenerateEmbedUrlForRegisteredUser)
-> Generic GenerateEmbedUrlForRegisteredUser
forall x.
Rep GenerateEmbedUrlForRegisteredUser x
-> GenerateEmbedUrlForRegisteredUser
forall x.
GenerateEmbedUrlForRegisteredUser
-> Rep GenerateEmbedUrlForRegisteredUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GenerateEmbedUrlForRegisteredUser x
-> GenerateEmbedUrlForRegisteredUser
$cfrom :: forall x.
GenerateEmbedUrlForRegisteredUser
-> Rep GenerateEmbedUrlForRegisteredUser x
Prelude.Generic)

-- |
-- Create a value of 'GenerateEmbedUrlForRegisteredUser' 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', 'generateEmbedUrlForRegisteredUser_sessionLifetimeInMinutes' - How many minutes the session is valid. The session lifetime must be in
-- [15-600] minutes range.
--
-- 'awsAccountId', 'generateEmbedUrlForRegisteredUser_awsAccountId' - The ID for the Amazon Web Services account that contains the dashboard
-- that you\'re embedding.
--
-- 'userArn', 'generateEmbedUrlForRegisteredUser_userArn' - The Amazon Resource Name for the registered user.
--
-- 'experienceConfiguration', 'generateEmbedUrlForRegisteredUser_experienceConfiguration' - The experience you are embedding. For registered users, you can embed
-- Amazon QuickSight dashboards, the entire Amazon QuickSight console, or
-- the Amazon QuickSight Q search bar.
newGenerateEmbedUrlForRegisteredUser ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'userArn'
  Prelude.Text ->
  -- | 'experienceConfiguration'
  RegisteredUserEmbeddingExperienceConfiguration ->
  GenerateEmbedUrlForRegisteredUser
newGenerateEmbedUrlForRegisteredUser :: Text
-> Text
-> RegisteredUserEmbeddingExperienceConfiguration
-> GenerateEmbedUrlForRegisteredUser
newGenerateEmbedUrlForRegisteredUser
  Text
pAwsAccountId_
  Text
pUserArn_
  RegisteredUserEmbeddingExperienceConfiguration
pExperienceConfiguration_ =
    GenerateEmbedUrlForRegisteredUser' :: Maybe Natural
-> Text
-> Text
-> RegisteredUserEmbeddingExperienceConfiguration
-> GenerateEmbedUrlForRegisteredUser
GenerateEmbedUrlForRegisteredUser'
      { $sel:sessionLifetimeInMinutes:GenerateEmbedUrlForRegisteredUser' :: Maybe Natural
sessionLifetimeInMinutes =
          Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:awsAccountId:GenerateEmbedUrlForRegisteredUser' :: Text
awsAccountId = Text
pAwsAccountId_,
        $sel:userArn:GenerateEmbedUrlForRegisteredUser' :: Text
userArn = Text
pUserArn_,
        $sel:experienceConfiguration:GenerateEmbedUrlForRegisteredUser' :: RegisteredUserEmbeddingExperienceConfiguration
experienceConfiguration =
          RegisteredUserEmbeddingExperienceConfiguration
pExperienceConfiguration_
      }

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

-- | The ID for the Amazon Web Services account that contains the dashboard
-- that you\'re embedding.
generateEmbedUrlForRegisteredUser_awsAccountId :: Lens.Lens' GenerateEmbedUrlForRegisteredUser Prelude.Text
generateEmbedUrlForRegisteredUser_awsAccountId :: (Text -> f Text)
-> GenerateEmbedUrlForRegisteredUser
-> f GenerateEmbedUrlForRegisteredUser
generateEmbedUrlForRegisteredUser_awsAccountId = (GenerateEmbedUrlForRegisteredUser -> Text)
-> (GenerateEmbedUrlForRegisteredUser
    -> Text -> GenerateEmbedUrlForRegisteredUser)
-> Lens
     GenerateEmbedUrlForRegisteredUser
     GenerateEmbedUrlForRegisteredUser
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateEmbedUrlForRegisteredUser' {Text
awsAccountId :: Text
$sel:awsAccountId:GenerateEmbedUrlForRegisteredUser' :: GenerateEmbedUrlForRegisteredUser -> Text
awsAccountId} -> Text
awsAccountId) (\s :: GenerateEmbedUrlForRegisteredUser
s@GenerateEmbedUrlForRegisteredUser' {} Text
a -> GenerateEmbedUrlForRegisteredUser
s {$sel:awsAccountId:GenerateEmbedUrlForRegisteredUser' :: Text
awsAccountId = Text
a} :: GenerateEmbedUrlForRegisteredUser)

-- | The Amazon Resource Name for the registered user.
generateEmbedUrlForRegisteredUser_userArn :: Lens.Lens' GenerateEmbedUrlForRegisteredUser Prelude.Text
generateEmbedUrlForRegisteredUser_userArn :: (Text -> f Text)
-> GenerateEmbedUrlForRegisteredUser
-> f GenerateEmbedUrlForRegisteredUser
generateEmbedUrlForRegisteredUser_userArn = (GenerateEmbedUrlForRegisteredUser -> Text)
-> (GenerateEmbedUrlForRegisteredUser
    -> Text -> GenerateEmbedUrlForRegisteredUser)
-> Lens
     GenerateEmbedUrlForRegisteredUser
     GenerateEmbedUrlForRegisteredUser
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateEmbedUrlForRegisteredUser' {Text
userArn :: Text
$sel:userArn:GenerateEmbedUrlForRegisteredUser' :: GenerateEmbedUrlForRegisteredUser -> Text
userArn} -> Text
userArn) (\s :: GenerateEmbedUrlForRegisteredUser
s@GenerateEmbedUrlForRegisteredUser' {} Text
a -> GenerateEmbedUrlForRegisteredUser
s {$sel:userArn:GenerateEmbedUrlForRegisteredUser' :: Text
userArn = Text
a} :: GenerateEmbedUrlForRegisteredUser)

-- | The experience you are embedding. For registered users, you can embed
-- Amazon QuickSight dashboards, the entire Amazon QuickSight console, or
-- the Amazon QuickSight Q search bar.
generateEmbedUrlForRegisteredUser_experienceConfiguration :: Lens.Lens' GenerateEmbedUrlForRegisteredUser RegisteredUserEmbeddingExperienceConfiguration
generateEmbedUrlForRegisteredUser_experienceConfiguration :: (RegisteredUserEmbeddingExperienceConfiguration
 -> f RegisteredUserEmbeddingExperienceConfiguration)
-> GenerateEmbedUrlForRegisteredUser
-> f GenerateEmbedUrlForRegisteredUser
generateEmbedUrlForRegisteredUser_experienceConfiguration = (GenerateEmbedUrlForRegisteredUser
 -> RegisteredUserEmbeddingExperienceConfiguration)
-> (GenerateEmbedUrlForRegisteredUser
    -> RegisteredUserEmbeddingExperienceConfiguration
    -> GenerateEmbedUrlForRegisteredUser)
-> Lens
     GenerateEmbedUrlForRegisteredUser
     GenerateEmbedUrlForRegisteredUser
     RegisteredUserEmbeddingExperienceConfiguration
     RegisteredUserEmbeddingExperienceConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateEmbedUrlForRegisteredUser' {RegisteredUserEmbeddingExperienceConfiguration
experienceConfiguration :: RegisteredUserEmbeddingExperienceConfiguration
$sel:experienceConfiguration:GenerateEmbedUrlForRegisteredUser' :: GenerateEmbedUrlForRegisteredUser
-> RegisteredUserEmbeddingExperienceConfiguration
experienceConfiguration} -> RegisteredUserEmbeddingExperienceConfiguration
experienceConfiguration) (\s :: GenerateEmbedUrlForRegisteredUser
s@GenerateEmbedUrlForRegisteredUser' {} RegisteredUserEmbeddingExperienceConfiguration
a -> GenerateEmbedUrlForRegisteredUser
s {$sel:experienceConfiguration:GenerateEmbedUrlForRegisteredUser' :: RegisteredUserEmbeddingExperienceConfiguration
experienceConfiguration = RegisteredUserEmbeddingExperienceConfiguration
a} :: GenerateEmbedUrlForRegisteredUser)

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

instance
  Prelude.Hashable
    GenerateEmbedUrlForRegisteredUser

instance
  Prelude.NFData
    GenerateEmbedUrlForRegisteredUser

instance
  Core.ToHeaders
    GenerateEmbedUrlForRegisteredUser
  where
  toHeaders :: GenerateEmbedUrlForRegisteredUser -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> GenerateEmbedUrlForRegisteredUser -> 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.ToJSON
    GenerateEmbedUrlForRegisteredUser
  where
  toJSON :: GenerateEmbedUrlForRegisteredUser -> Value
toJSON GenerateEmbedUrlForRegisteredUser' {Maybe Natural
Text
RegisteredUserEmbeddingExperienceConfiguration
experienceConfiguration :: RegisteredUserEmbeddingExperienceConfiguration
userArn :: Text
awsAccountId :: Text
sessionLifetimeInMinutes :: Maybe Natural
$sel:experienceConfiguration:GenerateEmbedUrlForRegisteredUser' :: GenerateEmbedUrlForRegisteredUser
-> RegisteredUserEmbeddingExperienceConfiguration
$sel:userArn:GenerateEmbedUrlForRegisteredUser' :: GenerateEmbedUrlForRegisteredUser -> Text
$sel:awsAccountId:GenerateEmbedUrlForRegisteredUser' :: GenerateEmbedUrlForRegisteredUser -> Text
$sel:sessionLifetimeInMinutes:GenerateEmbedUrlForRegisteredUser' :: GenerateEmbedUrlForRegisteredUser -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SessionLifetimeInMinutes" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
sessionLifetimeInMinutes,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"ExperienceConfiguration"
                  Text -> RegisteredUserEmbeddingExperienceConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RegisteredUserEmbeddingExperienceConfiguration
experienceConfiguration
              )
          ]
      )

instance
  Core.ToPath
    GenerateEmbedUrlForRegisteredUser
  where
  toPath :: GenerateEmbedUrlForRegisteredUser -> ByteString
toPath GenerateEmbedUrlForRegisteredUser' {Maybe Natural
Text
RegisteredUserEmbeddingExperienceConfiguration
experienceConfiguration :: RegisteredUserEmbeddingExperienceConfiguration
userArn :: Text
awsAccountId :: Text
sessionLifetimeInMinutes :: Maybe Natural
$sel:experienceConfiguration:GenerateEmbedUrlForRegisteredUser' :: GenerateEmbedUrlForRegisteredUser
-> RegisteredUserEmbeddingExperienceConfiguration
$sel:userArn:GenerateEmbedUrlForRegisteredUser' :: GenerateEmbedUrlForRegisteredUser -> Text
$sel:awsAccountId:GenerateEmbedUrlForRegisteredUser' :: GenerateEmbedUrlForRegisteredUser -> Text
$sel:sessionLifetimeInMinutes:GenerateEmbedUrlForRegisteredUser' :: GenerateEmbedUrlForRegisteredUser -> 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
"/embed-url/registered-user"
      ]

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

-- | /See:/ 'newGenerateEmbedUrlForRegisteredUserResponse' smart constructor.
data GenerateEmbedUrlForRegisteredUserResponse = GenerateEmbedUrlForRegisteredUserResponse'
  { -- | The HTTP status of the request.
    GenerateEmbedUrlForRegisteredUserResponse -> Int
status :: Prelude.Int,
    -- | The embed URL for the Amazon QuickSight dashboard, console, or Q search
    -- bar.
    GenerateEmbedUrlForRegisteredUserResponse -> Sensitive Text
embedUrl :: Core.Sensitive Prelude.Text,
    -- | The Amazon Web Services request ID for this operation.
    GenerateEmbedUrlForRegisteredUserResponse -> Text
requestId :: Prelude.Text
  }
  deriving (GenerateEmbedUrlForRegisteredUserResponse
-> GenerateEmbedUrlForRegisteredUserResponse -> Bool
(GenerateEmbedUrlForRegisteredUserResponse
 -> GenerateEmbedUrlForRegisteredUserResponse -> Bool)
-> (GenerateEmbedUrlForRegisteredUserResponse
    -> GenerateEmbedUrlForRegisteredUserResponse -> Bool)
-> Eq GenerateEmbedUrlForRegisteredUserResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GenerateEmbedUrlForRegisteredUserResponse
-> GenerateEmbedUrlForRegisteredUserResponse -> Bool
$c/= :: GenerateEmbedUrlForRegisteredUserResponse
-> GenerateEmbedUrlForRegisteredUserResponse -> Bool
== :: GenerateEmbedUrlForRegisteredUserResponse
-> GenerateEmbedUrlForRegisteredUserResponse -> Bool
$c== :: GenerateEmbedUrlForRegisteredUserResponse
-> GenerateEmbedUrlForRegisteredUserResponse -> Bool
Prelude.Eq, Int -> GenerateEmbedUrlForRegisteredUserResponse -> ShowS
[GenerateEmbedUrlForRegisteredUserResponse] -> ShowS
GenerateEmbedUrlForRegisteredUserResponse -> String
(Int -> GenerateEmbedUrlForRegisteredUserResponse -> ShowS)
-> (GenerateEmbedUrlForRegisteredUserResponse -> String)
-> ([GenerateEmbedUrlForRegisteredUserResponse] -> ShowS)
-> Show GenerateEmbedUrlForRegisteredUserResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GenerateEmbedUrlForRegisteredUserResponse] -> ShowS
$cshowList :: [GenerateEmbedUrlForRegisteredUserResponse] -> ShowS
show :: GenerateEmbedUrlForRegisteredUserResponse -> String
$cshow :: GenerateEmbedUrlForRegisteredUserResponse -> String
showsPrec :: Int -> GenerateEmbedUrlForRegisteredUserResponse -> ShowS
$cshowsPrec :: Int -> GenerateEmbedUrlForRegisteredUserResponse -> ShowS
Prelude.Show, (forall x.
 GenerateEmbedUrlForRegisteredUserResponse
 -> Rep GenerateEmbedUrlForRegisteredUserResponse x)
-> (forall x.
    Rep GenerateEmbedUrlForRegisteredUserResponse x
    -> GenerateEmbedUrlForRegisteredUserResponse)
-> Generic GenerateEmbedUrlForRegisteredUserResponse
forall x.
Rep GenerateEmbedUrlForRegisteredUserResponse x
-> GenerateEmbedUrlForRegisteredUserResponse
forall x.
GenerateEmbedUrlForRegisteredUserResponse
-> Rep GenerateEmbedUrlForRegisteredUserResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GenerateEmbedUrlForRegisteredUserResponse x
-> GenerateEmbedUrlForRegisteredUserResponse
$cfrom :: forall x.
GenerateEmbedUrlForRegisteredUserResponse
-> Rep GenerateEmbedUrlForRegisteredUserResponse x
Prelude.Generic)

-- |
-- Create a value of 'GenerateEmbedUrlForRegisteredUserResponse' 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:
--
-- 'status', 'generateEmbedUrlForRegisteredUserResponse_status' - The HTTP status of the request.
--
-- 'embedUrl', 'generateEmbedUrlForRegisteredUserResponse_embedUrl' - The embed URL for the Amazon QuickSight dashboard, console, or Q search
-- bar.
--
-- 'requestId', 'generateEmbedUrlForRegisteredUserResponse_requestId' - The Amazon Web Services request ID for this operation.
newGenerateEmbedUrlForRegisteredUserResponse ::
  -- | 'status'
  Prelude.Int ->
  -- | 'embedUrl'
  Prelude.Text ->
  -- | 'requestId'
  Prelude.Text ->
  GenerateEmbedUrlForRegisteredUserResponse
newGenerateEmbedUrlForRegisteredUserResponse :: Int -> Text -> Text -> GenerateEmbedUrlForRegisteredUserResponse
newGenerateEmbedUrlForRegisteredUserResponse
  Int
pStatus_
  Text
pEmbedUrl_
  Text
pRequestId_ =
    GenerateEmbedUrlForRegisteredUserResponse' :: Int
-> Sensitive Text
-> Text
-> GenerateEmbedUrlForRegisteredUserResponse
GenerateEmbedUrlForRegisteredUserResponse'
      { $sel:status:GenerateEmbedUrlForRegisteredUserResponse' :: Int
status =
          Int
pStatus_,
        $sel:embedUrl:GenerateEmbedUrlForRegisteredUserResponse' :: Sensitive Text
embedUrl =
          Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive
            (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pEmbedUrl_,
        $sel:requestId:GenerateEmbedUrlForRegisteredUserResponse' :: Text
requestId = Text
pRequestId_
      }

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

-- | The embed URL for the Amazon QuickSight dashboard, console, or Q search
-- bar.
generateEmbedUrlForRegisteredUserResponse_embedUrl :: Lens.Lens' GenerateEmbedUrlForRegisteredUserResponse Prelude.Text
generateEmbedUrlForRegisteredUserResponse_embedUrl :: (Text -> f Text)
-> GenerateEmbedUrlForRegisteredUserResponse
-> f GenerateEmbedUrlForRegisteredUserResponse
generateEmbedUrlForRegisteredUserResponse_embedUrl = (GenerateEmbedUrlForRegisteredUserResponse -> Sensitive Text)
-> (GenerateEmbedUrlForRegisteredUserResponse
    -> Sensitive Text -> GenerateEmbedUrlForRegisteredUserResponse)
-> Lens
     GenerateEmbedUrlForRegisteredUserResponse
     GenerateEmbedUrlForRegisteredUserResponse
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateEmbedUrlForRegisteredUserResponse' {Sensitive Text
embedUrl :: Sensitive Text
$sel:embedUrl:GenerateEmbedUrlForRegisteredUserResponse' :: GenerateEmbedUrlForRegisteredUserResponse -> Sensitive Text
embedUrl} -> Sensitive Text
embedUrl) (\s :: GenerateEmbedUrlForRegisteredUserResponse
s@GenerateEmbedUrlForRegisteredUserResponse' {} Sensitive Text
a -> GenerateEmbedUrlForRegisteredUserResponse
s {$sel:embedUrl:GenerateEmbedUrlForRegisteredUserResponse' :: Sensitive Text
embedUrl = Sensitive Text
a} :: GenerateEmbedUrlForRegisteredUserResponse) ((Sensitive Text -> f (Sensitive Text))
 -> GenerateEmbedUrlForRegisteredUserResponse
 -> f GenerateEmbedUrlForRegisteredUserResponse)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> GenerateEmbedUrlForRegisteredUserResponse
-> f GenerateEmbedUrlForRegisteredUserResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

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

instance
  Prelude.NFData
    GenerateEmbedUrlForRegisteredUserResponse