{-# 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.IoTSiteWise.CreatePortal
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a portal, which can contain projects and dashboards. IoT
-- SiteWise Monitor uses Amazon Web Services SSO or IAM to authenticate
-- portal users and manage user permissions.
--
-- Before you can sign in to a new portal, you must add at least one
-- identity to that portal. For more information, see
-- <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/administer-portals.html#portal-change-admins Adding or removing portal administrators>
-- in the /IoT SiteWise User Guide/.
module Amazonka.IoTSiteWise.CreatePortal
  ( -- * Creating a Request
    CreatePortal (..),
    newCreatePortal,

    -- * Request Lenses
    createPortal_portalAuthMode,
    createPortal_clientToken,
    createPortal_portalDescription,
    createPortal_notificationSenderEmail,
    createPortal_alarms,
    createPortal_portalLogoImageFile,
    createPortal_tags,
    createPortal_portalName,
    createPortal_portalContactEmail,
    createPortal_roleArn,

    -- * Destructuring the Response
    CreatePortalResponse (..),
    newCreatePortalResponse,

    -- * Response Lenses
    createPortalResponse_httpStatus,
    createPortalResponse_portalId,
    createPortalResponse_portalArn,
    createPortalResponse_portalStartUrl,
    createPortalResponse_portalStatus,
    createPortalResponse_ssoApplicationId,
  )
where

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

-- | /See:/ 'newCreatePortal' smart constructor.
data CreatePortal = CreatePortal'
  { -- | The service to use to authenticate users to the portal. Choose from the
    -- following options:
    --
    -- -   @SSO@ – The portal uses Amazon Web Services Single Sign On to
    --     authenticate users and manage user permissions. Before you can
    --     create a portal that uses Amazon Web Services SSO, you must enable
    --     Amazon Web Services SSO. For more information, see
    --     <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-get-started.html#mon-gs-sso Enabling Amazon Web Services SSO>
    --     in the /IoT SiteWise User Guide/. This option is only available in
    --     Amazon Web Services Regions other than the China Regions.
    --
    -- -   @IAM@ – The portal uses Identity and Access Management to
    --     authenticate users and manage user permissions. This option is only
    --     available in the China Regions.
    --
    -- You can\'t change this value after you create a portal.
    --
    -- Default: @SSO@
    CreatePortal -> Maybe AuthMode
portalAuthMode :: Prelude.Maybe AuthMode,
    -- | A unique case-sensitive identifier that you can provide to ensure the
    -- idempotency of the request. Don\'t reuse this client token if a new
    -- idempotent request is required.
    CreatePortal -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | A description for the portal.
    CreatePortal -> Maybe Text
portalDescription :: Prelude.Maybe Prelude.Text,
    -- | The email address that sends alarm notifications.
    --
    -- If you use the
    -- <https://docs.aws.amazon.com/iotevents/latest/developerguide/lambda-support.html IoT Events managed Lambda function>
    -- to manage your emails, you must
    -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html verify the sender email address in Amazon SES>.
    CreatePortal -> Maybe Text
notificationSenderEmail :: Prelude.Maybe Prelude.Text,
    -- | Contains the configuration information of an alarm created in an IoT
    -- SiteWise Monitor portal. You can use the alarm to monitor an asset
    -- property and get notified when the asset property value is outside a
    -- specified range. For more information, see
    -- <https://docs.aws.amazon.com/iot-sitewise/latest/appguide/monitor-alarms.html Monitoring with alarms>
    -- in the /IoT SiteWise Application Guide/.
    CreatePortal -> Maybe Alarms
alarms :: Prelude.Maybe Alarms,
    -- | A logo image to display in the portal. Upload a square, high-resolution
    -- image. The image is displayed on a dark background.
    CreatePortal -> Maybe ImageFile
portalLogoImageFile :: Prelude.Maybe ImageFile,
    -- | A list of key-value pairs that contain metadata for the portal. For more
    -- information, see
    -- <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html Tagging your IoT SiteWise resources>
    -- in the /IoT SiteWise User Guide/.
    CreatePortal -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A friendly name for the portal.
    CreatePortal -> Text
portalName :: Prelude.Text,
    -- | The Amazon Web Services administrator\'s contact email address.
    CreatePortal -> Text
portalContactEmail :: Prelude.Text,
    -- | The
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
    -- of a service role that allows the portal\'s users to access your IoT
    -- SiteWise resources on your behalf. For more information, see
    -- <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-service-role.html Using service roles for IoT SiteWise Monitor>
    -- in the /IoT SiteWise User Guide/.
    CreatePortal -> Text
roleArn :: Prelude.Text
  }
  deriving (CreatePortal -> CreatePortal -> Bool
(CreatePortal -> CreatePortal -> Bool)
-> (CreatePortal -> CreatePortal -> Bool) -> Eq CreatePortal
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePortal -> CreatePortal -> Bool
$c/= :: CreatePortal -> CreatePortal -> Bool
== :: CreatePortal -> CreatePortal -> Bool
$c== :: CreatePortal -> CreatePortal -> Bool
Prelude.Eq, ReadPrec [CreatePortal]
ReadPrec CreatePortal
Int -> ReadS CreatePortal
ReadS [CreatePortal]
(Int -> ReadS CreatePortal)
-> ReadS [CreatePortal]
-> ReadPrec CreatePortal
-> ReadPrec [CreatePortal]
-> Read CreatePortal
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreatePortal]
$creadListPrec :: ReadPrec [CreatePortal]
readPrec :: ReadPrec CreatePortal
$creadPrec :: ReadPrec CreatePortal
readList :: ReadS [CreatePortal]
$creadList :: ReadS [CreatePortal]
readsPrec :: Int -> ReadS CreatePortal
$creadsPrec :: Int -> ReadS CreatePortal
Prelude.Read, Int -> CreatePortal -> ShowS
[CreatePortal] -> ShowS
CreatePortal -> String
(Int -> CreatePortal -> ShowS)
-> (CreatePortal -> String)
-> ([CreatePortal] -> ShowS)
-> Show CreatePortal
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePortal] -> ShowS
$cshowList :: [CreatePortal] -> ShowS
show :: CreatePortal -> String
$cshow :: CreatePortal -> String
showsPrec :: Int -> CreatePortal -> ShowS
$cshowsPrec :: Int -> CreatePortal -> ShowS
Prelude.Show, (forall x. CreatePortal -> Rep CreatePortal x)
-> (forall x. Rep CreatePortal x -> CreatePortal)
-> Generic CreatePortal
forall x. Rep CreatePortal x -> CreatePortal
forall x. CreatePortal -> Rep CreatePortal x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreatePortal x -> CreatePortal
$cfrom :: forall x. CreatePortal -> Rep CreatePortal x
Prelude.Generic)

