{-# 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.AppStream.UpdateStack
-- 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 the specified fields for the specified stack.
module Amazonka.AppStream.UpdateStack
  ( -- * Creating a Request
    UpdateStack (..),
    newUpdateStack,

    -- * Request Lenses
    updateStack_accessEndpoints,
    updateStack_applicationSettings,
    updateStack_attributesToDelete,
    updateStack_deleteStorageConnectors,
    updateStack_description,
    updateStack_displayName,
    updateStack_embedHostDomains,
    updateStack_feedbackURL,
    updateStack_redirectURL,
    updateStack_storageConnectors,
    updateStack_streamingExperienceSettings,
    updateStack_userSettings,
    updateStack_name,

    -- * Destructuring the Response
    UpdateStackResponse (..),
    newUpdateStackResponse,

    -- * Response Lenses
    updateStackResponse_stack,
    updateStackResponse_httpStatus,
  )
where

import Amazonka.AppStream.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateStack' smart constructor.
data UpdateStack = UpdateStack'
  { -- | The list of interface VPC endpoint (interface endpoint) objects. Users
    -- of the stack can connect to AppStream 2.0 only through the specified
    -- endpoints.
    UpdateStack -> Maybe (NonEmpty AccessEndpoint)
accessEndpoints :: Prelude.Maybe (Prelude.NonEmpty AccessEndpoint),
    -- | The persistent application settings for users of a stack. When these
    -- settings are enabled, changes that users make to applications and
    -- Windows settings are automatically saved after each session and applied
    -- to the next session.
    UpdateStack -> Maybe ApplicationSettings
applicationSettings :: Prelude.Maybe ApplicationSettings,
    -- | The stack attributes to delete.
    UpdateStack -> Maybe [StackAttribute]
attributesToDelete :: Prelude.Maybe [StackAttribute],
    -- | Deletes the storage connectors currently enabled for the stack.
    UpdateStack -> Maybe Bool
deleteStorageConnectors :: Prelude.Maybe Prelude.Bool,
    -- | The description to display.
    UpdateStack -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The stack name to display.
    UpdateStack -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
    -- | The domains where AppStream 2.0 streaming sessions can be embedded in an
    -- iframe. You must approve the domains that you want to host embedded
    -- AppStream 2.0 streaming sessions.
    UpdateStack -> Maybe (NonEmpty Text)
embedHostDomains :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The URL that users are redirected to after they choose the Send Feedback
    -- link. If no URL is specified, no Send Feedback link is displayed.
    UpdateStack -> Maybe Text
feedbackURL :: Prelude.Maybe Prelude.Text,
    -- | The URL that users are redirected to after their streaming session ends.
    UpdateStack -> Maybe Text
redirectURL :: Prelude.Maybe Prelude.Text,
    -- | The storage connectors to enable.
    UpdateStack -> Maybe [StorageConnector]
storageConnectors :: Prelude.Maybe [StorageConnector],
    -- | The streaming protocol you want your stack to prefer. This can be UDP or
    -- TCP. Currently, UDP is only supported in the Windows native client.
    UpdateStack -> Maybe StreamingExperienceSettings
streamingExperienceSettings :: Prelude.Maybe StreamingExperienceSettings,
    -- | The actions that are enabled or disabled for users during their
    -- streaming sessions. By default, these actions are enabled.
    UpdateStack -> Maybe (NonEmpty UserSetting)
userSettings :: Prelude.Maybe (Prelude.NonEmpty UserSetting),
    -- | The name of the stack.
    UpdateStack -> Text
name :: Prelude.Text
  }
  deriving (UpdateStack -> UpdateStack -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateStack -> UpdateStack -> Bool
$c/= :: UpdateStack -> UpdateStack -> Bool
== :: UpdateStack -> UpdateStack -> Bool
$c== :: UpdateStack -> UpdateStack -> Bool
Prelude.Eq, ReadPrec [UpdateStack]
ReadPrec UpdateStack
Int -> ReadS UpdateStack
ReadS [UpdateStack]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateStack]
$creadListPrec :: ReadPrec [UpdateStack]
readPrec :: ReadPrec UpdateStack
$creadPrec :: ReadPrec UpdateStack
readList :: ReadS [UpdateStack]
$creadList :: ReadS [UpdateStack]
readsPrec :: Int -> ReadS UpdateStack
$creadsPrec :: Int -> ReadS UpdateStack
Prelude.Read, Int -> UpdateStack -> ShowS
[UpdateStack] -> ShowS
UpdateStack -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateStack] -> ShowS
$cshowList :: [UpdateStack] -> ShowS
show :: UpdateStack -> String
$cshow :: UpdateStack -> String
showsPrec :: Int -> UpdateStack -> ShowS
$cshowsPrec :: Int -> UpdateStack -> ShowS
Prelude.Show, forall x. Rep UpdateStack x -> UpdateStack
forall x. UpdateStack -> Rep UpdateStack x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateStack x -> UpdateStack
$cfrom :: forall x. UpdateStack -> Rep UpdateStack x
Prelude.Generic)

