{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.ApplicationSettingsResponse
-- 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)
module Amazonka.AppStream.Types.ApplicationSettingsResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes the persistent application settings for users of a stack.
--
-- /See:/ 'newApplicationSettingsResponse' smart constructor.
data ApplicationSettingsResponse = ApplicationSettingsResponse'
  { -- | Specifies whether persistent application settings are enabled for users
    -- during their streaming sessions.
    ApplicationSettingsResponse -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The path prefix for the S3 bucket where users’ persistent application
    -- settings are stored.
    ApplicationSettingsResponse -> Maybe Text
settingsGroup :: Prelude.Maybe Prelude.Text,
    -- | The S3 bucket where users’ persistent application settings are stored.
    -- When persistent application settings are enabled for the first time for
    -- an account in an AWS Region, an S3 bucket is created. The bucket is
    -- unique to the AWS account and the Region.
    ApplicationSettingsResponse -> Maybe Text
s3BucketName :: Prelude.Maybe Prelude.Text
  }
  deriving (ApplicationSettingsResponse -> ApplicationSettingsResponse -> Bool
(ApplicationSettingsResponse
 -> ApplicationSettingsResponse -> Bool)
-> (ApplicationSettingsResponse
    -> ApplicationSettingsResponse -> Bool)
-> Eq ApplicationSettingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplicationSettingsResponse -> ApplicationSettingsResponse -> Bool
$c/= :: ApplicationSettingsResponse -> ApplicationSettingsResponse -> Bool
== :: ApplicationSettingsResponse -> ApplicationSettingsResponse -> Bool
$c== :: ApplicationSettingsResponse -> ApplicationSettingsResponse -> Bool
Prelude.Eq, ReadPrec [ApplicationSettingsResponse]
ReadPrec ApplicationSettingsResponse
Int -> ReadS ApplicationSettingsResponse
ReadS [ApplicationSettingsResponse]
(Int -> ReadS ApplicationSettingsResponse)
-> ReadS [ApplicationSettingsResponse]
-> ReadPrec ApplicationSettingsResponse
-> ReadPrec [ApplicationSettingsResponse]
-> Read ApplicationSettingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplicationSettingsResponse]
$creadListPrec :: ReadPrec [ApplicationSettingsResponse]
readPrec :: ReadPrec ApplicationSettingsResponse
$creadPrec :: ReadPrec ApplicationSettingsResponse
readList :: ReadS [ApplicationSettingsResponse]
$creadList :: ReadS [ApplicationSettingsResponse]
readsPrec :: Int -> ReadS ApplicationSettingsResponse
$creadsPrec :: Int -> ReadS ApplicationSettingsResponse
Prelude.Read, Int -> ApplicationSettingsResponse -> ShowS
[ApplicationSettingsResponse] -> ShowS
ApplicationSettingsResponse -> String
(Int -> ApplicationSettingsResponse -> ShowS)
-> (ApplicationSettingsResponse -> String)
-> ([ApplicationSettingsResponse] -> ShowS)
-> Show ApplicationSettingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplicationSettingsResponse] -> ShowS
$cshowList :: [ApplicationSettingsResponse] -> ShowS
show :: ApplicationSettingsResponse -> String
$cshow :: ApplicationSettingsResponse -> String
showsPrec :: Int -> ApplicationSettingsResponse -> ShowS
$cshowsPrec :: Int -> ApplicationSettingsResponse -> ShowS
Prelude.Show, (forall x.
 ApplicationSettingsResponse -> Rep ApplicationSettingsResponse x)
-> (forall x.
    Rep ApplicationSettingsResponse x -> ApplicationSettingsResponse)
-> Generic ApplicationSettingsResponse
forall x.
Rep ApplicationSettingsResponse x -> ApplicationSettingsResponse
forall x.
ApplicationSettingsResponse -> Rep ApplicationSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplicationSettingsResponse x -> ApplicationSettingsResponse
$cfrom :: forall x.
ApplicationSettingsResponse -> Rep ApplicationSettingsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ApplicationSettingsResponse' 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:
--
-- 'enabled', 'applicationSettingsResponse_enabled' - Specifies whether persistent application settings are enabled for users
-- during their streaming sessions.
--
-- 'settingsGroup', 'applicationSettingsResponse_settingsGroup' - The path prefix for the S3 bucket where users’ persistent application
-- settings are stored.
--
-- 's3BucketName', 'applicationSettingsResponse_s3BucketName' - The S3 bucket where users’ persistent application settings are stored.
-- When persistent application settings are enabled for the first time for
-- an account in an AWS Region, an S3 bucket is created. The bucket is
-- unique to the AWS account and the Region.
newApplicationSettingsResponse ::
  ApplicationSettingsResponse
newApplicationSettingsResponse :: ApplicationSettingsResponse
newApplicationSettingsResponse =
  ApplicationSettingsResponse' :: Maybe Bool