-- |
-- Create a value of 'CreatePortal' 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:
--
-- 'portalAuthMode', 'createPortal_portalAuthMode' - The service to use to authenticate users to the portal. Choose from the
-- following options:
--
-- -   @SSO@ – The portal uses Amazon Web Services Single Sign On to
--     authenticate users and manage user permissions. Before you can
--     create a portal that uses Amazon Web Services SSO, you must enable
--     Amazon Web Services SSO. For more information, see
--     <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-get-started.html#mon-gs-sso Enabling Amazon Web Services SSO>
--     in the /IoT SiteWise User Guide/. This option is only available in
--     Amazon Web Services Regions other than the China Regions.
--
-- -   @IAM@ – The portal uses Identity and Access Management to
--     authenticate users and manage user permissions. This option is only
--     available in the China Regions.
--
-- You can\'t change this value after you create a portal.
--
-- Default: @SSO@
--
-- 'clientToken', 'createPortal_clientToken' - A unique case-sensitive identifier that you can provide to ensure the
-- idempotency of the request. Don\'t reuse this client token if a new
-- idempotent request is required.
--
-- 'portalDescription', 'createPortal_portalDescription' - A description for the portal.
--
-- 'notificationSenderEmail', 'createPortal_notificationSenderEmail' - The email address that sends alarm notifications.
--
-- If you use the
-- <https://docs.aws.amazon.com/iotevents/latest/developerguide/lambda-support.html IoT Events managed Lambda function>
-- to manage your emails, you must
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html verify the sender email address in Amazon SES>.
--
-- 'alarms', 'createPortal_alarms' - Contains the configuration information of an alarm created in an IoT
-- SiteWise Monitor portal. You can use the alarm to monitor an asset
-- property and get notified when the asset property value is outside a
-- specified range. For more information, see
-- <https://docs.aws.amazon.com/iot-sitewise/latest/appguide/monitor-alarms.html Monitoring with alarms>
-- in the /IoT SiteWise Application Guide/.
--
-- 'portalLogoImageFile', 'createPortal_portalLogoImageFile' - A logo image to display in the portal. Upload a square, high-resolution
-- image. The image is displayed on a dark background.
--
-- 'tags', 'createPortal_tags' - A list of key-value pairs that contain metadata for the portal. For more
-- information, see
-- <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html Tagging your IoT SiteWise resources>
-- in the /IoT SiteWise User Guide/.
--
-- 'portalName', 'createPortal_portalName' - A friendly name for the portal.
--
-- 'portalContactEmail', 'createPortal_portalContactEmail' - The Amazon Web Services administrator\'s contact email address.
--
-- 'roleArn', 'createPortal_roleArn' - The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of a service role that allows the portal\'s users to access your IoT
-- SiteWise resources on your behalf. For more information, see
-- <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-service-role.html Using service roles for IoT SiteWise Monitor>
-- in the /IoT SiteWise User Guide/.
newCreatePortal ::
  -- | 'portalName'
  Prelude.Text ->
  -- | 'portalContactEmail'
  Prelude.Text ->
  -- | 'roleArn'
  Prelude.Text ->
  CreatePortal
