{-# 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.GenerateEmbedUrlForAnonymousUser
-- 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
-- dashboard in your website, without having to register any reader users.
-- Before you use this action, make sure that you have configured the
-- dashboards 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.GenerateEmbedUrlForAnonymousUser
  ( -- * Creating a Request
    GenerateEmbedUrlForAnonymousUser (..),
    newGenerateEmbedUrlForAnonymousUser,

    -- * Request Lenses
    generateEmbedUrlForAnonymousUser_sessionLifetimeInMinutes,
    generateEmbedUrlForAnonymousUser_sessionTags,
    generateEmbedUrlForAnonymousUser_awsAccountId,
    generateEmbedUrlForAnonymousUser_namespace,
    generateEmbedUrlForAnonymousUser_authorizedResourceArns,
    generateEmbedUrlForAnonymousUser_experienceConfiguration,

    -- * Destructuring the Response
    GenerateEmbedUrlForAnonymousUserResponse (..),
    newGenerateEmbedUrlForAnonymousUserResponse,

    -- * Response Lenses
    generateEmbedUrlForAnonymousUserResponse_status,
    generateEmbedUrlForAnonymousUserResponse_embedUrl,
    generateEmbedUrlForAnonymousUserResponse_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:/ 'newGenerateEmbedUrlForAnonymousUser' smart constructor.
data GenerateEmbedUrlForAnonymousUser = GenerateEmbedUrlForAnonymousUser'
  { -- | How many minutes the session is valid. The session lifetime must be in
    -- [15-600] minutes range.
    GenerateEmbedUrlForAnonymousUser -> Maybe Natural
sessionLifetimeInMinutes :: Prelude.Maybe Prelude.Natural,
    -- | The session tags used for row-level security. Before you use this
    -- parameter, make sure that you have configured the relevant datasets
    -- using the @DataSet$RowLevelPermissionTagConfiguration@ parameter so that
    -- session tags can be used to provide row-level security.
    --
    -- These are not the tags used for the Amazon Web Services resource tagging
    -- feature. For more information, see
    -- <https://docs.aws.amazon.com/quicksight/latest/user/quicksight-dev-rls-tags.html Using Row-Level Security (RLS) with Tags>.
    GenerateEmbedUrlForAnonymousUser -> Maybe (NonEmpty SessionTag)
sessionTags :: Prelude.Maybe (Prelude.NonEmpty SessionTag),
    -- | The ID for the Amazon Web Services account that contains the dashboard
    -- that you\'re embedding.
    GenerateEmbedUrlForAnonymousUser -> Text
awsAccountId :: Prelude.Text,
    -- | The Amazon QuickSight namespace that the anonymous user virtually
    -- belongs to. If you are not using an Amazon QuickSight custom namespace,
    -- set this to @default@.
    GenerateEmbedUrlForAnonymousUser -> Text
namespace :: Prelude.Text,
    -- | The Amazon Resource Names for the Amazon QuickSight resources that the
    -- user is authorized to access during the lifetime of the session. If you
    -- choose @Dashboard@ embedding experience, pass the list of dashboard ARNs
    -- in the account that you want the user to be able to view.
    GenerateEmbedUrlForAnonymousUser -> [Text]
authorizedResourceArns :: [Prelude.Text],
    -- | The configuration of the experience you are embedding.
    GenerateEmbedUrlForAnonymousUser
-> AnonymousUserEmbeddingExperienceConfiguration
experienceConfiguration :: AnonymousUserEmbeddingExperienceConfiguration
  }
  deriving (GenerateEmbedUrlForAnonymousUser
-> GenerateEmbedUrlForAnonymousUser -> Bool
(GenerateEmbedUrlForAnonymousUser
 -> GenerateEmbedUrlForAnonymousUser -> Bool)
-> (GenerateEmbedUrlForAnonymousUser
    -> GenerateEmbedUrlForAnonymousUser -> Bool)
-> Eq GenerateEmbedUrlForAnonymousUser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GenerateEmbedUrlForAnonymousUser
-> GenerateEmbedUrlForAnonymousUser -> Bool
$c/= :: GenerateEmbedUrlForAnonymousUser
-> GenerateEmbedUrlForAnonymousUser -> Bool
== :: GenerateEmbedUrlForAnonymousUser
-> GenerateEmbedUrlForAnonymousUser -> Bool
$c== :: GenerateEmbedUrlForAnonymousUser
-> GenerateEmbedUrlForAnonymousUser -> Bool
Prelude.Eq, Int -> GenerateEmbedUrlForAnonymousUser -> ShowS
[GenerateEmbedUrlForAnonymousUser] -> ShowS
GenerateEmbedUrlForAnonymousUser -> String
(Int -> GenerateEmbedUrlForAnonymousUser -> ShowS)
-> (GenerateEmbedUrlForAnonymousUser -> String)
-> ([GenerateEmbedUrlForAnonymousUser] -> ShowS)
-> Show GenerateEmbedUrlForAnonymousUser
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GenerateEmbedUrlForAnonymousUser] -> ShowS
$cshowList :: [GenerateEmbedUrlForAnonymousUser] -> ShowS
show :: GenerateEmbedUrlForAnonymousUser -> String
$cshow :: GenerateEmbedUrlForAnonymousUser -> String
showsPrec :: Int -> GenerateEmbedUrlForAnonymousUser -> ShowS
$cshowsPrec :: Int -> GenerateEmbedUrlForAnonymousUser -> ShowS
Prelude.Show, (forall x.
 GenerateEmbedUrlForAnonymousUser
 -> Rep GenerateEmbedUrlForAnonymousUser x)
-> (forall x.
    Rep GenerateEmbedUrlForAnonymousUser x
    -> GenerateEmbedUrlForAnonymousUser)
-> Generic GenerateEmbedUrlForAnonymousUser
forall x.
Rep GenerateEmbedUrlForAnonymousUser x
-> GenerateEmbedUrlForAnonymousUser
forall x.
GenerateEmbedUrlForAnonymousUser
-> Rep GenerateEmbedUrlForAnonymousUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GenerateEmbedUrlForAnonymousUser x
-> GenerateEmbedUrlForAnonymousUser
$cfrom :: forall x.
GenerateEmbedUrlForAnonymousUser
-> Rep GenerateEmbedUrlForAnonymousUser x
Prelude.Generic)

-- |
-- Create a value of 'GenerateEmbedUrlForAnonymousUser' 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', 'generateEmbedUrlForAnonymousUser_sessionLifetimeInMinutes' - How many minutes the session is valid. The session lifetime must be in
-- [15-600] minutes range.
--
-- 'sessionTags', 'generateEmbedUrlForAnonymousUser_sessionTags' - The session tags used for row-level security. Before you use this
-- parameter, make sure that you have configured the relevant datasets
-- using the @DataSet$RowLevelPermissionTagConfiguration@ parameter so that
-- session tags can be used to provide row-level security.
--
-- These are not the tags used for the Amazon Web Services resource tagging
-- feature. For more information, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/quicksight-dev-rls-tags.html Using Row-Level Security (RLS) with Tags>.
--
-- 'awsAccountId', 'generateEmbedUrlForAnonymousUser_awsAccountId' - The ID for the Amazon Web Services account that contains the dashboard
-- that you\'re embedding.
--
-- 'namespace', 'generateEmbedUrlForAnonymousUser_namespace' - The Amazon QuickSight namespace that the anonymous user virtually
-- belongs to. If you are not using an Amazon QuickSight custom namespace,
-- set this to @default@.
--
-- 'authorizedResourceArns', 'generateEmbedUrlForAnonymousUser_authorizedResourceArns' - The Amazon Resource Names for the Amazon QuickSight resources that the
-- user is authorized to access during the lifetime of the session. If you
-- choose @Dashboard@ embedding experience, pass the list of dashboard ARNs
-- in the account that you want the user to be able to view.
--
-- 'experienceConfiguration', 'generateEmbedUrlForAnonymousUser_experienceConfiguration' - The configuration of the experience you are embedding.
newGenerateEmbedUrlForAnonymousUser ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'namespace'
  Prelude.Text ->
  -- | 'experienceConfiguration'
  AnonymousUserEmbeddingExperienceConfiguration ->
  GenerateEmbedUrlForAnonymousUser
newGenerateEmbedUrlForAnonymousUser :: Text
-> Text
-> AnonymousUserEmbeddingExperienceConfiguration
-> GenerateEmbedUrlForAnonymousUser
newGenerateEmbedUrlForAnonymousUser
  Text
pAwsAccountId_
  Text
pNamespace_
  AnonymousUserEmbeddingExperienceConfiguration
pExperienceConfiguration_ =
    GenerateEmbedUrlForAnonymousUser' :: Maybe Natural
-> Maybe (NonEmpty SessionTag)
-> Text
-> Text
-> [Text]
-> AnonymousUserEmbeddingExperienceConfiguration
-> GenerateEmbedUrlForAnonymousUser
GenerateEmbedUrlForAnonymousUser'
      { $sel:sessionLifetimeInMinutes:GenerateEmbedUrlForAnonymousUser' :: Maybe Natural
sessionLifetimeInMinutes =
          Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:sessionTags:GenerateEmbedUrlForAnonymousUser' :: Maybe (NonEmpty SessionTag)
sessionTags = Maybe (NonEmpty SessionTag)
forall a. Maybe a
Prelude.Nothing,
        $sel:awsAccountId:GenerateEmbedUrlForAnonymousUser' :: Text
awsAccountId = Text
pAwsAccountId_,
        $sel:namespace:GenerateEmbedUrlForAnonymousUser' :: Text
namespace = Text
pNamespace_,
        $sel:authorizedResourceArns:GenerateEmbedUrlForAnonymousUser' :: [Text]
authorizedResourceArns = [Text]
forall a. Monoid a => a
Prelude.mempty,
        $sel:experienceConfiguration:GenerateEmbedUrlForAnonymousUser' :: AnonymousUserEmbeddingExperienceConfiguration
experienceConfiguration =
          AnonymousUserEmbeddingExperienceConfiguration
pExperienceConfiguration_
      }

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

-- | The session tags used for row-level security. Before you use this
-- parameter, make sure that you have configured the relevant datasets
-- using the @DataSet$RowLevelPermissionTagConfiguration@ parameter so that
-- session tags can be used to provide row-level security.
--
-- These are not the tags used for the Amazon Web Services resource tagging
-- feature. For more information, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/quicksight-dev-rls-tags.html Using Row-Level Security (RLS) with Tags>.
generateEmbedUrlForAnonymousUser_sessionTags :: Lens.Lens' GenerateEmbedUrlForAnonymousUser (Prelude.Maybe (Prelude.NonEmpty SessionTag))
generateEmbedUrlForAnonymousUser_sessionTags :: (Maybe (NonEmpty SessionTag) -> f (Maybe (NonEmpty SessionTag)))
-> GenerateEmbedUrlForAnonymousUser
-> f GenerateEmbedUrlForAnonymousUser
generateEmbedUrlForAnonymousUser_sessionTags = (GenerateEmbedUrlForAnonymousUser -> Maybe (NonEmpty SessionTag))
-> (GenerateEmbedUrlForAnonymousUser
    -> Maybe (NonEmpty SessionTag) -> GenerateEmbedUrlForAnonymousUser)
-> Lens
     GenerateEmbedUrlForAnonymousUser
     GenerateEmbedUrlForAnonymousUser
     (Maybe (NonEmpty SessionTag))
     (Maybe (NonEmpty SessionTag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateEmbedUrlForAnonymousUser' {Maybe (NonEmpty SessionTag)
sessionTags :: Maybe (NonEmpty SessionTag)
$sel:sessionTags:GenerateEmbedUrlForAnonymousUser' :: GenerateEmbedUrlForAnonymousUser -> Maybe (NonEmpty SessionTag)
sessionTags} -> Maybe (NonEmpty SessionTag)
sessionTags) (\s :: GenerateEmbedUrlForAnonymousUser
s@GenerateEmbedUrlForAnonymousUser' {} Maybe (NonEmpty SessionTag)
a -> GenerateEmbedUrlForAnonymousUser
s {$sel:sessionTags:GenerateEmbedUrlForAnonymousUser' :: Maybe (NonEmpty SessionTag)
sessionTags = Maybe (NonEmpty SessionTag)
a} :: GenerateEmbedUrlForAnonymousUser) ((Maybe (NonEmpty SessionTag) -> f (Maybe (NonEmpty SessionTag)))
 -> GenerateEmbedUrlForAnonymousUser
 -> f GenerateEmbedUrlForAnonymousUser)
-> ((Maybe (NonEmpty SessionTag)
     -> f (Maybe (NonEmpty SessionTag)))
    -> Maybe (NonEmpty SessionTag) -> f (Maybe (NonEmpty SessionTag)))
-> (Maybe (NonEmpty SessionTag) -> f (Maybe (NonEmpty SessionTag)))
-> GenerateEmbedUrlForAnonymousUser
-> f GenerateEmbedUrlForAnonymousUser
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty SessionTag)
  (NonEmpty SessionTag)
  (NonEmpty SessionTag)
  (NonEmpty SessionTag)
