{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.AppStream.StartImageBuilder
(
startImageBuilder
, StartImageBuilder
, sibAppstreamAgentVersion
, sibName
, startImageBuilderResponse
, StartImageBuilderResponse
, srsImageBuilder
, srsResponseStatus
) where
import Network.AWS.AppStream.Types
import Network.AWS.AppStream.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data StartImageBuilder = StartImageBuilder'
{ _sibAppstreamAgentVersion :: !(Maybe Text)
, _sibName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startImageBuilder
:: Text
-> StartImageBuilder
startImageBuilder pName_ =
StartImageBuilder' {_sibAppstreamAgentVersion = Nothing, _sibName = pName_}
sibAppstreamAgentVersion :: Lens' StartImageBuilder (Maybe Text)
sibAppstreamAgentVersion = lens _sibAppstreamAgentVersion (\ s a -> s{_sibAppstreamAgentVersion = a})
sibName :: Lens' StartImageBuilder Text
sibName = lens _sibName (\ s a -> s{_sibName = a})
instance AWSRequest StartImageBuilder where
type Rs StartImageBuilder = StartImageBuilderResponse
request = postJSON appStream
response
= receiveJSON
(\ s h x ->
StartImageBuilderResponse' <$>
(x .?> "ImageBuilder") <*> (pure (fromEnum s)))
instance Hashable StartImageBuilder where
instance NFData StartImageBuilder where
instance ToHeaders StartImageBuilder where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("PhotonAdminProxyService.StartImageBuilder" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StartImageBuilder where
toJSON StartImageBuilder'{..}
= object
(catMaybes
[("AppstreamAgentVersion" .=) <$>
_sibAppstreamAgentVersion,
Just ("Name" .= _sibName)])
instance ToPath StartImageBuilder where
toPath = const "/"
instance ToQuery StartImageBuilder where
toQuery = const mempty
data StartImageBuilderResponse = StartImageBuilderResponse'
{ _srsImageBuilder :: !(Maybe ImageBuilder)
, _srsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startImageBuilderResponse
:: Int
-> StartImageBuilderResponse
startImageBuilderResponse pResponseStatus_ =
StartImageBuilderResponse'
{_srsImageBuilder = Nothing, _srsResponseStatus = pResponseStatus_}
srsImageBuilder :: Lens' StartImageBuilderResponse (Maybe ImageBuilder)
srsImageBuilder = lens _srsImageBuilder (\ s a -> s{_srsImageBuilder = a})
srsResponseStatus :: Lens' StartImageBuilderResponse Int
srsResponseStatus = lens _srsResponseStatus (\ s a -> s{_srsResponseStatus = a})
instance NFData StartImageBuilderResponse where