{-# 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.DataSync.CreateLocationNfs
-- 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)
--
-- Defines a file system on a Network File System (NFS) server that can be
-- read from or written to.
module Amazonka.DataSync.CreateLocationNfs
  ( -- * Creating a Request
    CreateLocationNfs (..),
    newCreateLocationNfs,

    -- * Request Lenses
    createLocationNfs_mountOptions,
    createLocationNfs_tags,
    createLocationNfs_subdirectory,
    createLocationNfs_serverHostname,
    createLocationNfs_onPremConfig,

    -- * Destructuring the Response
    CreateLocationNfsResponse (..),
    newCreateLocationNfsResponse,

    -- * Response Lenses
    createLocationNfsResponse_locationArn,
    createLocationNfsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DataSync.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | CreateLocationNfsRequest
--
-- /See:/ 'newCreateLocationNfs' smart constructor.
data CreateLocationNfs = CreateLocationNfs'
  { -- | The NFS mount options that DataSync can use to mount your NFS share.
    CreateLocationNfs -> Maybe NfsMountOptions
mountOptions :: Prelude.Maybe NfsMountOptions,
    -- | The key-value pair that represents the tag that you want to add to the
    -- location. The value can be an empty string. We recommend using tags to
    -- name your resources.
    CreateLocationNfs -> Maybe [TagListEntry]
tags :: Prelude.Maybe [TagListEntry],
    -- | The subdirectory in the NFS file system that is used to read data from
    -- the NFS source location or write data to the NFS destination. The NFS
    -- path should be a path that\'s exported by the NFS server, or a
    -- subdirectory of that path. The path should be such that it can be
    -- mounted by other NFS clients in your network.
    --
    -- To see all the paths exported by your NFS server, run
    -- \"@showmount -e nfs-server-name@\" from an NFS client that has access to
    -- your server. You can specify any directory that appears in the results,
    -- and any subdirectory of that directory. Ensure that the NFS export is
    -- accessible without Kerberos authentication.
    --
    -- To transfer all the data in the folder you specified, DataSync needs to
    -- have permissions to read all the data. To ensure this, either configure
    -- the NFS export with @no_root_squash,@ or ensure that the permissions for
    -- all of the files that you want DataSync allow read access for all users.
    -- Doing either enables the agent to read the files. For the agent to
    -- access directories, you must additionally enable all execute access.
    --
    -- If you are copying data to or from your Snowcone device, see
    -- <https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#nfs-on-snowcone NFS Server on Snowcone>
    -- for more information.
    --
    -- For information about NFS export configuration, see 18.7. The
    -- \/etc\/exports Configuration File in the Red Hat Enterprise Linux
    -- documentation.
    CreateLocationNfs -> Text
subdirectory :: Prelude.Text,
    -- | The name of the NFS server. This value is the IP address or Domain Name
    -- Service (DNS) name of the NFS server. An agent that is installed
    -- on-premises uses this host name to mount the NFS server in a network.
    --
    -- If you are copying data to or from your Snowcone device, see
    -- <https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#nfs-on-snowcone NFS Server on Snowcone>
    -- for more information.
    --
    -- This name must either be DNS-compliant or must be an IP version 4 (IPv4)
    -- address.
    CreateLocationNfs -> Text
serverHostname :: Prelude.Text,
    -- | Contains a list of Amazon Resource Names (ARNs) of agents that are used
    -- to connect to an NFS server.
    --
    -- If you are copying data to or from your Snowcone device, see
    -- <https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#nfs-on-snowcone NFS Server on Snowcone>
    -- for more information.
    CreateLocationNfs -> OnPremConfig
onPremConfig :: OnPremConfig
  }
  deriving (CreateLocationNfs -> CreateLocationNfs -> Bool
(CreateLocationNfs -> CreateLocationNfs -> Bool)
-> (CreateLocationNfs -> CreateLocationNfs -> Bool)
-> Eq CreateLocationNfs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLocationNfs -> CreateLocationNfs -> Bool
$c/= :: CreateLocationNfs -> CreateLocationNfs -> Bool
== :: CreateLocationNfs -> CreateLocationNfs -> Bool
$c== :: CreateLocationNfs -> CreateLocationNfs -> Bool
Prelude.Eq, ReadPrec [CreateLocationNfs]
ReadPrec CreateLocationNfs
Int -> ReadS CreateLocationNfs
ReadS [CreateLocationNfs]
(Int -> ReadS CreateLocationNfs)
-> ReadS [CreateLocationNfs]
-> ReadPrec CreateLocationNfs
-> ReadPrec [CreateLocationNfs]
-> Read CreateLocationNfs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLocationNfs]
$creadListPrec :: ReadPrec [CreateLocationNfs]
readPrec :: ReadPrec CreateLocationNfs
$creadPrec :: ReadPrec CreateLocationNfs
readList :: ReadS [CreateLocationNfs]
$creadList :: ReadS [CreateLocationNfs]
readsPrec :: Int -> ReadS CreateLocationNfs
$creadsPrec :: Int -> ReadS CreateLocationNfs
Prelude.Read, Int -> CreateLocationNfs -> ShowS
[CreateLocationNfs] -> ShowS
CreateLocationNfs -> String
(Int -> CreateLocationNfs -> ShowS)
-> (CreateLocationNfs -> String)
-> ([CreateLocationNfs] -> ShowS)
-> Show CreateLocationNfs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLocationNfs] -> ShowS
$cshowList :: [CreateLocationNfs] -> ShowS
show :: CreateLocationNfs -> String
$cshow :: CreateLocationNfs -> String
showsPrec :: Int -> CreateLocationNfs -> ShowS
$cshowsPrec :: Int -> CreateLocationNfs -> ShowS
Prelude.Show, (forall x. CreateLocationNfs -> Rep CreateLocationNfs x)
-> (forall x. Rep CreateLocationNfs x -> CreateLocationNfs)
-> Generic CreateLocationNfs
forall x. Rep CreateLocationNfs x -> CreateLocationNfs
forall x. CreateLocationNfs -> Rep CreateLocationNfs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateLocationNfs x -> CreateLocationNfs
$cfrom :: forall x. CreateLocationNfs -> Rep CreateLocationNfs x
Prelude.Generic)