-> Iso
     (Maybe (NonEmpty SessionTag))
     (Maybe (NonEmpty SessionTag))
     (Maybe (NonEmpty SessionTag))
     (Maybe (NonEmpty SessionTag))
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
  (NonEmpty SessionTag)
  (NonEmpty SessionTag)
  (NonEmpty SessionTag)
  (NonEmpty SessionTag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The Amazon QuickSight namespace that the anonymous user virtually
-- belongs to. If you are not using an Amazon QuickSight custom namespace,
-- set this to @default@.
generateEmbedUrlForAnonymousUser_namespace :: Lens.Lens' GenerateEmbedUrlForAnonymousUser Prelude.Text
generateEmbedUrlForAnonymousUser_namespace :: (Text -> f Text)
-> GenerateEmbedUrlForAnonymousUser
-> f GenerateEmbedUrlForAnonymousUser
generateEmbedUrlForAnonymousUser_namespace = (GenerateEmbedUrlForAnonymousUser -> Text)
-> (GenerateEmbedUrlForAnonymousUser
    -> Text -> GenerateEmbedUrlForAnonymousUser)
-> Lens
     GenerateEmbedUrlForAnonymousUser
     GenerateEmbedUrlForAnonymousUser
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateEmbedUrlForAnonymousUser' {Text
namespace :: Text
$sel:namespace:GenerateEmbedUrlForAnonymousUser' :: GenerateEmbedUrlForAnonymousUser -> Text
namespace} -> Text
namespace) (\s :: GenerateEmbedUrlForAnonymousUser
s@GenerateEmbedUrlForAnonymousUser' {} Text
a -> GenerateEmbedUrlForAnonymousUser
s {$sel:namespace:GenerateEmbedUrlForAnonymousUser' :: Text
namespace = Text
a} :: GenerateEmbedUrlForAnonymousUser)

