{-# 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 #-}
module Amazonka.DataSync.UpdateLocationNfs
(
UpdateLocationNfs (..),
newUpdateLocationNfs,
updateLocationNfs_onPremConfig,
updateLocationNfs_subdirectory,
updateLocationNfs_mountOptions,
updateLocationNfs_locationArn,
UpdateLocationNfsResponse (..),
newUpdateLocationNfsResponse,
updateLocationNfsResponse_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
data UpdateLocationNfs = UpdateLocationNfs'
{ UpdateLocationNfs -> Maybe OnPremConfig
onPremConfig :: Prelude.Maybe OnPremConfig,
UpdateLocationNfs -> Maybe Text
subdirectory :: Prelude.Maybe Prelude.Text,
UpdateLocationNfs -> Maybe NfsMountOptions
mountOptions :: Prelude.Maybe NfsMountOptions,
UpdateLocationNfs -> Text
locationArn :: Prelude.Text
}
deriving (UpdateLocationNfs -> UpdateLocationNfs -> Bool
(UpdateLocationNfs -> UpdateLocationNfs -> Bool)
-> (UpdateLocationNfs -> UpdateLocationNfs -> Bool)
-> Eq UpdateLocationNfs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLocationNfs -> UpdateLocationNfs -> Bool
$c/= :: UpdateLocationNfs -> UpdateLocationNfs -> Bool
== :: UpdateLocationNfs -> UpdateLocationNfs -> Bool
$c== :: UpdateLocationNfs -> UpdateLocationNfs -> Bool
Prelude.Eq, ReadPrec [UpdateLocationNfs]
ReadPrec UpdateLocationNfs
Int -> ReadS UpdateLocationNfs
ReadS [UpdateLocationNfs]
(Int -> ReadS UpdateLocationNfs)
-> ReadS [UpdateLocationNfs]
-> ReadPrec UpdateLocationNfs
-> ReadPrec [UpdateLocationNfs]
-> Read UpdateLocationNfs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLocationNfs]
$creadListPrec :: ReadPrec [UpdateLocationNfs]
readPrec :: ReadPrec UpdateLocationNfs
$creadPrec :: ReadPrec UpdateLocationNfs
readList :: ReadS [UpdateLocationNfs]
$creadList :: ReadS [UpdateLocationNfs]
readsPrec :: Int -> ReadS UpdateLocationNfs
$creadsPrec :: Int -> ReadS UpdateLocationNfs
Prelude.Read, Int -> UpdateLocationNfs -> ShowS
[UpdateLocationNfs] -> ShowS
UpdateLocationNfs -> String
(Int -> UpdateLocationNfs -> ShowS)
-> (UpdateLocationNfs -> String)
-> ([UpdateLocationNfs] -> ShowS)
-> Show UpdateLocationNfs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLocationNfs] -> ShowS
$cshowList :: [UpdateLocationNfs] -> ShowS
show :: UpdateLocationNfs -> String
$cshow :: UpdateLocationNfs -> String
showsPrec :: Int -> UpdateLocationNfs -> ShowS
$cshowsPrec :: Int -> UpdateLocationNfs -> ShowS
Prelude.Show, (forall x. UpdateLocationNfs -> Rep UpdateLocationNfs x)
-> (forall x. Rep UpdateLocationNfs x -> UpdateLocationNfs)
-> Generic UpdateLocationNfs
forall x. Rep UpdateLocationNfs x -> UpdateLocationNfs
forall x. UpdateLocationNfs -> Rep UpdateLocationNfs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateLocationNfs x -> UpdateLocationNfs
$cfrom :: forall x. UpdateLocationNfs -> Rep UpdateLocationNfs x
Prelude.Generic)
newUpdateLocationNfs ::
Prelude.Text ->
UpdateLocationNfs
newUpdateLocationNfs :: Text -> UpdateLocationNfs
newUpdateLocationNfs Text
pLocationArn_ =
UpdateLocationNfs' :: Maybe OnPremConfig
-> Maybe Text -> Maybe NfsMountOptions -> Text -> UpdateLocationNfs
UpdateLocationNfs'
{ $sel:onPremConfig:UpdateLocationNfs' :: Maybe OnPremConfig
onPremConfig = Maybe OnPremConfig
forall a. Maybe a
Prelude.Nothing,
$sel:subdirectory:UpdateLocationNfs' :: Maybe Text
subdirectory = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:mountOptions:UpdateLocationNfs' :: Maybe NfsMountOptions
mountOptions = Maybe NfsMountOptions
forall a. Maybe a
Prelude.Nothing,
$sel:locationArn:UpdateLocationNfs' :: Text
locationArn = Text
pLocationArn_
}
updateLocationNfs_onPremConfig :: Lens.Lens' UpdateLocationNfs (Prelude.Maybe OnPremConfig)
updateLocationNfs_onPremConfig :: (Maybe OnPremConfig -> f (Maybe OnPremConfig))
-> UpdateLocationNfs -> f UpdateLocationNfs
updateLocationNfs_onPremConfig = (UpdateLocationNfs -> Maybe OnPremConfig)
-> (UpdateLocationNfs -> Maybe OnPremConfig -> UpdateLocationNfs)
-> Lens
UpdateLocationNfs
UpdateLocationNfs
(Maybe OnPremConfig)
(Maybe OnPremConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationNfs' {Maybe OnPremConfig
onPremConfig :: Maybe OnPremConfig
$sel:onPremConfig:UpdateLocationNfs' :: UpdateLocationNfs -> Maybe OnPremConfig
onPremConfig} -> Maybe OnPremConfig
onPremConfig) (\s :: UpdateLocationNfs
s@UpdateLocationNfs' {} Maybe OnPremConfig
a -> UpdateLocationNfs
s {$sel:onPremConfig:UpdateLocationNfs' :: Maybe OnPremConfig
onPremConfig = Maybe OnPremConfig
a} :: UpdateLocationNfs)
updateLocationNfs_subdirectory :: Lens.Lens' UpdateLocationNfs (Prelude.Maybe Prelude.Text)
updateLocationNfs_subdirectory :: (Maybe Text -> f (Maybe Text))
-> UpdateLocationNfs -> f UpdateLocationNfs
updateLocationNfs_subdirectory = (UpdateLocationNfs -> Maybe Text)
-> (UpdateLocationNfs -> Maybe Text -> UpdateLocationNfs)
-> Lens
UpdateLocationNfs UpdateLocationNfs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationNfs' {Maybe Text
subdirectory :: Maybe Text
$sel:subdirectory:UpdateLocationNfs' :: UpdateLocationNfs -> Maybe Text
subdirectory} -> Maybe Text
subdirectory) (\s :: UpdateLocationNfs
s@UpdateLocationNfs' {} Maybe Text
a -> UpdateLocationNfs
s {$sel:subdirectory:UpdateLocationNfs' :: Maybe Text
subdirectory = Maybe Text
a} :: UpdateLocationNfs)
updateLocationNfs_mountOptions :: Lens.Lens' UpdateLocationNfs (Prelude.Maybe NfsMountOptions)
updateLocationNfs_mountOptions :: (Maybe NfsMountOptions -> f (Maybe NfsMountOptions))
-> UpdateLocationNfs -> f UpdateLocationNfs
updateLocationNfs_mountOptions = (UpdateLocationNfs -> Maybe NfsMountOptions)
-> (UpdateLocationNfs
-> Maybe NfsMountOptions -> UpdateLocationNfs)
-> Lens
UpdateLocationNfs
UpdateLocationNfs
(Maybe NfsMountOptions)
(Maybe NfsMountOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationNfs' {Maybe NfsMountOptions
mountOptions :: Maybe NfsMountOptions
$sel:mountOptions:UpdateLocationNfs' :: UpdateLocationNfs -> Maybe NfsMountOptions
mountOptions} -> Maybe NfsMountOptions
mountOptions) (\s :: UpdateLocationNfs
s@UpdateLocationNfs' {} Maybe NfsMountOptions
a -> UpdateLocationNfs
s {$sel:mountOptions:UpdateLocationNfs' :: Maybe NfsMountOptions
mountOptions = Maybe NfsMountOptions
a} :: UpdateLocationNfs)
updateLocationNfs_locationArn :: Lens.Lens' UpdateLocationNfs Prelude.Text
updateLocationNfs_locationArn :: (Text -> f Text) -> UpdateLocationNfs -> f UpdateLocationNfs
updateLocationNfs_locationArn = (UpdateLocationNfs -> Text)
-> (UpdateLocationNfs -> Text -> UpdateLocationNfs)
-> Lens UpdateLocationNfs UpdateLocationNfs Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationNfs' {Text
locationArn :: Text
$sel:locationArn:UpdateLocationNfs' :: UpdateLocationNfs -> Text
locationArn} -> Text
locationArn) (\s :: UpdateLocationNfs
s@UpdateLocationNfs' {} Text
a -> UpdateLocationNfs
s {$sel:locationArn:UpdateLocationNfs' :: Text
locationArn = Text
a} :: UpdateLocationNfs)
instance Core.AWSRequest UpdateLocationNfs where
type
AWSResponse UpdateLocationNfs =
UpdateLocationNfsResponse
request :: UpdateLocationNfs -> Request UpdateLocationNfs
request = Service -> UpdateLocationNfs -> Request UpdateLocationNfs
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateLocationNfs
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateLocationNfs)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateLocationNfs))
-> Logger
-> Service
-> Proxy UpdateLocationNfs
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateLocationNfs)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateLocationNfsResponse
UpdateLocationNfsResponse'
(Int -> UpdateLocationNfsResponse)
-> Either String Int -> Either String UpdateLocationNfsResponse
forall (f :: * -> *) a b. Functor 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 UpdateLocationNfs
instance Prelude.NFData UpdateLocationNfs
instance Core.ToHeaders UpdateLocationNfs where
toHeaders :: UpdateLocationNfs -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateLocationNfs -> 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.UpdateLocationNfs" ::
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 UpdateLocationNfs where
toJSON :: UpdateLocationNfs -> Value
toJSON UpdateLocationNfs' {Maybe Text
Maybe NfsMountOptions
Maybe OnPremConfig
Text
locationArn :: Text
mountOptions :: Maybe NfsMountOptions
subdirectory :: Maybe Text
onPremConfig :: Maybe OnPremConfig
$sel:locationArn:UpdateLocationNfs' :: UpdateLocationNfs -> Text
$sel:mountOptions:UpdateLocationNfs' :: UpdateLocationNfs -> Maybe NfsMountOptions
$sel:subdirectory:UpdateLocationNfs' :: UpdateLocationNfs -> Maybe Text
$sel:onPremConfig:UpdateLocationNfs' :: UpdateLocationNfs -> Maybe OnPremConfig
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"OnPremConfig" Text -> OnPremConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (OnPremConfig -> Pair) -> Maybe OnPremConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OnPremConfig
onPremConfig,
(Text
"Subdirectory" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
subdirectory,
(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,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"LocationArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
locationArn)
]
)
instance Core.ToPath UpdateLocationNfs where
toPath :: UpdateLocationNfs -> ByteString
toPath = ByteString -> UpdateLocationNfs -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateLocationNfs where
toQuery :: UpdateLocationNfs -> QueryString
toQuery = QueryString -> UpdateLocationNfs -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateLocationNfsResponse = UpdateLocationNfsResponse'
{
UpdateLocationNfsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateLocationNfsResponse -> UpdateLocationNfsResponse -> Bool
(UpdateLocationNfsResponse -> UpdateLocationNfsResponse -> Bool)
-> (UpdateLocationNfsResponse -> UpdateLocationNfsResponse -> Bool)
-> Eq UpdateLocationNfsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLocationNfsResponse -> UpdateLocationNfsResponse -> Bool
$c/= :: UpdateLocationNfsResponse -> UpdateLocationNfsResponse -> Bool
== :: UpdateLocationNfsResponse -> UpdateLocationNfsResponse -> Bool
$c== :: UpdateLocationNfsResponse -> UpdateLocationNfsResponse -> Bool
Prelude.Eq, ReadPrec [UpdateLocationNfsResponse]
ReadPrec UpdateLocationNfsResponse
Int -> ReadS UpdateLocationNfsResponse
ReadS [UpdateLocationNfsResponse]
(Int -> ReadS UpdateLocationNfsResponse)
-> ReadS [UpdateLocationNfsResponse]
-> ReadPrec UpdateLocationNfsResponse
-> ReadPrec [UpdateLocationNfsResponse]
-> Read UpdateLocationNfsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLocationNfsResponse]
$creadListPrec :: ReadPrec [UpdateLocationNfsResponse]
readPrec :: ReadPrec UpdateLocationNfsResponse
$creadPrec :: ReadPrec UpdateLocationNfsResponse
readList :: ReadS [UpdateLocationNfsResponse]
$creadList :: ReadS [UpdateLocationNfsResponse]
readsPrec :: Int -> ReadS UpdateLocationNfsResponse
$creadsPrec :: Int -> ReadS UpdateLocationNfsResponse
Prelude.Read, Int -> UpdateLocationNfsResponse -> ShowS
[UpdateLocationNfsResponse] -> ShowS
UpdateLocationNfsResponse -> String
(Int -> UpdateLocationNfsResponse -> ShowS)
-> (UpdateLocationNfsResponse -> String)
-> ([UpdateLocationNfsResponse] -> ShowS)
-> Show UpdateLocationNfsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLocationNfsResponse] -> ShowS
$cshowList :: [UpdateLocationNfsResponse] -> ShowS
show :: UpdateLocationNfsResponse -> String
$cshow :: UpdateLocationNfsResponse -> String
showsPrec :: Int -> UpdateLocationNfsResponse -> ShowS
$cshowsPrec :: Int -> UpdateLocationNfsResponse -> ShowS
Prelude.Show, (forall x.
UpdateLocationNfsResponse -> Rep UpdateLocationNfsResponse x)
-> (forall x.
Rep UpdateLocationNfsResponse x -> UpdateLocationNfsResponse)
-> Generic UpdateLocationNfsResponse
forall x.
Rep UpdateLocationNfsResponse x -> UpdateLocationNfsResponse
forall x.
UpdateLocationNfsResponse -> Rep UpdateLocationNfsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateLocationNfsResponse x -> UpdateLocationNfsResponse
$cfrom :: forall x.
UpdateLocationNfsResponse -> Rep UpdateLocationNfsResponse x
Prelude.Generic)
newUpdateLocationNfsResponse ::
Prelude.Int ->
UpdateLocationNfsResponse
newUpdateLocationNfsResponse :: Int -> UpdateLocationNfsResponse
newUpdateLocationNfsResponse Int
pHttpStatus_ =
UpdateLocationNfsResponse' :: Int -> UpdateLocationNfsResponse
UpdateLocationNfsResponse'
{ $sel:httpStatus:UpdateLocationNfsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateLocationNfsResponse_httpStatus :: Lens.Lens' UpdateLocationNfsResponse Prelude.Int
updateLocationNfsResponse_httpStatus :: (Int -> f Int)
-> UpdateLocationNfsResponse -> f UpdateLocationNfsResponse
updateLocationNfsResponse_httpStatus = (UpdateLocationNfsResponse -> Int)
-> (UpdateLocationNfsResponse -> Int -> UpdateLocationNfsResponse)
-> Lens UpdateLocationNfsResponse UpdateLocationNfsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationNfsResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateLocationNfsResponse' :: UpdateLocationNfsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateLocationNfsResponse
s@UpdateLocationNfsResponse' {} Int
a -> UpdateLocationNfsResponse
s {$sel:httpStatus:UpdateLocationNfsResponse' :: Int
httpStatus = Int
a} :: UpdateLocationNfsResponse)
instance Prelude.NFData UpdateLocationNfsResponse