-- |
-- Create a value of 'CreateLocationNfs' 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:
--
-- 'mountOptions', 'createLocationNfs_mountOptions' - The NFS mount options that DataSync can use to mount your NFS share.
--
-- 'tags', 'createLocationNfs_tags' - The key-value pair that represents the tag that you want to add to the
-- location. The value can be an empty string. We recommend using tags to
-- name your resources.
--
-- 'subdirectory', 'createLocationNfs_subdirectory' - The subdirectory in the NFS file system that is used to read data from
-- the NFS source location or write data to the NFS destination. The NFS
-- path should be a path that\'s exported by the NFS server, or a
-- subdirectory of that path. The path should be such that it can be
-- mounted by other NFS clients in your network.
--
-- To see all the paths exported by your NFS server, run
-- \"@showmount -e nfs-server-name@\" from an NFS client that has access to
-- your server. You can specify any directory that appears in the results,
-- and any subdirectory of that directory. Ensure that the NFS export is
-- accessible without Kerberos authentication.
--
-- To transfer all the data in the folder you specified, DataSync needs to
-- have permissions to read all the data. To ensure this, either configure
-- the NFS export with @no_root_squash,@ or ensure that the permissions for
-- all of the files that you want DataSync allow read access for all users.
-- Doing either enables the agent to read the files. For the agent to
-- access directories, you must additionally enable all execute access.
--
-- If you are copying data to or from your Snowcone device, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#nfs-on-snowcone NFS Server on Snowcone>
-- for more information.
--
-- For information about NFS export configuration, see 18.7. The
-- \/etc\/exports Configuration File in the Red Hat Enterprise Linux
-- documentation.
--
-- 'serverHostname', 'createLocationNfs_serverHostname' - The name of the NFS server. This value is the IP address or Domain Name
-- Service (DNS) name of the NFS server. An agent that is installed
-- on-premises uses this host name to mount the NFS server in a network.
--
-- If you are copying data to or from your Snowcone device, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#nfs-on-snowcone NFS Server on Snowcone>
-- for more information.
--
-- This name must either be DNS-compliant or must be an IP version 4 (IPv4)
-- address.
--
-- 'onPremConfig', 'createLocationNfs_onPremConfig' - Contains a list of Amazon Resource Names (ARNs) of agents that are used
-- to connect to an NFS server.
--
-- If you are copying data to or from your Snowcone device, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#nfs-on-snowcone NFS Server on Snowcone>
-- for more information.
newCreateLocationNfs ::
  -- | 'subdirectory'
  Prelude.Text ->
  -- | 'serverHostname'
  Prelude.Text ->
  -- | 'onPremConfig'
  OnPremConfig ->
  CreateLocationNfs