-- |
-- Create a value of 'UpdateStack' 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:
--
-- 'accessEndpoints', 'updateStack_accessEndpoints' - The list of interface VPC endpoint (interface endpoint) objects. Users
-- of the stack can connect to AppStream 2.0 only through the specified
-- endpoints.
--
-- 'applicationSettings', 'updateStack_applicationSettings' - The persistent application settings for users of a stack. When these
-- settings are enabled, changes that users make to applications and
-- Windows settings are automatically saved after each session and applied
-- to the next session.
--
-- 'attributesToDelete', 'updateStack_attributesToDelete' - The stack attributes to delete.
--
-- 'deleteStorageConnectors', 'updateStack_deleteStorageConnectors' - Deletes the storage connectors currently enabled for the stack.
--
-- 'description', 'updateStack_description' - The description to display.
--
-- 'displayName', 'updateStack_displayName' - The stack name to display.
--
-- 'embedHostDomains', 'updateStack_embedHostDomains' - The domains where AppStream 2.0 streaming sessions can be embedded in an
-- iframe. You must approve the domains that you want to host embedded
-- AppStream 2.0 streaming sessions.
--
-- 'feedbackURL', 'updateStack_feedbackURL' - The URL that users are redirected to after they choose the Send Feedback
-- link. If no URL is specified, no Send Feedback link is displayed.
--
-- 'redirectURL', 'updateStack_redirectURL' - The URL that users are redirected to after their streaming session ends.
--
-- 'storageConnectors', 'updateStack_storageConnectors' - The storage connectors to enable.
--
-- 'streamingExperienceSettings', 'updateStack_streamingExperienceSettings' - The streaming protocol you want your stack to prefer. This can be UDP or
-- TCP. Currently, UDP is only supported in the Windows native client.
--
-- 'userSettings', 'updateStack_userSettings' - The actions that are enabled or disabled for users during their
-- streaming sessions. By default, these actions are enabled.
--
-- 'name', 'updateStack_name' - The name of the stack.
newUpdateStack ::
  -- | 'name'
  Prelude.Text ->
  UpdateStack
newUpdateStack :: Text -> UpdateStack
newUpdateStack Text
pName_ =
  UpdateStack'
    { $sel:accessEndpoints:UpdateStack' :: Maybe (NonEmpty AccessEndpoint)
accessEndpoints = forall a. Maybe a
Prelude.Nothing,
      $sel:applicationSettings:UpdateStack' :: Maybe ApplicationSettings
applicationSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:attributesToDelete:UpdateStack' :: Maybe [StackAttribute]
attributesToDelete = forall a. Maybe a
Prelude.Nothing,
      $sel:deleteStorageConnectors:UpdateStack' :: Maybe Bool
deleteStorageConnectors = forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateStack' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:UpdateStack' :: Maybe Text
displayName = forall a. Maybe a
Prelude.Nothing,
      $sel:embedHostDomains:UpdateStack' :: Maybe (NonEmpty Text)
embedHostDomains = forall a. Maybe a
Prelude.Nothing,
      $sel:feedbackURL:UpdateStack' :: Maybe Text
feedbackURL = forall a. Maybe a
Prelude.Nothing,
      $sel:redirectURL:UpdateStack' :: Maybe Text
redirectURL = forall a. Maybe a
Prelude.Nothing,
      $sel:storageConnectors:UpdateStack' :: Maybe [StorageConnector]
storageConnectors = forall a. Maybe a
Prelude.Nothing,
      $sel:streamingExperienceSettings:UpdateStack' :: Maybe StreamingExperienceSettings
streamingExperienceSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:userSettings:UpdateStack' :: Maybe (NonEmpty UserSetting)
userSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateStack' :: Text
name = Text
pName_
    }

