{-# 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.AssociateFleet
(
associateFleet
, AssociateFleet
, afFleetName
, afStackName
, associateFleetResponse
, AssociateFleetResponse
, afrsResponseStatus
) 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 AssociateFleet = AssociateFleet'
{ _afFleetName :: !Text
, _afStackName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateFleet
:: Text
-> Text
-> AssociateFleet
associateFleet pFleetName_ pStackName_ =
AssociateFleet' {_afFleetName = pFleetName_, _afStackName = pStackName_}
afFleetName :: Lens' AssociateFleet Text
afFleetName = lens _afFleetName (\ s a -> s{_afFleetName = a})
afStackName :: Lens' AssociateFleet Text
afStackName = lens _afStackName (\ s a -> s{_afStackName = a})
instance AWSRequest AssociateFleet where
type Rs AssociateFleet = AssociateFleetResponse
request = postJSON appStream
response
= receiveEmpty
(\ s h x ->
AssociateFleetResponse' <$> (pure (fromEnum s)))
instance Hashable AssociateFleet where
instance NFData AssociateFleet where
instance ToHeaders AssociateFleet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("PhotonAdminProxyService.AssociateFleet" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AssociateFleet where
toJSON AssociateFleet'{..}
= object
(catMaybes
[Just ("FleetName" .= _afFleetName),
Just ("StackName" .= _afStackName)])
instance ToPath AssociateFleet where
toPath = const "/"
instance ToQuery AssociateFleet where
toQuery = const mempty
newtype AssociateFleetResponse = AssociateFleetResponse'
{ _afrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateFleetResponse
:: Int
-> AssociateFleetResponse
associateFleetResponse pResponseStatus_ =
AssociateFleetResponse' {_afrsResponseStatus = pResponseStatus_}
afrsResponseStatus :: Lens' AssociateFleetResponse Int
afrsResponseStatus = lens _afrsResponseStatus (\ s a -> s{_afrsResponseStatus = a})
instance NFData AssociateFleetResponse where