{-# 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.UpdatePortal
-- 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)
--
-- Updates an IoT SiteWise Monitor portal.
module Amazonka.IoTSiteWise.UpdatePortal
  ( -- * Creating a Request
    UpdatePortal (..),
    newUpdatePortal,

    -- * Request Lenses
    updatePortal_clientToken,
    updatePortal_portalDescription,
    updatePortal_notificationSenderEmail,
    updatePortal_portalLogoImage,
    updatePortal_alarms,
    updatePortal_portalId,
    updatePortal_portalName,
    updatePortal_portalContactEmail,
    updatePortal_roleArn,

    -- * Destructuring the Response
    UpdatePortalResponse (..),
    newUpdatePortalResponse,

    -- * Response Lenses
    updatePortalResponse_httpStatus,
    updatePortalResponse_portalStatus,
  )
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:/ 'newUpdatePortal' smart constructor.
data UpdatePortal = UpdatePortal'
  { -- | 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.
    UpdatePortal -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | A new description for the portal.
    UpdatePortal -> Maybe Text
portalDescription :: Prelude.Maybe Prelude.Text,
    -- | The email address that sends alarm notifications.
    UpdatePortal -> Maybe Text
notificationSenderEmail :: Prelude.Maybe Prelude.Text,
    UpdatePortal -> Maybe Image
portalLogoImage :: Prelude.Maybe Image,
    -- | 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/.
    UpdatePortal -> Maybe Alarms
alarms :: Prelude.Maybe Alarms,
    -- | The ID of the portal to update.
    UpdatePortal -> Text
portalId :: Prelude.Text,
    -- | A new friendly name for the portal.
    UpdatePortal -> Text
portalName :: Prelude.Text,
    -- | The Amazon Web Services administrator\'s contact email address.
    UpdatePortal -> 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/.
    UpdatePortal -> Text
roleArn :: Prelude.Text
  }
  deriving (UpdatePortal -> UpdatePortal -> Bool
(UpdatePortal -> UpdatePortal -> Bool)
-> (UpdatePortal -> UpdatePortal -> Bool) -> Eq UpdatePortal
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdatePortal -> UpdatePortal -> Bool
$c/= :: UpdatePortal -> UpdatePortal -> Bool
== :: UpdatePortal -> UpdatePortal -> Bool
$c== :: UpdatePortal -> UpdatePortal -> Bool
Prelude.Eq, ReadPrec [UpdatePortal]
ReadPrec UpdatePortal
Int -> ReadS UpdatePortal
ReadS [UpdatePortal]
(Int -> ReadS UpdatePortal)
-> ReadS [UpdatePortal]
-> ReadPrec UpdatePortal
-> ReadPrec [UpdatePortal]
-> Read UpdatePortal
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdatePortal]
$creadListPrec :: ReadPrec [UpdatePortal]
readPrec :: ReadPrec UpdatePortal
$creadPrec :: ReadPrec UpdatePortal
readList :: ReadS [UpdatePortal]
$creadList :: ReadS [UpdatePortal]
readsPrec :: Int -> ReadS UpdatePortal
$creadsPrec :: Int -> ReadS UpdatePortal
Prelude.Read, Int -> UpdatePortal -> ShowS
[UpdatePortal] -> ShowS
UpdatePortal -> String
(Int -> UpdatePortal -> ShowS)
-> (UpdatePortal -> String)
-> ([UpdatePortal] -> ShowS)
-> Show UpdatePortal
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatePortal] -> ShowS
$cshowList :: [UpdatePortal] -> ShowS
show :: UpdatePortal -> String
$cshow :: UpdatePortal -> String
showsPrec :: Int -> UpdatePortal -> ShowS
$cshowsPrec :: Int -> UpdatePortal -> ShowS
Prelude.Show, (forall x. UpdatePortal -> Rep UpdatePortal x)
-> (forall x. Rep UpdatePortal x -> UpdatePortal)
-> Generic UpdatePortal
forall x. Rep UpdatePortal x -> UpdatePortal
forall x. UpdatePortal -> Rep UpdatePortal x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdatePortal x -> UpdatePortal
$cfrom :: forall x. UpdatePortal -> Rep UpdatePortal x
Prelude.Generic)

-- |
-- Create a value of 'UpdatePortal' 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:
--
-- 'clientToken', 'updatePortal_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', 'updatePortal_portalDescription' - A new description for the portal.
--
-- 'notificationSenderEmail', 'updatePortal_notificationSenderEmail' - The email address that sends alarm notifications.
--
-- 'portalLogoImage', 'updatePortal_portalLogoImage' - Undocumented member.
--
-- 'alarms', 'updatePortal_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/.
--
-- 'portalId', 'updatePortal_portalId' - The ID of the portal to update.
--
-- 'portalName', 'updatePortal_portalName' - A new friendly name for the portal.
--
-- 'portalContactEmail', 'updatePortal_portalContactEmail' - The Amazon Web Services administrator\'s contact email address.
--
-- 'roleArn', 'updatePortal_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/.
newUpdatePortal ::
  -- | 'portalId'
  Prelude.Text ->
  -- | 'portalName'
  Prelude.Text ->
  -- | 'portalContactEmail'
  Prelude.Text ->
  -- | 'roleArn'
  Prelude.Text ->
  UpdatePortal
newUpdatePortal :: Text -> Text -> Text -> Text -> UpdatePortal
newUpdatePortal
  Text
pPortalId_
  Text
pPortalName_
  Text
pPortalContactEmail_
  Text
pRoleArn_ =
    UpdatePortal' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Image
-> Maybe Alarms
-> Text
-> Text
-> Text
-> Text
-> UpdatePortal
UpdatePortal'
      { $sel:clientToken:UpdatePortal' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:portalDescription:UpdatePortal' :: Maybe Text
portalDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:notificationSenderEmail:UpdatePortal' :: Maybe Text
notificationSenderEmail = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:portalLogoImage:UpdatePortal' :: Maybe Image
portalLogoImage = Maybe Image
forall a. Maybe a
Prelude.Nothing,
        $sel:alarms:UpdatePortal' :: Maybe Alarms
alarms = Maybe Alarms
forall a. Maybe a
Prelude.Nothing,
        $sel:portalId:UpdatePortal' :: Text
portalId = Text
pPortalId_,
        $sel:portalName:UpdatePortal' :: Text
portalName = Text
pPortalName_,
        $sel:portalContactEmail:UpdatePortal' :: Text
portalContactEmail = Text
pPortalContactEmail_,
        $sel:roleArn:UpdatePortal' :: Text
roleArn = Text
pRoleArn_
      }

-- | 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.
updatePortal_clientToken :: Lens.Lens' UpdatePortal (Prelude.Maybe Prelude.Text)
updatePortal_clientToken :: (Maybe Text -> f (Maybe Text)) -> UpdatePortal -> f UpdatePortal
updatePortal_clientToken = (UpdatePortal -> Maybe Text)
-> (UpdatePortal -> Maybe Text -> UpdatePortal)
-> Lens UpdatePortal UpdatePortal (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePortal' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:UpdatePortal' :: UpdatePortal -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: UpdatePortal
s@UpdatePortal' {} Maybe Text
a -> UpdatePortal
s {$sel:clientToken:UpdatePortal' :: Maybe Text
clientToken = Maybe Text
a} :: UpdatePortal)

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

-- | The email address that sends alarm notifications.
updatePortal_notificationSenderEmail :: Lens.Lens' UpdatePortal (Prelude.Maybe Prelude.Text)
updatePortal_notificationSenderEmail :: (Maybe Text -> f (Maybe Text)) -> UpdatePortal -> f UpdatePortal
updatePortal_notificationSenderEmail = (UpdatePortal -> Maybe Text)
-> (UpdatePortal -> Maybe Text -> UpdatePortal)
-> Lens UpdatePortal UpdatePortal (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePortal' {Maybe Text
notificationSenderEmail :: Maybe Text
$sel:notificationSenderEmail:UpdatePortal' :: UpdatePortal -> Maybe Text
notificationSenderEmail} -> Maybe Text
notificationSenderEmail) (\s :: UpdatePortal
s@UpdatePortal' {} Maybe Text
a -> UpdatePortal
s {$sel:notificationSenderEmail:UpdatePortal' :: Maybe Text
notificationSenderEmail = Maybe Text
a} :: UpdatePortal)

-- | Undocumented member.
updatePortal_portalLogoImage :: Lens.Lens' UpdatePortal (Prelude.Maybe Image)
updatePortal_portalLogoImage :: (Maybe Image -> f (Maybe Image)) -> UpdatePortal -> f UpdatePortal
updatePortal_portalLogoImage = (UpdatePortal -> Maybe Image)
-> (UpdatePortal -> Maybe Image -> UpdatePortal)
-> Lens UpdatePortal UpdatePortal (Maybe Image) (Maybe Image)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePortal' {Maybe Image
portalLogoImage :: Maybe Image
$sel:portalLogoImage:UpdatePortal' :: UpdatePortal -> Maybe Image
portalLogoImage} -> Maybe Image
portalLogoImage) (\s :: UpdatePortal
s@UpdatePortal' {} Maybe Image
a -> UpdatePortal
s {$sel:portalLogoImage:UpdatePortal' :: Maybe Image
portalLogoImage = Maybe Image
a} :: UpdatePortal)

-- | 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/.
updatePortal_alarms :: Lens.Lens' UpdatePortal (Prelude.Maybe Alarms)
updatePortal_alarms :: (Maybe Alarms -> f (Maybe Alarms))
-> UpdatePortal -> f UpdatePortal
updatePortal_alarms = (UpdatePortal -> Maybe Alarms)
-> (UpdatePortal -> Maybe Alarms -> UpdatePortal)
-> Lens UpdatePortal UpdatePortal (Maybe Alarms) (Maybe Alarms)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePortal' {Maybe Alarms
alarms :: Maybe Alarms
$sel:alarms:UpdatePortal' :: UpdatePortal -> Maybe Alarms
alarms} -> Maybe Alarms
alarms) (\s :: UpdatePortal
s@UpdatePortal' {} Maybe Alarms
a -> UpdatePortal
s {$sel:alarms:UpdatePortal' :: Maybe Alarms
alarms = Maybe Alarms
a} :: UpdatePortal)

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

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

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

-- | 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/.
updatePortal_roleArn :: Lens.Lens' UpdatePortal Prelude.Text
updatePortal_roleArn :: (Text -> f Text) -> UpdatePortal -> f UpdatePortal
updatePortal_roleArn = (UpdatePortal -> Text)
-> (UpdatePortal -> Text -> UpdatePortal)
-> Lens UpdatePortal UpdatePortal Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePortal' {Text
roleArn :: Text
$sel:roleArn:UpdatePortal' :: UpdatePortal -> Text
roleArn} -> Text
roleArn) (\s :: UpdatePortal
s@UpdatePortal' {} Text
a -> UpdatePortal
s {$sel:roleArn:UpdatePortal' :: Text
roleArn = Text
a} :: UpdatePortal)

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

instance Prelude.Hashable UpdatePortal

instance Prelude.NFData UpdatePortal

instance Core.ToHeaders UpdatePortal where
  toHeaders :: UpdatePortal -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdatePortal -> 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 UpdatePortal where
  toJSON :: UpdatePortal -> Value
toJSON UpdatePortal' {Maybe Text
Maybe Alarms
Maybe Image
Text
roleArn :: Text
portalContactEmail :: Text
portalName :: Text
portalId :: Text
alarms :: Maybe Alarms
portalLogoImage :: Maybe Image
notificationSenderEmail :: Maybe Text
portalDescription :: Maybe Text
clientToken :: Maybe Text
$sel:roleArn:UpdatePortal' :: UpdatePortal -> Text
$sel:portalContactEmail:UpdatePortal' :: UpdatePortal -> Text
$sel:portalName:UpdatePortal' :: UpdatePortal -> Text
$sel:portalId:UpdatePortal' :: UpdatePortal -> Text
$sel:alarms:UpdatePortal' :: UpdatePortal -> Maybe Alarms
$sel:portalLogoImage:UpdatePortal' :: UpdatePortal -> Maybe Image
$sel:notificationSenderEmail:UpdatePortal' :: UpdatePortal -> Maybe Text
$sel:portalDescription:UpdatePortal' :: UpdatePortal -> Maybe Text
$sel:clientToken:UpdatePortal' :: UpdatePortal -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"portalLogoImage" Text -> Image -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Image -> Pair) -> Maybe Image -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Image
portalLogoImage,
            (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,
            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 UpdatePortal where
  toPath :: UpdatePortal -> ByteString
toPath UpdatePortal' {Maybe Text
Maybe Alarms
Maybe Image
Text
roleArn :: Text
portalContactEmail :: Text
portalName :: Text
portalId :: Text
alarms :: Maybe Alarms
portalLogoImage :: Maybe Image
notificationSenderEmail :: Maybe Text
portalDescription :: Maybe Text
clientToken :: Maybe Text
$sel:roleArn:UpdatePortal' :: UpdatePortal -> Text
$sel:portalContactEmail:UpdatePortal' :: UpdatePortal -> Text
$sel:portalName:UpdatePortal' :: UpdatePortal -> Text
$sel:portalId:UpdatePortal' :: UpdatePortal -> Text
$sel:alarms:UpdatePortal' :: UpdatePortal -> Maybe Alarms
$sel:portalLogoImage:UpdatePortal' :: UpdatePortal -> Maybe Image
$sel:notificationSenderEmail:UpdatePortal' :: UpdatePortal -> Maybe Text
$sel:portalDescription:UpdatePortal' :: UpdatePortal -> Maybe Text
$sel:clientToken:UpdatePortal' :: UpdatePortal -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/portals/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
portalId]

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