newCreatePortal :: Text -> Text -> Text -> CreatePortal
newCreatePortal
  Text
pPortalName_
  Text
pPortalContactEmail_
  Text
pRoleArn_ =
    CreatePortal' :: Maybe AuthMode
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Alarms
-> Maybe ImageFile
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> CreatePortal
CreatePortal'
      { $sel:portalAuthMode:CreatePortal' :: Maybe AuthMode
portalAuthMode = Maybe AuthMode
forall a. Maybe a
Prelude.Nothing,
        $sel:clientToken:CreatePortal' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:portalDescription:CreatePortal' :: Maybe Text
portalDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:notificationSenderEmail:CreatePortal' :: Maybe Text
notificationSenderEmail = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:alarms:CreatePortal' :: Maybe Alarms
alarms = Maybe Alarms
forall a. Maybe a
Prelude.Nothing,
        $sel:portalLogoImageFile:CreatePortal' :: Maybe ImageFile
portalLogoImageFile = Maybe ImageFile
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreatePortal' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:portalName:CreatePortal' :: Text
portalName = Text
pPortalName_,
        $sel:portalContactEmail:CreatePortal' :: Text
portalContactEmail = Text
pPortalContactEmail_,
        $sel:roleArn:CreatePortal' :: Text
roleArn = Text
pRoleArn_
      }

-- | The service to use to authenticate users to the portal. Choose from the
-- following options:
--
-- -   @SSO@ – The portal uses Amazon Web Services Single Sign On to
--     authenticate users and manage user permissions. Before you can
--     create a portal that uses Amazon Web Services SSO, you must enable
--     Amazon Web Services SSO. For more information, see
--     <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-get-started.html#mon-gs-sso Enabling Amazon Web Services SSO>
--     in the /IoT SiteWise User Guide/. This option is only available in
--     Amazon Web Services Regions other than the China Regions.
--
-- -   @IAM@ – The portal uses Identity and Access Management to
--     authenticate users and manage user permissions. This option is only
--     available in the China Regions.
--
-- You can\'t change this value after you create a portal.
--
-- Default: @SSO@
createPortal_portalAuthMode :: Lens.Lens' CreatePortal (Prelude.Maybe AuthMode)
createPortal_portalAuthMode :: (Maybe AuthMode -> f (Maybe AuthMode))
-> CreatePortal -> f CreatePortal
createPortal_portalAuthMode = (CreatePortal -> Maybe AuthMode)
-> (CreatePortal -> Maybe AuthMode -> CreatePortal)
-> Lens CreatePortal CreatePortal (Maybe AuthMode) (Maybe AuthMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePortal' {Maybe AuthMode
portalAuthMode :: Maybe AuthMode
$sel:portalAuthMode:CreatePortal' :: CreatePortal -> Maybe AuthMode
portalAuthMode} -> Maybe AuthMode
portalAuthMode) (\s :: CreatePortal
s@CreatePortal' {} Maybe AuthMode
a -> CreatePortal
s {$sel:portalAuthMode:CreatePortal' :: Maybe AuthMode
portalAuthMode = Maybe AuthMode
a} :: CreatePortal)

-- | A unique case-sensitive identifier that you can provide to ensure the
-- idempotency of the request. Don\'t reuse this client token if a new
-- idempotent request is required.
createPortal_clientToken :: Lens.Lens' CreatePortal (Prelude.Maybe Prelude.Text)
createPortal_clientToken :: (Maybe Text -> f (Maybe Text)) -> CreatePortal -> f CreatePortal
createPortal_clientToken = (CreatePortal -> Maybe Text)
-> (CreatePortal -> Maybe Text -> CreatePortal)
-> Lens CreatePortal CreatePortal (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePortal' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreatePortal' :: CreatePortal -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreatePortal
s@CreatePortal' {} Maybe Text
a -> CreatePortal
s {$sel:clientToken:CreatePortal' :: Maybe Text
clientToken = Maybe Text
a} :: CreatePortal)