-- | The Amazon Resource Names for the Amazon QuickSight resources that the
-- user is authorized to access during the lifetime of the session. If you
-- choose @Dashboard@ embedding experience, pass the list of dashboard ARNs
-- in the account that you want the user to be able to view.
generateEmbedUrlForAnonymousUser_authorizedResourceArns :: Lens.Lens' GenerateEmbedUrlForAnonymousUser [Prelude.Text]
generateEmbedUrlForAnonymousUser_authorizedResourceArns :: ([Text] -> f [Text])
-> GenerateEmbedUrlForAnonymousUser
-> f GenerateEmbedUrlForAnonymousUser
generateEmbedUrlForAnonymousUser_authorizedResourceArns = (GenerateEmbedUrlForAnonymousUser -> [Text])
-> (GenerateEmbedUrlForAnonymousUser
    -> [Text] -> GenerateEmbedUrlForAnonymousUser)
-> Lens
     GenerateEmbedUrlForAnonymousUser
     GenerateEmbedUrlForAnonymousUser
     [Text]
     [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateEmbedUrlForAnonymousUser' {[Text]
authorizedResourceArns :: [Text]
$sel:authorizedResourceArns:GenerateEmbedUrlForAnonymousUser' :: GenerateEmbedUrlForAnonymousUser -> [Text]
authorizedResourceArns} -> [Text]
authorizedResourceArns) (\s :: GenerateEmbedUrlForAnonymousUser
s@GenerateEmbedUrlForAnonymousUser' {} [Text]
a -> GenerateEmbedUrlForAnonymousUser
s {$sel:authorizedResourceArns:GenerateEmbedUrlForAnonymousUser' :: [Text]
authorizedResourceArns = [Text]
a} :: GenerateEmbedUrlForAnonymousUser) (([Text] -> f [Text])
 -> GenerateEmbedUrlForAnonymousUser
 -> f GenerateEmbedUrlForAnonymousUser)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> GenerateEmbedUrlForAnonymousUser