newCreateLocationNfs :: Text -> Text -> OnPremConfig -> CreateLocationNfs
newCreateLocationNfs
  Text
pSubdirectory_
  Text
pServerHostname_
  OnPremConfig
pOnPremConfig_ =
    CreateLocationNfs' :: Maybe NfsMountOptions
-> Maybe [TagListEntry]
-> Text
-> Text
-> OnPremConfig
-> CreateLocationNfs
CreateLocationNfs'
      { $sel:mountOptions:CreateLocationNfs' :: Maybe NfsMountOptions
mountOptions = Maybe NfsMountOptions
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateLocationNfs' :: Maybe [TagListEntry]
tags = Maybe [TagListEntry]
forall a. Maybe a
Prelude.Nothing,
        $sel:subdirectory:CreateLocationNfs' :: Text
subdirectory = Text
pSubdirectory_,
        $sel:serverHostname:CreateLocationNfs' :: Text
serverHostname = Text
pServerHostname_,
        $sel:onPremConfig:CreateLocationNfs' :: OnPremConfig
onPremConfig = OnPremConfig
pOnPremConfig_
      }

-- | The NFS mount options that DataSync can use to mount your NFS share.
createLocationNfs_mountOptions :: Lens.Lens' CreateLocationNfs (Prelude.Maybe NfsMountOptions)
createLocationNfs_mountOptions :: (Maybe NfsMountOptions -> f (Maybe NfsMountOptions))
-> CreateLocationNfs -> f CreateLocationNfs
createLocationNfs_mountOptions = (CreateLocationNfs -> Maybe NfsMountOptions)
-> (CreateLocationNfs
    -> Maybe NfsMountOptions -> CreateLocationNfs)
-> Lens
     CreateLocationNfs
     CreateLocationNfs
     (Maybe NfsMountOptions)
     (Maybe NfsMountOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationNfs' {Maybe NfsMountOptions
mountOptions :: Maybe NfsMountOptions
$sel:mountOptions:CreateLocationNfs' :: CreateLocationNfs -> Maybe NfsMountOptions
mountOptions} -> Maybe NfsMountOptions
mountOptions) (\s :: CreateLocationNfs
s@CreateLocationNfs' {} Maybe NfsMountOptions
a -> CreateLocationNfs
s {$sel:mountOptions:CreateLocationNfs' :: Maybe NfsMountOptions
mountOptions = Maybe NfsMountOptions
a} :: CreateLocationNfs)

-- | The key-value pair that represents the tag that you want to add to the
-- location. The value can be an empty string. We recommend using tags to
-- name your resources.
createLocationNfs_tags :: Lens.Lens' CreateLocationNfs (Prelude.Maybe [TagListEntry])
createLocationNfs_tags :: (Maybe [TagListEntry] -> f (Maybe [TagListEntry]))
-> CreateLocationNfs -> f CreateLocationNfs
createLocationNfs_tags = (CreateLocationNfs -> Maybe [TagListEntry])
-> (CreateLocationNfs -> Maybe [TagListEntry] -> CreateLocationNfs)
-> Lens
     CreateLocationNfs
     CreateLocationNfs
     (Maybe [TagListEntry])
     (Maybe [TagListEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationNfs' {Maybe [TagListEntry]
tags :: Maybe [TagListEntry]
$sel:tags:CreateLocationNfs' :: CreateLocationNfs -> Maybe [TagListEntry]
tags} -> Maybe [TagListEntry]
tags) (\s :: CreateLocationNfs
s@CreateLocationNfs' {} Maybe [TagListEntry]
a -> CreateLocationNfs
s {$sel:tags:CreateLocationNfs' :: Maybe [TagListEntry]
tags = Maybe [TagListEntry]
a} :: CreateLocationNfs) ((Maybe [TagListEntry] -> f (Maybe [TagListEntry]))
 -> CreateLocationNfs -> f CreateLocationNfs)
