{-# 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.CreateLocationEfs
(
CreateLocationEfs (..),
newCreateLocationEfs,
createLocationEfs_subdirectory,
createLocationEfs_tags,
createLocationEfs_efsFilesystemArn,
createLocationEfs_ec2Config,
CreateLocationEfsResponse (..),
newCreateLocationEfsResponse,
createLocationEfsResponse_locationArn,
createLocationEfsResponse_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 CreateLocationEfs = CreateLocationEfs'
{
CreateLocationEfs -> Maybe Text
subdirectory :: Prelude.Maybe Prelude.Text,
CreateLocationEfs -> Maybe [TagListEntry]
tags :: Prelude.Maybe [TagListEntry],
CreateLocationEfs -> Text
efsFilesystemArn :: Prelude.Text,
CreateLocationEfs -> Ec2Config
ec2Config :: Ec2Config
}
deriving (CreateLocationEfs -> CreateLocationEfs -> Bool
(CreateLocationEfs -> CreateLocationEfs -> Bool)
-> (CreateLocationEfs -> CreateLocationEfs -> Bool)
-> Eq CreateLocationEfs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLocationEfs -> CreateLocationEfs -> Bool
$c/= :: CreateLocationEfs -> CreateLocationEfs -> Bool
== :: CreateLocationEfs -> CreateLocationEfs -> Bool
$c== :: CreateLocationEfs -> CreateLocationEfs -> Bool
Prelude.Eq, ReadPrec [CreateLocationEfs]
ReadPrec CreateLocationEfs
Int -> ReadS CreateLocationEfs
ReadS [CreateLocationEfs]
(Int -> ReadS CreateLocationEfs)
-> ReadS [CreateLocationEfs]
-> ReadPrec CreateLocationEfs
-> ReadPrec [CreateLocationEfs]
-> Read CreateLocationEfs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLocationEfs]
$creadListPrec :: ReadPrec [CreateLocationEfs]
readPrec :: ReadPrec CreateLocationEfs
$creadPrec :: ReadPrec CreateLocationEfs
readList :: ReadS [CreateLocationEfs]
$creadList :: ReadS [CreateLocationEfs]
readsPrec :: Int -> ReadS CreateLocationEfs
$creadsPrec :: Int -> ReadS CreateLocationEfs
Prelude.Read, Int -> CreateLocationEfs -> ShowS
[CreateLocationEfs] -> ShowS
CreateLocationEfs -> String
(Int -> CreateLocationEfs -> ShowS)
-> (CreateLocationEfs -> String)
-> ([CreateLocationEfs] -> ShowS)
-> Show CreateLocationEfs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLocationEfs] -> ShowS
$cshowList :: [CreateLocationEfs] -> ShowS
show :: CreateLocationEfs -> String
$cshow :: CreateLocationEfs -> String
showsPrec :: Int -> CreateLocationEfs -> ShowS
$cshowsPrec :: Int -> CreateLocationEfs -> ShowS
Prelude.Show, (forall x. CreateLocationEfs -> Rep CreateLocationEfs x)
-> (forall x. Rep CreateLocationEfs x -> CreateLocationEfs)
-> Generic CreateLocationEfs
forall x. Rep CreateLocationEfs x -> CreateLocationEfs
forall x. CreateLocationEfs -> Rep CreateLocationEfs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateLocationEfs x -> CreateLocationEfs
$cfrom :: forall x. CreateLocationEfs -> Rep CreateLocationEfs x
Prelude.Generic)
newCreateLocationEfs ::
Prelude.Text ->
Ec2Config ->
CreateLocationEfs
newCreateLocationEfs :: Text -> Ec2Config -> CreateLocationEfs
newCreateLocationEfs Text
pEfsFilesystemArn_ Ec2Config
pEc2Config_ =
CreateLocationEfs' :: Maybe Text
-> Maybe [TagListEntry] -> Text -> Ec2Config -> CreateLocationEfs
CreateLocationEfs'
{ $sel:subdirectory:CreateLocationEfs' :: Maybe Text
subdirectory = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateLocationEfs' :: Maybe [TagListEntry]
tags = Maybe [TagListEntry]
forall a. Maybe a
Prelude.Nothing,
$sel:efsFilesystemArn:CreateLocationEfs' :: Text
efsFilesystemArn = Text
pEfsFilesystemArn_,
$sel:ec2Config:CreateLocationEfs' :: Ec2Config
ec2Config = Ec2Config
pEc2Config_
}
createLocationEfs_subdirectory :: Lens.Lens' CreateLocationEfs (Prelude.Maybe Prelude.Text)
createLocationEfs_subdirectory :: (Maybe Text -> f (Maybe Text))
-> CreateLocationEfs -> f CreateLocationEfs
createLocationEfs_subdirectory = (CreateLocationEfs -> Maybe Text)
-> (CreateLocationEfs -> Maybe Text -> CreateLocationEfs)
-> Lens
CreateLocationEfs CreateLocationEfs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationEfs' {Maybe Text
subdirectory :: Maybe Text
$sel:subdirectory:CreateLocationEfs' :: CreateLocationEfs -> Maybe Text
subdirectory} -> Maybe Text
subdirectory) (\s :: CreateLocationEfs
s@CreateLocationEfs' {} Maybe Text
a -> CreateLocationEfs
s {$sel:subdirectory:CreateLocationEfs' :: Maybe Text
subdirectory = Maybe Text
a} :: CreateLocationEfs)
createLocationEfs_tags :: Lens.Lens' CreateLocationEfs (Prelude.Maybe [TagListEntry])
createLocationEfs_tags :: (Maybe [TagListEntry] -> f (Maybe [TagListEntry]))
-> CreateLocationEfs -> f CreateLocationEfs
createLocationEfs_tags = (CreateLocationEfs -> Maybe [TagListEntry])
-> (CreateLocationEfs -> Maybe [TagListEntry] -> CreateLocationEfs)
-> Lens
CreateLocationEfs
CreateLocationEfs
(Maybe [TagListEntry])
(Maybe [TagListEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationEfs' {Maybe [TagListEntry]
tags :: Maybe [TagListEntry]
$sel:tags:CreateLocationEfs' :: CreateLocationEfs -> Maybe [TagListEntry]
tags} -> Maybe [TagListEntry]
tags) (\s :: CreateLocationEfs
s@CreateLocationEfs' {} Maybe [TagListEntry]
a -> CreateLocationEfs
s {$sel:tags:CreateLocationEfs' :: Maybe [TagListEntry]
tags = Maybe [TagListEntry]
a} :: CreateLocationEfs) ((Maybe [TagListEntry] -> f (Maybe [TagListEntry]))
-> CreateLocationEfs -> f CreateLocationEfs)
-> ((Maybe [TagListEntry] -> f (Maybe [TagListEntry]))
-> Maybe [TagListEntry] -> f (Maybe [TagListEntry]))
-> (Maybe [TagListEntry] -> f (Maybe [TagListEntry]))
-> CreateLocationEfs
-> f CreateLocationEfs
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
createLocationEfs_efsFilesystemArn :: Lens.Lens' CreateLocationEfs Prelude.Text
createLocationEfs_efsFilesystemArn :: (Text -> f Text) -> CreateLocationEfs -> f CreateLocationEfs
createLocationEfs_efsFilesystemArn = (CreateLocationEfs -> Text)
-> (CreateLocationEfs -> Text -> CreateLocationEfs)
-> Lens CreateLocationEfs CreateLocationEfs Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationEfs' {Text
efsFilesystemArn :: Text
$sel:efsFilesystemArn:CreateLocationEfs' :: CreateLocationEfs -> Text
efsFilesystemArn} -> Text
efsFilesystemArn) (\s :: CreateLocationEfs
s@CreateLocationEfs' {} Text
a -> CreateLocationEfs
s {$sel:efsFilesystemArn:CreateLocationEfs' :: Text
efsFilesystemArn = Text
a} :: CreateLocationEfs)
createLocationEfs_ec2Config :: Lens.Lens' CreateLocationEfs Ec2Config
createLocationEfs_ec2Config :: (Ec2Config -> f Ec2Config)
-> CreateLocationEfs -> f CreateLocationEfs
createLocationEfs_ec2Config = (CreateLocationEfs -> Ec2Config)
-> (CreateLocationEfs -> Ec2Config -> CreateLocationEfs)
-> Lens CreateLocationEfs CreateLocationEfs Ec2Config Ec2Config
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationEfs' {Ec2Config
ec2Config :: Ec2Config
$sel:ec2Config:CreateLocationEfs' :: CreateLocationEfs -> Ec2Config
ec2Config} -> Ec2Config
ec2Config) (\s :: CreateLocationEfs
s@CreateLocationEfs' {} Ec2Config
a -> CreateLocationEfs
s {$sel:ec2Config:CreateLocationEfs' :: Ec2Config
ec2Config = Ec2Config
a} :: CreateLocationEfs)
instance Core.AWSRequest CreateLocationEfs where
type
AWSResponse CreateLocationEfs =
CreateLocationEfsResponse
request :: CreateLocationEfs -> Request CreateLocationEfs
request = Service -> CreateLocationEfs -> Request CreateLocationEfs
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateLocationEfs
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateLocationEfs)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateLocationEfs))
-> Logger
-> Service
-> Proxy CreateLocationEfs
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateLocationEfs)))
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 -> CreateLocationEfsResponse
CreateLocationEfsResponse'
(Maybe Text -> Int -> CreateLocationEfsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateLocationEfsResponse)
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 -> CreateLocationEfsResponse)
-> Either String Int -> Either String CreateLocationEfsResponse
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 CreateLocationEfs
instance Prelude.NFData CreateLocationEfs
instance Core.ToHeaders CreateLocationEfs where
toHeaders :: CreateLocationEfs -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateLocationEfs -> 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.CreateLocationEfs" ::
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 CreateLocationEfs where
toJSON :: CreateLocationEfs -> Value
toJSON CreateLocationEfs' {Maybe [TagListEntry]
Maybe Text
Text
Ec2Config
ec2Config :: Ec2Config
efsFilesystemArn :: Text
tags :: Maybe [TagListEntry]
subdirectory :: Maybe Text
$sel:ec2Config:CreateLocationEfs' :: CreateLocationEfs -> Ec2Config
$sel:efsFilesystemArn:CreateLocationEfs' :: CreateLocationEfs -> Text
$sel:tags:CreateLocationEfs' :: CreateLocationEfs -> Maybe [TagListEntry]
$sel:subdirectory:CreateLocationEfs' :: CreateLocationEfs -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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
"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
"EfsFilesystemArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
efsFilesystemArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Ec2Config" Text -> Ec2Config -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Ec2Config
ec2Config)
]
)
instance Core.ToPath CreateLocationEfs where
toPath :: CreateLocationEfs -> ByteString
toPath = ByteString -> CreateLocationEfs -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateLocationEfs where
toQuery :: CreateLocationEfs -> QueryString
toQuery = QueryString -> CreateLocationEfs -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateLocationEfsResponse = CreateLocationEfsResponse'
{
CreateLocationEfsResponse -> Maybe Text
locationArn :: Prelude.Maybe Prelude.Text,
CreateLocationEfsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateLocationEfsResponse -> CreateLocationEfsResponse -> Bool
(CreateLocationEfsResponse -> CreateLocationEfsResponse -> Bool)
-> (CreateLocationEfsResponse -> CreateLocationEfsResponse -> Bool)
-> Eq CreateLocationEfsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLocationEfsResponse -> CreateLocationEfsResponse -> Bool
$c/= :: CreateLocationEfsResponse -> CreateLocationEfsResponse -> Bool
== :: CreateLocationEfsResponse -> CreateLocationEfsResponse -> Bool
$c== :: CreateLocationEfsResponse -> CreateLocationEfsResponse -> Bool
Prelude.Eq, ReadPrec [CreateLocationEfsResponse]
ReadPrec CreateLocationEfsResponse
Int -> ReadS CreateLocationEfsResponse
ReadS [CreateLocationEfsResponse]
(Int -> ReadS CreateLocationEfsResponse)
-> ReadS [CreateLocationEfsResponse]
-> ReadPrec CreateLocationEfsResponse
-> ReadPrec [CreateLocationEfsResponse]
-> Read CreateLocationEfsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLocationEfsResponse]
$creadListPrec :: ReadPrec [CreateLocationEfsResponse]
readPrec :: ReadPrec CreateLocationEfsResponse
$creadPrec :: ReadPrec CreateLocationEfsResponse
readList :: ReadS [CreateLocationEfsResponse]
$creadList :: ReadS [CreateLocationEfsResponse]
readsPrec :: Int -> ReadS CreateLocationEfsResponse
$creadsPrec :: Int -> ReadS CreateLocationEfsResponse
Prelude.Read, Int -> CreateLocationEfsResponse -> ShowS
[CreateLocationEfsResponse] -> ShowS
CreateLocationEfsResponse -> String
(Int -> CreateLocationEfsResponse -> ShowS)
-> (CreateLocationEfsResponse -> String)
-> ([CreateLocationEfsResponse] -> ShowS)
-> Show CreateLocationEfsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLocationEfsResponse] -> ShowS
$cshowList :: [CreateLocationEfsResponse] -> ShowS
show :: CreateLocationEfsResponse -> String
$cshow :: CreateLocationEfsResponse -> String
showsPrec :: Int -> CreateLocationEfsResponse -> ShowS
$cshowsPrec :: Int -> CreateLocationEfsResponse -> ShowS
Prelude.Show, (forall x.
CreateLocationEfsResponse -> Rep CreateLocationEfsResponse x)
-> (forall x.
Rep CreateLocationEfsResponse x -> CreateLocationEfsResponse)
-> Generic CreateLocationEfsResponse
forall x.
Rep CreateLocationEfsResponse x -> CreateLocationEfsResponse
forall x.
CreateLocationEfsResponse -> Rep CreateLocationEfsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLocationEfsResponse x -> CreateLocationEfsResponse
$cfrom :: forall x.
CreateLocationEfsResponse -> Rep CreateLocationEfsResponse x
Prelude.Generic)
newCreateLocationEfsResponse ::
Prelude.Int ->
CreateLocationEfsResponse
newCreateLocationEfsResponse :: Int -> CreateLocationEfsResponse
newCreateLocationEfsResponse Int
pHttpStatus_ =
CreateLocationEfsResponse' :: Maybe Text -> Int -> CreateLocationEfsResponse
CreateLocationEfsResponse'
{ $sel:locationArn:CreateLocationEfsResponse' :: Maybe Text
locationArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateLocationEfsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createLocationEfsResponse_locationArn :: Lens.Lens' CreateLocationEfsResponse (Prelude.Maybe Prelude.Text)
createLocationEfsResponse_locationArn :: (Maybe Text -> f (Maybe Text))
-> CreateLocationEfsResponse -> f CreateLocationEfsResponse
createLocationEfsResponse_locationArn = (CreateLocationEfsResponse -> Maybe Text)
-> (CreateLocationEfsResponse
-> Maybe Text -> CreateLocationEfsResponse)
-> Lens
CreateLocationEfsResponse
CreateLocationEfsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationEfsResponse' {Maybe Text
locationArn :: Maybe Text
$sel:locationArn:CreateLocationEfsResponse' :: CreateLocationEfsResponse -> Maybe Text
locationArn} -> Maybe Text
locationArn) (\s :: CreateLocationEfsResponse
s@CreateLocationEfsResponse' {} Maybe Text
a -> CreateLocationEfsResponse
s {$sel:locationArn:CreateLocationEfsResponse' :: Maybe Text
locationArn = Maybe Text
a} :: CreateLocationEfsResponse)
createLocationEfsResponse_httpStatus :: Lens.Lens' CreateLocationEfsResponse Prelude.Int
createLocationEfsResponse_httpStatus :: (Int -> f Int)
-> CreateLocationEfsResponse -> f CreateLocationEfsResponse
createLocationEfsResponse_httpStatus = (CreateLocationEfsResponse -> Int)
-> (CreateLocationEfsResponse -> Int -> CreateLocationEfsResponse)
-> Lens CreateLocationEfsResponse CreateLocationEfsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationEfsResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateLocationEfsResponse' :: CreateLocationEfsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateLocationEfsResponse
s@CreateLocationEfsResponse' {} Int
a -> CreateLocationEfsResponse
s {$sel:httpStatus:CreateLocationEfsResponse' :: Int
httpStatus = Int
a} :: CreateLocationEfsResponse)
instance Prelude.NFData CreateLocationEfsResponse