{-# 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.CreateImageBuilderStreamingURL
(
createImageBuilderStreamingURL
, CreateImageBuilderStreamingURL
, cibsuValidity
, cibsuName
, createImageBuilderStreamingURLResponse
, CreateImageBuilderStreamingURLResponse
, cibsursStreamingURL
, cibsursExpires
, cibsursResponseStatus
) 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 CreateImageBuilderStreamingURL = CreateImageBuilderStreamingURL'
{ _cibsuValidity :: !(Maybe Integer)
, _cibsuName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createImageBuilderStreamingURL
:: Text
-> CreateImageBuilderStreamingURL
createImageBuilderStreamingURL pName_ =
CreateImageBuilderStreamingURL'
{_cibsuValidity = Nothing, _cibsuName = pName_}
cibsuValidity :: Lens' CreateImageBuilderStreamingURL (Maybe Integer)
cibsuValidity = lens _cibsuValidity (\ s a -> s{_cibsuValidity = a})
cibsuName :: Lens' CreateImageBuilderStreamingURL Text
cibsuName = lens _cibsuName (\ s a -> s{_cibsuName = a})
instance AWSRequest CreateImageBuilderStreamingURL
where
type Rs CreateImageBuilderStreamingURL =
CreateImageBuilderStreamingURLResponse
request = postJSON appStream
response
= receiveJSON
(\ s h x ->
CreateImageBuilderStreamingURLResponse' <$>
(x .?> "StreamingURL") <*> (x .?> "Expires") <*>
(pure (fromEnum s)))
instance Hashable CreateImageBuilderStreamingURL
where
instance NFData CreateImageBuilderStreamingURL where
instance ToHeaders CreateImageBuilderStreamingURL
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("PhotonAdminProxyService.CreateImageBuilderStreamingURL"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateImageBuilderStreamingURL where
toJSON CreateImageBuilderStreamingURL'{..}
= object
(catMaybes
[("Validity" .=) <$> _cibsuValidity,
Just ("Name" .= _cibsuName)])
instance ToPath CreateImageBuilderStreamingURL where
toPath = const "/"
instance ToQuery CreateImageBuilderStreamingURL where
toQuery = const mempty
data CreateImageBuilderStreamingURLResponse = CreateImageBuilderStreamingURLResponse'
{ _cibsursStreamingURL :: !(Maybe Text)
, _cibsursExpires :: !(Maybe POSIX)
, _cibsursResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createImageBuilderStreamingURLResponse
:: Int
-> CreateImageBuilderStreamingURLResponse
createImageBuilderStreamingURLResponse pResponseStatus_ =
CreateImageBuilderStreamingURLResponse'
{ _cibsursStreamingURL = Nothing
, _cibsursExpires = Nothing
, _cibsursResponseStatus = pResponseStatus_
}
cibsursStreamingURL :: Lens' CreateImageBuilderStreamingURLResponse (Maybe Text)
cibsursStreamingURL = lens _cibsursStreamingURL (\ s a -> s{_cibsursStreamingURL = a})
cibsursExpires :: Lens' CreateImageBuilderStreamingURLResponse (Maybe UTCTime)
cibsursExpires = lens _cibsursExpires (\ s a -> s{_cibsursExpires = a}) . mapping _Time
cibsursResponseStatus :: Lens' CreateImageBuilderStreamingURLResponse Int
cibsursResponseStatus = lens _cibsursResponseStatus (\ s a -> s{_cibsursResponseStatus = a})
instance NFData
CreateImageBuilderStreamingURLResponse
where