-- | The list of interface VPC endpoint (interface endpoint) objects. Users
-- of the stack can connect to AppStream 2.0 only through the specified
-- endpoints.
updateStack_accessEndpoints :: Lens.Lens' UpdateStack (Prelude.Maybe (Prelude.NonEmpty AccessEndpoint))
updateStack_accessEndpoints :: Lens' UpdateStack (Maybe (NonEmpty AccessEndpoint))
updateStack_accessEndpoints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe (NonEmpty AccessEndpoint)
accessEndpoints :: Maybe (NonEmpty AccessEndpoint)
$sel:accessEndpoints:UpdateStack' :: UpdateStack -> Maybe (NonEmpty AccessEndpoint)
accessEndpoints} -> Maybe (NonEmpty AccessEndpoint)
accessEndpoints) (\s :: UpdateStack
s@UpdateStack' {} Maybe (NonEmpty AccessEndpoint)
a -> UpdateStack
s {$sel:accessEndpoints:UpdateStack' :: Maybe (NonEmpty AccessEndpoint)
accessEndpoints = Maybe (NonEmpty AccessEndpoint)
a} :: UpdateStack) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The persistent application settings for users of a stack. When these
-- settings are enabled, changes that users make to applications and
-- Windows settings are automatically saved after each session and applied
-- to the next session.
updateStack_applicationSettings :: Lens.Lens' UpdateStack (Prelude.Maybe ApplicationSettings)
updateStack_applicationSettings :: Lens' UpdateStack (Maybe ApplicationSettings)
updateStack_applicationSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe ApplicationSettings
applicationSettings :: Maybe ApplicationSettings
$sel:applicationSettings:UpdateStack' :: UpdateStack -> Maybe ApplicationSettings
applicationSettings} -> Maybe ApplicationSettings
applicationSettings) (\s :: UpdateStack
s@UpdateStack' {} Maybe ApplicationSettings
a -> UpdateStack
s {$sel:applicationSettings:UpdateStack' :: Maybe ApplicationSettings
applicationSettings = Maybe ApplicationSettings
a} :: UpdateStack)

-- | The stack attributes to delete.
updateStack_attributesToDelete :: Lens.Lens' UpdateStack (Prelude.Maybe [StackAttribute])
updateStack_attributesToDelete :: Lens' UpdateStack (Maybe [StackAttribute])
updateStack_attributesToDelete = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe [StackAttribute]
attributesToDelete :: Maybe [StackAttribute]
$sel:attributesToDelete:UpdateStack' :: UpdateStack -> Maybe [StackAttribute]
attributesToDelete} -> Maybe [StackAttribute]
attributesToDelete) (\s :: UpdateStack
s@UpdateStack' {} Maybe [StackAttribute]
a -> UpdateStack
s {$sel:attributesToDelete:UpdateStack' :: Maybe [StackAttribute]
attributesToDelete = Maybe [StackAttribute]
a} :: UpdateStack) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Deletes the storage connectors currently enabled for the stack.
updateStack_deleteStorageConnectors :: Lens.Lens' UpdateStack (Prelude.Maybe Prelude.Bool)
updateStack_deleteStorageConnectors :: Lens' UpdateStack (Maybe Bool)
updateStack_deleteStorageConnectors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Bool
deleteStorageConnectors :: Maybe Bool
$sel:deleteStorageConnectors:UpdateStack' :: UpdateStack -> Maybe Bool
deleteStorageConnectors} -> Maybe Bool
deleteStorageConnectors) (\s :: UpdateStack
s@UpdateStack' {} Maybe Bool
a -> UpdateStack
s {$sel:deleteStorageConnectors:UpdateStack' :: Maybe Bool
deleteStorageConnectors = Maybe Bool
a} :: UpdateStack)