-> Maybe Text -> Maybe Text -> ApplicationSettingsResponse
ApplicationSettingsResponse'
    { $sel:enabled:ApplicationSettingsResponse' :: Maybe Bool
enabled =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:settingsGroup:ApplicationSettingsResponse' :: Maybe Text
settingsGroup = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:s3BucketName:ApplicationSettingsResponse' :: Maybe Text
s3BucketName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies whether persistent application settings are enabled for users
-- during their streaming sessions.
applicationSettingsResponse_enabled :: Lens.Lens' ApplicationSettingsResponse (Prelude.Maybe Prelude.Bool)
applicationSettingsResponse_enabled :: (Maybe Bool -> f (Maybe Bool))
-> ApplicationSettingsResponse -> f ApplicationSettingsResponse
applicationSettingsResponse_enabled = (ApplicationSettingsResponse -> Maybe Bool)
-> (ApplicationSettingsResponse
    -> Maybe Bool -> ApplicationSettingsResponse)
-> Lens
     ApplicationSettingsResponse
     ApplicationSettingsResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSettingsResponse' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:ApplicationSettingsResponse' :: ApplicationSettingsResponse -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: ApplicationSettingsResponse
s@ApplicationSettingsResponse' {} Maybe Bool
a -> ApplicationSettingsResponse
s {$sel:enabled:ApplicationSettingsResponse' :: Maybe Bool
enabled = Maybe Bool
a} :: ApplicationSettingsResponse)

-- | The path prefix for the S3 bucket where users’ persistent application
-- settings are stored.
applicationSettingsResponse_settingsGroup :: Lens.Lens' ApplicationSettingsResponse (Prelude.Maybe Prelude.Text)
applicationSettingsResponse_settingsGroup :: (Maybe Text -> f (Maybe Text))
-> ApplicationSettingsResponse -> f ApplicationSettingsResponse
applicationSettingsResponse_settingsGroup = (ApplicationSettingsResponse -> Maybe Text)
-> (ApplicationSettingsResponse
    -> Maybe Text -> ApplicationSettingsResponse)
-> Lens
     ApplicationSettingsResponse
     ApplicationSettingsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSettingsResponse' {Maybe Text
settingsGroup :: Maybe Text
$sel:settingsGroup:ApplicationSettingsResponse' :: ApplicationSettingsResponse -> Maybe Text
settingsGroup} -> Maybe Text
settingsGroup) (\s :: ApplicationSettingsResponse
s@ApplicationSettingsResponse' {} Maybe Text
a -> ApplicationSettingsResponse
s {$sel:settingsGroup:ApplicationSettingsResponse' :: Maybe Text
settingsGroup = Maybe Text
a} :: ApplicationSettingsResponse)

-- | The S3 bucket where users’ persistent application settings are stored.
-- When persistent application settings are enabled for the first time for
-- an account in an AWS Region, an S3 bucket is created. The bucket is
-- unique to the AWS account and the Region.
applicationSettingsResponse_s3BucketName :: Lens.Lens' ApplicationSettingsResponse (Prelude.Maybe Prelude.Text)
applicationSettingsResponse_s3BucketName :: (Maybe Text -> f (Maybe Text))
-> ApplicationSettingsResponse -> f ApplicationSettingsResponse
applicationSettingsResponse_s3BucketName = (ApplicationSettingsResponse -> Maybe Text)
-> (ApplicationSettingsResponse
    -> Maybe Text -> ApplicationSettingsResponse)
-> Lens
     ApplicationSettingsResponse
     ApplicationSettingsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSettingsResponse' {Maybe Text
s3BucketName :: Maybe Text
$sel:s3BucketName:ApplicationSettingsResponse' :: ApplicationSettingsResponse -> Maybe Text
s3BucketName} -> Maybe Text
s3BucketName) (\s :: ApplicationSettingsResponse
s@ApplicationSettingsResponse' {} Maybe Text
a -> ApplicationSettingsResponse
s {$sel:s3BucketName:ApplicationSettingsResponse' :: Maybe Text
s3BucketName = Maybe Text
a} :: ApplicationSettingsResponse)

instance Core.FromJSON ApplicationSettingsResponse where
  parseJSON :: Value -> Parser ApplicationSettingsResponse
parseJSON =
    String
-> (Object -> Parser ApplicationSettingsResponse)
-> Value
-> Parser ApplicationSettingsResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ApplicationSettingsResponse"
      ( \Object
x ->
          Maybe Bool
-> Maybe Text -> Maybe Text -> ApplicationSettingsResponse
ApplicationSettingsResponse'
            (Maybe Bool
 -> Maybe Text -> Maybe Text -> ApplicationSettingsResponse)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Maybe Text -> ApplicationSettingsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Enabled")
            Parser (Maybe Text -> Maybe Text -> ApplicationSettingsResponse)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ApplicationSettingsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SettingsGroup")
            Parser (Maybe Text -> ApplicationSettingsResponse)
-> Parser (Maybe Text) -> Parser ApplicationSettingsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"S3BucketName")
      )

instance Prelude.Hashable ApplicationSettingsResponse

instance Prelude.NFData ApplicationSettingsResponse