{-# 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.Transfer.Types.EfsFileLocation
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Transfer.Types.EfsFileLocation where

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

-- | Reserved for future use.
--
-- /See:/ 'newEfsFileLocation' smart constructor.
data EfsFileLocation = EfsFileLocation'
  { -- | The identifier of the file system, assigned by Amazon EFS.
    EfsFileLocation -> Maybe Text
fileSystemId :: Prelude.Maybe Prelude.Text,
    -- | The pathname for the folder being used by a workflow.
    EfsFileLocation -> Maybe Text
path :: Prelude.Maybe Prelude.Text
  }
  deriving (EfsFileLocation -> EfsFileLocation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EfsFileLocation -> EfsFileLocation -> Bool
$c/= :: EfsFileLocation -> EfsFileLocation -> Bool
== :: EfsFileLocation -> EfsFileLocation -> Bool
$c== :: EfsFileLocation -> EfsFileLocation -> Bool
Prelude.Eq, ReadPrec [EfsFileLocation]
ReadPrec EfsFileLocation
Int -> ReadS EfsFileLocation
ReadS [EfsFileLocation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EfsFileLocation]
$creadListPrec :: ReadPrec [EfsFileLocation]
readPrec :: ReadPrec EfsFileLocation
$creadPrec :: ReadPrec EfsFileLocation
readList :: ReadS [EfsFileLocation]
$creadList :: ReadS [EfsFileLocation]
readsPrec :: Int -> ReadS EfsFileLocation
$creadsPrec :: Int -> ReadS EfsFileLocation
Prelude.Read, Int -> EfsFileLocation -> ShowS
[EfsFileLocation] -> ShowS
EfsFileLocation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EfsFileLocation] -> ShowS
$cshowList :: [EfsFileLocation] -> ShowS
show :: EfsFileLocation -> String
$cshow :: EfsFileLocation -> String
showsPrec :: Int -> EfsFileLocation -> ShowS
$cshowsPrec :: Int -> EfsFileLocation -> ShowS
Prelude.Show, forall x. Rep EfsFileLocation x -> EfsFileLocation
forall x. EfsFileLocation -> Rep EfsFileLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EfsFileLocation x -> EfsFileLocation
$cfrom :: forall x. EfsFileLocation -> Rep EfsFileLocation x
Prelude.Generic)

-- |
-- Create a value of 'EfsFileLocation' 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', 'efsFileLocation_fileSystemId' - The identifier of the file system, assigned by Amazon EFS.
--
-- 'path', 'efsFileLocation_path' - The pathname for the folder being used by a workflow.
newEfsFileLocation ::
  EfsFileLocation
newEfsFileLocation :: EfsFileLocation
newEfsFileLocation =
  EfsFileLocation'
    { $sel:fileSystemId:EfsFileLocation' :: Maybe Text
fileSystemId = forall a. Maybe a
Prelude.Nothing,
      $sel:path:EfsFileLocation' :: Maybe Text
path = forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier of the file system, assigned by Amazon EFS.
efsFileLocation_fileSystemId :: Lens.Lens' EfsFileLocation (Prelude.Maybe Prelude.Text)
efsFileLocation_fileSystemId :: Lens' EfsFileLocation (Maybe Text)
efsFileLocation_fileSystemId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EfsFileLocation' {Maybe Text
fileSystemId :: Maybe Text
$sel:fileSystemId:EfsFileLocation' :: EfsFileLocation -> Maybe Text
fileSystemId} -> Maybe Text
fileSystemId) (\s :: EfsFileLocation
s@EfsFileLocation' {} Maybe Text
a -> EfsFileLocation
s {$sel:fileSystemId:EfsFileLocation' :: Maybe Text
fileSystemId = Maybe Text
a} :: EfsFileLocation)

-- | The pathname for the folder being used by a workflow.
efsFileLocation_path :: Lens.Lens' EfsFileLocation (Prelude.Maybe Prelude.Text)
efsFileLocation_path :: Lens' EfsFileLocation (Maybe Text)
efsFileLocation_path = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EfsFileLocation' {Maybe Text
path :: Maybe Text
$sel:path:EfsFileLocation' :: EfsFileLocation -> Maybe Text
path} -> Maybe Text
path) (\s :: EfsFileLocation
s@EfsFileLocation' {} Maybe Text
a -> EfsFileLocation
s {$sel:path:EfsFileLocation' :: Maybe Text
path = Maybe Text
a} :: EfsFileLocation)

instance Data.FromJSON EfsFileLocation where
  parseJSON :: Value -> Parser EfsFileLocation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EfsFileLocation"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> EfsFileLocation
EfsFileLocation'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"FileSystemId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Path")
      )

instance Prelude.Hashable EfsFileLocation where
  hashWithSalt :: Int -> EfsFileLocation -> Int
hashWithSalt Int
_salt EfsFileLocation' {Maybe Text
path :: Maybe Text
fileSystemId :: Maybe Text
$sel:path:EfsFileLocation' :: EfsFileLocation -> Maybe Text
$sel:fileSystemId:EfsFileLocation' :: EfsFileLocation -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fileSystemId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
path

instance Prelude.NFData EfsFileLocation where
  rnf :: EfsFileLocation -> ()
rnf EfsFileLocation' {Maybe Text
path :: Maybe Text
fileSystemId :: Maybe Text
$sel:path:EfsFileLocation' :: EfsFileLocation -> Maybe Text
$sel:fileSystemId:EfsFileLocation' :: EfsFileLocation -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fileSystemId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
path

instance Data.ToJSON EfsFileLocation where
  toJSON :: EfsFileLocation -> Value
toJSON EfsFileLocation' {Maybe Text
path :: Maybe Text
fileSystemId :: Maybe Text
$sel:path:EfsFileLocation' :: EfsFileLocation -> Maybe Text
$sel:fileSystemId:EfsFileLocation' :: EfsFileLocation -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"FileSystemId" 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
fileSystemId,
            (Key
"Path" 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
path
          ]
      )