-- | The description to display.
updateStack_description :: Lens.Lens' UpdateStack (Prelude.Maybe Prelude.Text)
updateStack_description :: Lens' UpdateStack (Maybe Text)
updateStack_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Text
description :: Maybe Text
$sel:description:UpdateStack' :: UpdateStack -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateStack
s@UpdateStack' {} Maybe Text
a -> UpdateStack
s {$sel:description:UpdateStack' :: Maybe Text
description = Maybe Text
a} :: UpdateStack)

-- | The stack name to display.
updateStack_displayName :: Lens.Lens' UpdateStack (Prelude.Maybe Prelude.Text)
updateStack_displayName :: Lens' UpdateStack (Maybe Text)
updateStack_displayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Text
displayName :: Maybe Text
$sel:displayName:UpdateStack' :: UpdateStack -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: UpdateStack
s@UpdateStack' {} Maybe Text
a -> UpdateStack
s {$sel:displayName:UpdateStack' :: Maybe Text
displayName = Maybe Text
a} :: UpdateStack)

-- | The domains where AppStream 2.0 streaming sessions can be embedded in an
-- iframe. You must approve the domains that you want to host embedded
-- AppStream 2.0 streaming sessions.
updateStack_embedHostDomains :: Lens.Lens' UpdateStack (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
updateStack_embedHostDomains :: Lens' UpdateStack (Maybe (NonEmpty Text))
updateStack_embedHostDomains = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe (NonEmpty Text)
embedHostDomains :: Maybe (NonEmpty Text)
$sel:embedHostDomains:UpdateStack' :: UpdateStack -> Maybe (NonEmpty Text)
embedHostDomains} -> Maybe (NonEmpty Text)
embedHostDomains) (\s :: UpdateStack
s@UpdateStack' {} Maybe (NonEmpty Text)
a -> UpdateStack
s {$sel:embedHostDomains:UpdateStack' :: Maybe (NonEmpty Text)
embedHostDomains = Maybe (NonEmpty Text)
a} :: UpdateStack) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The URL that users are redirected to after they choose the Send Feedback
-- link. If no URL is specified, no Send Feedback link is displayed.
updateStack_feedbackURL :: Lens.Lens' UpdateStack (Prelude.Maybe Prelude.Text)
updateStack_feedbackURL :: Lens' UpdateStack (Maybe Text)
updateStack_feedbackURL = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Text
feedbackURL :: Maybe Text
$sel:feedbackURL:UpdateStack' :: UpdateStack -> Maybe Text
feedbackURL} -> Maybe Text
feedbackURL) (\s :: UpdateStack
s@UpdateStack' {} Maybe Text
a -> UpdateStack
s {$sel:feedbackURL:UpdateStack' :: Maybe Text
feedbackURL = Maybe Text
a} :: UpdateStack)

-- | The URL that users are redirected to after their streaming session ends.
updateStack_redirectURL :: Lens.Lens' UpdateStack (Prelude.Maybe Prelude.Text)
updateStack_redirectURL :: Lens' UpdateStack (Maybe Text)
updateStack_redirectURL = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe Text
redirectURL :: Maybe Text
$sel:redirectURL:UpdateStack' :: UpdateStack -> Maybe Text
redirectURL} -> Maybe Text
redirectURL) (\s :: UpdateStack
s@UpdateStack' {} Maybe Text
a -> UpdateStack
s {$sel:redirectURL:UpdateStack' :: Maybe Text
redirectURL = Maybe Text
a} :: UpdateStack)