-- | A description for the portal.
createPortal_portalDescription :: Lens.Lens' CreatePortal (Prelude.Maybe Prelude.Text)
createPortal_portalDescription :: (Maybe Text -> f (Maybe Text)) -> CreatePortal -> f CreatePortal
createPortal_portalDescription = (CreatePortal -> Maybe Text)
-> (CreatePortal -> Maybe Text -> CreatePortal)
-> Lens CreatePortal CreatePortal (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePortal' {Maybe Text
portalDescription :: Maybe Text
$sel:portalDescription:CreatePortal' :: CreatePortal -> Maybe Text
portalDescription} -> Maybe Text
portalDescription) (\s :: CreatePortal
s@CreatePortal' {} Maybe Text
a -> CreatePortal
s {$sel:portalDescription:CreatePortal' :: Maybe Text
portalDescription = Maybe Text
a} :: CreatePortal)

-- | The email address that sends alarm notifications.
--
-- If you use the
-- <https://docs.aws.amazon.com/iotevents/latest/developerguide/lambda-support.html IoT Events managed Lambda function>
-- to manage your emails, you must
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html verify the sender email address in Amazon SES>.
createPortal_notificationSenderEmail :: Lens.Lens' CreatePortal (Prelude.Maybe Prelude.Text)
createPortal_notificationSenderEmail :: (Maybe Text -> f (Maybe Text)) -> CreatePortal -> f CreatePortal
createPortal_notificationSenderEmail = (CreatePortal -> Maybe Text)
-> (CreatePortal -> Maybe Text -> CreatePortal)
-> Lens CreatePortal CreatePortal (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePortal' {Maybe Text
notificationSenderEmail :: Maybe Text
$sel:notificationSenderEmail:CreatePortal' :: CreatePortal -> Maybe Text
notificationSenderEmail} -> Maybe Text
notificationSenderEmail) (\s :: CreatePortal
s@CreatePortal' {} Maybe Text
a -> CreatePortal
s {$sel:notificationSenderEmail:CreatePortal' :: Maybe Text
notificationSenderEmail = Maybe Text
a} :: CreatePortal)

-- | Contains the configuration information of an alarm created in an IoT
-- SiteWise Monitor portal. You can use the alarm to monitor an asset
-- property and get notified when the asset property value is outside a
-- specified range. For more information, see
-- <https://docs.aws.amazon.com/iot-sitewise/latest/appguide/monitor-alarms.html Monitoring with alarms>
-- in the /IoT SiteWise Application Guide/.
createPortal_alarms :: Lens.Lens' CreatePortal (Prelude.Maybe Alarms)
createPortal_alarms :: (Maybe Alarms -> f (Maybe Alarms))
-> CreatePortal -> f CreatePortal
createPortal_alarms = (CreatePortal -> Maybe Alarms)
-> (CreatePortal -> Maybe Alarms -> CreatePortal)
-> Lens CreatePortal CreatePortal (Maybe Alarms) (Maybe Alarms)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePortal' {Maybe Alarms
alarms :: Maybe Alarms
$sel:alarms:CreatePortal' :: CreatePortal -> Maybe Alarms
alarms} -> Maybe Alarms
alarms) (\s :: CreatePortal
s@CreatePortal' {} Maybe Alarms
a -> CreatePortal
s {$sel:alarms:CreatePortal' :: Maybe Alarms
alarms = Maybe Alarms
a} :: CreatePortal)

-- | A logo image to display in the portal. Upload a square, high-resolution
-- image. The image is displayed on a dark background.
createPortal_portalLogoImageFile :: Lens.Lens' CreatePortal (Prelude.Maybe ImageFile)
createPortal_portalLogoImageFile :: (Maybe ImageFile -> f (Maybe ImageFile))
-> CreatePortal -> f CreatePortal
createPortal_portalLogoImageFile = (CreatePortal -> Maybe ImageFile)
-> (CreatePortal -> Maybe ImageFile -> CreatePortal)
-> Lens
     CreatePortal CreatePortal (Maybe ImageFile) (Maybe ImageFile)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePortal' {Maybe ImageFile
portalLogoImageFile :: Maybe ImageFile
$sel:portalLogoImageFile:CreatePortal' :: CreatePortal -> Maybe ImageFile
portalLogoImageFile} -> Maybe ImageFile
portalLogoImageFile) (\s :: CreatePortal
s@CreatePortal' {} Maybe ImageFile
a -> CreatePortal
s {$sel:portalLogoImageFile:CreatePortal' :: Maybe ImageFile
portalLogoImageFile = Maybe ImageFile
a} :: CreatePortal)