-> f GenerateEmbedUrlForAnonymousUser
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The configuration of the experience you are embedding.
generateEmbedUrlForAnonymousUser_experienceConfiguration :: Lens.Lens' GenerateEmbedUrlForAnonymousUser AnonymousUserEmbeddingExperienceConfiguration
generateEmbedUrlForAnonymousUser_experienceConfiguration :: (AnonymousUserEmbeddingExperienceConfiguration
 -> f AnonymousUserEmbeddingExperienceConfiguration)
-> GenerateEmbedUrlForAnonymousUser
-> f GenerateEmbedUrlForAnonymousUser
generateEmbedUrlForAnonymousUser_experienceConfiguration = (GenerateEmbedUrlForAnonymousUser
 -> AnonymousUserEmbeddingExperienceConfiguration)
-> (GenerateEmbedUrlForAnonymousUser
    -> AnonymousUserEmbeddingExperienceConfiguration
    -> GenerateEmbedUrlForAnonymousUser)
-> Lens
     GenerateEmbedUrlForAnonymousUser
     GenerateEmbedUrlForAnonymousUser
     AnonymousUserEmbeddingExperienceConfiguration
     AnonymousUserEmbeddingExperienceConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateEmbedUrlForAnonymousUser' {AnonymousUserEmbeddingExperienceConfiguration