-> ((Maybe [TagListEntry] -> f (Maybe [TagListEntry]))
    -> Maybe [TagListEntry] -> f (Maybe [TagListEntry]))
-> (Maybe [TagListEntry] -> f (Maybe [TagListEntry]))
-> CreateLocationNfs
-> f CreateLocationNfs
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [TagListEntry] [TagListEntry] [TagListEntry] [TagListEntry]
-> Iso
     (Maybe [TagListEntry])
     (Maybe [TagListEntry])
     (Maybe [TagListEntry])
     (Maybe [TagListEntry])
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 AnIso [TagListEntry] [TagListEntry] [TagListEntry] [TagListEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The subdirectory in the NFS file system that is used to read data from
-- the NFS source location or write data to the NFS destination. The NFS
-- path should be a path that\'s exported by the NFS server, or a
-- subdirectory of that path. The path should be such that it can be
-- mounted by other NFS clients in your network.
--
-- To see all the paths exported by your NFS server, run
-- \"@showmount -e nfs-server-name@\" from an NFS client that has access to
-- your server. You can specify any directory that appears in the results,
-- and any subdirectory of that directory. Ensure that the NFS export is
-- accessible without Kerberos authentication.
--
-- To transfer all the data in the folder you specified, DataSync needs to
-- have permissions to read all the data. To ensure this, either configure
-- the NFS export with @no_root_squash,@ or ensure that the permissions for
-- all of the files that you want DataSync allow read access for all users.
-- Doing either enables the agent to read the files. For the agent to
-- access directories, you must additionally enable all execute access.
--
-- If you are copying data to or from your Snowcone device, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#nfs-on-snowcone NFS Server on Snowcone>
-- for more information.
--
-- For information about NFS export configuration, see 18.7. The
-- \/etc\/exports Configuration File in the Red Hat Enterprise Linux
-- documentation.
createLocationNfs_subdirectory :: Lens.Lens' CreateLocationNfs Prelude.Text
createLocationNfs_subdirectory :: (Text -> f Text) -> CreateLocationNfs -> f CreateLocationNfs
createLocationNfs_subdirectory = (CreateLocationNfs -> Text)
-> (CreateLocationNfs -> Text -> CreateLocationNfs)
-> Lens CreateLocationNfs CreateLocationNfs Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationNfs' {Text
subdirectory :: Text
$sel:subdirectory:CreateLocationNfs' :: CreateLocationNfs -> Text
subdirectory} -> Text
subdirectory) (\s :: CreateLocationNfs
s@CreateLocationNfs' {} Text
a -> CreateLocationNfs
s {$sel:subdirectory:CreateLocationNfs' :: Text
subdirectory = Text
a} :: CreateLocationNfs)

-- | The name of the NFS server. This value is the IP address or Domain Name
-- Service (DNS) name of the NFS server. An agent that is installed
-- on-premises uses this host name to mount the NFS server in a network.
--
-- If you are copying data to or from your Snowcone device, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#nfs-on-snowcone NFS Server on Snowcone>
-- for more information.
--
-- This name must either be DNS-compliant or must be an IP version 4 (IPv4)
-- address.
createLocationNfs_serverHostname :: Lens.Lens' CreateLocationNfs Prelude.Text
createLocationNfs_serverHostname :: (Text -> f Text) -> CreateLocationNfs -> f CreateLocationNfs
createLocationNfs_serverHostname = (CreateLocationNfs -> Text)
-> (CreateLocationNfs -> Text -> CreateLocationNfs)
-> Lens CreateLocationNfs CreateLocationNfs Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationNfs' {Text
serverHostname :: Text
$sel:serverHostname:CreateLocationNfs' :: CreateLocationNfs -> Text
serverHostname} -> Text
serverHostname) (\s :: CreateLocationNfs
s@CreateLocationNfs' {} Text
a -> CreateLocationNfs
s {$sel:serverHostname:CreateLocationNfs' :: Text
serverHostname = Text
a} :: CreateLocationNfs)