-- | The storage connectors to enable.
updateStack_storageConnectors :: Lens.Lens' UpdateStack (Prelude.Maybe [StorageConnector])
updateStack_storageConnectors :: Lens' UpdateStack (Maybe [StorageConnector])
updateStack_storageConnectors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe [StorageConnector]
storageConnectors :: Maybe [StorageConnector]
$sel:storageConnectors:UpdateStack' :: UpdateStack -> Maybe [StorageConnector]
storageConnectors} -> Maybe [StorageConnector]
storageConnectors) (\s :: UpdateStack
s@UpdateStack' {} Maybe [StorageConnector]
a -> UpdateStack
s {$sel:storageConnectors:UpdateStack' :: Maybe [StorageConnector]
storageConnectors = Maybe [StorageConnector]
a} :: UpdateStack) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The streaming protocol you want your stack to prefer. This can be UDP or
-- TCP. Currently, UDP is only supported in the Windows native client.
updateStack_streamingExperienceSettings :: Lens.Lens' UpdateStack (Prelude.Maybe StreamingExperienceSettings)
updateStack_streamingExperienceSettings :: Lens' UpdateStack (Maybe StreamingExperienceSettings)
updateStack_streamingExperienceSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe StreamingExperienceSettings
streamingExperienceSettings :: Maybe StreamingExperienceSettings
$sel:streamingExperienceSettings:UpdateStack' :: UpdateStack -> Maybe StreamingExperienceSettings
streamingExperienceSettings} -> Maybe StreamingExperienceSettings
streamingExperienceSettings) (\s :: UpdateStack
s@UpdateStack' {} Maybe StreamingExperienceSettings
a -> UpdateStack
s {$sel:streamingExperienceSettings:UpdateStack' :: Maybe StreamingExperienceSettings
streamingExperienceSettings = Maybe StreamingExperienceSettings
a} :: UpdateStack)

-- | The actions that are enabled or disabled for users during their
-- streaming sessions. By default, these actions are enabled.
updateStack_userSettings :: Lens.Lens' UpdateStack (Prelude.Maybe (Prelude.NonEmpty UserSetting))
updateStack_userSettings :: Lens' UpdateStack (Maybe (NonEmpty UserSetting))
updateStack_userSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Maybe (NonEmpty UserSetting)
userSettings :: Maybe (NonEmpty UserSetting)
$sel:userSettings:UpdateStack' :: UpdateStack -> Maybe (NonEmpty UserSetting)
userSettings} -> Maybe (NonEmpty UserSetting)
userSettings) (\s :: UpdateStack
s@UpdateStack' {} Maybe (NonEmpty UserSetting)
a -> UpdateStack
s {$sel:userSettings:UpdateStack' :: Maybe (NonEmpty UserSetting)
userSettings = Maybe (NonEmpty UserSetting)
a} :: UpdateStack) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the stack.
updateStack_name :: Lens.Lens' UpdateStack Prelude.Text
updateStack_name :: Lens' UpdateStack Text
updateStack_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStack' {Text
name :: Text
$sel:name:UpdateStack' :: UpdateStack -> Text
name} -> Text
name) (\s :: UpdateStack
s@UpdateStack' {} Text
a -> UpdateStack
s {$sel:name:UpdateStack' :: Text
name = Text
a} :: UpdateStack)

instance Core.AWSRequest UpdateStack where
  type AWSResponse UpdateStack = UpdateStackResponse
  request :: (Service -> Service) -> UpdateStack -> Request UpdateStack
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateStack
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateStack)))
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 ->
          Maybe Stack -> Int -> UpdateStackResponse
UpdateStackResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Stack")
            forall (f :: * -> *) a b. Applicative f => 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))
      )

instance Prelude.Hashable UpdateStack where
  hashWithSalt :: Int -> UpdateStack -> Int