experienceConfiguration :: AnonymousUserEmbeddingExperienceConfiguration
$sel:experienceConfiguration:GenerateEmbedUrlForAnonymousUser' :: GenerateEmbedUrlForAnonymousUser
-> AnonymousUserEmbeddingExperienceConfiguration
experienceConfiguration} -> AnonymousUserEmbeddingExperienceConfiguration
experienceConfiguration) (\s :: GenerateEmbedUrlForAnonymousUser
s@GenerateEmbedUrlForAnonymousUser' {} AnonymousUserEmbeddingExperienceConfiguration
a -> GenerateEmbedUrlForAnonymousUser
s {$sel:experienceConfiguration:GenerateEmbedUrlForAnonymousUser' :: AnonymousUserEmbeddingExperienceConfiguration
experienceConfiguration = AnonymousUserEmbeddingExperienceConfiguration
a} :: GenerateEmbedUrlForAnonymousUser)

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

instance
  Prelude.NFData
    GenerateEmbedUrlForAnonymousUser

instance
  Core.ToHeaders
    GenerateEmbedUrlForAnonymousUser
  where
  toHeaders :: GenerateEmbedUrlForAnonymousUser -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> GenerateEmbedUrlForAnonymousUser -> 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 GenerateEmbedUrlForAnonymousUser where
  toJSON :: GenerateEmbedUrlForAnonymousUser -> Value
