{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_alarms,
    updatePortal_clientToken,
    updatePortal_notificationSenderEmail,
    updatePortal_portalDescription,
    updatePortal_portalLogoImage,
    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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTSiteWise.Types
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'
  { -- | 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,
    -- | 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,
    -- | The email address that sends alarm notifications.
    UpdatePortal -> Maybe Text
notificationSenderEmail :: Prelude.Maybe Prelude.Text,
    -- | A new description for the portal.
    UpdatePortal -> Maybe Text
portalDescription :: Prelude.Maybe Prelude.Text,
    UpdatePortal -> Maybe Image
portalLogoImage :: Prelude.Maybe Image,
    -- | 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
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]
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
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. 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:
--
-- '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/.
--
-- '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.
--
-- 'notificationSenderEmail', 'updatePortal_notificationSenderEmail' - The email address that sends alarm notifications.
--
-- 'portalDescription', 'updatePortal_portalDescription' - A new description for the portal.
--
-- 'portalLogoImage', 'updatePortal_portalLogoImage' - Undocumented member.
--
-- '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'
      { $sel:alarms:UpdatePortal' :: Maybe Alarms
alarms = forall a. Maybe a
Prelude.Nothing,
        $sel:clientToken:UpdatePortal' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
        $sel:notificationSenderEmail:UpdatePortal' :: Maybe Text
notificationSenderEmail = forall a. Maybe a
Prelude.Nothing,
        $sel:portalDescription:UpdatePortal' :: Maybe Text
portalDescription = forall a. Maybe a
Prelude.Nothing,
        $sel:portalLogoImage:UpdatePortal' :: Maybe Image
portalLogoImage = 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_
      }

-- | 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 :: Lens' UpdatePortal (Maybe Alarms)
updatePortal_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)

-- | 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 :: Lens' UpdatePortal (Maybe Text)
updatePortal_clientToken = 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)

-- | The email address that sends alarm notifications.
updatePortal_notificationSenderEmail :: Lens.Lens' UpdatePortal (Prelude.Maybe Prelude.Text)
updatePortal_notificationSenderEmail :: Lens' UpdatePortal (Maybe Text)
updatePortal_notificationSenderEmail = 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)

-- | A new description for the portal.
updatePortal_portalDescription :: Lens.Lens' UpdatePortal (Prelude.Maybe Prelude.Text)
updatePortal_portalDescription :: Lens' UpdatePortal (Maybe Text)
updatePortal_portalDescription = 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)

-- | Undocumented member.
updatePortal_portalLogoImage :: Lens.Lens' UpdatePortal (Prelude.Maybe Image)
updatePortal_portalLogoImage :: Lens' UpdatePortal (Maybe Image)
updatePortal_portalLogoImage = 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)

-- | The ID of the portal to update.
updatePortal_portalId :: Lens.Lens' UpdatePortal Prelude.Text
updatePortal_portalId :: Lens' UpdatePortal Text
updatePortal_portalId = 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 :: Lens' UpdatePortal Text
updatePortal_portalName = 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 :: Lens' UpdatePortal Text
updatePortal_portalContactEmail = 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 :: Lens' UpdatePortal Text
updatePortal_roleArn = 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 :: (Service -> Service) -> UpdatePortal -> Request UpdatePortal
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdatePortal
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdatePortal)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> PortalStatus -> UpdatePortalResponse
UpdatePortalResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"portalStatus")
      )

instance Prelude.Hashable UpdatePortal where
  hashWithSalt :: Int -> UpdatePortal -> Int
hashWithSalt Int
_salt UpdatePortal' {Maybe Text
Maybe Alarms
Maybe Image
Text
roleArn :: Text
portalContactEmail :: Text
portalName :: Text
portalId :: Text
portalLogoImage :: Maybe Image
portalDescription :: Maybe Text
notificationSenderEmail :: Maybe Text
clientToken :: Maybe Text
alarms :: Maybe Alarms
$sel:roleArn:UpdatePortal' :: UpdatePortal -> Text
$sel:portalContactEmail:UpdatePortal' :: UpdatePortal -> Text
$sel:portalName:UpdatePortal' :: UpdatePortal -> Text
$sel:portalId:UpdatePortal' :: UpdatePortal -> Text
$sel:portalLogoImage:UpdatePortal' :: UpdatePortal -> Maybe Image
$sel:portalDescription:UpdatePortal' :: UpdatePortal -> Maybe Text
$sel:notificationSenderEmail:UpdatePortal' :: UpdatePortal -> Maybe Text
$sel:clientToken:UpdatePortal' :: UpdatePortal -> Maybe Text
$sel:alarms:UpdatePortal' :: UpdatePortal -> Maybe Alarms
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Alarms
alarms
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
notificationSenderEmail
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
portalDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Image
portalLogoImage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
portalId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
portalName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
portalContactEmail
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn

instance Prelude.NFData UpdatePortal where
  rnf :: UpdatePortal -> ()
rnf UpdatePortal' {Maybe Text
Maybe Alarms
Maybe Image
Text
roleArn :: Text
portalContactEmail :: Text
portalName :: Text
portalId :: Text
portalLogoImage :: Maybe Image
portalDescription :: Maybe Text
notificationSenderEmail :: Maybe Text
clientToken :: Maybe Text
alarms :: Maybe Alarms
$sel:roleArn:UpdatePortal' :: UpdatePortal -> Text
$sel:portalContactEmail:UpdatePortal' :: UpdatePortal -> Text
$sel:portalName:UpdatePortal' :: UpdatePortal -> Text
$sel:portalId:UpdatePortal' :: UpdatePortal -> Text
$sel:portalLogoImage:UpdatePortal' :: UpdatePortal -> Maybe Image
$sel:portalDescription:UpdatePortal' :: UpdatePortal -> Maybe Text
$sel:notificationSenderEmail:UpdatePortal' :: UpdatePortal -> Maybe Text
$sel:clientToken:UpdatePortal' :: UpdatePortal -> Maybe Text
$sel:alarms:UpdatePortal' :: UpdatePortal -> Maybe Alarms
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Alarms
alarms
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
notificationSenderEmail
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
portalDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Image
portalLogoImage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
portalId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
portalName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
portalContactEmail
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn

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

instance Data.ToJSON UpdatePortal where
  toJSON :: UpdatePortal -> Value
toJSON UpdatePortal' {Maybe Text
Maybe Alarms
Maybe Image
Text
roleArn :: Text
portalContactEmail :: Text
portalName :: Text
portalId :: Text
portalLogoImage :: Maybe Image
portalDescription :: Maybe Text
notificationSenderEmail :: Maybe Text
clientToken :: Maybe Text
alarms :: Maybe Alarms
$sel:roleArn:UpdatePortal' :: UpdatePortal -> Text
$sel:portalContactEmail:UpdatePortal' :: UpdatePortal -> Text
$sel:portalName:UpdatePortal' :: UpdatePortal -> Text
$sel:portalId:UpdatePortal' :: UpdatePortal -> Text
$sel:portalLogoImage:UpdatePortal' :: UpdatePortal -> Maybe Image
$sel:portalDescription:UpdatePortal' :: UpdatePortal -> Maybe Text
$sel:notificationSenderEmail:UpdatePortal' :: UpdatePortal -> Maybe Text
$sel:clientToken:UpdatePortal' :: UpdatePortal -> Maybe Text
$sel:alarms:UpdatePortal' :: UpdatePortal -> Maybe Alarms
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"alarms" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Alarms
alarms,
            (Key
"clientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            (Key
"notificationSenderEmail" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
notificationSenderEmail,
            (Key
"portalDescription" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
portalDescription,
            (Key
"portalLogoImage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Image
portalLogoImage,
            forall a. a -> Maybe a
Prelude.Just (Key
"portalName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
portalName),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"portalContactEmail" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
portalContactEmail),
            forall a. a -> Maybe a
Prelude.Just (Key
"roleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn)
          ]
      )

instance Data.ToPath UpdatePortal where
  toPath :: UpdatePortal -> ByteString
toPath UpdatePortal' {Maybe Text
Maybe Alarms
Maybe Image
Text
roleArn :: Text
portalContactEmail :: Text
portalName :: Text
portalId :: Text
portalLogoImage :: Maybe Image
portalDescription :: Maybe Text
notificationSenderEmail :: Maybe Text
clientToken :: Maybe Text
alarms :: Maybe Alarms
$sel:roleArn:UpdatePortal' :: UpdatePortal -> Text
$sel:portalContactEmail:UpdatePortal' :: UpdatePortal -> Text
$sel:portalName:UpdatePortal' :: UpdatePortal -> Text
$sel:portalId:UpdatePortal' :: UpdatePortal -> Text
$sel:portalLogoImage:UpdatePortal' :: UpdatePortal -> Maybe Image
$sel:portalDescription:UpdatePortal' :: UpdatePortal -> Maybe Text
$sel:notificationSenderEmail:UpdatePortal' :: UpdatePortal -> Maybe Text
$sel:clientToken:UpdatePortal' :: UpdatePortal -> Maybe Text
$sel:alarms:UpdatePortal' :: UpdatePortal -> Maybe Alarms
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/portals/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
portalId]

instance Data.ToQuery UpdatePortal where
  toQuery :: UpdatePortal -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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. 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'
    { $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 :: Lens' UpdatePortalResponse Int
updatePortalResponse_httpStatus = 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 :: Lens' UpdatePortalResponse PortalStatus
updatePortalResponse_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 where
  rnf :: UpdatePortalResponse -> ()
rnf UpdatePortalResponse' {Int
PortalStatus
portalStatus :: PortalStatus
httpStatus :: Int
$sel:portalStatus:UpdatePortalResponse' :: UpdatePortalResponse -> PortalStatus
$sel:httpStatus:UpdatePortalResponse' :: UpdatePortalResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf PortalStatus
portalStatus