-- | Contains a list of Amazon Resource Names (ARNs) of agents that are used
-- to connect to an NFS server.
--
-- If you are copying data to or from your Snowcone device, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#nfs-on-snowcone NFS Server on Snowcone>
-- for more information.
createLocationNfs_onPremConfig :: Lens.Lens' CreateLocationNfs OnPremConfig
createLocationNfs_onPremConfig :: (OnPremConfig -> f OnPremConfig)
-> CreateLocationNfs -> f CreateLocationNfs
createLocationNfs_onPremConfig = (CreateLocationNfs -> OnPremConfig)
-> (CreateLocationNfs -> OnPremConfig -> CreateLocationNfs)
-> Lens
     CreateLocationNfs CreateLocationNfs OnPremConfig OnPremConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationNfs' {OnPremConfig
onPremConfig :: OnPremConfig
$sel:onPremConfig:CreateLocationNfs' :: CreateLocationNfs -> OnPremConfig
onPremConfig} -> OnPremConfig
onPremConfig) (\s :: CreateLocationNfs
s@CreateLocationNfs' {} OnPremConfig
a -> CreateLocationNfs
s {$sel:onPremConfig:CreateLocationNfs' :: OnPremConfig
onPremConfig = OnPremConfig
a} :: CreateLocationNfs)

instance Core.AWSRequest CreateLocationNfs where
  type
    AWSResponse CreateLocationNfs =
      CreateLocationNfsResponse
  request :: CreateLocationNfs -> Request CreateLocationNfs
request = Service -> CreateLocationNfs -> Request CreateLocationNfs
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateLocationNfs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateLocationNfs)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateLocationNfs))
-> Logger
-> Service
-> Proxy CreateLocationNfs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateLocationNfs)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreateLocationNfsResponse
CreateLocationNfsResponse'
            (Maybe Text -> Int -> CreateLocationNfsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateLocationNfsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LocationArn")
            Either String (Int -> CreateLocationNfsResponse)
-> Either String Int -> Either String CreateLocationNfsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateLocationNfs

instance Prelude.NFData CreateLocationNfs

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

instance Core.ToJSON CreateLocationNfs where
  toJSON :: CreateLocationNfs -> Value
toJSON CreateLocationNfs' {Maybe [TagListEntry]
Maybe NfsMountOptions
Text
OnPremConfig
onPremConfig :: OnPremConfig
serverHostname :: Text
subdirectory :: Text
tags :: Maybe [TagListEntry]
mountOptions :: Maybe NfsMountOptions
$sel:onPremConfig:CreateLocationNfs' :: CreateLocationNfs -> OnPremConfig
$sel:serverHostname:CreateLocationNfs' :: CreateLocationNfs -> Text
$sel:subdirectory:CreateLocationNfs' :: CreateLocationNfs -> Text
$sel:tags:CreateLocationNfs' :: CreateLocationNfs -> Maybe [TagListEntry]
$sel:mountOptions:CreateLocationNfs' :: CreateLocationNfs -> Maybe NfsMountOptions
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"MountOptions" Text -> NfsMountOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NfsMountOptions -> Pair) -> Maybe NfsMountOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NfsMountOptions
mountOptions,
            (Text
"Tags" Text -> [TagListEntry] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([TagListEntry] -> Pair) -> Maybe [TagListEntry] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TagListEntry]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Subdirectory" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
subdirectory),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ServerHostname" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serverHostname),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"OnPremConfig" Text -> OnPremConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= OnPremConfig
onPremConfig)
          ]
      )

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

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