-- | A list of key-value pairs that contain metadata for the portal. For more
-- information, see
-- <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html Tagging your IoT SiteWise resources>
-- in the /IoT SiteWise User Guide/.
createPortal_tags :: Lens.Lens' CreatePortal (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createPortal_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreatePortal -> f CreatePortal
createPortal_tags = (CreatePortal -> Maybe (HashMap Text Text))
-> (CreatePortal -> Maybe (HashMap Text Text) -> CreatePortal)
-> Lens
     CreatePortal
     CreatePortal
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePortal' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreatePortal' :: CreatePortal -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreatePortal
s@CreatePortal' {} Maybe (HashMap Text Text)
a -> CreatePortal
s {$sel:tags:CreatePortal' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreatePortal) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreatePortal -> f CreatePortal)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreatePortal
-> f CreatePortal
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A friendly name for the portal.
createPortal_portalName :: Lens.Lens' CreatePortal Prelude.Text
createPortal_portalName :: (Text -> f Text) -> CreatePortal -> f CreatePortal
createPortal_portalName = (CreatePortal -> Text)
-> (CreatePortal -> Text -> CreatePortal)
-> Lens CreatePortal CreatePortal Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePortal' {Text
portalName :: Text
$sel:portalName:CreatePortal' :: CreatePortal -> Text
portalName} -> Text
portalName) (\s :: CreatePortal
s@CreatePortal' {} Text
a -> CreatePortal
s {$sel:portalName:CreatePortal' :: Text
portalName = Text
a} :: CreatePortal)

-- | The Amazon Web Services administrator\'s contact email address.
createPortal_portalContactEmail :: Lens.Lens' CreatePortal Prelude.Text
createPortal_portalContactEmail :: (Text -> f Text) -> CreatePortal -> f CreatePortal
createPortal_portalContactEmail = (CreatePortal -> Text)
-> (CreatePortal -> Text -> CreatePortal)
-> Lens CreatePortal CreatePortal Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePortal' {Text
portalContactEmail :: Text
$sel:portalContactEmail:CreatePortal' :: CreatePortal -> Text
portalContactEmail} -> Text
portalContactEmail) (\s :: CreatePortal
s@CreatePortal' {} Text
a -> CreatePortal
s {$sel:portalContactEmail:CreatePortal' :: Text
portalContactEmail = Text
a} :: CreatePortal)

-- | The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of a service role that allows the portal\'s users to access your IoT
-- SiteWise resources on your behalf. For more information, see
-- <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-service-role.html Using service roles for IoT SiteWise Monitor>
-- in the /IoT SiteWise User Guide/.
createPortal_roleArn :: Lens.Lens' CreatePortal Prelude.Text
createPortal_roleArn :: (Text -> f Text) -> CreatePortal -> f CreatePortal
createPortal_roleArn = (CreatePortal -> Text)
-> (CreatePortal -> Text -> CreatePortal)
-> Lens CreatePortal CreatePortal Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePortal' {Text
roleArn :: Text
$sel:roleArn:CreatePortal' :: CreatePortal -> Text
roleArn} -> Text
roleArn) (\s :: CreatePortal
s@CreatePortal' {} Text
a -> CreatePortal
s {$sel:roleArn:CreatePortal' :: Text
roleArn = Text
a} :: CreatePortal)

instance Core.AWSRequest CreatePortal where
  type AWSResponse CreatePortal = CreatePortalResponse
  request :: CreatePortal -> Request CreatePortal
request = Service -> CreatePortal -> Request CreatePortal
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreatePortal
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreatePortal)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreatePortal))
-> Logger
-> Service
-> Proxy CreatePortal
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreatePortal)))
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
-> Text
-> Text
-> Text
-> PortalStatus
-> Text
-> CreatePortalResponse
CreatePortalResponse'
            (Int
 -> Text
 -> Text
 -> Text
 -> PortalStatus
 -> Text
 -> CreatePortalResponse)
-> Either String Int
-> Either
     String
     (Text
      -> Text -> Text -> PortalStatus -> Text -> CreatePortalResponse)
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
  (Text
   -> Text -> Text -> PortalStatus -> Text -> CreatePortalResponse)
-> Either String Text
-> Either
     String
     (Text -> Text -> PortalStatus -> Text -> CreatePortalResponse)
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
"portalId")
            Either
  String
  (Text -> Text -> PortalStatus -> Text -> CreatePortalResponse)
-> Either String Text
-> Either
     String (Text -> PortalStatus -> Text -> CreatePortalResponse)
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
"portalArn")
            Either
  String (Text -> PortalStatus -> Text -> CreatePortalResponse)
-> Either String Text
-> Either String (PortalStatus -> Text -> CreatePortalResponse)
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
"portalStartUrl")
            Either String (PortalStatus -> Text -> CreatePortalResponse)
-> Either String PortalStatus
-> Either String (Text -> CreatePortalResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String PortalStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"portalStatus")
            Either String (Text -> CreatePortalResponse)
-> Either String Text -> Either String CreatePortalResponse
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
"ssoApplicationId")
      )