-- | /See:/ 'newUpdatePortalResponse' smart constructor.
data UpdatePortalResponse = UpdatePortalResponse'
  { -- | The response's http status code.
    UpdatePortalResponse -> Int
httpStatus :: Prelude.Int,
    -- | The status of the portal, which contains a state (@UPDATING@ after
    -- successfully calling this operation) and any error message.
    UpdatePortalResponse -> PortalStatus
portalStatus :: PortalStatus
  }
  deriving (UpdatePortalResponse -> UpdatePortalResponse -> Bool
(UpdatePortalResponse -> UpdatePortalResponse -> Bool)
-> (UpdatePortalResponse -> UpdatePortalResponse -> Bool)
-> Eq UpdatePortalResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdatePortalResponse -> UpdatePortalResponse -> Bool
$c/= :: UpdatePortalResponse -> UpdatePortalResponse -> Bool
== :: UpdatePortalResponse -> UpdatePortalResponse -> Bool
$c== :: UpdatePortalResponse -> UpdatePortalResponse -> Bool
Prelude.Eq, ReadPrec [UpdatePortalResponse]
ReadPrec UpdatePortalResponse
Int -> ReadS UpdatePortalResponse
ReadS [UpdatePortalResponse]
(Int -> ReadS UpdatePortalResponse)
-> ReadS [UpdatePortalResponse]
-> ReadPrec UpdatePortalResponse
-> ReadPrec [UpdatePortalResponse]
-> Read UpdatePortalResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdatePortalResponse]
$creadListPrec :: ReadPrec [UpdatePortalResponse]
readPrec :: ReadPrec UpdatePortalResponse
$creadPrec :: ReadPrec UpdatePortalResponse
readList :: ReadS [UpdatePortalResponse]
$creadList :: ReadS [UpdatePortalResponse]
readsPrec :: Int -> ReadS UpdatePortalResponse
$creadsPrec :: Int -> ReadS UpdatePortalResponse
Prelude.Read, Int -> UpdatePortalResponse -> ShowS
[UpdatePortalResponse] -> ShowS
UpdatePortalResponse -> String
(Int -> UpdatePortalResponse -> ShowS)
-> (UpdatePortalResponse -> String)
-> ([UpdatePortalResponse] -> ShowS)
-> Show UpdatePortalResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatePortalResponse] -> ShowS
$cshowList :: [UpdatePortalResponse] -> ShowS
show :: UpdatePortalResponse -> String
$cshow :: UpdatePortalResponse -> String
showsPrec :: Int -> UpdatePortalResponse -> ShowS
$cshowsPrec :: Int -> UpdatePortalResponse -> ShowS
Prelude.Show, (forall x. UpdatePortalResponse -> Rep UpdatePortalResponse x)
-> (forall x. Rep UpdatePortalResponse x -> UpdatePortalResponse)
-> Generic UpdatePortalResponse
forall x. Rep UpdatePortalResponse x -> UpdatePortalResponse
forall x. UpdatePortalResponse -> Rep UpdatePortalResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdatePortalResponse x -> UpdatePortalResponse
$cfrom :: forall x. UpdatePortalResponse -> Rep UpdatePortalResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdatePortalResponse' 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', 'updatePortalResponse_httpStatus' - The response's http status code.
--
-- 'portalStatus', 'updatePortalResponse_portalStatus' - The status of the portal, which contains a state (@UPDATING@ after
-- successfully calling this operation) and any error message.
newUpdatePortalResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'portalStatus'
  PortalStatus ->
  UpdatePortalResponse
newUpdatePortalResponse :: Int -> PortalStatus -> UpdatePortalResponse
newUpdatePortalResponse Int
pHttpStatus_ PortalStatus
pPortalStatus_ =
  UpdatePortalResponse' :: Int -> PortalStatus -> UpdatePortalResponse
UpdatePortalResponse'
    { $sel:httpStatus:UpdatePortalResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:portalStatus:UpdatePortalResponse' :: PortalStatus
portalStatus = PortalStatus
pPortalStatus_
    }

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

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

instance Prelude.NFData UpdatePortalResponse