toJSON GenerateEmbedUrlForAnonymousUser' {[Text]
Maybe Natural
Maybe (NonEmpty SessionTag)
Text
AnonymousUserEmbeddingExperienceConfiguration
experienceConfiguration :: AnonymousUserEmbeddingExperienceConfiguration
authorizedResourceArns :: [Text]
namespace :: Text
awsAccountId :: Text
sessionTags :: Maybe (NonEmpty SessionTag)
sessionLifetimeInMinutes :: Maybe Natural
$sel:experienceConfiguration:GenerateEmbedUrlForAnonymousUser' :: GenerateEmbedUrlForAnonymousUser
-> AnonymousUserEmbeddingExperienceConfiguration
$sel:authorizedResourceArns:GenerateEmbedUrlForAnonymousUser' :: GenerateEmbedUrlForAnonymousUser -> [Text]
$sel:namespace:GenerateEmbedUrlForAnonymousUser' :: GenerateEmbedUrlForAnonymousUser -> Text
$sel:awsAccountId:GenerateEmbedUrlForAnonymousUser' :: GenerateEmbedUrlForAnonymousUser -> Text
$sel:sessionTags:GenerateEmbedUrlForAnonymousUser' :: GenerateEmbedUrlForAnonymousUser -> Maybe (NonEmpty SessionTag)
$sel:sessionLifetimeInMinutes:GenerateEmbedUrlForAnonymousUser' :: GenerateEmbedUrlForAnonymousUser -> 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,
            (Text
"SessionTags" Text -> NonEmpty SessionTag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty SessionTag -> Pair)
-> Maybe (NonEmpty SessionTag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty SessionTag)
sessionTags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Namespace" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
namespace),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"AuthorizedResourceArns"
                  Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
authorizedResourceArns
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"ExperienceConfiguration"
                  Text -> AnonymousUserEmbeddingExperienceConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AnonymousUserEmbeddingExperienceConfiguration
experienceConfiguration
              )
          ]
      )

instance Core.ToPath GenerateEmbedUrlForAnonymousUser where
  toPath :: GenerateEmbedUrlForAnonymousUser -> ByteString
toPath GenerateEmbedUrlForAnonymousUser' {[Text]
Maybe Natural
Maybe (NonEmpty SessionTag)
Text
AnonymousUserEmbeddingExperienceConfiguration
experienceConfiguration :: AnonymousUserEmbeddingExperienceConfiguration
authorizedResourceArns :: [Text]
namespace :: Text
awsAccountId :: Text
sessionTags :: Maybe (NonEmpty SessionTag)
sessionLifetimeInMinutes :: Maybe Natural
$sel:experienceConfiguration:GenerateEmbedUrlForAnonymousUser' :: GenerateEmbedUrlForAnonymousUser
-> AnonymousUserEmbeddingExperienceConfiguration
$sel:authorizedResourceArns:GenerateEmbedUrlForAnonymousUser' :: GenerateEmbedUrlForAnonymousUser -> [Text]
$sel:namespace:GenerateEmbedUrlForAnonymousUser' :: GenerateEmbedUrlForAnonymousUser -> Text
$sel:awsAccountId:GenerateEmbedUrlForAnonymousUser' :: GenerateEmbedUrlForAnonymousUser -> Text
$sel:sessionTags:GenerateEmbedUrlForAnonymousUser' :: GenerateEmbedUrlForAnonymousUser -> Maybe (NonEmpty SessionTag)
$sel:sessionLifetimeInMinutes:GenerateEmbedUrlForAnonymousUser' :: GenerateEmbedUrlForAnonymousUser -> 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/anonymous-user"
      ]

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

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

-- |
-- Create a value of 'GenerateEmbedUrlForAnonymousUserResponse' 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', 'generateEmbedUrlForAnonymousUserResponse_status' - The HTTP status of the request.
--
-- 'embedUrl', 'generateEmbedUrlForAnonymousUserResponse_embedUrl' - The embed URL for the dashboard.
--
-- 'requestId', 'generateEmbedUrlForAnonymousUserResponse_requestId' - The Amazon Web Services request ID for this operation.
newGenerateEmbedUrlForAnonymousUserResponse ::
  -- | 'status'
  Prelude.Int ->
  -- | 'embedUrl'
  Prelude.Text ->
  -- | 'requestId'
  Prelude.Text ->
  GenerateEmbedUrlForAnonymousUserResponse
newGenerateEmbedUrlForAnonymousUserResponse :: Int -> Text -> Text -> GenerateEmbedUrlForAnonymousUserResponse
newGenerateEmbedUrlForAnonymousUserResponse
  Int
pStatus_
  Text
pEmbedUrl_
  Text