hashWithSalt Int
_salt UpdateStack' {Maybe Bool
Maybe [StackAttribute]
Maybe [StorageConnector]
Maybe (NonEmpty Text)
Maybe (NonEmpty AccessEndpoint)
Maybe (NonEmpty UserSetting)
Maybe Text
Maybe ApplicationSettings
Maybe StreamingExperienceSettings
Text
name :: Text
userSettings :: Maybe (NonEmpty UserSetting)
streamingExperienceSettings :: Maybe StreamingExperienceSettings
storageConnectors :: Maybe [StorageConnector]
redirectURL :: Maybe Text
feedbackURL :: Maybe Text
embedHostDomains :: Maybe (NonEmpty Text)
displayName :: Maybe Text
description :: Maybe Text
deleteStorageConnectors :: Maybe Bool
attributesToDelete :: Maybe [StackAttribute]
applicationSettings :: Maybe ApplicationSettings
accessEndpoints :: Maybe (NonEmpty AccessEndpoint)
$sel:name:UpdateStack' :: UpdateStack -> Text
$sel:userSettings:UpdateStack' :: UpdateStack -> Maybe (NonEmpty UserSetting)
$sel:streamingExperienceSettings:UpdateStack' :: UpdateStack -> Maybe StreamingExperienceSettings
$sel:storageConnectors:UpdateStack' :: UpdateStack -> Maybe [StorageConnector]
$sel:redirectURL:UpdateStack' :: UpdateStack -> Maybe Text
$sel:feedbackURL:UpdateStack' :: UpdateStack -> Maybe Text
$sel:embedHostDomains:UpdateStack' :: UpdateStack -> Maybe (NonEmpty Text)
$sel:displayName:UpdateStack' :: UpdateStack -> Maybe Text
$sel:description:UpdateStack' :: UpdateStack -> Maybe Text
$sel:deleteStorageConnectors:UpdateStack' :: UpdateStack -> Maybe Bool
$sel:attributesToDelete:UpdateStack' :: UpdateStack -> Maybe [StackAttribute]
$sel:applicationSettings:UpdateStack' :: UpdateStack -> Maybe ApplicationSettings
$sel:accessEndpoints:UpdateStack' :: UpdateStack -> Maybe (NonEmpty AccessEndpoint)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty AccessEndpoint)
accessEndpoints
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ApplicationSettings
applicationSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [StackAttribute]
attributesToDelete
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
deleteStorageConnectors
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
displayName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
embedHostDomains
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
feedbackURL
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
redirectURL
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [StorageConnector]
storageConnectors
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StreamingExperienceSettings
streamingExperienceSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty UserSetting)
userSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData UpdateStack where
  rnf :: UpdateStack -> ()
rnf UpdateStack' {Maybe Bool
Maybe [StackAttribute]
Maybe [StorageConnector]
Maybe (NonEmpty Text)
Maybe (NonEmpty AccessEndpoint)
Maybe (NonEmpty UserSetting)
Maybe Text
Maybe ApplicationSettings
Maybe StreamingExperienceSettings
Text
name :: Text
userSettings :: Maybe (NonEmpty UserSetting)
streamingExperienceSettings :: Maybe StreamingExperienceSettings
storageConnectors :: Maybe [StorageConnector]
redirectURL :: Maybe Text
feedbackURL :: Maybe Text
embedHostDomains :: Maybe (NonEmpty Text)
displayName :: Maybe Text
description :: Maybe Text
deleteStorageConnectors :: Maybe Bool
attributesToDelete :: Maybe [StackAttribute]
applicationSettings :: Maybe ApplicationSettings
accessEndpoints :: Maybe (NonEmpty AccessEndpoint)
$sel:name:UpdateStack' :: UpdateStack -> Text
$sel:userSettings:UpdateStack' :: UpdateStack -> Maybe (NonEmpty UserSetting)
$sel:streamingExperienceSettings:UpdateStack' :: UpdateStack -> Maybe StreamingExperienceSettings
$sel:storageConnectors:UpdateStack' :: UpdateStack -> Maybe [StorageConnector]
$sel:redirectURL:UpdateStack' :: UpdateStack -> Maybe Text
$sel:feedbackURL:UpdateStack' :: UpdateStack -> Maybe Text
$sel:embedHostDomains:UpdateStack' :: UpdateStack -> Maybe (NonEmpty Text)
$sel:displayName:UpdateStack' :: UpdateStack -> Maybe Text
$sel:description:UpdateStack' :: UpdateStack -> Maybe Text
$sel:deleteStorageConnectors:UpdateStack' :: UpdateStack -> Maybe Bool
$sel:attributesToDelete:UpdateStack' :: UpdateStack -> Maybe [StackAttribute]
$sel:applicationSettings:UpdateStack' :: UpdateStack -> Maybe ApplicationSettings
$sel:accessEndpoints:UpdateStack' :: UpdateStack -> Maybe (NonEmpty AccessEndpoint)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty AccessEndpoint)
accessEndpoints
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ApplicationSettings
applicationSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [StackAttribute]
attributesToDelete
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
deleteStorageConnectors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
displayName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
embedHostDomains
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
feedbackURL
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
redirectURL
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [StorageConnector]
storageConnectors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StreamingExperienceSettings
streamingExperienceSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty UserSetting)
userSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

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

