module Network.AWS.DirectoryService.StartSchemaExtension
(
startSchemaExtension
, StartSchemaExtension
, sseDirectoryId
, sseCreateSnapshotBeforeSchemaExtension
, sseLdifContent
, sseDescription
, startSchemaExtensionResponse
, StartSchemaExtensionResponse
, ssersSchemaExtensionId
, ssersResponseStatus
) where
import Network.AWS.DirectoryService.Types
import Network.AWS.DirectoryService.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data StartSchemaExtension = StartSchemaExtension'
{ _sseDirectoryId :: !Text
, _sseCreateSnapshotBeforeSchemaExtension :: !Bool
, _sseLdifContent :: !Text
, _sseDescription :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startSchemaExtension
:: Text
-> Bool
-> Text
-> Text
-> StartSchemaExtension
startSchemaExtension pDirectoryId_ pCreateSnapshotBeforeSchemaExtension_ pLdifContent_ pDescription_ =
StartSchemaExtension'
{ _sseDirectoryId = pDirectoryId_
, _sseCreateSnapshotBeforeSchemaExtension =
pCreateSnapshotBeforeSchemaExtension_
, _sseLdifContent = pLdifContent_
, _sseDescription = pDescription_
}
sseDirectoryId :: Lens' StartSchemaExtension Text
sseDirectoryId = lens _sseDirectoryId (\ s a -> s{_sseDirectoryId = a});
sseCreateSnapshotBeforeSchemaExtension :: Lens' StartSchemaExtension Bool
sseCreateSnapshotBeforeSchemaExtension = lens _sseCreateSnapshotBeforeSchemaExtension (\ s a -> s{_sseCreateSnapshotBeforeSchemaExtension = a});
sseLdifContent :: Lens' StartSchemaExtension Text
sseLdifContent = lens _sseLdifContent (\ s a -> s{_sseLdifContent = a});
sseDescription :: Lens' StartSchemaExtension Text
sseDescription = lens _sseDescription (\ s a -> s{_sseDescription = a});
instance AWSRequest StartSchemaExtension where
type Rs StartSchemaExtension =
StartSchemaExtensionResponse
request = postJSON directoryService
response
= receiveJSON
(\ s h x ->
StartSchemaExtensionResponse' <$>
(x .?> "SchemaExtensionId") <*> (pure (fromEnum s)))
instance Hashable StartSchemaExtension where
instance NFData StartSchemaExtension where
instance ToHeaders StartSchemaExtension where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DirectoryService_20150416.StartSchemaExtension" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StartSchemaExtension where
toJSON StartSchemaExtension'{..}
= object
(catMaybes
[Just ("DirectoryId" .= _sseDirectoryId),
Just
("CreateSnapshotBeforeSchemaExtension" .=
_sseCreateSnapshotBeforeSchemaExtension),
Just ("LdifContent" .= _sseLdifContent),
Just ("Description" .= _sseDescription)])
instance ToPath StartSchemaExtension where
toPath = const "/"
instance ToQuery StartSchemaExtension where
toQuery = const mempty
data StartSchemaExtensionResponse = StartSchemaExtensionResponse'
{ _ssersSchemaExtensionId :: !(Maybe Text)
, _ssersResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startSchemaExtensionResponse
:: Int
-> StartSchemaExtensionResponse
startSchemaExtensionResponse pResponseStatus_ =
StartSchemaExtensionResponse'
{_ssersSchemaExtensionId = Nothing, _ssersResponseStatus = pResponseStatus_}
ssersSchemaExtensionId :: Lens' StartSchemaExtensionResponse (Maybe Text)
ssersSchemaExtensionId = lens _ssersSchemaExtensionId (\ s a -> s{_ssersSchemaExtensionId = a});
ssersResponseStatus :: Lens' StartSchemaExtensionResponse Int
ssersResponseStatus = lens _ssersResponseStatus (\ s a -> s{_ssersResponseStatus = a});
instance NFData StartSchemaExtensionResponse where