-- | CreateLocationNfsResponse
--
-- /See:/ 'newCreateLocationNfsResponse' smart constructor.
data CreateLocationNfsResponse = CreateLocationNfsResponse'
  { -- | The Amazon Resource Name (ARN) of the source NFS file system location
    -- that is created.
    CreateLocationNfsResponse -> Maybe Text
locationArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateLocationNfsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateLocationNfsResponse -> CreateLocationNfsResponse -> Bool
(CreateLocationNfsResponse -> CreateLocationNfsResponse -> Bool)
-> (CreateLocationNfsResponse -> CreateLocationNfsResponse -> Bool)
-> Eq CreateLocationNfsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLocationNfsResponse -> CreateLocationNfsResponse -> Bool
$c/= :: CreateLocationNfsResponse -> CreateLocationNfsResponse -> Bool
== :: CreateLocationNfsResponse -> CreateLocationNfsResponse -> Bool
$c== :: CreateLocationNfsResponse -> CreateLocationNfsResponse -> Bool
Prelude.Eq, ReadPrec [CreateLocationNfsResponse]
ReadPrec CreateLocationNfsResponse
Int -> ReadS CreateLocationNfsResponse
ReadS [CreateLocationNfsResponse]
(Int -> ReadS CreateLocationNfsResponse)
-> ReadS [CreateLocationNfsResponse]
-> ReadPrec CreateLocationNfsResponse
-> ReadPrec [CreateLocationNfsResponse]
-> Read CreateLocationNfsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLocationNfsResponse]
$creadListPrec :: ReadPrec [CreateLocationNfsResponse]
readPrec :: ReadPrec CreateLocationNfsResponse
$creadPrec :: ReadPrec CreateLocationNfsResponse
readList :: ReadS [CreateLocationNfsResponse]
$creadList :: ReadS [CreateLocationNfsResponse]
readsPrec :: Int -> ReadS CreateLocationNfsResponse
$creadsPrec :: Int -> ReadS CreateLocationNfsResponse
Prelude.Read, Int -> CreateLocationNfsResponse -> ShowS
[CreateLocationNfsResponse] -> ShowS
CreateLocationNfsResponse -> String
(Int -> CreateLocationNfsResponse -> ShowS)
-> (CreateLocationNfsResponse -> String)
-> ([CreateLocationNfsResponse] -> ShowS)
-> Show CreateLocationNfsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLocationNfsResponse] -> ShowS
$cshowList :: [CreateLocationNfsResponse] -> ShowS
show :: CreateLocationNfsResponse -> String
$cshow :: CreateLocationNfsResponse -> String
showsPrec :: Int -> CreateLocationNfsResponse -> ShowS
$cshowsPrec :: Int -> CreateLocationNfsResponse -> ShowS
Prelude.Show, (forall x.
 CreateLocationNfsResponse -> Rep CreateLocationNfsResponse x)
-> (forall x.
    Rep CreateLocationNfsResponse x -> CreateLocationNfsResponse)
-> Generic CreateLocationNfsResponse
forall x.
Rep CreateLocationNfsResponse x -> CreateLocationNfsResponse
forall x.
CreateLocationNfsResponse -> Rep CreateLocationNfsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLocationNfsResponse x -> CreateLocationNfsResponse
$cfrom :: forall x.
CreateLocationNfsResponse -> Rep CreateLocationNfsResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateLocationNfsResponse' 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:
--
-- 'locationArn', 'createLocationNfsResponse_locationArn' - The Amazon Resource Name (ARN) of the source NFS file system location
-- that is created.
--
-- 'httpStatus', 'createLocationNfsResponse_httpStatus' - The response's http status code.
newCreateLocationNfsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateLocationNfsResponse
newCreateLocationNfsResponse :: Int -> CreateLocationNfsResponse
newCreateLocationNfsResponse Int
pHttpStatus_ =
  CreateLocationNfsResponse' :: Maybe Text -> Int -> CreateLocationNfsResponse
CreateLocationNfsResponse'
    { $sel:locationArn:CreateLocationNfsResponse' :: Maybe Text
locationArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateLocationNfsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the source NFS file system location
-- that is created.
createLocationNfsResponse_locationArn :: Lens.Lens' CreateLocationNfsResponse (Prelude.Maybe Prelude.Text)
createLocationNfsResponse_locationArn :: (Maybe Text -> f (Maybe Text))
-> CreateLocationNfsResponse -> f CreateLocationNfsResponse
createLocationNfsResponse_locationArn = (CreateLocationNfsResponse -> Maybe Text)
-> (CreateLocationNfsResponse
    -> Maybe Text -> CreateLocationNfsResponse)
-> Lens
     CreateLocationNfsResponse
     CreateLocationNfsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationNfsResponse' {Maybe Text
locationArn :: Maybe Text
$sel:locationArn:CreateLocationNfsResponse' :: CreateLocationNfsResponse -> Maybe Text
locationArn} -> Maybe Text
locationArn) (\s :: CreateLocationNfsResponse
s@CreateLocationNfsResponse' {} Maybe Text
a -> CreateLocationNfsResponse
s {$sel:locationArn:CreateLocationNfsResponse' :: Maybe Text
locationArn = Maybe Text
a} :: CreateLocationNfsResponse)

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

instance Prelude.NFData CreateLocationNfsResponse