{-# 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.ECS.Types.FSxWindowsFileServerVolumeConfiguration
-- 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.ECS.Types.FSxWindowsFileServerVolumeConfiguration where

import qualified Amazonka.Core as Core
import Amazonka.ECS.Types.FSxWindowsFileServerAuthorizationConfig
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | This parameter is specified when you are using
-- <https://docs.aws.amazon.com/fsx/latest/WindowsGuide/what-is.html Amazon FSx for Windows File Server>
-- file system for task storage.
--
-- For more information and the input format, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/wfsx-volumes.html Amazon FSx for Windows File Server Volumes>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- /See:/ 'newFSxWindowsFileServerVolumeConfiguration' smart constructor.
data FSxWindowsFileServerVolumeConfiguration = FSxWindowsFileServerVolumeConfiguration'
  { -- | The Amazon FSx for Windows File Server file system ID to use.
    FSxWindowsFileServerVolumeConfiguration -> Text
fileSystemId :: Prelude.Text,
    -- | The directory within the Amazon FSx for Windows File Server file system
    -- to mount as the root directory inside the host.
    FSxWindowsFileServerVolumeConfiguration -> Text
rootDirectory :: Prelude.Text,
    -- | The authorization configuration details for the Amazon FSx for Windows
    -- File Server file system.
    FSxWindowsFileServerVolumeConfiguration
-> FSxWindowsFileServerAuthorizationConfig
authorizationConfig :: FSxWindowsFileServerAuthorizationConfig
  }
  deriving (FSxWindowsFileServerVolumeConfiguration
-> FSxWindowsFileServerVolumeConfiguration -> Bool
(FSxWindowsFileServerVolumeConfiguration
 -> FSxWindowsFileServerVolumeConfiguration -> Bool)
-> (FSxWindowsFileServerVolumeConfiguration
    -> FSxWindowsFileServerVolumeConfiguration -> Bool)
-> Eq FSxWindowsFileServerVolumeConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FSxWindowsFileServerVolumeConfiguration
-> FSxWindowsFileServerVolumeConfiguration -> Bool
$c/= :: FSxWindowsFileServerVolumeConfiguration
-> FSxWindowsFileServerVolumeConfiguration -> Bool
== :: FSxWindowsFileServerVolumeConfiguration
-> FSxWindowsFileServerVolumeConfiguration -> Bool
$c== :: FSxWindowsFileServerVolumeConfiguration
-> FSxWindowsFileServerVolumeConfiguration -> Bool
Prelude.Eq, ReadPrec [FSxWindowsFileServerVolumeConfiguration]
ReadPrec FSxWindowsFileServerVolumeConfiguration
Int -> ReadS FSxWindowsFileServerVolumeConfiguration
ReadS [FSxWindowsFileServerVolumeConfiguration]
(Int -> ReadS FSxWindowsFileServerVolumeConfiguration)
-> ReadS [FSxWindowsFileServerVolumeConfiguration]
-> ReadPrec FSxWindowsFileServerVolumeConfiguration
-> ReadPrec [FSxWindowsFileServerVolumeConfiguration]
-> Read FSxWindowsFileServerVolumeConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FSxWindowsFileServerVolumeConfiguration]
$creadListPrec :: ReadPrec [FSxWindowsFileServerVolumeConfiguration]
readPrec :: ReadPrec FSxWindowsFileServerVolumeConfiguration
$creadPrec :: ReadPrec FSxWindowsFileServerVolumeConfiguration
readList :: ReadS [FSxWindowsFileServerVolumeConfiguration]
$creadList :: ReadS [FSxWindowsFileServerVolumeConfiguration]
readsPrec :: Int -> ReadS FSxWindowsFileServerVolumeConfiguration
$creadsPrec :: Int -> ReadS FSxWindowsFileServerVolumeConfiguration
Prelude.Read, Int -> FSxWindowsFileServerVolumeConfiguration -> ShowS
[FSxWindowsFileServerVolumeConfiguration] -> ShowS
FSxWindowsFileServerVolumeConfiguration -> String
(Int -> FSxWindowsFileServerVolumeConfiguration -> ShowS)
-> (FSxWindowsFileServerVolumeConfiguration -> String)
-> ([FSxWindowsFileServerVolumeConfiguration] -> ShowS)
-> Show FSxWindowsFileServerVolumeConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FSxWindowsFileServerVolumeConfiguration] -> ShowS
$cshowList :: [FSxWindowsFileServerVolumeConfiguration] -> ShowS
show :: FSxWindowsFileServerVolumeConfiguration -> String
$cshow :: FSxWindowsFileServerVolumeConfiguration -> String
showsPrec :: Int -> FSxWindowsFileServerVolumeConfiguration -> ShowS
$cshowsPrec :: Int -> FSxWindowsFileServerVolumeConfiguration -> ShowS
Prelude.Show, (forall x.
 FSxWindowsFileServerVolumeConfiguration
 -> Rep FSxWindowsFileServerVolumeConfiguration x)
-> (forall x.
    Rep FSxWindowsFileServerVolumeConfiguration x
    -> FSxWindowsFileServerVolumeConfiguration)
-> Generic FSxWindowsFileServerVolumeConfiguration
forall x.
Rep FSxWindowsFileServerVolumeConfiguration x
-> FSxWindowsFileServerVolumeConfiguration
forall x.
FSxWindowsFileServerVolumeConfiguration
-> Rep FSxWindowsFileServerVolumeConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FSxWindowsFileServerVolumeConfiguration x
-> FSxWindowsFileServerVolumeConfiguration
$cfrom :: forall x.
FSxWindowsFileServerVolumeConfiguration
-> Rep FSxWindowsFileServerVolumeConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'FSxWindowsFileServerVolumeConfiguration' 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:
--
-- 'fileSystemId', 'fSxWindowsFileServerVolumeConfiguration_fileSystemId' - The Amazon FSx for Windows File Server file system ID to use.
--
-- 'rootDirectory', 'fSxWindowsFileServerVolumeConfiguration_rootDirectory' - The directory within the Amazon FSx for Windows File Server file system
-- to mount as the root directory inside the host.
--
-- 'authorizationConfig', 'fSxWindowsFileServerVolumeConfiguration_authorizationConfig' - The authorization configuration details for the Amazon FSx for Windows
-- File Server file system.
newFSxWindowsFileServerVolumeConfiguration ::
  -- | 'fileSystemId'
  Prelude.Text ->
  -- | 'rootDirectory'
  Prelude.Text ->
  -- | 'authorizationConfig'
  FSxWindowsFileServerAuthorizationConfig ->
  FSxWindowsFileServerVolumeConfiguration
newFSxWindowsFileServerVolumeConfiguration :: Text
-> Text
-> FSxWindowsFileServerAuthorizationConfig
-> FSxWindowsFileServerVolumeConfiguration
newFSxWindowsFileServerVolumeConfiguration
  Text
pFileSystemId_
  Text
pRootDirectory_
  FSxWindowsFileServerAuthorizationConfig
pAuthorizationConfig_ =
    FSxWindowsFileServerVolumeConfiguration' :: Text
-> Text
-> FSxWindowsFileServerAuthorizationConfig
-> FSxWindowsFileServerVolumeConfiguration
FSxWindowsFileServerVolumeConfiguration'
      { $sel:fileSystemId:FSxWindowsFileServerVolumeConfiguration' :: Text
fileSystemId =
          Text
pFileSystemId_,
        $sel:rootDirectory:FSxWindowsFileServerVolumeConfiguration' :: Text
rootDirectory = Text
pRootDirectory_,
        $sel:authorizationConfig:FSxWindowsFileServerVolumeConfiguration' :: FSxWindowsFileServerAuthorizationConfig
authorizationConfig =
          FSxWindowsFileServerAuthorizationConfig
pAuthorizationConfig_
      }