instance Data.ToJSON UpdateStack where
  toJSON :: UpdateStack -> Value
toJSON UpdateStack' {Maybe Bool
Maybe [StackAttribute]
Maybe [StorageConnector]
Maybe (NonEmpty Text)
Maybe (NonEmpty AccessEndpoint)
Maybe (NonEmpty UserSetting)
Maybe Text
Maybe ApplicationSettings
Maybe StreamingExperienceSettings
Text
name :: Text
userSettings :: Maybe (NonEmpty UserSetting)
streamingExperienceSettings :: Maybe StreamingExperienceSettings
storageConnectors :: Maybe [StorageConnector]
redirectURL :: Maybe Text
feedbackURL :: Maybe Text
embedHostDomains :: Maybe (NonEmpty Text)
displayName :: Maybe Text
description :: Maybe Text
deleteStorageConnectors :: Maybe Bool
attributesToDelete :: Maybe [StackAttribute]
applicationSettings :: Maybe ApplicationSettings
accessEndpoints :: Maybe (NonEmpty AccessEndpoint)
$sel:name:UpdateStack' :: UpdateStack -> Text
$sel:userSettings:UpdateStack' :: UpdateStack -> Maybe (NonEmpty UserSetting)
$sel:streamingExperienceSettings:UpdateStack' :: UpdateStack -> Maybe StreamingExperienceSettings
$sel:storageConnectors:UpdateStack' :: UpdateStack -> Maybe [StorageConnector]
$sel:redirectURL:UpdateStack' :: UpdateStack -> Maybe Text
$sel:feedbackURL:UpdateStack' :: UpdateStack -> Maybe Text
$sel:embedHostDomains:UpdateStack' :: UpdateStack -> Maybe (NonEmpty Text)
$sel:displayName:UpdateStack' :: UpdateStack -> Maybe Text
$sel:description:UpdateStack' :: UpdateStack -> Maybe Text
$sel:deleteStorageConnectors:UpdateStack' :: UpdateStack -> Maybe Bool
$sel:attributesToDelete:UpdateStack' :: UpdateStack -> Maybe [StackAttribute]
$sel:applicationSettings:UpdateStack' :: UpdateStack -> Maybe ApplicationSettings
$sel:accessEndpoints:UpdateStack' :: UpdateStack -> Maybe (NonEmpty AccessEndpoint)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AccessEndpoints" 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 (NonEmpty AccessEndpoint)
accessEndpoints,
            (Key
"ApplicationSettings" 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 ApplicationSettings
applicationSettings,
            (Key
"AttributesToDelete" 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 [StackAttribute]
attributesToDelete,
            (Key
"DeleteStorageConnectors" 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 Bool
deleteStorageConnectors,
            (Key
"Description" 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
description,
            (Key
"DisplayName" 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
displayName,
            (Key
"EmbedHostDomains" 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 (NonEmpty Text)
embedHostDomains,
            (Key
"FeedbackURL" 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
feedbackURL,
            (Key
"RedirectURL" 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
redirectURL,
            (Key
"StorageConnectors" 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 [StorageConnector]
storageConnectors,
            (Key
"StreamingExperienceSettings" 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 StreamingExperienceSettings
streamingExperienceSettings,
            (Key
"UserSettings" 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 (NonEmpty UserSetting)
userSettings,
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
          ]
      )

instance Data.ToPath UpdateStack where
  toPath :: UpdateStack -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newUpdateStackResponse' smart constructor.
data UpdateStackResponse = UpdateStackResponse'
  { -- | Information about the stack.
    UpdateStackResponse -> Maybe Stack
stack :: Prelude.Maybe Stack,
    -- | The response's http status code.
    UpdateStackResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateStackResponse -> UpdateStackResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateStackResponse -> UpdateStackResponse -> Bool
$c/= :: UpdateStackResponse -> UpdateStackResponse -> Bool
== :: UpdateStackResponse -> UpdateStackResponse -> Bool
$c== :: UpdateStackResponse -> UpdateStackResponse -> Bool
Prelude.Eq, ReadPrec [UpdateStackResponse]
ReadPrec UpdateStackResponse
Int -> ReadS UpdateStackResponse
ReadS [UpdateStackResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateStackResponse]
$creadListPrec :: ReadPrec [UpdateStackResponse]
readPrec :: ReadPrec UpdateStackResponse
$creadPrec :: ReadPrec UpdateStackResponse
readList :: ReadS [UpdateStackResponse]
$creadList :: ReadS [UpdateStackResponse]
readsPrec :: Int -> ReadS UpdateStackResponse
$creadsPrec :: Int -> ReadS UpdateStackResponse
Prelude.Read, Int -> UpdateStackResponse -> ShowS
[UpdateStackResponse] -> ShowS
UpdateStackResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateStackResponse] -> ShowS
$cshowList :: [UpdateStackResponse] -> ShowS
show :: UpdateStackResponse -> String
$cshow :: UpdateStackResponse -> String
showsPrec :: Int -> UpdateStackResponse -> ShowS
$cshowsPrec :: Int -> UpdateStackResponse -> ShowS
Prelude.Show, forall x. Rep UpdateStackResponse x -> UpdateStackResponse
forall x. UpdateStackResponse -> Rep UpdateStackResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateStackResponse x -> UpdateStackResponse
$cfrom :: forall x. UpdateStackResponse -> Rep UpdateStackResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateStackResponse' 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:
--
-- 'stack', 'updateStackResponse_stack' - Information about the stack.
--
-- 'httpStatus', 'updateStackResponse_httpStatus' - The response's http status code.
newUpdateStackResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateStackResponse
newUpdateStackResponse :: Int -> UpdateStackResponse
newUpdateStackResponse Int
pHttpStatus_ =
  UpdateStackResponse'
    { $sel:stack:UpdateStackResponse' :: Maybe Stack
stack = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateStackResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the stack.
updateStackResponse_stack :: Lens.Lens' UpdateStackResponse (Prelude.Maybe Stack)
updateStackResponse_stack :: Lens' UpdateStackResponse (Maybe Stack)
updateStackResponse_stack = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStackResponse' {Maybe Stack
stack :: Maybe Stack
$sel:stack:UpdateStackResponse' :: UpdateStackResponse -> Maybe Stack
stack} -> Maybe Stack
stack) (\s :: UpdateStackResponse
s@UpdateStackResponse' {} Maybe Stack
a -> UpdateStackResponse
s {$sel:stack:UpdateStackResponse' :: Maybe Stack
stack = Maybe Stack
a} :: UpdateStackResponse)

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

instance Prelude.NFData UpdateStackResponse where
  rnf :: UpdateStackResponse -> ()
rnf UpdateStackResponse' {Int
Maybe Stack
httpStatus :: Int
stack :: Maybe Stack
$sel:httpStatus:UpdateStackResponse' :: UpdateStackResponse -> Int
$sel:stack:UpdateStackResponse' :: UpdateStackResponse -> Maybe Stack
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Stack
stack
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus