@@ -718,7 +718,7 @@ instance ToJSON ListHistoryResponse where
718718-- | Settings associated with a send-as alias, which can be either the
719719-- primary login address associated with the account or a custom \"from\"
720720-- address. Send-as aliases correspond to the \"Send Mail As\" feature in
721−-- the web interface. See for more details.
721+-- the web interface.
722722--
723723-- /See:/ 'sendAs' smart constructor.
724724data SendAs = SendAs'
@@ -784,8 +784,8 @@ saReplyToAddress
784784 (\ s a -> s{_saReplyToAddress = a})
785785
786786-- | Whether Gmail should treat this address as an alias for the user\'s
787−-- primary email address. See for more details. This setting only applies
788−-- to custom \"from\" aliases.
787+-- primary email address. This setting only applies to custom \"from\"
788+-- aliases.
789789saTreatAsAlias :: Lens' SendAs (Maybe Bool)
790790saTreatAsAlias
791791 = lens _saTreatAsAlias
@@ -1112,8 +1112,7 @@ instance ToJSON ListLabelsResponse where
11121112 = object (catMaybes [("labels" .=) <$> _llrLabels])
11131113
11141114-- | Vacation auto-reply settings for an account. These settings correspond
1115−-- to the \"Vacation responder\" feature in the web interface. See for more
1116−-- details.
1115+-- to the \"Vacation responder\" feature in the web interface.
11171116--
11181117-- /See:/ 'vacationSettings' smart constructor.
11191118data VacationSettings = VacationSettings'
@@ -1284,7 +1283,7 @@ instance ToJSON HistoryMessageDeleted where
12841283-- /See:/ 'messagePartBody' smart constructor.
12851284data MessagePartBody = MessagePartBody'
12861285 { _mpbSize :: !(Maybe (Textual Int32))
1287− , _mpbData :: !(Maybe Base64)
1286+ , _mpbData :: !(Maybe Bytes)
12881287 , _mpbAttachmentId :: !(Maybe Text)
12891288 } deriving (Eq,Show,Data,Typeable,Generic)
12901289
@@ -1306,20 +1305,20 @@ messagePartBody =
13061305 , _mpbAttachmentId = Nothing
13071306 }
13081307
1309−-- | Total number of bytes in the body of the message part.
1308+-- | Number of bytes for the message part data (encoding notwithstanding).
13101309mpbSize :: Lens' MessagePartBody (Maybe Int32)
13111310mpbSize
13121311 = lens _mpbSize (\ s a -> s{_mpbSize = a}) .
13131312 mapping _Coerce
13141313
1315−-- | The body data of a MIME message part. May be empty for MIME container
1316−-- types that have no message body or when the body data is sent as a
1317−-- separate attachment. An attachment ID is present if the body data is
1318−-- contained in a separate attachment.
1314+-- | The body data of a MIME message part as a base64url encoded string. May
1315+-- be empty for MIME container types that have no message body or when the
1316+-- body data is sent as a separate attachment. An attachment ID is present
1317+-- if the body data is contained in a separate attachment.
13191318mpbData :: Lens' MessagePartBody (Maybe ByteString)
13201319mpbData
13211320 = lens _mpbData (\ s a -> s{_mpbData = a}) .
1322− mapping _Base64
1321+ mapping _Bytes
13231322
13241323-- | When present, contains the ID of an external attachment that can be
13251324-- retrieved in a separate messages.attachments.get request. When not
@@ -1555,6 +1554,72 @@ instance ToJSON WatchResponse where
15551554 [("expiration" .=) <$> _wrExpiration,
15561555 ("historyId" .=) <$> _wrHistoryId])
15571556
1557+--
1558+-- /See:/ 'batchModifyMessagesRequest' smart constructor.
1559+data BatchModifyMessagesRequest = BatchModifyMessagesRequest'
1560+ { _bmmrIds :: !(Maybe [Text])
1561+ , _bmmrRemoveLabelIds :: !(Maybe [Text])
1562+ , _bmmrAddLabelIds :: !(Maybe [Text])
1563+ } deriving (Eq,Show,Data,Typeable,Generic)
1564+
1565+-- | Creates a value of 'BatchModifyMessagesRequest' with the minimum fields required to make a request.
1566+--
1567+-- Use one of the following lenses to modify other fields as desired:
1568+--
1569+-- * 'bmmrIds'
1570+--
1571+-- * 'bmmrRemoveLabelIds'
1572+--
1573+-- * 'bmmrAddLabelIds'
1574+batchModifyMessagesRequest
1575+ :: BatchModifyMessagesRequest
1576+batchModifyMessagesRequest =
1577+ BatchModifyMessagesRequest'
1578+ { _bmmrIds = Nothing
1579+ , _bmmrRemoveLabelIds = Nothing
1580+ , _bmmrAddLabelIds = Nothing
1581+ }
1582+
1583+-- | The IDs of the messages to modify. There is a limit of 1000 ids per
1584+-- request.
1585+bmmrIds :: Lens' BatchModifyMessagesRequest [Text]
1586+bmmrIds
1587+ = lens _bmmrIds (\ s a -> s{_bmmrIds = a}) . _Default
1588+ . _Coerce
1589+
1590+-- | A list of label IDs to remove from messages.
1591+bmmrRemoveLabelIds :: Lens' BatchModifyMessagesRequest [Text]
1592+bmmrRemoveLabelIds
1593+ = lens _bmmrRemoveLabelIds
1594+ (\ s a -> s{_bmmrRemoveLabelIds = a})
1595+ . _Default
1596+ . _Coerce
1597+
1598+-- | A list of label IDs to add to messages.
1599+bmmrAddLabelIds :: Lens' BatchModifyMessagesRequest [Text]
1600+bmmrAddLabelIds
1601+ = lens _bmmrAddLabelIds
1602+ (\ s a -> s{_bmmrAddLabelIds = a})
1603+ . _Default
1604+ . _Coerce
1605+
1606+instance FromJSON BatchModifyMessagesRequest where
1607+ parseJSON
1608+ = withObject "BatchModifyMessagesRequest"
1609+ (\ o ->
1610+ BatchModifyMessagesRequest' <$>
1611+ (o .:? "ids" .!= mempty) <*>
1612+ (o .:? "removeLabelIds" .!= mempty)
1613+ <*> (o .:? "addLabelIds" .!= mempty))
1614+
1615+instance ToJSON BatchModifyMessagesRequest where
1616+ toJSON BatchModifyMessagesRequest'{..}
1617+ = object
1618+ (catMaybes
1619+ [("ids" .=) <$> _bmmrIds,
1620+ ("removeLabelIds" .=) <$> _bmmrRemoveLabelIds,
1621+ ("addLabelIds" .=) <$> _bmmrAddLabelIds])
1622+
15581623-- | A draft email in the user\'s mailbox.
15591624--
15601625-- /See:/ 'draft' smart constructor.
@@ -1941,7 +2006,7 @@ instance ToJSON ImapSettings where
19412006--
19422007-- /See:/ 'message' smart constructor.
19432008data Message = Message'
1944− { _mRaw :: !(Maybe Base64)
2009+ { _mRaw :: !(Maybe Bytes)
19452010 , _mSnippet :: !(Maybe Text)
19462011 , _mSizeEstimate :: !(Maybe (Textual Int32))
19472012 , _mPayload :: !(Maybe MessagePart)
@@ -1993,8 +2058,7 @@ message =
19932058-- format=RAW parameter is supplied.
19942059mRaw :: Lens' Message (Maybe ByteString)
19952060mRaw
1996− = lens _mRaw (\ s a -> s{_mRaw = a}) .
1997− mapping _Base64
2061+ = lens _mRaw (\ s a -> s{_mRaw = a}) . mapping _Bytes
19982062
19992063-- | A short part of the message text.
20002064mSnippet :: Lens' Message (Maybe Text)