-- | The Amazon FSx for Windows File Server file system ID to use.
fSxWindowsFileServerVolumeConfiguration_fileSystemId :: Lens.Lens' FSxWindowsFileServerVolumeConfiguration Prelude.Text
fSxWindowsFileServerVolumeConfiguration_fileSystemId :: (Text -> f Text)
-> FSxWindowsFileServerVolumeConfiguration
-> f FSxWindowsFileServerVolumeConfiguration
fSxWindowsFileServerVolumeConfiguration_fileSystemId = (FSxWindowsFileServerVolumeConfiguration -> Text)
-> (FSxWindowsFileServerVolumeConfiguration
    -> Text -> FSxWindowsFileServerVolumeConfiguration)
-> Lens
     FSxWindowsFileServerVolumeConfiguration
     FSxWindowsFileServerVolumeConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FSxWindowsFileServerVolumeConfiguration' {Text
fileSystemId :: Text
$sel:fileSystemId:FSxWindowsFileServerVolumeConfiguration' :: FSxWindowsFileServerVolumeConfiguration -> Text
fileSystemId} -> Text
fileSystemId) (\s :: FSxWindowsFileServerVolumeConfiguration
s@FSxWindowsFileServerVolumeConfiguration' {} Text
a -> FSxWindowsFileServerVolumeConfiguration
s {$sel:fileSystemId:FSxWindowsFileServerVolumeConfiguration' :: Text
fileSystemId = Text
a} :: FSxWindowsFileServerVolumeConfiguration)

-- | The directory within the Amazon FSx for Windows File Server file system
-- to mount as the root directory inside the host.
fSxWindowsFileServerVolumeConfiguration_rootDirectory :: Lens.Lens' FSxWindowsFileServerVolumeConfiguration Prelude.Text
fSxWindowsFileServerVolumeConfiguration_rootDirectory :: (Text -> f Text)
-> FSxWindowsFileServerVolumeConfiguration
-> f FSxWindowsFileServerVolumeConfiguration
fSxWindowsFileServerVolumeConfiguration_rootDirectory = (FSxWindowsFileServerVolumeConfiguration -> Text)
-> (FSxWindowsFileServerVolumeConfiguration
    -> Text -> FSxWindowsFileServerVolumeConfiguration)
-> Lens
     FSxWindowsFileServerVolumeConfiguration
     FSxWindowsFileServerVolumeConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FSxWindowsFileServerVolumeConfiguration' {Text
rootDirectory :: Text
$sel:rootDirectory:FSxWindowsFileServerVolumeConfiguration' :: FSxWindowsFileServerVolumeConfiguration -> Text
rootDirectory} -> Text
rootDirectory) (\s :: FSxWindowsFileServerVolumeConfiguration
s@FSxWindowsFileServerVolumeConfiguration' {} Text
a -> FSxWindowsFileServerVolumeConfiguration
s {$sel:rootDirectory:FSxWindowsFileServerVolumeConfiguration' :: Text
rootDirectory = Text
a} :: FSxWindowsFileServerVolumeConfiguration)

-- | The authorization configuration details for the Amazon FSx for Windows
-- File Server file system.
fSxWindowsFileServerVolumeConfiguration_authorizationConfig :: Lens.Lens' FSxWindowsFileServerVolumeConfiguration FSxWindowsFileServerAuthorizationConfig
fSxWindowsFileServerVolumeConfiguration_authorizationConfig :: (FSxWindowsFileServerAuthorizationConfig
 -> f FSxWindowsFileServerAuthorizationConfig)
-> FSxWindowsFileServerVolumeConfiguration
-> f FSxWindowsFileServerVolumeConfiguration
fSxWindowsFileServerVolumeConfiguration_authorizationConfig = (FSxWindowsFileServerVolumeConfiguration
 -> FSxWindowsFileServerAuthorizationConfig)
-> (FSxWindowsFileServerVolumeConfiguration
    -> FSxWindowsFileServerAuthorizationConfig
    -> FSxWindowsFileServerVolumeConfiguration)
-> Lens
     FSxWindowsFileServerVolumeConfiguration
     FSxWindowsFileServerVolumeConfiguration
     FSxWindowsFileServerAuthorizationConfig
     FSxWindowsFileServerAuthorizationConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FSxWindowsFileServerVolumeConfiguration' {FSxWindowsFileServerAuthorizationConfig