instance Prelude.Hashable CreatePortal

instance Prelude.NFData CreatePortal

instance Core.ToHeaders CreatePortal where
  toHeaders :: CreatePortal -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreatePortal -> 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.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreatePortal where
  toJSON :: CreatePortal -> Value
toJSON CreatePortal' {Maybe Text
Maybe (HashMap Text Text)
Maybe Alarms
Maybe AuthMode
Maybe ImageFile
Text
roleArn :: Text
portalContactEmail :: Text
portalName :: Text
tags :: Maybe (HashMap Text Text)
portalLogoImageFile :: Maybe ImageFile
alarms :: Maybe Alarms
notificationSenderEmail :: Maybe Text
portalDescription :: Maybe Text
clientToken :: Maybe Text
portalAuthMode :: Maybe AuthMode
$sel:roleArn:CreatePortal' :: CreatePortal -> Text
$sel:portalContactEmail:CreatePortal' :: CreatePortal -> Text
$sel:portalName:CreatePortal' :: CreatePortal -> Text
$sel:tags:CreatePortal' :: CreatePortal -> Maybe (HashMap Text Text)
$sel:portalLogoImageFile:CreatePortal' :: CreatePortal -> Maybe ImageFile
$sel:alarms:CreatePortal' :: CreatePortal -> Maybe Alarms
$sel:notificationSenderEmail:CreatePortal' :: CreatePortal -> Maybe Text
$sel:portalDescription:CreatePortal' :: CreatePortal -> Maybe Text
$sel:clientToken:CreatePortal' :: CreatePortal -> Maybe Text
$sel:portalAuthMode:CreatePortal' :: CreatePortal -> Maybe AuthMode
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"portalAuthMode" Text -> AuthMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AuthMode -> Pair) -> Maybe AuthMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AuthMode
portalAuthMode,
            (Text
"clientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            (Text
"portalDescription" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
portalDescription,
            (Text
"notificationSenderEmail" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
notificationSenderEmail,
            (Text
"alarms" Text -> Alarms -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Alarms -> Pair) -> Maybe Alarms -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Alarms
alarms,
            (Text
"portalLogoImageFile" Text -> ImageFile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ImageFile -> Pair) -> Maybe ImageFile -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ImageFile
portalLogoImageFile,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"portalName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
portalName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"portalContactEmail" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
portalContactEmail),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"roleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn)
          ]
      )

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

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

-- | /See:/ 'newCreatePortalResponse' smart constructor.
data CreatePortalResponse = CreatePortalResponse'
  { -- | The response's http status code.
    CreatePortalResponse -> Int
httpStatus :: Prelude.Int,
    -- | The ID of the created portal.
    CreatePortalResponse -> Text
portalId :: Prelude.Text,
    -- | The
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
    -- of the portal, which has the following format.
    --
    -- @arn:${Partition}:iotsitewise:${Region}:${Account}:portal\/${PortalId}@
    CreatePortalResponse -> Text
portalArn :: Prelude.Text,
    -- | The URL for the IoT SiteWise Monitor portal. You can use this URL to
    -- access portals that use Amazon Web Services SSO for authentication. For
    -- portals that use IAM for authentication, you must use the IoT SiteWise
    -- console to get a URL that you can use to access the portal.
    CreatePortalResponse -> Text
portalStartUrl :: Prelude.Text,
    -- | The status of the portal, which contains a state (@CREATING@ after
    -- successfully calling this operation) and any error message.
    CreatePortalResponse -> PortalStatus
portalStatus :: PortalStatus,
    -- | The associated Amazon Web Services SSO application ID, if the portal
    -- uses Amazon Web Services SSO.
    CreatePortalResponse -> Text
ssoApplicationId :: Prelude.Text
  }
  deriving (CreatePortalResponse -> CreatePortalResponse -> Bool
(CreatePortalResponse -> CreatePortalResponse -> Bool)
-> (CreatePortalResponse -> CreatePortalResponse -> Bool)
-> Eq CreatePortalResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePortalResponse -> CreatePortalResponse -> Bool
$c/= :: CreatePortalResponse -> CreatePortalResponse -> Bool
== :: CreatePortalResponse -> CreatePortalResponse -> Bool
$c== :: CreatePortalResponse -> CreatePortalResponse -> Bool
Prelude.Eq, ReadPrec [CreatePortalResponse]
ReadPrec CreatePortalResponse
Int -> ReadS CreatePortalResponse
ReadS [CreatePortalResponse]
(Int -> ReadS CreatePortalResponse)
-> ReadS [CreatePortalResponse]
-> ReadPrec CreatePortalResponse
-> ReadPrec [CreatePortalResponse]
-> Read CreatePortalResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreatePortalResponse]
$creadListPrec :: ReadPrec [CreatePortalResponse]
readPrec :: ReadPrec CreatePortalResponse
$creadPrec :: ReadPrec CreatePortalResponse
readList :: ReadS [CreatePortalResponse]
$creadList :: ReadS [CreatePortalResponse]
readsPrec :: Int -> ReadS CreatePortalResponse
$creadsPrec :: Int -> ReadS CreatePortalResponse
Prelude.Read, Int -> CreatePortalResponse -> ShowS
[CreatePortalResponse] -> ShowS
CreatePortalResponse -> String
(Int -> CreatePortalResponse -> ShowS)
-> (CreatePortalResponse -> String)
-> ([CreatePortalResponse] -> ShowS)
-> Show CreatePortalResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePortalResponse] -> ShowS
$cshowList :: [CreatePortalResponse] -> ShowS
show :: CreatePortalResponse -> String
$cshow :: CreatePortalResponse -> String
showsPrec :: Int -> CreatePortalResponse -> ShowS
$cshowsPrec :: Int -> CreatePortalResponse -> ShowS
Prelude.Show, (forall x. CreatePortalResponse -> Rep CreatePortalResponse x)
-> (forall x. Rep CreatePortalResponse x -> CreatePortalResponse)
-> Generic CreatePortalResponse
forall x. Rep CreatePortalResponse x -> CreatePortalResponse
forall x. CreatePortalResponse -> Rep CreatePortalResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreatePortalResponse x -> CreatePortalResponse
$cfrom :: forall x. CreatePortalResponse -> Rep CreatePortalResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreatePortalResponse' 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:
--
-- 'httpStatus', 'createPortalResponse_httpStatus' - The response's http status code.
--
-- 'portalId', 'createPortalResponse_portalId' - The ID of the created portal.
--
-- 'portalArn', 'createPortalResponse_portalArn' - The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of the portal, which has the following format.
--
-- @arn:${Partition}:iotsitewise:${Region}:${Account}:portal\/${PortalId}@
--
-- 'portalStartUrl', 'createPortalResponse_portalStartUrl' - The URL for the IoT SiteWise Monitor portal. You can use this URL to
-- access portals that use Amazon Web Services SSO for authentication. For
-- portals that use IAM for authentication, you must use the IoT SiteWise
-- console to get a URL that you can use to access the portal.
--
-- 'portalStatus', 'createPortalResponse_portalStatus' - The status of the portal, which contains a state (@CREATING@ after
-- successfully calling this operation) and any error message.
--
-- 'ssoApplicationId', 'createPortalResponse_ssoApplicationId' - The associated Amazon Web Services SSO application ID, if the portal
-- uses Amazon Web Services SSO.
newCreatePortalResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'portalId'
  Prelude.Text ->
  -- | 'portalArn'
  Prelude.Text ->
  -- | 'portalStartUrl'
  Prelude.Text ->
  -- | 'portalStatus'
  PortalStatus ->
  -- | 'ssoApplicationId'
  Prelude.Text ->
  CreatePortalResponse
newCreatePortalResponse :: Int
-> Text
-> Text
-> Text
-> PortalStatus
-> Text
-> CreatePortalResponse
newCreatePortalResponse
  Int
pHttpStatus_
  Text
pPortalId_
  Text
pPortalArn_
  Text
pPortalStartUrl_
  PortalStatus
pPortalStatus_
  Text
pSsoApplicationId_ =
    CreatePortalResponse' :: Int
-> Text
-> Text
-> Text
-> PortalStatus
-> Text
-> CreatePortalResponse
CreatePortalResponse'
      { $sel:httpStatus:CreatePortalResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:portalId:CreatePortalResponse' :: Text
portalId = Text
pPortalId_,
        $sel:portalArn:CreatePortalResponse' :: Text
portalArn = Text
pPortalArn_,
        $sel:portalStartUrl:CreatePortalResponse' :: Text
portalStartUrl = Text
pPortalStartUrl_,
        $sel:portalStatus:CreatePortalResponse' :: PortalStatus
portalStatus = PortalStatus
pPortalStatus_,
        $sel:ssoApplicationId:CreatePortalResponse' :: Text
ssoApplicationId = Text
pSsoApplicationId_
      }

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

-- | The ID of the created portal.
createPortalResponse_portalId :: Lens.Lens' CreatePortalResponse Prelude.Text
createPortalResponse_portalId :: (Text -> f Text) -> CreatePortalResponse -> f CreatePortalResponse
createPortalResponse_portalId = (CreatePortalResponse -> Text)
-> (CreatePortalResponse -> Text -> CreatePortalResponse)
-> Lens CreatePortalResponse CreatePortalResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePortalResponse' {Text
portalId :: Text
$sel:portalId:CreatePortalResponse' :: CreatePortalResponse -> Text
portalId} -> Text
portalId) (\s :: CreatePortalResponse
s@CreatePortalResponse' {} Text
a -> CreatePortalResponse
s {$sel:portalId:CreatePortalResponse' :: Text
portalId = Text
a} :: CreatePortalResponse)

