{-# 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
, desrsThingTypeProperties
, desrsThingTypeName
, desrsThingTypeId
, desrsThingTypeMetadata
, desrsThingTypeARN
, desrsResponseStatus
) 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 .?> "thingTypeId")
<*> (x .?> "thingTypeMetadata")
<*> (x .?> "thingTypeArn")
<*> (pure (fromEnum s)))
instance Hashable DescribeThingType where
instance NFData DescribeThingType where
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'
{ _desrsThingTypeProperties :: !(Maybe ThingTypeProperties)
, _desrsThingTypeName :: !(Maybe Text)
, _desrsThingTypeId :: !(Maybe Text)
, _desrsThingTypeMetadata :: !(Maybe ThingTypeMetadata)
, _desrsThingTypeARN :: !(Maybe Text)
, _desrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeThingTypeResponse
:: Int
-> DescribeThingTypeResponse
describeThingTypeResponse pResponseStatus_ =
DescribeThingTypeResponse'
{ _desrsThingTypeProperties = Nothing
, _desrsThingTypeName = Nothing
, _desrsThingTypeId = Nothing
, _desrsThingTypeMetadata = Nothing
, _desrsThingTypeARN = Nothing
, _desrsResponseStatus = pResponseStatus_
}
desrsThingTypeProperties :: Lens' DescribeThingTypeResponse (Maybe ThingTypeProperties)
desrsThingTypeProperties = lens _desrsThingTypeProperties (\ s a -> s{_desrsThingTypeProperties = a})
desrsThingTypeName :: Lens' DescribeThingTypeResponse (Maybe Text)
desrsThingTypeName = lens _desrsThingTypeName (\ s a -> s{_desrsThingTypeName = a})
desrsThingTypeId :: Lens' DescribeThingTypeResponse (Maybe Text)
desrsThingTypeId = lens _desrsThingTypeId (\ s a -> s{_desrsThingTypeId = a})
desrsThingTypeMetadata :: Lens' DescribeThingTypeResponse (Maybe ThingTypeMetadata)
desrsThingTypeMetadata = lens _desrsThingTypeMetadata (\ s a -> s{_desrsThingTypeMetadata = a})
desrsThingTypeARN :: Lens' DescribeThingTypeResponse (Maybe Text)
desrsThingTypeARN = lens _desrsThingTypeARN (\ s a -> s{_desrsThingTypeARN = a})
desrsResponseStatus :: Lens' DescribeThingTypeResponse Int
desrsResponseStatus = lens _desrsResponseStatus (\ s a -> s{_desrsResponseStatus = a})
instance NFData DescribeThingTypeResponse where