authorizationConfig :: FSxWindowsFileServerAuthorizationConfig
$sel:authorizationConfig:FSxWindowsFileServerVolumeConfiguration' :: FSxWindowsFileServerVolumeConfiguration
-> FSxWindowsFileServerAuthorizationConfig
authorizationConfig} -> FSxWindowsFileServerAuthorizationConfig
authorizationConfig) (\s :: FSxWindowsFileServerVolumeConfiguration
s@FSxWindowsFileServerVolumeConfiguration' {} FSxWindowsFileServerAuthorizationConfig
a -> FSxWindowsFileServerVolumeConfiguration
s {$sel:authorizationConfig:FSxWindowsFileServerVolumeConfiguration' :: FSxWindowsFileServerAuthorizationConfig
authorizationConfig = FSxWindowsFileServerAuthorizationConfig
a} :: FSxWindowsFileServerVolumeConfiguration)

instance
  Core.FromJSON
    FSxWindowsFileServerVolumeConfiguration
  where
  parseJSON :: Value -> Parser FSxWindowsFileServerVolumeConfiguration
parseJSON =
    String
-> (Object -> Parser FSxWindowsFileServerVolumeConfiguration)
-> Value
-> Parser FSxWindowsFileServerVolumeConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FSxWindowsFileServerVolumeConfiguration"
      ( \Object
x ->
          Text
-> Text
-> FSxWindowsFileServerAuthorizationConfig
-> FSxWindowsFileServerVolumeConfiguration
FSxWindowsFileServerVolumeConfiguration'
            (Text
 -> Text
 -> FSxWindowsFileServerAuthorizationConfig
 -> FSxWindowsFileServerVolumeConfiguration)
-> Parser Text
-> Parser
     (Text
      -> FSxWindowsFileServerAuthorizationConfig
      -> FSxWindowsFileServerVolumeConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"fileSystemId")
            Parser
  (Text
   -> FSxWindowsFileServerAuthorizationConfig
   -> FSxWindowsFileServerVolumeConfiguration)
-> Parser Text
-> Parser
     (FSxWindowsFileServerAuthorizationConfig
      -> FSxWindowsFileServerVolumeConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"rootDirectory")
            Parser
  (FSxWindowsFileServerAuthorizationConfig
   -> FSxWindowsFileServerVolumeConfiguration)
-> Parser FSxWindowsFileServerAuthorizationConfig
-> Parser FSxWindowsFileServerVolumeConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser FSxWindowsFileServerAuthorizationConfig
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"authorizationConfig")
      )

instance
  Prelude.Hashable
    FSxWindowsFileServerVolumeConfiguration

instance
  Prelude.NFData
    FSxWindowsFileServerVolumeConfiguration

instance
  Core.ToJSON
    FSxWindowsFileServerVolumeConfiguration
  where
  toJSON :: FSxWindowsFileServerVolumeConfiguration -> Value
toJSON FSxWindowsFileServerVolumeConfiguration' {Text
FSxWindowsFileServerAuthorizationConfig
authorizationConfig :: FSxWindowsFileServerAuthorizationConfig
rootDirectory :: Text
fileSystemId :: Text
$sel:authorizationConfig:FSxWindowsFileServerVolumeConfiguration' :: FSxWindowsFileServerVolumeConfiguration
-> FSxWindowsFileServerAuthorizationConfig
$sel:rootDirectory:FSxWindowsFileServerVolumeConfiguration' :: FSxWindowsFileServerVolumeConfiguration -> Text
$sel:fileSystemId:FSxWindowsFileServerVolumeConfiguration' :: FSxWindowsFileServerVolumeConfiguration -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"fileSystemId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fileSystemId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"rootDirectory" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
rootDirectory),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"authorizationConfig" Text -> FSxWindowsFileServerAuthorizationConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= FSxWindowsFileServerAuthorizationConfig
authorizationConfig)
          ]
      )