{-# 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.StorageGateway.DisassociateFileSystem
(
DisassociateFileSystem (..),
newDisassociateFileSystem,
disassociateFileSystem_forceDelete,
disassociateFileSystem_fileSystemAssociationARN,
DisassociateFileSystemResponse (..),
newDisassociateFileSystemResponse,
disassociateFileSystemResponse_fileSystemAssociationARN,
disassociateFileSystemResponse_httpStatus,
)
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.StorageGateway.Types
data DisassociateFileSystem = DisassociateFileSystem'
{
DisassociateFileSystem -> Maybe Bool
forceDelete :: Prelude.Maybe Prelude.Bool,
DisassociateFileSystem -> Text
fileSystemAssociationARN :: Prelude.Text
}
deriving (DisassociateFileSystem -> DisassociateFileSystem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateFileSystem -> DisassociateFileSystem -> Bool
$c/= :: DisassociateFileSystem -> DisassociateFileSystem -> Bool
== :: DisassociateFileSystem -> DisassociateFileSystem -> Bool
$c== :: DisassociateFileSystem -> DisassociateFileSystem -> Bool
Prelude.Eq, ReadPrec [DisassociateFileSystem]
ReadPrec DisassociateFileSystem
Int -> ReadS DisassociateFileSystem
ReadS [DisassociateFileSystem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateFileSystem]
$creadListPrec :: ReadPrec [DisassociateFileSystem]
readPrec :: ReadPrec DisassociateFileSystem
$creadPrec :: ReadPrec DisassociateFileSystem
readList :: ReadS [DisassociateFileSystem]
$creadList :: ReadS [DisassociateFileSystem]
readsPrec :: Int -> ReadS DisassociateFileSystem
$creadsPrec :: Int -> ReadS DisassociateFileSystem
Prelude.Read, Int -> DisassociateFileSystem -> ShowS
[DisassociateFileSystem] -> ShowS
DisassociateFileSystem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateFileSystem] -> ShowS
$cshowList :: [DisassociateFileSystem] -> ShowS
show :: DisassociateFileSystem -> String
$cshow :: DisassociateFileSystem -> String
showsPrec :: Int -> DisassociateFileSystem -> ShowS
$cshowsPrec :: Int -> DisassociateFileSystem -> ShowS
Prelude.Show, forall x. Rep DisassociateFileSystem x -> DisassociateFileSystem
forall x. DisassociateFileSystem -> Rep DisassociateFileSystem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisassociateFileSystem x -> DisassociateFileSystem
$cfrom :: forall x. DisassociateFileSystem -> Rep DisassociateFileSystem x
Prelude.Generic)
newDisassociateFileSystem ::
Prelude.Text ->
DisassociateFileSystem
newDisassociateFileSystem :: Text -> DisassociateFileSystem
newDisassociateFileSystem Text
pFileSystemAssociationARN_ =
DisassociateFileSystem'
{ $sel:forceDelete:DisassociateFileSystem' :: Maybe Bool
forceDelete =
forall a. Maybe a
Prelude.Nothing,
$sel:fileSystemAssociationARN:DisassociateFileSystem' :: Text
fileSystemAssociationARN =
Text
pFileSystemAssociationARN_
}
disassociateFileSystem_forceDelete :: Lens.Lens' DisassociateFileSystem (Prelude.Maybe Prelude.Bool)
disassociateFileSystem_forceDelete :: Lens' DisassociateFileSystem (Maybe Bool)
disassociateFileSystem_forceDelete = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateFileSystem' {Maybe Bool
forceDelete :: Maybe Bool
$sel:forceDelete:DisassociateFileSystem' :: DisassociateFileSystem -> Maybe Bool
forceDelete} -> Maybe Bool
forceDelete) (\s :: DisassociateFileSystem
s@DisassociateFileSystem' {} Maybe Bool
a -> DisassociateFileSystem
s {$sel:forceDelete:DisassociateFileSystem' :: Maybe Bool
forceDelete = Maybe Bool
a} :: DisassociateFileSystem)
disassociateFileSystem_fileSystemAssociationARN :: Lens.Lens' DisassociateFileSystem Prelude.Text
disassociateFileSystem_fileSystemAssociationARN :: Lens' DisassociateFileSystem Text
disassociateFileSystem_fileSystemAssociationARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateFileSystem' {Text
fileSystemAssociationARN :: Text
$sel:fileSystemAssociationARN:DisassociateFileSystem' :: DisassociateFileSystem -> Text
fileSystemAssociationARN} -> Text
fileSystemAssociationARN) (\s :: DisassociateFileSystem
s@DisassociateFileSystem' {} Text
a -> DisassociateFileSystem
s {$sel:fileSystemAssociationARN:DisassociateFileSystem' :: Text
fileSystemAssociationARN = Text
a} :: DisassociateFileSystem)
instance Core.AWSRequest DisassociateFileSystem where
type
AWSResponse DisassociateFileSystem =
DisassociateFileSystemResponse
request :: (Service -> Service)
-> DisassociateFileSystem -> Request DisassociateFileSystem
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DisassociateFileSystem
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateFileSystem)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> DisassociateFileSystemResponse
DisassociateFileSystemResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"FileSystemAssociationARN")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DisassociateFileSystem where
hashWithSalt :: Int -> DisassociateFileSystem -> Int
hashWithSalt Int
_salt DisassociateFileSystem' {Maybe Bool
Text
fileSystemAssociationARN :: Text
forceDelete :: Maybe Bool
$sel:fileSystemAssociationARN:DisassociateFileSystem' :: DisassociateFileSystem -> Text
$sel:forceDelete:DisassociateFileSystem' :: DisassociateFileSystem -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
forceDelete
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
fileSystemAssociationARN
instance Prelude.NFData DisassociateFileSystem where
rnf :: DisassociateFileSystem -> ()
rnf DisassociateFileSystem' {Maybe Bool
Text
fileSystemAssociationARN :: Text
forceDelete :: Maybe Bool
$sel:fileSystemAssociationARN:DisassociateFileSystem' :: DisassociateFileSystem -> Text
$sel:forceDelete:DisassociateFileSystem' :: DisassociateFileSystem -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
forceDelete
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
fileSystemAssociationARN
instance Data.ToHeaders DisassociateFileSystem where
toHeaders :: DisassociateFileSystem -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"StorageGateway_20130630.DisassociateFileSystem" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DisassociateFileSystem where
toJSON :: DisassociateFileSystem -> Value
toJSON DisassociateFileSystem' {Maybe Bool
Text
fileSystemAssociationARN :: Text
forceDelete :: Maybe Bool
$sel:fileSystemAssociationARN:DisassociateFileSystem' :: DisassociateFileSystem -> Text
$sel:forceDelete:DisassociateFileSystem' :: DisassociateFileSystem -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ForceDelete" 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 Bool
forceDelete,
forall a. a -> Maybe a
Prelude.Just
( Key
"FileSystemAssociationARN"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
fileSystemAssociationARN
)
]
)
instance Data.ToPath DisassociateFileSystem where
toPath :: DisassociateFileSystem -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DisassociateFileSystem where
toQuery :: DisassociateFileSystem -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DisassociateFileSystemResponse = DisassociateFileSystemResponse'
{
DisassociateFileSystemResponse -> Maybe Text
fileSystemAssociationARN :: Prelude.Maybe Prelude.Text,
DisassociateFileSystemResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociateFileSystemResponse
-> DisassociateFileSystemResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateFileSystemResponse
-> DisassociateFileSystemResponse -> Bool
$c/= :: DisassociateFileSystemResponse
-> DisassociateFileSystemResponse -> Bool
== :: DisassociateFileSystemResponse
-> DisassociateFileSystemResponse -> Bool
$c== :: DisassociateFileSystemResponse
-> DisassociateFileSystemResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateFileSystemResponse]
ReadPrec DisassociateFileSystemResponse
Int -> ReadS DisassociateFileSystemResponse
ReadS [DisassociateFileSystemResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateFileSystemResponse]
$creadListPrec :: ReadPrec [DisassociateFileSystemResponse]
readPrec :: ReadPrec DisassociateFileSystemResponse
$creadPrec :: ReadPrec DisassociateFileSystemResponse
readList :: ReadS [DisassociateFileSystemResponse]
$creadList :: ReadS [DisassociateFileSystemResponse]
readsPrec :: Int -> ReadS DisassociateFileSystemResponse
$creadsPrec :: Int -> ReadS DisassociateFileSystemResponse
Prelude.Read, Int -> DisassociateFileSystemResponse -> ShowS
[DisassociateFileSystemResponse] -> ShowS
DisassociateFileSystemResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateFileSystemResponse] -> ShowS
$cshowList :: [DisassociateFileSystemResponse] -> ShowS
show :: DisassociateFileSystemResponse -> String
$cshow :: DisassociateFileSystemResponse -> String
showsPrec :: Int -> DisassociateFileSystemResponse -> ShowS
$cshowsPrec :: Int -> DisassociateFileSystemResponse -> ShowS
Prelude.Show, forall x.
Rep DisassociateFileSystemResponse x
-> DisassociateFileSystemResponse
forall x.
DisassociateFileSystemResponse
-> Rep DisassociateFileSystemResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateFileSystemResponse x
-> DisassociateFileSystemResponse
$cfrom :: forall x.
DisassociateFileSystemResponse
-> Rep DisassociateFileSystemResponse x
Prelude.Generic)
newDisassociateFileSystemResponse ::
Prelude.Int ->
DisassociateFileSystemResponse
newDisassociateFileSystemResponse :: Int -> DisassociateFileSystemResponse
newDisassociateFileSystemResponse Int
pHttpStatus_ =
DisassociateFileSystemResponse'
{ $sel:fileSystemAssociationARN:DisassociateFileSystemResponse' :: Maybe Text
fileSystemAssociationARN =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DisassociateFileSystemResponse' :: Int
httpStatus = Int
pHttpStatus_
}
disassociateFileSystemResponse_fileSystemAssociationARN :: Lens.Lens' DisassociateFileSystemResponse (Prelude.Maybe Prelude.Text)
disassociateFileSystemResponse_fileSystemAssociationARN :: Lens' DisassociateFileSystemResponse (Maybe Text)
disassociateFileSystemResponse_fileSystemAssociationARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateFileSystemResponse' {Maybe Text
fileSystemAssociationARN :: Maybe Text
$sel:fileSystemAssociationARN:DisassociateFileSystemResponse' :: DisassociateFileSystemResponse -> Maybe Text
fileSystemAssociationARN} -> Maybe Text
fileSystemAssociationARN) (\s :: DisassociateFileSystemResponse
s@DisassociateFileSystemResponse' {} Maybe Text
a -> DisassociateFileSystemResponse
s {$sel:fileSystemAssociationARN:DisassociateFileSystemResponse' :: Maybe Text
fileSystemAssociationARN = Maybe Text
a} :: DisassociateFileSystemResponse)
disassociateFileSystemResponse_httpStatus :: Lens.Lens' DisassociateFileSystemResponse Prelude.Int
disassociateFileSystemResponse_httpStatus :: Lens' DisassociateFileSystemResponse Int
disassociateFileSystemResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateFileSystemResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateFileSystemResponse' :: DisassociateFileSystemResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateFileSystemResponse
s@DisassociateFileSystemResponse' {} Int
a -> DisassociateFileSystemResponse
s {$sel:httpStatus:DisassociateFileSystemResponse' :: Int
httpStatus = Int
a} :: DisassociateFileSystemResponse)
instance
Prelude.NFData
DisassociateFileSystemResponse
where
rnf :: DisassociateFileSystemResponse -> ()
rnf DisassociateFileSystemResponse' {Int
Maybe Text
httpStatus :: Int
fileSystemAssociationARN :: Maybe Text
$sel:httpStatus:DisassociateFileSystemResponse' :: DisassociateFileSystemResponse -> Int
$sel:fileSystemAssociationARN:DisassociateFileSystemResponse' :: DisassociateFileSystemResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fileSystemAssociationARN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus