{-# 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.DeviceFarm.ListInstanceProfiles
(
listInstanceProfiles
, ListInstanceProfiles
, lipNextToken
, lipMaxResults
, listInstanceProfilesResponse
, ListInstanceProfilesResponse
, liprsNextToken
, liprsInstanceProfiles
, liprsResponseStatus
) where
import Network.AWS.DeviceFarm.Types
import Network.AWS.DeviceFarm.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListInstanceProfiles = ListInstanceProfiles'
{ _lipNextToken :: !(Maybe Text)
, _lipMaxResults :: !(Maybe Int)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listInstanceProfiles
:: ListInstanceProfiles
listInstanceProfiles =
ListInstanceProfiles' {_lipNextToken = Nothing, _lipMaxResults = Nothing}
lipNextToken :: Lens' ListInstanceProfiles (Maybe Text)
lipNextToken = lens _lipNextToken (\ s a -> s{_lipNextToken = a})
lipMaxResults :: Lens' ListInstanceProfiles (Maybe Int)
lipMaxResults = lens _lipMaxResults (\ s a -> s{_lipMaxResults = a})
instance AWSRequest ListInstanceProfiles where
type Rs ListInstanceProfiles =
ListInstanceProfilesResponse
request = postJSON deviceFarm
response
= receiveJSON
(\ s h x ->
ListInstanceProfilesResponse' <$>
(x .?> "nextToken") <*>
(x .?> "instanceProfiles" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable ListInstanceProfiles where
instance NFData ListInstanceProfiles where
instance ToHeaders ListInstanceProfiles where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DeviceFarm_20150623.ListInstanceProfiles" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListInstanceProfiles where
toJSON ListInstanceProfiles'{..}
= object
(catMaybes
[("nextToken" .=) <$> _lipNextToken,
("maxResults" .=) <$> _lipMaxResults])
instance ToPath ListInstanceProfiles where
toPath = const "/"
instance ToQuery ListInstanceProfiles where
toQuery = const mempty
data ListInstanceProfilesResponse = ListInstanceProfilesResponse'
{ _liprsNextToken :: !(Maybe Text)
, _liprsInstanceProfiles :: !(Maybe [InstanceProfile])
, _liprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listInstanceProfilesResponse
:: Int
-> ListInstanceProfilesResponse
listInstanceProfilesResponse pResponseStatus_ =
ListInstanceProfilesResponse'
{ _liprsNextToken = Nothing
, _liprsInstanceProfiles = Nothing
, _liprsResponseStatus = pResponseStatus_
}
liprsNextToken :: Lens' ListInstanceProfilesResponse (Maybe Text)
liprsNextToken = lens _liprsNextToken (\ s a -> s{_liprsNextToken = a})
liprsInstanceProfiles :: Lens' ListInstanceProfilesResponse [InstanceProfile]
liprsInstanceProfiles = lens _liprsInstanceProfiles (\ s a -> s{_liprsInstanceProfiles = a}) . _Default . _Coerce
liprsResponseStatus :: Lens' ListInstanceProfilesResponse Int
liprsResponseStatus = lens _liprsResponseStatus (\ s a -> s{_liprsResponseStatus = a})
instance NFData ListInstanceProfilesResponse where