{-# 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.WorkMail.DescribeGroup
(
describeGroup
, DescribeGroup
, dgOrganizationId
, dgGroupId
, describeGroupResponse
, DescribeGroupResponse
, desrsEmail
, desrsState
, desrsDisabledDate
, desrsName
, desrsGroupId
, desrsEnabledDate
, desrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.WorkMail.Types
import Network.AWS.WorkMail.Types.Product
data DescribeGroup = DescribeGroup'
{ _dgOrganizationId :: !Text
, _dgGroupId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeGroup
:: Text
-> Text
-> DescribeGroup
describeGroup pOrganizationId_ pGroupId_ =
DescribeGroup' {_dgOrganizationId = pOrganizationId_, _dgGroupId = pGroupId_}
dgOrganizationId :: Lens' DescribeGroup Text
dgOrganizationId = lens _dgOrganizationId (\ s a -> s{_dgOrganizationId = a})
dgGroupId :: Lens' DescribeGroup Text
dgGroupId = lens _dgGroupId (\ s a -> s{_dgGroupId = a})
instance AWSRequest DescribeGroup where
type Rs DescribeGroup = DescribeGroupResponse
request = postJSON workMail
response
= receiveJSON
(\ s h x ->
DescribeGroupResponse' <$>
(x .?> "Email") <*> (x .?> "State") <*>
(x .?> "DisabledDate")
<*> (x .?> "Name")
<*> (x .?> "GroupId")
<*> (x .?> "EnabledDate")
<*> (pure (fromEnum s)))
instance Hashable DescribeGroup where
instance NFData DescribeGroup where
instance ToHeaders DescribeGroup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("WorkMailService.DescribeGroup" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeGroup where
toJSON DescribeGroup'{..}
= object
(catMaybes
[Just ("OrganizationId" .= _dgOrganizationId),
Just ("GroupId" .= _dgGroupId)])
instance ToPath DescribeGroup where
toPath = const "/"
instance ToQuery DescribeGroup where
toQuery = const mempty
data DescribeGroupResponse = DescribeGroupResponse'
{ _desrsEmail :: !(Maybe Text)
, _desrsState :: !(Maybe EntityState)
, _desrsDisabledDate :: !(Maybe POSIX)
, _desrsName :: !(Maybe Text)
, _desrsGroupId :: !(Maybe Text)
, _desrsEnabledDate :: !(Maybe POSIX)
, _desrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeGroupResponse
:: Int
-> DescribeGroupResponse
describeGroupResponse pResponseStatus_ =
DescribeGroupResponse'
{ _desrsEmail = Nothing
, _desrsState = Nothing
, _desrsDisabledDate = Nothing
, _desrsName = Nothing
, _desrsGroupId = Nothing
, _desrsEnabledDate = Nothing
, _desrsResponseStatus = pResponseStatus_
}
desrsEmail :: Lens' DescribeGroupResponse (Maybe Text)
desrsEmail = lens _desrsEmail (\ s a -> s{_desrsEmail = a})
desrsState :: Lens' DescribeGroupResponse (Maybe EntityState)
desrsState = lens _desrsState (\ s a -> s{_desrsState = a})
desrsDisabledDate :: Lens' DescribeGroupResponse (Maybe UTCTime)
desrsDisabledDate = lens _desrsDisabledDate (\ s a -> s{_desrsDisabledDate = a}) . mapping _Time
desrsName :: Lens' DescribeGroupResponse (Maybe Text)
desrsName = lens _desrsName (\ s a -> s{_desrsName = a})
desrsGroupId :: Lens' DescribeGroupResponse (Maybe Text)
desrsGroupId = lens _desrsGroupId (\ s a -> s{_desrsGroupId = a})
desrsEnabledDate :: Lens' DescribeGroupResponse (Maybe UTCTime)
desrsEnabledDate = lens _desrsEnabledDate (\ s a -> s{_desrsEnabledDate = a}) . mapping _Time
desrsResponseStatus :: Lens' DescribeGroupResponse Int
desrsResponseStatus = lens _desrsResponseStatus (\ s a -> s{_desrsResponseStatus = a})
instance NFData DescribeGroupResponse where