pRequestId_ =
    GenerateEmbedUrlForAnonymousUserResponse' :: Int
-> Sensitive Text
-> Text
-> GenerateEmbedUrlForAnonymousUserResponse
GenerateEmbedUrlForAnonymousUserResponse'
      { $sel:status:GenerateEmbedUrlForAnonymousUserResponse' :: Int
status =
          Int
pStatus_,
        $sel:embedUrl:GenerateEmbedUrlForAnonymousUserResponse' :: 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:GenerateEmbedUrlForAnonymousUserResponse' :: Text
requestId = Text
pRequestId_
      }

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

-- | The embed URL for the dashboard.
generateEmbedUrlForAnonymousUserResponse_embedUrl :: Lens.Lens' GenerateEmbedUrlForAnonymousUserResponse Prelude.Text
generateEmbedUrlForAnonymousUserResponse_embedUrl :: (Text -> f Text)
-> GenerateEmbedUrlForAnonymousUserResponse
-> f GenerateEmbedUrlForAnonymousUserResponse
generateEmbedUrlForAnonymousUserResponse_embedUrl = (GenerateEmbedUrlForAnonymousUserResponse -> Sensitive Text)
-> (GenerateEmbedUrlForAnonymousUserResponse
    -> Sensitive Text -> GenerateEmbedUrlForAnonymousUserResponse)
-> Lens
     GenerateEmbedUrlForAnonymousUserResponse
     GenerateEmbedUrlForAnonymousUserResponse
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateEmbedUrlForAnonymousUserResponse' {Sensitive Text
embedUrl :: Sensitive Text
$sel:embedUrl:GenerateEmbedUrlForAnonymousUserResponse' :: GenerateEmbedUrlForAnonymousUserResponse -> Sensitive Text
embedUrl} -> Sensitive Text
embedUrl) (\s :: GenerateEmbedUrlForAnonymousUserResponse
s@GenerateEmbedUrlForAnonymousUserResponse' {} Sensitive Text
a -> GenerateEmbedUrlForAnonymousUserResponse
s {$sel:embedUrl:GenerateEmbedUrlForAnonymousUserResponse' :: Sensitive Text
embedUrl = Sensitive Text
a} :: GenerateEmbedUrlForAnonymousUserResponse) ((Sensitive Text -> f (Sensitive Text))
 -> GenerateEmbedUrlForAnonymousUserResponse
 -> f GenerateEmbedUrlForAnonymousUserResponse)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> GenerateEmbedUrlForAnonymousUserResponse
-> f GenerateEmbedUrlForAnonymousUserResponse
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.
generateEmbedUrlForAnonymousUserResponse_requestId :: Lens.Lens' GenerateEmbedUrlForAnonymousUserResponse Prelude.Text
generateEmbedUrlForAnonymousUserResponse_requestId :: (Text -> f Text)
-> GenerateEmbedUrlForAnonymousUserResponse
-> f GenerateEmbedUrlForAnonymousUserResponse
generateEmbedUrlForAnonymousUserResponse_requestId = (GenerateEmbedUrlForAnonymousUserResponse -> Text)
-> (GenerateEmbedUrlForAnonymousUserResponse
    -> Text -> GenerateEmbedUrlForAnonymousUserResponse)
-> Lens
     GenerateEmbedUrlForAnonymousUserResponse
     GenerateEmbedUrlForAnonymousUserResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenerateEmbedUrlForAnonymousUserResponse' {Text
requestId :: Text
$sel:requestId:GenerateEmbedUrlForAnonymousUserResponse' :: GenerateEmbedUrlForAnonymousUserResponse -> Text
requestId} -> Text
requestId) (\s :: GenerateEmbedUrlForAnonymousUserResponse
s@GenerateEmbedUrlForAnonymousUserResponse' {} Text
a -> GenerateEmbedUrlForAnonymousUserResponse
s {$sel:requestId:GenerateEmbedUrlForAnonymousUserResponse' :: Text
requestId = Text
a} :: GenerateEmbedUrlForAnonymousUserResponse)

instance
  Prelude.NFData
    GenerateEmbedUrlForAnonymousUserResponse