{-# 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.IoT.DescribeThingType
(
describeThingType
, DescribeThingType
, dThingTypeName
, describeThingTypeResponse
, DescribeThingTypeResponse
, drsThingTypeProperties
, drsThingTypeName
, drsThingTypeMetadata
, drsResponseStatus
) where
import Network.AWS.IoT.Types
import Network.AWS.IoT.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DescribeThingType = DescribeThingType'
{ _dThingTypeName :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeThingType
:: Text
-> DescribeThingType
describeThingType pThingTypeName_ =
DescribeThingType'
{ _dThingTypeName = pThingTypeName_
}
dThingTypeName :: Lens' DescribeThingType Text
dThingTypeName = lens _dThingTypeName (\ s a -> s{_dThingTypeName = a});
instance AWSRequest DescribeThingType where
type Rs DescribeThingType = DescribeThingTypeResponse
request = get ioT
response
= receiveJSON
(\ s h x ->
DescribeThingTypeResponse' <$>
(x .?> "thingTypeProperties") <*>
(x .?> "thingTypeName")
<*> (x .?> "thingTypeMetadata")
<*> (pure (fromEnum s)))
instance Hashable DescribeThingType
instance NFData DescribeThingType
instance ToHeaders DescribeThingType where
toHeaders = const mempty
instance ToPath DescribeThingType where
toPath DescribeThingType'{..}
= mconcat ["/thing-types/", toBS _dThingTypeName]
instance ToQuery DescribeThingType where
toQuery = const mempty
data DescribeThingTypeResponse = DescribeThingTypeResponse'
{ _drsThingTypeProperties :: !(Maybe ThingTypeProperties)
, _drsThingTypeName :: !(Maybe Text)
, _drsThingTypeMetadata :: !(Maybe ThingTypeMetadata)
, _drsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeThingTypeResponse
:: Int
-> DescribeThingTypeResponse
describeThingTypeResponse pResponseStatus_ =
DescribeThingTypeResponse'
{ _drsThingTypeProperties = Nothing
, _drsThingTypeName = Nothing
, _drsThingTypeMetadata = Nothing
, _drsResponseStatus = pResponseStatus_
}
drsThingTypeProperties :: Lens' DescribeThingTypeResponse (Maybe ThingTypeProperties)
drsThingTypeProperties = lens _drsThingTypeProperties (\ s a -> s{_drsThingTypeProperties = a});
drsThingTypeName :: Lens' DescribeThingTypeResponse (Maybe Text)
drsThingTypeName = lens _drsThingTypeName (\ s a -> s{_drsThingTypeName = a});
drsThingTypeMetadata :: Lens' DescribeThingTypeResponse (Maybe ThingTypeMetadata)
drsThingTypeMetadata = lens _drsThingTypeMetadata (\ s a -> s{_drsThingTypeMetadata = a});
drsResponseStatus :: Lens' DescribeThingTypeResponse Int
drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a});
instance NFData DescribeThingTypeResponse