-- | The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of the portal, which has the following format.
--
-- @arn:${Partition}:iotsitewise:${Region}:${Account}:portal\/${PortalId}@
createPortalResponse_portalArn :: Lens.Lens' CreatePortalResponse Prelude.Text
createPortalResponse_portalArn :: (Text -> f Text) -> CreatePortalResponse -> f CreatePortalResponse
createPortalResponse_portalArn = (CreatePortalResponse -> Text)
-> (CreatePortalResponse -> Text -> CreatePortalResponse)
-> Lens CreatePortalResponse CreatePortalResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePortalResponse' {Text
portalArn :: Text
$sel:portalArn:CreatePortalResponse' :: CreatePortalResponse -> Text
portalArn} -> Text
portalArn) (\s :: CreatePortalResponse
s@CreatePortalResponse' {} Text
a -> CreatePortalResponse
s {$sel:portalArn:CreatePortalResponse' :: Text
portalArn = Text
a} :: CreatePortalResponse)

-- | The URL for the IoT SiteWise Monitor portal. You can use this URL to
-- access portals that use Amazon Web Services SSO for authentication. For
-- portals that use IAM for authentication, you must use the IoT SiteWise
-- console to get a URL that you can use to access the portal.
createPortalResponse_portalStartUrl :: Lens.Lens' CreatePortalResponse Prelude.Text
createPortalResponse_portalStartUrl :: (Text -> f Text) -> CreatePortalResponse -> f CreatePortalResponse
createPortalResponse_portalStartUrl = (CreatePortalResponse -> Text)
-> (CreatePortalResponse -> Text -> CreatePortalResponse)
-> Lens CreatePortalResponse CreatePortalResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePortalResponse' {Text
portalStartUrl :: Text
$sel:portalStartUrl:CreatePortalResponse' :: CreatePortalResponse -> Text
portalStartUrl} -> Text
portalStartUrl) (\s :: CreatePortalResponse
s@CreatePortalResponse' {} Text
a -> CreatePortalResponse
s {$sel:portalStartUrl:CreatePortalResponse' :: Text
portalStartUrl = Text
a} :: CreatePortalResponse)

-- | The status of the portal, which contains a state (@CREATING@ after
-- successfully calling this operation) and any error message.
createPortalResponse_portalStatus :: Lens.Lens' CreatePortalResponse PortalStatus
createPortalResponse_portalStatus :: (PortalStatus -> f PortalStatus)
-> CreatePortalResponse -> f CreatePortalResponse
createPortalResponse_portalStatus = (CreatePortalResponse -> PortalStatus)
-> (CreatePortalResponse -> PortalStatus -> CreatePortalResponse)
-> Lens
     CreatePortalResponse CreatePortalResponse PortalStatus PortalStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePortalResponse' {PortalStatus
portalStatus :: PortalStatus
$sel:portalStatus:CreatePortalResponse' :: CreatePortalResponse -> PortalStatus
portalStatus} -> PortalStatus
portalStatus) (\s :: CreatePortalResponse
s@CreatePortalResponse' {} PortalStatus
a -> CreatePortalResponse
s {$sel:portalStatus:CreatePortalResponse' :: PortalStatus
portalStatus = PortalStatus
a} :: CreatePortalResponse)

-- | The associated Amazon Web Services SSO application ID, if the portal
-- uses Amazon Web Services SSO.
createPortalResponse_ssoApplicationId :: Lens.Lens' CreatePortalResponse Prelude.Text
createPortalResponse_ssoApplicationId :: (Text -> f Text) -> CreatePortalResponse -> f CreatePortalResponse
createPortalResponse_ssoApplicationId = (CreatePortalResponse -> Text)
-> (CreatePortalResponse -> Text -> CreatePortalResponse)
-> Lens CreatePortalResponse CreatePortalResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePortalResponse' {Text
ssoApplicationId :: Text
$sel:ssoApplicationId:CreatePortalResponse' :: CreatePortalResponse -> Text
ssoApplicationId} -> Text
ssoApplicationId) (\s :: CreatePortalResponse
s@CreatePortalResponse' {} Text
a -> CreatePortalResponse
s {$sel:ssoApplicationId:CreatePortalResponse' :: Text
ssoApplicationId = Text
a} :: CreatePortalResponse)

instance Prelude.NFData CreatePortalResponse