gogol-gmail (empty) → 0.0.1
raw patch · 40 files changed
+6555/−0 lines, 40 filesdep +basedep +gogol-coresetup-changed
Dependencies added: base, gogol-core
Files
- LICENSE +367/−0
- README.md +28/−0
- Setup.hs +2/−0
- gen/Network/Google/Gmail.hs +387/−0
- gen/Network/Google/Gmail/Types.hs +255/−0
- gen/Network/Google/Gmail/Types/Product.hs +1472/−0
- gen/Network/Google/Gmail/Types/Sum.hs +295/−0
- gen/Network/Google/Resource/Gmail/Users/Drafts/Create.hs +123/−0
- gen/Network/Google/Resource/Gmail/Users/Drafts/Delete.hs +98/−0
- gen/Network/Google/Resource/Gmail/Users/Drafts/Get.hs +108/−0
- gen/Network/Google/Resource/Gmail/Users/Drafts/List.hs +112/−0
- gen/Network/Google/Resource/Gmail/Users/Drafts/Send.hs +126/−0
- gen/Network/Google/Resource/Gmail/Users/Drafts/Update.hs +135/−0
- gen/Network/Google/Resource/Gmail/Users/GetProFile.hs +85/−0
- gen/Network/Google/Resource/Gmail/Users/History/List.hs +150/−0
- gen/Network/Google/Resource/Gmail/Users/Labels/Create.hs +98/−0
- gen/Network/Google/Resource/Gmail/Users/Labels/Delete.hs +98/−0
- gen/Network/Google/Resource/Gmail/Users/Labels/Get.hs +95/−0
- gen/Network/Google/Resource/Gmail/Users/Labels/List.hs +86/−0
- gen/Network/Google/Resource/Gmail/Users/Labels/Patch.hs +109/−0
- gen/Network/Google/Resource/Gmail/Users/Labels/Update.hs +109/−0
- gen/Network/Google/Resource/Gmail/Users/Messages/Attachments/Get.hs +114/−0
- gen/Network/Google/Resource/Gmail/Users/Messages/Delete.hs +98/−0
- gen/Network/Google/Resource/Gmail/Users/Messages/Get.hs +124/−0
- gen/Network/Google/Resource/Gmail/Users/Messages/Import.hs +198/−0
- gen/Network/Google/Resource/Gmail/Users/Messages/Insert.hs +161/−0
- gen/Network/Google/Resource/Gmail/Users/Messages/List.hs +153/−0
- gen/Network/Google/Resource/Gmail/Users/Messages/Modify.hs +111/−0
- gen/Network/Google/Resource/Gmail/Users/Messages/Send.hs +127/−0
- gen/Network/Google/Resource/Gmail/Users/Messages/Trash.hs +97/−0
- gen/Network/Google/Resource/Gmail/Users/Messages/Untrash.hs +97/−0
- gen/Network/Google/Resource/Gmail/Users/Stop.hs +82/−0
- gen/Network/Google/Resource/Gmail/Users/Threads/Delete.hs +98/−0
- gen/Network/Google/Resource/Gmail/Users/Threads/Get.hs +124/−0
- gen/Network/Google/Resource/Gmail/Users/Threads/List.hs +153/−0
- gen/Network/Google/Resource/Gmail/Users/Threads/Modify.hs +113/−0
- gen/Network/Google/Resource/Gmail/Users/Threads/Trash.hs +97/−0
- gen/Network/Google/Resource/Gmail/Users/Threads/Untrash.hs +97/−0
- gen/Network/Google/Resource/Gmail/Users/Watch.hs +96/−0
- gogol-gmail.cabal +77/−0
+ LICENSE view
@@ -0,0 +1,367 @@+Mozilla Public License Version 2.0+==================================++1. Definitions+--------------++1.1. "Contributor"+ means each individual or legal entity that creates, contributes to+ the creation of, or owns Covered Software.++1.2. "Contributor Version"+ means the combination of the Contributions of others (if any) used+ by a Contributor and that particular Contributor's Contribution.++1.3. "Contribution"+ means Covered Software of a particular Contributor.++1.4. "Covered Software"+ means Source Code Form to which the initial Contributor has attached+ the notice in Exhibit A, the Executable Form of such Source Code+ Form, and Modifications of such Source Code Form, in each case+ including portions thereof.++1.5. "Incompatible With Secondary Licenses"+ means++ (a) that the initial Contributor has attached the notice described+ in Exhibit B to the Covered Software; or++ (b) that the Covered Software was made available under the terms of+ version 1.1 or earlier of the License, but not also under the+ terms of a Secondary License.++1.6. "Executable Form"+ means any form of the work other than Source Code Form.++1.7. "Larger Work"+ means a work that combines Covered Software with other material, in+ a separate file or files, that is not Covered Software.++1.8. "License"+ means this document.++1.9. "Licensable"+ means having the right to grant, to the maximum extent possible,+ whether at the time of the initial grant or subsequently, any and+ all of the rights conveyed by this License.++1.10. "Modifications"+ means any of the following:++ (a) any file in Source Code Form that results from an addition to,+ deletion from, or modification of the contents of Covered+ Software; or++ (b) any new file in Source Code Form that contains any Covered+ Software.++1.11. "Patent Claims" of a Contributor+ means any patent claim(s), including without limitation, method,+ process, and apparatus claims, in any patent Licensable by such+ Contributor that would be infringed, but for the grant of the+ License, by the making, using, selling, offering for sale, having+ made, import, or transfer of either its Contributions or its+ Contributor Version.++1.12. "Secondary License"+ means either the GNU General Public License, Version 2.0, the GNU+ Lesser General Public License, Version 2.1, the GNU Affero General+ Public License, Version 3.0, or any later versions of those+ licenses.++1.13. "Source Code Form"+ means the form of the work preferred for making modifications.++1.14. "You" (or "Your")+ means an individual or a legal entity exercising rights under this+ License. For legal entities, "You" includes any entity that+ controls, is controlled by, or is under common control with You. For+ purposes of this definition, "control" means (a) the power, direct+ or indirect, to cause the direction or management of such entity,+ whether by contract or otherwise, or (b) ownership of more than+ fifty percent (50%) of the outstanding shares or beneficial+ ownership of such entity.++2. License Grants and Conditions+--------------------------------++2.1. Grants++Each Contributor hereby grants You a world-wide, royalty-free,+non-exclusive license:++(a) under intellectual property rights (other than patent or trademark)+ Licensable by such Contributor to use, reproduce, make available,+ modify, display, perform, distribute, and otherwise exploit its+ Contributions, either on an unmodified basis, with Modifications, or+ as part of a Larger Work; and++(b) under Patent Claims of such Contributor to make, use, sell, offer+ for sale, have made, import, and otherwise transfer either its+ Contributions or its Contributor Version.++2.2. Effective Date++The licenses granted in Section 2.1 with respect to any Contribution+become effective for each Contribution on the date the Contributor first+distributes such Contribution.++2.3. Limitations on Grant Scope++The licenses granted in this Section 2 are the only rights granted under+this License. No additional rights or licenses will be implied from the+distribution or licensing of Covered Software under this License.+Notwithstanding Section 2.1(b) above, no patent license is granted by a+Contributor:++(a) for any code that a Contributor has removed from Covered Software;+ or++(b) for infringements caused by: (i) Your and any other third party's+ modifications of Covered Software, or (ii) the combination of its+ Contributions with other software (except as part of its Contributor+ Version); or++(c) under Patent Claims infringed by Covered Software in the absence of+ its Contributions.++This License does not grant any rights in the trademarks, service marks,+or logos of any Contributor (except as may be necessary to comply with+the notice requirements in Section 3.4).++2.4. Subsequent Licenses++No Contributor makes additional grants as a result of Your choice to+distribute the Covered Software under a subsequent version of this+License (see Section 10.2) or under the terms of a Secondary License (if+permitted under the terms of Section 3.3).++2.5. Representation++Each Contributor represents that the Contributor believes its+Contributions are its original creation(s) or it has sufficient rights+to grant the rights to its Contributions conveyed by this License.++2.6. Fair Use++This License is not intended to limit any rights You have under+applicable copyright doctrines of fair use, fair dealing, or other+equivalents.++2.7. Conditions++Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted+in Section 2.1.++3. Responsibilities+-------------------++3.1. Distribution of Source Form++All distribution of Covered Software in Source Code Form, including any+Modifications that You create or to which You contribute, must be under+the terms of this License. You must inform recipients that the Source+Code Form of the Covered Software is governed by the terms of this+License, and how they can obtain a copy of this License. You may not+attempt to alter or restrict the recipients' rights in the Source Code+Form.++3.2. Distribution of Executable Form++If You distribute Covered Software in Executable Form then:++(a) such Covered Software must also be made available in Source Code+ Form, as described in Section 3.1, and You must inform recipients of+ the Executable Form how they can obtain a copy of such Source Code+ Form by reasonable means in a timely manner, at a charge no more+ than the cost of distribution to the recipient; and++(b) You may distribute such Executable Form under the terms of this+ License, or sublicense it under different terms, provided that the+ license for the Executable Form does not attempt to limit or alter+ the recipients' rights in the Source Code Form under this License.++3.3. Distribution of a Larger Work++You may create and distribute a Larger Work under terms of Your choice,+provided that You also comply with the requirements of this License for+the Covered Software. If the Larger Work is a combination of Covered+Software with a work governed by one or more Secondary Licenses, and the+Covered Software is not Incompatible With Secondary Licenses, this+License permits You to additionally distribute such Covered Software+under the terms of such Secondary License(s), so that the recipient of+the Larger Work may, at their option, further distribute the Covered+Software under the terms of either this License or such Secondary+License(s).++3.4. Notices++You may not remove or alter the substance of any license notices+(including copyright notices, patent notices, disclaimers of warranty,+or limitations of liability) contained within the Source Code Form of+the Covered Software, except that You may alter any license notices to+the extent required to remedy known factual inaccuracies.++3.5. Application of Additional Terms++You may choose to offer, and to charge a fee for, warranty, support,+indemnity or liability obligations to one or more recipients of Covered+Software. However, You may do so only on Your own behalf, and not on+behalf of any Contributor. You must make it absolutely clear that any+such warranty, support, indemnity, or liability obligation is offered by+You alone, and You hereby agree to indemnify every Contributor for any+liability incurred by such Contributor as a result of warranty, support,+indemnity or liability terms You offer. You may include additional+disclaimers of warranty and limitations of liability specific to any+jurisdiction.++4. Inability to Comply Due to Statute or Regulation+---------------------------------------------------++If it is impossible for You to comply with any of the terms of this+License with respect to some or all of the Covered Software due to+statute, judicial order, or regulation then You must: (a) comply with+the terms of this License to the maximum extent possible; and (b)+describe the limitations and the code they affect. Such description must+be placed in a text file included with all distributions of the Covered+Software under this License. Except to the extent prohibited by statute+or regulation, such description must be sufficiently detailed for a+recipient of ordinary skill to be able to understand it.++5. Termination+--------------++5.1. The rights granted under this License will terminate automatically+if You fail to comply with any of its terms. However, if You become+compliant, then the rights granted under this License from a particular+Contributor are reinstated (a) provisionally, unless and until such+Contributor explicitly and finally terminates Your grants, and (b) on an+ongoing basis, if such Contributor fails to notify You of the+non-compliance by some reasonable means prior to 60 days after You have+come back into compliance. Moreover, Your grants from a particular+Contributor are reinstated on an ongoing basis if such Contributor+notifies You of the non-compliance by some reasonable means, this is the+first time You have received notice of non-compliance with this License+from such Contributor, and You become compliant prior to 30 days after+Your receipt of the notice.++5.2. If You initiate litigation against any entity by asserting a patent+infringement claim (excluding declaratory judgment actions,+counter-claims, and cross-claims) alleging that a Contributor Version+directly or indirectly infringes any patent, then the rights granted to+You by any and all Contributors for the Covered Software under Section+2.1 of this License shall terminate.++5.3. In the event of termination under Sections 5.1 or 5.2 above, all+end user license agreements (excluding distributors and resellers) which+have been validly granted by You or Your distributors under this License+prior to termination shall survive termination.++************************************************************************+* *+* 6. Disclaimer of Warranty *+* ------------------------- *+* *+* Covered Software is provided under this License on an "as is" *+* basis, without warranty of any kind, either expressed, implied, or *+* statutory, including, without limitation, warranties that the *+* Covered Software is free of defects, merchantable, fit for a *+* particular purpose or non-infringing. The entire risk as to the *+* quality and performance of the Covered Software is with You. *+* Should any Covered Software prove defective in any respect, You *+* (not any Contributor) assume the cost of any necessary servicing, *+* repair, or correction. This disclaimer of warranty constitutes an *+* essential part of this License. No use of any Covered Software is *+* authorized under this License except under this disclaimer. *+* *+************************************************************************++************************************************************************+* *+* 7. Limitation of Liability *+* -------------------------- *+* *+* Under no circumstances and under no legal theory, whether tort *+* (including negligence), contract, or otherwise, shall any *+* Contributor, or anyone who distributes Covered Software as *+* permitted above, be liable to You for any direct, indirect, *+* special, incidental, or consequential damages of any character *+* including, without limitation, damages for lost profits, loss of *+* goodwill, work stoppage, computer failure or malfunction, or any *+* and all other commercial damages or losses, even if such party *+* shall have been informed of the possibility of such damages. This *+* limitation of liability shall not apply to liability for death or *+* personal injury resulting from such party's negligence to the *+* extent applicable law prohibits such limitation. Some *+* jurisdictions do not allow the exclusion or limitation of *+* incidental or consequential damages, so this exclusion and *+* limitation may not apply to You. *+* *+************************************************************************++8. Litigation+-------------++Any litigation relating to this License may be brought only in the+courts of a jurisdiction where the defendant maintains its principal+place of business and such litigation shall be governed by laws of that+jurisdiction, without reference to its conflict-of-law provisions.+Nothing in this Section shall prevent a party's ability to bring+cross-claims or counter-claims.++9. Miscellaneous+----------------++This License represents the complete agreement concerning the subject+matter hereof. If any provision of this License is held to be+unenforceable, such provision shall be reformed only to the extent+necessary to make it enforceable. Any law or regulation which provides+that the language of a contract shall be construed against the drafter+shall not be used to construe this License against a Contributor.++10. Versions of the License+---------------------------++10.1. New Versions++Mozilla Foundation is the license steward. Except as provided in Section+10.3, no one other than the license steward has the right to modify or+publish new versions of this License. Each version will be given a+distinguishing version number.++10.2. Effect of New Versions++You may distribute the Covered Software under the terms of the version+of the License under which You originally received the Covered Software,+or under the terms of any subsequent version published by the license+steward.++10.3. Modified Versions++If you create software not governed by this License, and you want to+create a new license for such software, you may create and use a+modified version of this License if you rename the license and remove+any references to the name of the license steward (except to note that+such modified license differs from this License).++10.4. Distributing Source Code Form that is Incompatible With Secondary+Licenses++If You choose to distribute Source Code Form that is Incompatible With+Secondary Licenses under the terms of this version of the License, the+notice described in Exhibit B of this License must be attached.++Exhibit A - Source Code Form License Notice+-------------------------------------------++ This Source Code Form is subject to the terms of the Mozilla Public+ License, v. 2.0. If a copy of the MPL was not distributed with this+ file, You can obtain one at http://mozilla.org/MPL/2.0/.++If it is not possible or desirable to put the notice in a particular+file, then You may include the notice in a location (such as a LICENSE+file in a relevant directory) where a recipient would be likely to look+for such a notice.++You may add additional accurate notices of copyright ownership.
+ README.md view
@@ -0,0 +1,28 @@+# gogol-gmail++* [Version](#version)+* [Description](#description)+* [Contribute](#contribute)+* [Licence](#licence)+++## Version++`0.0.1`+++## Description++A client library for the Google Gmail.+++## Contribute++For any problems, comments, or feedback please create an issue [here on GitHub](https://github.com/brendanhay/amazonka/issues).++> _Note:_ this library is an auto-generated Haskell package. Please see `amazonka-gen` for more information.+++## Licence++`gogol-gmail` is released under the [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/).
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ gen/Network/Google/Gmail.hs view
@@ -0,0 +1,387 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}++-- |+-- Module : Network.Google.Gmail+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- The Gmail REST API.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference>+module Network.Google.Gmail+ (+ -- * Service Configuration+ gmailService++ -- * API Declaration+ , GmailAPI++ -- * Resources++ -- ** gmail.users.drafts.create+ , module Network.Google.Resource.Gmail.Users.Drafts.Create++ -- ** gmail.users.drafts.delete+ , module Network.Google.Resource.Gmail.Users.Drafts.Delete++ -- ** gmail.users.drafts.get+ , module Network.Google.Resource.Gmail.Users.Drafts.Get++ -- ** gmail.users.drafts.list+ , module Network.Google.Resource.Gmail.Users.Drafts.List++ -- ** gmail.users.drafts.send+ , module Network.Google.Resource.Gmail.Users.Drafts.Send++ -- ** gmail.users.drafts.update+ , module Network.Google.Resource.Gmail.Users.Drafts.Update++ -- ** gmail.users.getProfile+ , module Network.Google.Resource.Gmail.Users.GetProFile++ -- ** gmail.users.history.list+ , module Network.Google.Resource.Gmail.Users.History.List++ -- ** gmail.users.labels.create+ , module Network.Google.Resource.Gmail.Users.Labels.Create++ -- ** gmail.users.labels.delete+ , module Network.Google.Resource.Gmail.Users.Labels.Delete++ -- ** gmail.users.labels.get+ , module Network.Google.Resource.Gmail.Users.Labels.Get++ -- ** gmail.users.labels.list+ , module Network.Google.Resource.Gmail.Users.Labels.List++ -- ** gmail.users.labels.patch+ , module Network.Google.Resource.Gmail.Users.Labels.Patch++ -- ** gmail.users.labels.update+ , module Network.Google.Resource.Gmail.Users.Labels.Update++ -- ** gmail.users.messages.attachments.get+ , module Network.Google.Resource.Gmail.Users.Messages.Attachments.Get++ -- ** gmail.users.messages.delete+ , module Network.Google.Resource.Gmail.Users.Messages.Delete++ -- ** gmail.users.messages.get+ , module Network.Google.Resource.Gmail.Users.Messages.Get++ -- ** gmail.users.messages.import+ , module Network.Google.Resource.Gmail.Users.Messages.Import++ -- ** gmail.users.messages.insert+ , module Network.Google.Resource.Gmail.Users.Messages.Insert++ -- ** gmail.users.messages.list+ , module Network.Google.Resource.Gmail.Users.Messages.List++ -- ** gmail.users.messages.modify+ , module Network.Google.Resource.Gmail.Users.Messages.Modify++ -- ** gmail.users.messages.send+ , module Network.Google.Resource.Gmail.Users.Messages.Send++ -- ** gmail.users.messages.trash+ , module Network.Google.Resource.Gmail.Users.Messages.Trash++ -- ** gmail.users.messages.untrash+ , module Network.Google.Resource.Gmail.Users.Messages.Untrash++ -- ** gmail.users.stop+ , module Network.Google.Resource.Gmail.Users.Stop++ -- ** gmail.users.threads.delete+ , module Network.Google.Resource.Gmail.Users.Threads.Delete++ -- ** gmail.users.threads.get+ , module Network.Google.Resource.Gmail.Users.Threads.Get++ -- ** gmail.users.threads.list+ , module Network.Google.Resource.Gmail.Users.Threads.List++ -- ** gmail.users.threads.modify+ , module Network.Google.Resource.Gmail.Users.Threads.Modify++ -- ** gmail.users.threads.trash+ , module Network.Google.Resource.Gmail.Users.Threads.Trash++ -- ** gmail.users.threads.untrash+ , module Network.Google.Resource.Gmail.Users.Threads.Untrash++ -- ** gmail.users.watch+ , module Network.Google.Resource.Gmail.Users.Watch++ -- * Types++ -- ** UsersMessagesGetFormat+ , UsersMessagesGetFormat (..)++ -- ** ModifyThreadRequest+ , ModifyThreadRequest+ , modifyThreadRequest+ , mtrRemoveLabelIds+ , mtrAddLabelIds++ -- ** ModifyMessageRequest+ , ModifyMessageRequest+ , modifyMessageRequest+ , mmrRemoveLabelIds+ , mmrAddLabelIds++ -- ** History+ , History+ , history+ , hLabelsRemoved+ , hMessagesDeleted+ , hMessagesAdded+ , hLabelsAdded+ , hId+ , hMessages++ -- ** ProFile+ , ProFile+ , proFile+ , pfMessagesTotal+ , pfThreadsTotal+ , pfHistoryId+ , pfEmailAddress++ -- ** MessagePartHeader+ , MessagePartHeader+ , messagePartHeader+ , mphValue+ , mphName++ -- ** ListHistoryResponse+ , ListHistoryResponse+ , listHistoryResponse+ , lhrNextPageToken+ , lhrHistory+ , lhrHistoryId++ -- ** LabelType+ , LabelType (..)++ -- ** UsersDraftsGetFormat+ , UsersDraftsGetFormat (..)++ -- ** UsersMessagesImportInternalDateSource+ , UsersMessagesImportInternalDateSource (..)++ -- ** LabelMessageListVisibility+ , LabelMessageListVisibility (..)++ -- ** ListThreadsResponse+ , ListThreadsResponse+ , listThreadsResponse+ , ltrNextPageToken+ , ltrResultSizeEstimate+ , ltrThreads++ -- ** MessagePart+ , MessagePart+ , messagePart+ , mpParts+ , mpBody+ , mpMimeType+ , mpHeaders+ , mpPartId+ , mpFilename++ -- ** HistoryLabelAdded+ , HistoryLabelAdded+ , historyLabelAdded+ , hlaLabelIds+ , hlaMessage++ -- ** ListLabelsResponse+ , ListLabelsResponse+ , listLabelsResponse+ , llrLabels++ -- ** LabelLabelListVisibility+ , LabelLabelListVisibility (..)++ -- ** HistoryMessageDeleted+ , HistoryMessageDeleted+ , historyMessageDeleted+ , hmdMessage++ -- ** MessagePartBody+ , MessagePartBody+ , messagePartBody+ , mpbSize+ , mpbData+ , mpbAttachmentId++ -- ** ListDraftsResponse+ , ListDraftsResponse+ , listDraftsResponse+ , ldrNextPageToken+ , ldrResultSizeEstimate+ , ldrDrafts++ -- ** WatchResponse+ , WatchResponse+ , watchResponse+ , wrExpiration+ , wrHistoryId++ -- ** UsersThreadsGetFormat+ , UsersThreadsGetFormat (..)++ -- ** Draft+ , Draft+ , draft+ , dId+ , dMessage++ -- ** WatchRequest+ , WatchRequest+ , watchRequest+ , wrLabelFilterAction+ , wrTopicName+ , wrLabelIds++ -- ** WatchRequestLabelFilterAction+ , WatchRequestLabelFilterAction (..)++ -- ** Message+ , Message+ , message+ , mRaw+ , mSnippet+ , mSizeEstimate+ , mPayload+ , mHistoryId+ , mId+ , mLabelIds+ , mThreadId+ , mInternalDate++ -- ** UsersMessagesInsertInternalDateSource+ , UsersMessagesInsertInternalDateSource (..)++ -- ** HistoryLabelRemoved+ , HistoryLabelRemoved+ , historyLabelRemoved+ , hlrLabelIds+ , hlrMessage++ -- ** Thread+ , Thread+ , thread+ , tSnippet+ , tHistoryId+ , tId+ , tMessages++ -- ** Label+ , Label+ , label+ , lThreadsUnread+ , lMessageListVisibility+ , lMessagesTotal+ , lMessagesUnread+ , lName+ , lThreadsTotal+ , lLabelListVisibility+ , lId+ , lType++ -- ** ListMessagesResponse+ , ListMessagesResponse+ , listMessagesResponse+ , lmrNextPageToken+ , lmrResultSizeEstimate+ , lmrMessages++ -- ** HistoryMessageAdded+ , HistoryMessageAdded+ , historyMessageAdded+ , hmaMessage+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude+import Network.Google.Resource.Gmail.Users.Drafts.Create+import Network.Google.Resource.Gmail.Users.Drafts.Delete+import Network.Google.Resource.Gmail.Users.Drafts.Get+import Network.Google.Resource.Gmail.Users.Drafts.List+import Network.Google.Resource.Gmail.Users.Drafts.Send+import Network.Google.Resource.Gmail.Users.Drafts.Update+import Network.Google.Resource.Gmail.Users.GetProFile+import Network.Google.Resource.Gmail.Users.History.List+import Network.Google.Resource.Gmail.Users.Labels.Create+import Network.Google.Resource.Gmail.Users.Labels.Delete+import Network.Google.Resource.Gmail.Users.Labels.Get+import Network.Google.Resource.Gmail.Users.Labels.List+import Network.Google.Resource.Gmail.Users.Labels.Patch+import Network.Google.Resource.Gmail.Users.Labels.Update+import Network.Google.Resource.Gmail.Users.Messages.Attachments.Get+import Network.Google.Resource.Gmail.Users.Messages.Delete+import Network.Google.Resource.Gmail.Users.Messages.Get+import Network.Google.Resource.Gmail.Users.Messages.Import+import Network.Google.Resource.Gmail.Users.Messages.Insert+import Network.Google.Resource.Gmail.Users.Messages.List+import Network.Google.Resource.Gmail.Users.Messages.Modify+import Network.Google.Resource.Gmail.Users.Messages.Send+import Network.Google.Resource.Gmail.Users.Messages.Trash+import Network.Google.Resource.Gmail.Users.Messages.Untrash+import Network.Google.Resource.Gmail.Users.Stop+import Network.Google.Resource.Gmail.Users.Threads.Delete+import Network.Google.Resource.Gmail.Users.Threads.Get+import Network.Google.Resource.Gmail.Users.Threads.List+import Network.Google.Resource.Gmail.Users.Threads.Modify+import Network.Google.Resource.Gmail.Users.Threads.Trash+import Network.Google.Resource.Gmail.Users.Threads.Untrash+import Network.Google.Resource.Gmail.Users.Watch++{- $resources+TODO+-}++-- | Represents the entirety of the methods and resources available for the Gmail API service.+type GmailAPI =+ UsersHistoryListResource :<|> UsersDraftsListResource+ :<|> UsersDraftsGetResource+ :<|> UsersDraftsCreateResource+ :<|> UsersDraftsSendResource+ :<|> UsersDraftsDeleteResource+ :<|> UsersDraftsUpdateResource+ :<|> UsersLabelsListResource+ :<|> UsersLabelsPatchResource+ :<|> UsersLabelsGetResource+ :<|> UsersLabelsCreateResource+ :<|> UsersLabelsDeleteResource+ :<|> UsersLabelsUpdateResource+ :<|> UsersThreadsListResource+ :<|> UsersThreadsGetResource+ :<|> UsersThreadsTrashResource+ :<|> UsersThreadsUntrashResource+ :<|> UsersThreadsModifyResource+ :<|> UsersThreadsDeleteResource+ :<|> UsersMessagesAttachmentsGetResource+ :<|> UsersMessagesInsertResource+ :<|> UsersMessagesListResource+ :<|> UsersMessagesGetResource+ :<|> UsersMessagesTrashResource+ :<|> UsersMessagesSendResource+ :<|> UsersMessagesUntrashResource+ :<|> UsersMessagesImportResource+ :<|> UsersMessagesModifyResource+ :<|> UsersMessagesDeleteResource+ :<|> UsersGetProFileResource+ :<|> UsersStopResource+ :<|> UsersWatchResource
+ gen/Network/Google/Gmail/Types.hs view
@@ -0,0 +1,255 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Gmail.Types+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Network.Google.Gmail.Types+ (+ -- * Service Configuration+ gmailService++ -- * OAuth Scopes+ , gmailAllScope+ , gmailModifyScope+ , gmailLabelsScope+ , gmailSendScope+ , gmailInsertScope+ , gmailComposeScope+ , gmailReadonlyScope++ -- * UsersMessagesGetFormat+ , UsersMessagesGetFormat (..)++ -- * ModifyThreadRequest+ , ModifyThreadRequest+ , modifyThreadRequest+ , mtrRemoveLabelIds+ , mtrAddLabelIds++ -- * ModifyMessageRequest+ , ModifyMessageRequest+ , modifyMessageRequest+ , mmrRemoveLabelIds+ , mmrAddLabelIds++ -- * History+ , History+ , history+ , hLabelsRemoved+ , hMessagesDeleted+ , hMessagesAdded+ , hLabelsAdded+ , hId+ , hMessages++ -- * ProFile+ , ProFile+ , proFile+ , pfMessagesTotal+ , pfThreadsTotal+ , pfHistoryId+ , pfEmailAddress++ -- * MessagePartHeader+ , MessagePartHeader+ , messagePartHeader+ , mphValue+ , mphName++ -- * ListHistoryResponse+ , ListHistoryResponse+ , listHistoryResponse+ , lhrNextPageToken+ , lhrHistory+ , lhrHistoryId++ -- * LabelType+ , LabelType (..)++ -- * UsersDraftsGetFormat+ , UsersDraftsGetFormat (..)++ -- * UsersMessagesImportInternalDateSource+ , UsersMessagesImportInternalDateSource (..)++ -- * LabelMessageListVisibility+ , LabelMessageListVisibility (..)++ -- * ListThreadsResponse+ , ListThreadsResponse+ , listThreadsResponse+ , ltrNextPageToken+ , ltrResultSizeEstimate+ , ltrThreads++ -- * MessagePart+ , MessagePart+ , messagePart+ , mpParts+ , mpBody+ , mpMimeType+ , mpHeaders+ , mpPartId+ , mpFilename++ -- * HistoryLabelAdded+ , HistoryLabelAdded+ , historyLabelAdded+ , hlaLabelIds+ , hlaMessage++ -- * ListLabelsResponse+ , ListLabelsResponse+ , listLabelsResponse+ , llrLabels++ -- * LabelLabelListVisibility+ , LabelLabelListVisibility (..)++ -- * HistoryMessageDeleted+ , HistoryMessageDeleted+ , historyMessageDeleted+ , hmdMessage++ -- * MessagePartBody+ , MessagePartBody+ , messagePartBody+ , mpbSize+ , mpbData+ , mpbAttachmentId++ -- * ListDraftsResponse+ , ListDraftsResponse+ , listDraftsResponse+ , ldrNextPageToken+ , ldrResultSizeEstimate+ , ldrDrafts++ -- * WatchResponse+ , WatchResponse+ , watchResponse+ , wrExpiration+ , wrHistoryId++ -- * UsersThreadsGetFormat+ , UsersThreadsGetFormat (..)++ -- * Draft+ , Draft+ , draft+ , dId+ , dMessage++ -- * WatchRequest+ , WatchRequest+ , watchRequest+ , wrLabelFilterAction+ , wrTopicName+ , wrLabelIds++ -- * WatchRequestLabelFilterAction+ , WatchRequestLabelFilterAction (..)++ -- * Message+ , Message+ , message+ , mRaw+ , mSnippet+ , mSizeEstimate+ , mPayload+ , mHistoryId+ , mId+ , mLabelIds+ , mThreadId+ , mInternalDate++ -- * UsersMessagesInsertInternalDateSource+ , UsersMessagesInsertInternalDateSource (..)++ -- * HistoryLabelRemoved+ , HistoryLabelRemoved+ , historyLabelRemoved+ , hlrLabelIds+ , hlrMessage++ -- * Thread+ , Thread+ , thread+ , tSnippet+ , tHistoryId+ , tId+ , tMessages++ -- * Label+ , Label+ , label+ , lThreadsUnread+ , lMessageListVisibility+ , lMessagesTotal+ , lMessagesUnread+ , lName+ , lThreadsTotal+ , lLabelListVisibility+ , lId+ , lType++ -- * ListMessagesResponse+ , ListMessagesResponse+ , listMessagesResponse+ , lmrNextPageToken+ , lmrResultSizeEstimate+ , lmrMessages++ -- * HistoryMessageAdded+ , HistoryMessageAdded+ , historyMessageAdded+ , hmaMessage+ ) where++import Network.Google.Gmail.Types.Product+import Network.Google.Gmail.Types.Sum+import Network.Google.Prelude++-- | Default request referring to version 'v1' of the Gmail API. This contains the host and root path used as a starting point for constructing service requests.+gmailService :: Service+gmailService+ = defaultService (ServiceId "gmail:v1")+ "www.googleapis.com"++-- | View and manage your mail+gmailAllScope :: OAuthScope+gmailAllScope = "https://mail.google.com/";++-- | View and modify but not delete your email+gmailModifyScope :: OAuthScope+gmailModifyScope = "https://www.googleapis.com/auth/gmail.modify";++-- | Manage mailbox labels+gmailLabelsScope :: OAuthScope+gmailLabelsScope = "https://www.googleapis.com/auth/gmail.labels";++-- | Send email on your behalf+gmailSendScope :: OAuthScope+gmailSendScope = "https://www.googleapis.com/auth/gmail.send";++-- | Insert mail into your mailbox+gmailInsertScope :: OAuthScope+gmailInsertScope = "https://www.googleapis.com/auth/gmail.insert";++-- | Manage drafts and send emails+gmailComposeScope :: OAuthScope+gmailComposeScope = "https://www.googleapis.com/auth/gmail.compose";++-- | View your emails messages and settings+gmailReadonlyScope :: OAuthScope+gmailReadonlyScope = "https://www.googleapis.com/auth/gmail.readonly";
+ gen/Network/Google/Gmail/Types/Product.hs view
@@ -0,0 +1,1472 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}++{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Gmail.Types.Product+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Network.Google.Gmail.Types.Product where++import Network.Google.Gmail.Types.Sum+import Network.Google.Prelude++--+-- /See:/ 'modifyThreadRequest' smart constructor.+data ModifyThreadRequest = ModifyThreadRequest+ { _mtrRemoveLabelIds :: !(Maybe [Text])+ , _mtrAddLabelIds :: !(Maybe [Text])+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'ModifyThreadRequest' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'mtrRemoveLabelIds'+--+-- * 'mtrAddLabelIds'+modifyThreadRequest+ :: ModifyThreadRequest+modifyThreadRequest =+ ModifyThreadRequest+ { _mtrRemoveLabelIds = Nothing+ , _mtrAddLabelIds = Nothing+ }++-- | A list of IDs of labels to remove from this thread.+mtrRemoveLabelIds :: Lens' ModifyThreadRequest [Text]+mtrRemoveLabelIds+ = lens _mtrRemoveLabelIds+ (\ s a -> s{_mtrRemoveLabelIds = a})+ . _Default+ . _Coerce++-- | A list of IDs of labels to add to this thread.+mtrAddLabelIds :: Lens' ModifyThreadRequest [Text]+mtrAddLabelIds+ = lens _mtrAddLabelIds+ (\ s a -> s{_mtrAddLabelIds = a})+ . _Default+ . _Coerce++instance FromJSON ModifyThreadRequest where+ parseJSON+ = withObject "ModifyThreadRequest"+ (\ o ->+ ModifyThreadRequest <$>+ (o .:? "removeLabelIds" .!= mempty) <*>+ (o .:? "addLabelIds" .!= mempty))++instance ToJSON ModifyThreadRequest where+ toJSON ModifyThreadRequest{..}+ = object+ (catMaybes+ [("removeLabelIds" .=) <$> _mtrRemoveLabelIds,+ ("addLabelIds" .=) <$> _mtrAddLabelIds])++--+-- /See:/ 'modifyMessageRequest' smart constructor.+data ModifyMessageRequest = ModifyMessageRequest+ { _mmrRemoveLabelIds :: !(Maybe [Text])+ , _mmrAddLabelIds :: !(Maybe [Text])+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'ModifyMessageRequest' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'mmrRemoveLabelIds'+--+-- * 'mmrAddLabelIds'+modifyMessageRequest+ :: ModifyMessageRequest+modifyMessageRequest =+ ModifyMessageRequest+ { _mmrRemoveLabelIds = Nothing+ , _mmrAddLabelIds = Nothing+ }++-- | A list IDs of labels to remove from this message.+mmrRemoveLabelIds :: Lens' ModifyMessageRequest [Text]+mmrRemoveLabelIds+ = lens _mmrRemoveLabelIds+ (\ s a -> s{_mmrRemoveLabelIds = a})+ . _Default+ . _Coerce++-- | A list of IDs of labels to add to this message.+mmrAddLabelIds :: Lens' ModifyMessageRequest [Text]+mmrAddLabelIds+ = lens _mmrAddLabelIds+ (\ s a -> s{_mmrAddLabelIds = a})+ . _Default+ . _Coerce++instance FromJSON ModifyMessageRequest where+ parseJSON+ = withObject "ModifyMessageRequest"+ (\ o ->+ ModifyMessageRequest <$>+ (o .:? "removeLabelIds" .!= mempty) <*>+ (o .:? "addLabelIds" .!= mempty))++instance ToJSON ModifyMessageRequest where+ toJSON ModifyMessageRequest{..}+ = object+ (catMaybes+ [("removeLabelIds" .=) <$> _mmrRemoveLabelIds,+ ("addLabelIds" .=) <$> _mmrAddLabelIds])++-- | A record of a change to the user\'s mailbox. Each history change may+-- affect multiple messages in multiple ways.+--+-- /See:/ 'history' smart constructor.+data History = History+ { _hLabelsRemoved :: !(Maybe [HistoryLabelRemoved])+ , _hMessagesDeleted :: !(Maybe [HistoryMessageDeleted])+ , _hMessagesAdded :: !(Maybe [HistoryMessageAdded])+ , _hLabelsAdded :: !(Maybe [HistoryLabelAdded])+ , _hId :: !(Maybe (Textual Word64))+ , _hMessages :: !(Maybe [Message])+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'History' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'hLabelsRemoved'+--+-- * 'hMessagesDeleted'+--+-- * 'hMessagesAdded'+--+-- * 'hLabelsAdded'+--+-- * 'hId'+--+-- * 'hMessages'+history+ :: History+history =+ History+ { _hLabelsRemoved = Nothing+ , _hMessagesDeleted = Nothing+ , _hMessagesAdded = Nothing+ , _hLabelsAdded = Nothing+ , _hId = Nothing+ , _hMessages = Nothing+ }++-- | Labels removed from messages in this history record.+hLabelsRemoved :: Lens' History [HistoryLabelRemoved]+hLabelsRemoved+ = lens _hLabelsRemoved+ (\ s a -> s{_hLabelsRemoved = a})+ . _Default+ . _Coerce++-- | Messages deleted (not Trashed) from the mailbox in this history record.+hMessagesDeleted :: Lens' History [HistoryMessageDeleted]+hMessagesDeleted+ = lens _hMessagesDeleted+ (\ s a -> s{_hMessagesDeleted = a})+ . _Default+ . _Coerce++-- | Messages added to the mailbox in this history record.+hMessagesAdded :: Lens' History [HistoryMessageAdded]+hMessagesAdded+ = lens _hMessagesAdded+ (\ s a -> s{_hMessagesAdded = a})+ . _Default+ . _Coerce++-- | Labels added to messages in this history record.+hLabelsAdded :: Lens' History [HistoryLabelAdded]+hLabelsAdded+ = lens _hLabelsAdded (\ s a -> s{_hLabelsAdded = a})+ . _Default+ . _Coerce++-- | The mailbox sequence ID.+hId :: Lens' History (Maybe Word64)+hId+ = lens _hId (\ s a -> s{_hId = a}) . mapping _Coerce++-- | List of messages changed in this history record. The fields for specific+-- change types, such as messagesAdded may duplicate messages in this+-- field. We recommend using the specific change-type fields instead of+-- this.+hMessages :: Lens' History [Message]+hMessages+ = lens _hMessages (\ s a -> s{_hMessages = a}) .+ _Default+ . _Coerce++instance FromJSON History where+ parseJSON+ = withObject "History"+ (\ o ->+ History <$>+ (o .:? "labelsRemoved" .!= mempty) <*>+ (o .:? "messagesDeleted" .!= mempty)+ <*> (o .:? "messagesAdded" .!= mempty)+ <*> (o .:? "labelsAdded" .!= mempty)+ <*> (o .:? "id")+ <*> (o .:? "messages" .!= mempty))++instance ToJSON History where+ toJSON History{..}+ = object+ (catMaybes+ [("labelsRemoved" .=) <$> _hLabelsRemoved,+ ("messagesDeleted" .=) <$> _hMessagesDeleted,+ ("messagesAdded" .=) <$> _hMessagesAdded,+ ("labelsAdded" .=) <$> _hLabelsAdded,+ ("id" .=) <$> _hId, ("messages" .=) <$> _hMessages])++-- | Profile for a Gmail user.+--+-- /See:/ 'proFile' smart constructor.+data ProFile = ProFile+ { _pfMessagesTotal :: !(Maybe (Textual Int32))+ , _pfThreadsTotal :: !(Maybe (Textual Int32))+ , _pfHistoryId :: !(Maybe (Textual Word64))+ , _pfEmailAddress :: !(Maybe Text)+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'ProFile' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'pfMessagesTotal'+--+-- * 'pfThreadsTotal'+--+-- * 'pfHistoryId'+--+-- * 'pfEmailAddress'+proFile+ :: ProFile+proFile =+ ProFile+ { _pfMessagesTotal = Nothing+ , _pfThreadsTotal = Nothing+ , _pfHistoryId = Nothing+ , _pfEmailAddress = Nothing+ }++-- | The total number of messages in the mailbox.+pfMessagesTotal :: Lens' ProFile (Maybe Int32)+pfMessagesTotal+ = lens _pfMessagesTotal+ (\ s a -> s{_pfMessagesTotal = a})+ . mapping _Coerce++-- | The total number of threads in the mailbox.+pfThreadsTotal :: Lens' ProFile (Maybe Int32)+pfThreadsTotal+ = lens _pfThreadsTotal+ (\ s a -> s{_pfThreadsTotal = a})+ . mapping _Coerce++-- | The ID of the mailbox\'s current history record.+pfHistoryId :: Lens' ProFile (Maybe Word64)+pfHistoryId+ = lens _pfHistoryId (\ s a -> s{_pfHistoryId = a}) .+ mapping _Coerce++-- | The user\'s email address.+pfEmailAddress :: Lens' ProFile (Maybe Text)+pfEmailAddress+ = lens _pfEmailAddress+ (\ s a -> s{_pfEmailAddress = a})++instance FromJSON ProFile where+ parseJSON+ = withObject "ProFile"+ (\ o ->+ ProFile <$>+ (o .:? "messagesTotal") <*> (o .:? "threadsTotal")+ <*> (o .:? "historyId")+ <*> (o .:? "emailAddress"))++instance ToJSON ProFile where+ toJSON ProFile{..}+ = object+ (catMaybes+ [("messagesTotal" .=) <$> _pfMessagesTotal,+ ("threadsTotal" .=) <$> _pfThreadsTotal,+ ("historyId" .=) <$> _pfHistoryId,+ ("emailAddress" .=) <$> _pfEmailAddress])++--+-- /See:/ 'messagePartHeader' smart constructor.+data MessagePartHeader = MessagePartHeader+ { _mphValue :: !(Maybe Text)+ , _mphName :: !(Maybe Text)+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'MessagePartHeader' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'mphValue'+--+-- * 'mphName'+messagePartHeader+ :: MessagePartHeader+messagePartHeader =+ MessagePartHeader+ { _mphValue = Nothing+ , _mphName = Nothing+ }++-- | The value of the header after the : separator. For example,+-- someuser\'example.com.+mphValue :: Lens' MessagePartHeader (Maybe Text)+mphValue = lens _mphValue (\ s a -> s{_mphValue = a})++-- | The name of the header before the : separator. For example, To.+mphName :: Lens' MessagePartHeader (Maybe Text)+mphName = lens _mphName (\ s a -> s{_mphName = a})++instance FromJSON MessagePartHeader where+ parseJSON+ = withObject "MessagePartHeader"+ (\ o ->+ MessagePartHeader <$>+ (o .:? "value") <*> (o .:? "name"))++instance ToJSON MessagePartHeader where+ toJSON MessagePartHeader{..}+ = object+ (catMaybes+ [("value" .=) <$> _mphValue,+ ("name" .=) <$> _mphName])++--+-- /See:/ 'listHistoryResponse' smart constructor.+data ListHistoryResponse = ListHistoryResponse+ { _lhrNextPageToken :: !(Maybe Text)+ , _lhrHistory :: !(Maybe [History])+ , _lhrHistoryId :: !(Maybe (Textual Word64))+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'ListHistoryResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'lhrNextPageToken'+--+-- * 'lhrHistory'+--+-- * 'lhrHistoryId'+listHistoryResponse+ :: ListHistoryResponse+listHistoryResponse =+ ListHistoryResponse+ { _lhrNextPageToken = Nothing+ , _lhrHistory = Nothing+ , _lhrHistoryId = Nothing+ }++-- | Page token to retrieve the next page of results in the list.+lhrNextPageToken :: Lens' ListHistoryResponse (Maybe Text)+lhrNextPageToken+ = lens _lhrNextPageToken+ (\ s a -> s{_lhrNextPageToken = a})++-- | List of history records. Any messages contained in the response will+-- typically only have id and threadId fields populated.+lhrHistory :: Lens' ListHistoryResponse [History]+lhrHistory+ = lens _lhrHistory (\ s a -> s{_lhrHistory = a}) .+ _Default+ . _Coerce++-- | The ID of the mailbox\'s current history record.+lhrHistoryId :: Lens' ListHistoryResponse (Maybe Word64)+lhrHistoryId+ = lens _lhrHistoryId (\ s a -> s{_lhrHistoryId = a})+ . mapping _Coerce++instance FromJSON ListHistoryResponse where+ parseJSON+ = withObject "ListHistoryResponse"+ (\ o ->+ ListHistoryResponse <$>+ (o .:? "nextPageToken") <*>+ (o .:? "history" .!= mempty)+ <*> (o .:? "historyId"))++instance ToJSON ListHistoryResponse where+ toJSON ListHistoryResponse{..}+ = object+ (catMaybes+ [("nextPageToken" .=) <$> _lhrNextPageToken,+ ("history" .=) <$> _lhrHistory,+ ("historyId" .=) <$> _lhrHistoryId])++--+-- /See:/ 'listThreadsResponse' smart constructor.+data ListThreadsResponse = ListThreadsResponse+ { _ltrNextPageToken :: !(Maybe Text)+ , _ltrResultSizeEstimate :: !(Maybe (Textual Word32))+ , _ltrThreads :: !(Maybe [Thread])+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'ListThreadsResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'ltrNextPageToken'+--+-- * 'ltrResultSizeEstimate'+--+-- * 'ltrThreads'+listThreadsResponse+ :: ListThreadsResponse+listThreadsResponse =+ ListThreadsResponse+ { _ltrNextPageToken = Nothing+ , _ltrResultSizeEstimate = Nothing+ , _ltrThreads = Nothing+ }++-- | Page token to retrieve the next page of results in the list.+ltrNextPageToken :: Lens' ListThreadsResponse (Maybe Text)+ltrNextPageToken+ = lens _ltrNextPageToken+ (\ s a -> s{_ltrNextPageToken = a})++-- | Estimated total number of results.+ltrResultSizeEstimate :: Lens' ListThreadsResponse (Maybe Word32)+ltrResultSizeEstimate+ = lens _ltrResultSizeEstimate+ (\ s a -> s{_ltrResultSizeEstimate = a})+ . mapping _Coerce++-- | List of threads.+ltrThreads :: Lens' ListThreadsResponse [Thread]+ltrThreads+ = lens _ltrThreads (\ s a -> s{_ltrThreads = a}) .+ _Default+ . _Coerce++instance FromJSON ListThreadsResponse where+ parseJSON+ = withObject "ListThreadsResponse"+ (\ o ->+ ListThreadsResponse <$>+ (o .:? "nextPageToken") <*>+ (o .:? "resultSizeEstimate")+ <*> (o .:? "threads" .!= mempty))++instance ToJSON ListThreadsResponse where+ toJSON ListThreadsResponse{..}+ = object+ (catMaybes+ [("nextPageToken" .=) <$> _ltrNextPageToken,+ ("resultSizeEstimate" .=) <$> _ltrResultSizeEstimate,+ ("threads" .=) <$> _ltrThreads])++-- | A single MIME message part.+--+-- /See:/ 'messagePart' smart constructor.+data MessagePart = MessagePart+ { _mpParts :: !(Maybe [MessagePart])+ , _mpBody :: !(Maybe MessagePartBody)+ , _mpMimeType :: !(Maybe Text)+ , _mpHeaders :: !(Maybe [MessagePartHeader])+ , _mpPartId :: !(Maybe Text)+ , _mpFilename :: !(Maybe Text)+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'MessagePart' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'mpParts'+--+-- * 'mpBody'+--+-- * 'mpMimeType'+--+-- * 'mpHeaders'+--+-- * 'mpPartId'+--+-- * 'mpFilename'+messagePart+ :: MessagePart+messagePart =+ MessagePart+ { _mpParts = Nothing+ , _mpBody = Nothing+ , _mpMimeType = Nothing+ , _mpHeaders = Nothing+ , _mpPartId = Nothing+ , _mpFilename = Nothing+ }++-- | The child MIME message parts of this part. This only applies to+-- container MIME message parts, for example multipart\/*. For non-+-- container MIME message part types, such as text\/plain, this field is+-- empty. For more information, see RFC 1521.+mpParts :: Lens' MessagePart [MessagePart]+mpParts+ = lens _mpParts (\ s a -> s{_mpParts = a}) . _Default+ . _Coerce++-- | The message part body for this part, which may be empty for container+-- MIME message parts.+mpBody :: Lens' MessagePart (Maybe MessagePartBody)+mpBody = lens _mpBody (\ s a -> s{_mpBody = a})++-- | The MIME type of the message part.+mpMimeType :: Lens' MessagePart (Maybe Text)+mpMimeType+ = lens _mpMimeType (\ s a -> s{_mpMimeType = a})++-- | List of headers on this message part. For the top-level message part,+-- representing the entire message payload, it will contain the standard+-- RFC 2822 email headers such as To, From, and Subject.+mpHeaders :: Lens' MessagePart [MessagePartHeader]+mpHeaders+ = lens _mpHeaders (\ s a -> s{_mpHeaders = a}) .+ _Default+ . _Coerce++-- | The immutable ID of the message part.+mpPartId :: Lens' MessagePart (Maybe Text)+mpPartId = lens _mpPartId (\ s a -> s{_mpPartId = a})++-- | The filename of the attachment. Only present if this message part+-- represents an attachment.+mpFilename :: Lens' MessagePart (Maybe Text)+mpFilename+ = lens _mpFilename (\ s a -> s{_mpFilename = a})++instance FromJSON MessagePart where+ parseJSON+ = withObject "MessagePart"+ (\ o ->+ MessagePart <$>+ (o .:? "parts" .!= mempty) <*> (o .:? "body") <*>+ (o .:? "mimeType")+ <*> (o .:? "headers" .!= mempty)+ <*> (o .:? "partId")+ <*> (o .:? "filename"))++instance ToJSON MessagePart where+ toJSON MessagePart{..}+ = object+ (catMaybes+ [("parts" .=) <$> _mpParts, ("body" .=) <$> _mpBody,+ ("mimeType" .=) <$> _mpMimeType,+ ("headers" .=) <$> _mpHeaders,+ ("partId" .=) <$> _mpPartId,+ ("filename" .=) <$> _mpFilename])++--+-- /See:/ 'historyLabelAdded' smart constructor.+data HistoryLabelAdded = HistoryLabelAdded+ { _hlaLabelIds :: !(Maybe [Text])+ , _hlaMessage :: !(Maybe Message)+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'HistoryLabelAdded' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'hlaLabelIds'+--+-- * 'hlaMessage'+historyLabelAdded+ :: HistoryLabelAdded+historyLabelAdded =+ HistoryLabelAdded+ { _hlaLabelIds = Nothing+ , _hlaMessage = Nothing+ }++-- | Label IDs added to the message.+hlaLabelIds :: Lens' HistoryLabelAdded [Text]+hlaLabelIds+ = lens _hlaLabelIds (\ s a -> s{_hlaLabelIds = a}) .+ _Default+ . _Coerce++hlaMessage :: Lens' HistoryLabelAdded (Maybe Message)+hlaMessage+ = lens _hlaMessage (\ s a -> s{_hlaMessage = a})++instance FromJSON HistoryLabelAdded where+ parseJSON+ = withObject "HistoryLabelAdded"+ (\ o ->+ HistoryLabelAdded <$>+ (o .:? "labelIds" .!= mempty) <*> (o .:? "message"))++instance ToJSON HistoryLabelAdded where+ toJSON HistoryLabelAdded{..}+ = object+ (catMaybes+ [("labelIds" .=) <$> _hlaLabelIds,+ ("message" .=) <$> _hlaMessage])++--+-- /See:/ 'listLabelsResponse' smart constructor.+newtype ListLabelsResponse = ListLabelsResponse+ { _llrLabels :: Maybe [Label]+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'ListLabelsResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'llrLabels'+listLabelsResponse+ :: ListLabelsResponse+listLabelsResponse =+ ListLabelsResponse+ { _llrLabels = Nothing+ }++-- | List of labels.+llrLabels :: Lens' ListLabelsResponse [Label]+llrLabels+ = lens _llrLabels (\ s a -> s{_llrLabels = a}) .+ _Default+ . _Coerce++instance FromJSON ListLabelsResponse where+ parseJSON+ = withObject "ListLabelsResponse"+ (\ o ->+ ListLabelsResponse <$> (o .:? "labels" .!= mempty))++instance ToJSON ListLabelsResponse where+ toJSON ListLabelsResponse{..}+ = object (catMaybes [("labels" .=) <$> _llrLabels])++--+-- /See:/ 'historyMessageDeleted' smart constructor.+newtype HistoryMessageDeleted = HistoryMessageDeleted+ { _hmdMessage :: Maybe Message+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'HistoryMessageDeleted' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'hmdMessage'+historyMessageDeleted+ :: HistoryMessageDeleted+historyMessageDeleted =+ HistoryMessageDeleted+ { _hmdMessage = Nothing+ }++hmdMessage :: Lens' HistoryMessageDeleted (Maybe Message)+hmdMessage+ = lens _hmdMessage (\ s a -> s{_hmdMessage = a})++instance FromJSON HistoryMessageDeleted where+ parseJSON+ = withObject "HistoryMessageDeleted"+ (\ o -> HistoryMessageDeleted <$> (o .:? "message"))++instance ToJSON HistoryMessageDeleted where+ toJSON HistoryMessageDeleted{..}+ = object (catMaybes [("message" .=) <$> _hmdMessage])++-- | The body of a single MIME message part.+--+-- /See:/ 'messagePartBody' smart constructor.+data MessagePartBody = MessagePartBody+ { _mpbSize :: !(Maybe (Textual Int32))+ , _mpbData :: !(Maybe (Textual Word8))+ , _mpbAttachmentId :: !(Maybe Text)+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'MessagePartBody' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'mpbSize'+--+-- * 'mpbData'+--+-- * 'mpbAttachmentId'+messagePartBody+ :: MessagePartBody+messagePartBody =+ MessagePartBody+ { _mpbSize = Nothing+ , _mpbData = Nothing+ , _mpbAttachmentId = Nothing+ }++-- | Total number of bytes in the body of the message part.+mpbSize :: Lens' MessagePartBody (Maybe Int32)+mpbSize+ = lens _mpbSize (\ s a -> s{_mpbSize = a}) .+ mapping _Coerce++-- | The body data of a MIME message part. May be empty for MIME container+-- types that have no message body or when the body data is sent as a+-- separate attachment. An attachment ID is present if the body data is+-- contained in a separate attachment.+mpbData :: Lens' MessagePartBody (Maybe Word8)+mpbData+ = lens _mpbData (\ s a -> s{_mpbData = a}) .+ mapping _Coerce++-- | When present, contains the ID of an external attachment that can be+-- retrieved in a separate messages.attachments.get request. When not+-- present, the entire content of the message part body is contained in the+-- data field.+mpbAttachmentId :: Lens' MessagePartBody (Maybe Text)+mpbAttachmentId+ = lens _mpbAttachmentId+ (\ s a -> s{_mpbAttachmentId = a})++instance FromJSON MessagePartBody where+ parseJSON+ = withObject "MessagePartBody"+ (\ o ->+ MessagePartBody <$>+ (o .:? "size") <*> (o .:? "data") <*>+ (o .:? "attachmentId"))++instance ToJSON MessagePartBody where+ toJSON MessagePartBody{..}+ = object+ (catMaybes+ [("size" .=) <$> _mpbSize, ("data" .=) <$> _mpbData,+ ("attachmentId" .=) <$> _mpbAttachmentId])++--+-- /See:/ 'listDraftsResponse' smart constructor.+data ListDraftsResponse = ListDraftsResponse+ { _ldrNextPageToken :: !(Maybe Text)+ , _ldrResultSizeEstimate :: !(Maybe (Textual Word32))+ , _ldrDrafts :: !(Maybe [Draft])+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'ListDraftsResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'ldrNextPageToken'+--+-- * 'ldrResultSizeEstimate'+--+-- * 'ldrDrafts'+listDraftsResponse+ :: ListDraftsResponse+listDraftsResponse =+ ListDraftsResponse+ { _ldrNextPageToken = Nothing+ , _ldrResultSizeEstimate = Nothing+ , _ldrDrafts = Nothing+ }++-- | Token to retrieve the next page of results in the list.+ldrNextPageToken :: Lens' ListDraftsResponse (Maybe Text)+ldrNextPageToken+ = lens _ldrNextPageToken+ (\ s a -> s{_ldrNextPageToken = a})++-- | Estimated total number of results.+ldrResultSizeEstimate :: Lens' ListDraftsResponse (Maybe Word32)+ldrResultSizeEstimate+ = lens _ldrResultSizeEstimate+ (\ s a -> s{_ldrResultSizeEstimate = a})+ . mapping _Coerce++-- | List of drafts.+ldrDrafts :: Lens' ListDraftsResponse [Draft]+ldrDrafts+ = lens _ldrDrafts (\ s a -> s{_ldrDrafts = a}) .+ _Default+ . _Coerce++instance FromJSON ListDraftsResponse where+ parseJSON+ = withObject "ListDraftsResponse"+ (\ o ->+ ListDraftsResponse <$>+ (o .:? "nextPageToken") <*>+ (o .:? "resultSizeEstimate")+ <*> (o .:? "drafts" .!= mempty))++instance ToJSON ListDraftsResponse where+ toJSON ListDraftsResponse{..}+ = object+ (catMaybes+ [("nextPageToken" .=) <$> _ldrNextPageToken,+ ("resultSizeEstimate" .=) <$> _ldrResultSizeEstimate,+ ("drafts" .=) <$> _ldrDrafts])++-- | Push notification watch response.+--+-- /See:/ 'watchResponse' smart constructor.+data WatchResponse = WatchResponse+ { _wrExpiration :: !(Maybe (Textual Int64))+ , _wrHistoryId :: !(Maybe (Textual Word64))+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'WatchResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'wrExpiration'+--+-- * 'wrHistoryId'+watchResponse+ :: WatchResponse+watchResponse =+ WatchResponse+ { _wrExpiration = Nothing+ , _wrHistoryId = Nothing+ }++-- | When Gmail will stop sending notifications for mailbox updates (epoch+-- millis). Call watch again before this time to renew the watch.+wrExpiration :: Lens' WatchResponse (Maybe Int64)+wrExpiration+ = lens _wrExpiration (\ s a -> s{_wrExpiration = a})+ . mapping _Coerce++-- | The ID of the mailbox\'s current history record.+wrHistoryId :: Lens' WatchResponse (Maybe Word64)+wrHistoryId+ = lens _wrHistoryId (\ s a -> s{_wrHistoryId = a}) .+ mapping _Coerce++instance FromJSON WatchResponse where+ parseJSON+ = withObject "WatchResponse"+ (\ o ->+ WatchResponse <$>+ (o .:? "expiration") <*> (o .:? "historyId"))++instance ToJSON WatchResponse where+ toJSON WatchResponse{..}+ = object+ (catMaybes+ [("expiration" .=) <$> _wrExpiration,+ ("historyId" .=) <$> _wrHistoryId])++-- | A draft email in the user\'s mailbox.+--+-- /See:/ 'draft' smart constructor.+data Draft = Draft+ { _dId :: !(Maybe Text)+ , _dMessage :: !(Maybe Message)+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'Draft' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'dId'+--+-- * 'dMessage'+draft+ :: Draft+draft =+ Draft+ { _dId = Nothing+ , _dMessage = Nothing+ }++-- | The immutable ID of the draft.+dId :: Lens' Draft (Maybe Text)+dId = lens _dId (\ s a -> s{_dId = a})++-- | The message content of the draft.+dMessage :: Lens' Draft (Maybe Message)+dMessage = lens _dMessage (\ s a -> s{_dMessage = a})++instance FromJSON Draft where+ parseJSON+ = withObject "Draft"+ (\ o -> Draft <$> (o .:? "id") <*> (o .:? "message"))++instance ToJSON Draft where+ toJSON Draft{..}+ = object+ (catMaybes+ [("id" .=) <$> _dId, ("message" .=) <$> _dMessage])++-- | Set up or update a new push notification watch on this user\'s mailbox.+--+-- /See:/ 'watchRequest' smart constructor.+data WatchRequest = WatchRequest+ { _wrLabelFilterAction :: !(Maybe WatchRequestLabelFilterAction)+ , _wrTopicName :: !(Maybe Text)+ , _wrLabelIds :: !(Maybe [Text])+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'WatchRequest' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'wrLabelFilterAction'+--+-- * 'wrTopicName'+--+-- * 'wrLabelIds'+watchRequest+ :: WatchRequest+watchRequest =+ WatchRequest+ { _wrLabelFilterAction = Nothing+ , _wrTopicName = Nothing+ , _wrLabelIds = Nothing+ }++-- | Filtering behavior of labelIds list specified.+wrLabelFilterAction :: Lens' WatchRequest (Maybe WatchRequestLabelFilterAction)+wrLabelFilterAction+ = lens _wrLabelFilterAction+ (\ s a -> s{_wrLabelFilterAction = a})++-- | A fully qualified Google Cloud Pub\/Sub API topic name to publish the+-- events to. This topic name **must** already exist in Cloud Pub\/Sub and+-- you **must** have already granted gmail \"publish\" permission on it.+-- For example, \"projects\/my-project-identifier\/topics\/my-topic-name\"+-- (using the new Cloud Pub\/Sub \"v1beta2\" topic naming format). Note+-- that the \"my-project-identifier\" portion must exactly match your+-- Google developer project id (the one executing this watch request).+wrTopicName :: Lens' WatchRequest (Maybe Text)+wrTopicName+ = lens _wrTopicName (\ s a -> s{_wrTopicName = a})++-- | List of label_ids to restrict notifications about. By default, if+-- unspecified, all changes are pushed out. If specified then dictates+-- which labels are required for a push notification to be generated.+wrLabelIds :: Lens' WatchRequest [Text]+wrLabelIds+ = lens _wrLabelIds (\ s a -> s{_wrLabelIds = a}) .+ _Default+ . _Coerce++instance FromJSON WatchRequest where+ parseJSON+ = withObject "WatchRequest"+ (\ o ->+ WatchRequest <$>+ (o .:? "labelFilterAction") <*> (o .:? "topicName")+ <*> (o .:? "labelIds" .!= mempty))++instance ToJSON WatchRequest where+ toJSON WatchRequest{..}+ = object+ (catMaybes+ [("labelFilterAction" .=) <$> _wrLabelFilterAction,+ ("topicName" .=) <$> _wrTopicName,+ ("labelIds" .=) <$> _wrLabelIds])++-- | An email message.+--+-- /See:/ 'message' smart constructor.+data Message = Message+ { _mRaw :: !(Maybe (Textual Word8))+ , _mSnippet :: !(Maybe Text)+ , _mSizeEstimate :: !(Maybe (Textual Int32))+ , _mPayload :: !(Maybe MessagePart)+ , _mHistoryId :: !(Maybe (Textual Word64))+ , _mId :: !(Maybe Text)+ , _mLabelIds :: !(Maybe [Text])+ , _mThreadId :: !(Maybe Text)+ , _mInternalDate :: !(Maybe (Textual Int64))+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'Message' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'mRaw'+--+-- * 'mSnippet'+--+-- * 'mSizeEstimate'+--+-- * 'mPayload'+--+-- * 'mHistoryId'+--+-- * 'mId'+--+-- * 'mLabelIds'+--+-- * 'mThreadId'+--+-- * 'mInternalDate'+message+ :: Message+message =+ Message+ { _mRaw = Nothing+ , _mSnippet = Nothing+ , _mSizeEstimate = Nothing+ , _mPayload = Nothing+ , _mHistoryId = Nothing+ , _mId = Nothing+ , _mLabelIds = Nothing+ , _mThreadId = Nothing+ , _mInternalDate = Nothing+ }++-- | The entire email message in an RFC 2822 formatted and base64url encoded+-- string. Returned in messages.get and drafts.get responses when the+-- format=RAW parameter is supplied.+mRaw :: Lens' Message (Maybe Word8)+mRaw+ = lens _mRaw (\ s a -> s{_mRaw = a}) .+ mapping _Coerce++-- | A short part of the message text.+mSnippet :: Lens' Message (Maybe Text)+mSnippet = lens _mSnippet (\ s a -> s{_mSnippet = a})++-- | Estimated size in bytes of the message.+mSizeEstimate :: Lens' Message (Maybe Int32)+mSizeEstimate+ = lens _mSizeEstimate+ (\ s a -> s{_mSizeEstimate = a})+ . mapping _Coerce++-- | The parsed email structure in the message parts.+mPayload :: Lens' Message (Maybe MessagePart)+mPayload = lens _mPayload (\ s a -> s{_mPayload = a})++-- | The ID of the last history record that modified this message.+mHistoryId :: Lens' Message (Maybe Word64)+mHistoryId+ = lens _mHistoryId (\ s a -> s{_mHistoryId = a}) .+ mapping _Coerce++-- | The immutable ID of the message.+mId :: Lens' Message (Maybe Text)+mId = lens _mId (\ s a -> s{_mId = a})++-- | List of IDs of labels applied to this message.+mLabelIds :: Lens' Message [Text]+mLabelIds+ = lens _mLabelIds (\ s a -> s{_mLabelIds = a}) .+ _Default+ . _Coerce++-- | The ID of the thread the message belongs to. To add a message or draft+-- to a thread, the following criteria must be met: - The requested+-- threadId must be specified on the Message or Draft.Message you supply+-- with your request. - The References and In-Reply-To headers must be set+-- in compliance with the RFC 2822 standard. - The Subject headers must+-- match.+mThreadId :: Lens' Message (Maybe Text)+mThreadId+ = lens _mThreadId (\ s a -> s{_mThreadId = a})++-- | The internal message creation timestamp (epoch ms), which determines+-- ordering in the inbox. For normal SMTP-received email, this represents+-- the time the message was originally accepted by Google, which is more+-- reliable than the Date header. However, for API-migrated mail, it can be+-- configured by client to be based on the Date header.+mInternalDate :: Lens' Message (Maybe Int64)+mInternalDate+ = lens _mInternalDate+ (\ s a -> s{_mInternalDate = a})+ . mapping _Coerce++instance FromJSON Message where+ parseJSON+ = withObject "Message"+ (\ o ->+ Message <$>+ (o .:? "raw") <*> (o .:? "snippet") <*>+ (o .:? "sizeEstimate")+ <*> (o .:? "payload")+ <*> (o .:? "historyId")+ <*> (o .:? "id")+ <*> (o .:? "labelIds" .!= mempty)+ <*> (o .:? "threadId")+ <*> (o .:? "internalDate"))++instance ToJSON Message where+ toJSON Message{..}+ = object+ (catMaybes+ [("raw" .=) <$> _mRaw, ("snippet" .=) <$> _mSnippet,+ ("sizeEstimate" .=) <$> _mSizeEstimate,+ ("payload" .=) <$> _mPayload,+ ("historyId" .=) <$> _mHistoryId, ("id" .=) <$> _mId,+ ("labelIds" .=) <$> _mLabelIds,+ ("threadId" .=) <$> _mThreadId,+ ("internalDate" .=) <$> _mInternalDate])++--+-- /See:/ 'historyLabelRemoved' smart constructor.+data HistoryLabelRemoved = HistoryLabelRemoved+ { _hlrLabelIds :: !(Maybe [Text])+ , _hlrMessage :: !(Maybe Message)+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'HistoryLabelRemoved' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'hlrLabelIds'+--+-- * 'hlrMessage'+historyLabelRemoved+ :: HistoryLabelRemoved+historyLabelRemoved =+ HistoryLabelRemoved+ { _hlrLabelIds = Nothing+ , _hlrMessage = Nothing+ }++-- | Label IDs removed from the message.+hlrLabelIds :: Lens' HistoryLabelRemoved [Text]+hlrLabelIds+ = lens _hlrLabelIds (\ s a -> s{_hlrLabelIds = a}) .+ _Default+ . _Coerce++hlrMessage :: Lens' HistoryLabelRemoved (Maybe Message)+hlrMessage+ = lens _hlrMessage (\ s a -> s{_hlrMessage = a})++instance FromJSON HistoryLabelRemoved where+ parseJSON+ = withObject "HistoryLabelRemoved"+ (\ o ->+ HistoryLabelRemoved <$>+ (o .:? "labelIds" .!= mempty) <*> (o .:? "message"))++instance ToJSON HistoryLabelRemoved where+ toJSON HistoryLabelRemoved{..}+ = object+ (catMaybes+ [("labelIds" .=) <$> _hlrLabelIds,+ ("message" .=) <$> _hlrMessage])++-- | A collection of messages representing a conversation.+--+-- /See:/ 'thread' smart constructor.+data Thread = Thread+ { _tSnippet :: !(Maybe Text)+ , _tHistoryId :: !(Maybe (Textual Word64))+ , _tId :: !(Maybe Text)+ , _tMessages :: !(Maybe [Message])+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'Thread' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'tSnippet'+--+-- * 'tHistoryId'+--+-- * 'tId'+--+-- * 'tMessages'+thread+ :: Thread+thread =+ Thread+ { _tSnippet = Nothing+ , _tHistoryId = Nothing+ , _tId = Nothing+ , _tMessages = Nothing+ }++-- | A short part of the message text.+tSnippet :: Lens' Thread (Maybe Text)+tSnippet = lens _tSnippet (\ s a -> s{_tSnippet = a})++-- | The ID of the last history record that modified this thread.+tHistoryId :: Lens' Thread (Maybe Word64)+tHistoryId+ = lens _tHistoryId (\ s a -> s{_tHistoryId = a}) .+ mapping _Coerce++-- | The unique ID of the thread.+tId :: Lens' Thread (Maybe Text)+tId = lens _tId (\ s a -> s{_tId = a})++-- | The list of messages in the thread.+tMessages :: Lens' Thread [Message]+tMessages+ = lens _tMessages (\ s a -> s{_tMessages = a}) .+ _Default+ . _Coerce++instance FromJSON Thread where+ parseJSON+ = withObject "Thread"+ (\ o ->+ Thread <$>+ (o .:? "snippet") <*> (o .:? "historyId") <*>+ (o .:? "id")+ <*> (o .:? "messages" .!= mempty))++instance ToJSON Thread where+ toJSON Thread{..}+ = object+ (catMaybes+ [("snippet" .=) <$> _tSnippet,+ ("historyId" .=) <$> _tHistoryId, ("id" .=) <$> _tId,+ ("messages" .=) <$> _tMessages])++-- | Labels are used to categorize messages and threads within the user\'s+-- mailbox.+--+-- /See:/ 'label' smart constructor.+data Label = Label+ { _lThreadsUnread :: !(Maybe (Textual Int32))+ , _lMessageListVisibility :: !(Maybe LabelMessageListVisibility)+ , _lMessagesTotal :: !(Maybe (Textual Int32))+ , _lMessagesUnread :: !(Maybe (Textual Int32))+ , _lName :: !(Maybe Text)+ , _lThreadsTotal :: !(Maybe (Textual Int32))+ , _lLabelListVisibility :: !(Maybe LabelLabelListVisibility)+ , _lId :: !(Maybe Text)+ , _lType :: !(Maybe LabelType)+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'Label' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'lThreadsUnread'+--+-- * 'lMessageListVisibility'+--+-- * 'lMessagesTotal'+--+-- * 'lMessagesUnread'+--+-- * 'lName'+--+-- * 'lThreadsTotal'+--+-- * 'lLabelListVisibility'+--+-- * 'lId'+--+-- * 'lType'+label+ :: Label+label =+ Label+ { _lThreadsUnread = Nothing+ , _lMessageListVisibility = Nothing+ , _lMessagesTotal = Nothing+ , _lMessagesUnread = Nothing+ , _lName = Nothing+ , _lThreadsTotal = Nothing+ , _lLabelListVisibility = Nothing+ , _lId = Nothing+ , _lType = Nothing+ }++-- | The number of unread threads with the label.+lThreadsUnread :: Lens' Label (Maybe Int32)+lThreadsUnread+ = lens _lThreadsUnread+ (\ s a -> s{_lThreadsUnread = a})+ . mapping _Coerce++-- | The visibility of the label in the message list in the Gmail web+-- interface.+lMessageListVisibility :: Lens' Label (Maybe LabelMessageListVisibility)+lMessageListVisibility+ = lens _lMessageListVisibility+ (\ s a -> s{_lMessageListVisibility = a})++-- | The total number of messages with the label.+lMessagesTotal :: Lens' Label (Maybe Int32)+lMessagesTotal+ = lens _lMessagesTotal+ (\ s a -> s{_lMessagesTotal = a})+ . mapping _Coerce++-- | The number of unread messages with the label.+lMessagesUnread :: Lens' Label (Maybe Int32)+lMessagesUnread+ = lens _lMessagesUnread+ (\ s a -> s{_lMessagesUnread = a})+ . mapping _Coerce++-- | The display name of the label.+lName :: Lens' Label (Maybe Text)+lName = lens _lName (\ s a -> s{_lName = a})++-- | The total number of threads with the label.+lThreadsTotal :: Lens' Label (Maybe Int32)+lThreadsTotal+ = lens _lThreadsTotal+ (\ s a -> s{_lThreadsTotal = a})+ . mapping _Coerce++-- | The visibility of the label in the label list in the Gmail web+-- interface.+lLabelListVisibility :: Lens' Label (Maybe LabelLabelListVisibility)+lLabelListVisibility+ = lens _lLabelListVisibility+ (\ s a -> s{_lLabelListVisibility = a})++-- | The immutable ID of the label.+lId :: Lens' Label (Maybe Text)+lId = lens _lId (\ s a -> s{_lId = a})++-- | The owner type for the label. User labels are created by the user and+-- can be modified and deleted by the user and can be applied to any+-- message or thread. System labels are internally created and cannot be+-- added, modified, or deleted. System labels may be able to be applied to+-- or removed from messages and threads under some circumstances but this+-- is not guaranteed. For example, users can apply and remove the INBOX and+-- UNREAD labels from messages and threads, but cannot apply or remove the+-- DRAFTS or SENT labels from messages or threads.+lType :: Lens' Label (Maybe LabelType)+lType = lens _lType (\ s a -> s{_lType = a})++instance FromJSON Label where+ parseJSON+ = withObject "Label"+ (\ o ->+ Label <$>+ (o .:? "threadsUnread") <*>+ (o .:? "messageListVisibility")+ <*> (o .:? "messagesTotal")+ <*> (o .:? "messagesUnread")+ <*> (o .:? "name")+ <*> (o .:? "threadsTotal")+ <*> (o .:? "labelListVisibility")+ <*> (o .:? "id")+ <*> (o .:? "type"))++instance ToJSON Label where+ toJSON Label{..}+ = object+ (catMaybes+ [("threadsUnread" .=) <$> _lThreadsUnread,+ ("messageListVisibility" .=) <$>+ _lMessageListVisibility,+ ("messagesTotal" .=) <$> _lMessagesTotal,+ ("messagesUnread" .=) <$> _lMessagesUnread,+ ("name" .=) <$> _lName,+ ("threadsTotal" .=) <$> _lThreadsTotal,+ ("labelListVisibility" .=) <$> _lLabelListVisibility,+ ("id" .=) <$> _lId, ("type" .=) <$> _lType])++--+-- /See:/ 'listMessagesResponse' smart constructor.+data ListMessagesResponse = ListMessagesResponse+ { _lmrNextPageToken :: !(Maybe Text)+ , _lmrResultSizeEstimate :: !(Maybe (Textual Word32))+ , _lmrMessages :: !(Maybe [Message])+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'ListMessagesResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'lmrNextPageToken'+--+-- * 'lmrResultSizeEstimate'+--+-- * 'lmrMessages'+listMessagesResponse+ :: ListMessagesResponse+listMessagesResponse =+ ListMessagesResponse+ { _lmrNextPageToken = Nothing+ , _lmrResultSizeEstimate = Nothing+ , _lmrMessages = Nothing+ }++-- | Token to retrieve the next page of results in the list.+lmrNextPageToken :: Lens' ListMessagesResponse (Maybe Text)+lmrNextPageToken+ = lens _lmrNextPageToken+ (\ s a -> s{_lmrNextPageToken = a})++-- | Estimated total number of results.+lmrResultSizeEstimate :: Lens' ListMessagesResponse (Maybe Word32)+lmrResultSizeEstimate+ = lens _lmrResultSizeEstimate+ (\ s a -> s{_lmrResultSizeEstimate = a})+ . mapping _Coerce++-- | List of messages.+lmrMessages :: Lens' ListMessagesResponse [Message]+lmrMessages+ = lens _lmrMessages (\ s a -> s{_lmrMessages = a}) .+ _Default+ . _Coerce++instance FromJSON ListMessagesResponse where+ parseJSON+ = withObject "ListMessagesResponse"+ (\ o ->+ ListMessagesResponse <$>+ (o .:? "nextPageToken") <*>+ (o .:? "resultSizeEstimate")+ <*> (o .:? "messages" .!= mempty))++instance ToJSON ListMessagesResponse where+ toJSON ListMessagesResponse{..}+ = object+ (catMaybes+ [("nextPageToken" .=) <$> _lmrNextPageToken,+ ("resultSizeEstimate" .=) <$> _lmrResultSizeEstimate,+ ("messages" .=) <$> _lmrMessages])++--+-- /See:/ 'historyMessageAdded' smart constructor.+newtype HistoryMessageAdded = HistoryMessageAdded+ { _hmaMessage :: Maybe Message+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'HistoryMessageAdded' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'hmaMessage'+historyMessageAdded+ :: HistoryMessageAdded+historyMessageAdded =+ HistoryMessageAdded+ { _hmaMessage = Nothing+ }++hmaMessage :: Lens' HistoryMessageAdded (Maybe Message)+hmaMessage+ = lens _hmaMessage (\ s a -> s{_hmaMessage = a})++instance FromJSON HistoryMessageAdded where+ parseJSON+ = withObject "HistoryMessageAdded"+ (\ o -> HistoryMessageAdded <$> (o .:? "message"))++instance ToJSON HistoryMessageAdded where+ toJSON HistoryMessageAdded{..}+ = object (catMaybes [("message" .=) <$> _hmaMessage])
+ gen/Network/Google/Gmail/Types/Sum.hs view
@@ -0,0 +1,295 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Gmail.Types.Sum+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Network.Google.Gmail.Types.Sum where++import Network.Google.Prelude++-- | The format to return the message in.+data UsersMessagesGetFormat+ = Full+ -- ^ @full@+ | Metadata+ -- ^ @metadata@+ | Minimal+ -- ^ @minimal@+ | Raw+ -- ^ @raw@+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)++instance Hashable UsersMessagesGetFormat++instance FromText UsersMessagesGetFormat where+ fromText = \case+ "full" -> Just Full+ "metadata" -> Just Metadata+ "minimal" -> Just Minimal+ "raw" -> Just Raw+ _ -> Nothing++instance ToText UsersMessagesGetFormat where+ toText = \case+ Full -> "full"+ Metadata -> "metadata"+ Minimal -> "minimal"+ Raw -> "raw"++instance FromJSON UsersMessagesGetFormat where+ parseJSON = parseJSONText "UsersMessagesGetFormat"++instance ToJSON UsersMessagesGetFormat where+ toJSON = toJSONText++-- | The owner type for the label. User labels are created by the user and+-- can be modified and deleted by the user and can be applied to any+-- message or thread. System labels are internally created and cannot be+-- added, modified, or deleted. System labels may be able to be applied to+-- or removed from messages and threads under some circumstances but this+-- is not guaranteed. For example, users can apply and remove the INBOX and+-- UNREAD labels from messages and threads, but cannot apply or remove the+-- DRAFTS or SENT labels from messages or threads.+data LabelType+ = System+ -- ^ @system@+ | User+ -- ^ @user@+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)++instance Hashable LabelType++instance FromText LabelType where+ fromText = \case+ "system" -> Just System+ "user" -> Just User+ _ -> Nothing++instance ToText LabelType where+ toText = \case+ System -> "system"+ User -> "user"++instance FromJSON LabelType where+ parseJSON = parseJSONText "LabelType"++instance ToJSON LabelType where+ toJSON = toJSONText++-- | The format to return the draft in.+data UsersDraftsGetFormat+ = UDGFFull+ -- ^ @full@+ | UDGFMetadata+ -- ^ @metadata@+ | UDGFMinimal+ -- ^ @minimal@+ | UDGFRaw+ -- ^ @raw@+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)++instance Hashable UsersDraftsGetFormat++instance FromText UsersDraftsGetFormat where+ fromText = \case+ "full" -> Just UDGFFull+ "metadata" -> Just UDGFMetadata+ "minimal" -> Just UDGFMinimal+ "raw" -> Just UDGFRaw+ _ -> Nothing++instance ToText UsersDraftsGetFormat where+ toText = \case+ UDGFFull -> "full"+ UDGFMetadata -> "metadata"+ UDGFMinimal -> "minimal"+ UDGFRaw -> "raw"++instance FromJSON UsersDraftsGetFormat where+ parseJSON = parseJSONText "UsersDraftsGetFormat"++instance ToJSON UsersDraftsGetFormat where+ toJSON = toJSONText++-- | Source for Gmail\'s internal date of the message.+data UsersMessagesImportInternalDateSource+ = DateHeader+ -- ^ @dateHeader@+ | ReceivedTime+ -- ^ @receivedTime@+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)++instance Hashable UsersMessagesImportInternalDateSource++instance FromText UsersMessagesImportInternalDateSource where+ fromText = \case+ "dateHeader" -> Just DateHeader+ "receivedTime" -> Just ReceivedTime+ _ -> Nothing++instance ToText UsersMessagesImportInternalDateSource where+ toText = \case+ DateHeader -> "dateHeader"+ ReceivedTime -> "receivedTime"++instance FromJSON UsersMessagesImportInternalDateSource where+ parseJSON = parseJSONText "UsersMessagesImportInternalDateSource"++instance ToJSON UsersMessagesImportInternalDateSource where+ toJSON = toJSONText++-- | The visibility of the label in the message list in the Gmail web+-- interface.+data LabelMessageListVisibility+ = Hide+ -- ^ @hide@+ | Show+ -- ^ @show@+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)++instance Hashable LabelMessageListVisibility++instance FromText LabelMessageListVisibility where+ fromText = \case+ "hide" -> Just Hide+ "show" -> Just Show+ _ -> Nothing++instance ToText LabelMessageListVisibility where+ toText = \case+ Hide -> "hide"+ Show -> "show"++instance FromJSON LabelMessageListVisibility where+ parseJSON = parseJSONText "LabelMessageListVisibility"++instance ToJSON LabelMessageListVisibility where+ toJSON = toJSONText++-- | The visibility of the label in the label list in the Gmail web+-- interface.+data LabelLabelListVisibility+ = LabelHide+ -- ^ @labelHide@+ | LabelShow+ -- ^ @labelShow@+ | LabelShowIfUnread+ -- ^ @labelShowIfUnread@+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)++instance Hashable LabelLabelListVisibility++instance FromText LabelLabelListVisibility where+ fromText = \case+ "labelHide" -> Just LabelHide+ "labelShow" -> Just LabelShow+ "labelShowIfUnread" -> Just LabelShowIfUnread+ _ -> Nothing++instance ToText LabelLabelListVisibility where+ toText = \case+ LabelHide -> "labelHide"+ LabelShow -> "labelShow"+ LabelShowIfUnread -> "labelShowIfUnread"++instance FromJSON LabelLabelListVisibility where+ parseJSON = parseJSONText "LabelLabelListVisibility"++instance ToJSON LabelLabelListVisibility where+ toJSON = toJSONText++-- | The format to return the messages in.+data UsersThreadsGetFormat+ = UTGFFull+ -- ^ @full@+ | UTGFMetadata+ -- ^ @metadata@+ | UTGFMinimal+ -- ^ @minimal@+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)++instance Hashable UsersThreadsGetFormat++instance FromText UsersThreadsGetFormat where+ fromText = \case+ "full" -> Just UTGFFull+ "metadata" -> Just UTGFMetadata+ "minimal" -> Just UTGFMinimal+ _ -> Nothing++instance ToText UsersThreadsGetFormat where+ toText = \case+ UTGFFull -> "full"+ UTGFMetadata -> "metadata"+ UTGFMinimal -> "minimal"++instance FromJSON UsersThreadsGetFormat where+ parseJSON = parseJSONText "UsersThreadsGetFormat"++instance ToJSON UsersThreadsGetFormat where+ toJSON = toJSONText++-- | Filtering behavior of labelIds list specified.+data WatchRequestLabelFilterAction+ = Exclude+ -- ^ @exclude@+ | Include+ -- ^ @include@+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)++instance Hashable WatchRequestLabelFilterAction++instance FromText WatchRequestLabelFilterAction where+ fromText = \case+ "exclude" -> Just Exclude+ "include" -> Just Include+ _ -> Nothing++instance ToText WatchRequestLabelFilterAction where+ toText = \case+ Exclude -> "exclude"+ Include -> "include"++instance FromJSON WatchRequestLabelFilterAction where+ parseJSON = parseJSONText "WatchRequestLabelFilterAction"++instance ToJSON WatchRequestLabelFilterAction where+ toJSON = toJSONText++-- | Source for Gmail\'s internal date of the message.+data UsersMessagesInsertInternalDateSource+ = UMIIDSDateHeader+ -- ^ @dateHeader@+ | UMIIDSReceivedTime+ -- ^ @receivedTime@+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)++instance Hashable UsersMessagesInsertInternalDateSource++instance FromText UsersMessagesInsertInternalDateSource where+ fromText = \case+ "dateHeader" -> Just UMIIDSDateHeader+ "receivedTime" -> Just UMIIDSReceivedTime+ _ -> Nothing++instance ToText UsersMessagesInsertInternalDateSource where+ toText = \case+ UMIIDSDateHeader -> "dateHeader"+ UMIIDSReceivedTime -> "receivedTime"++instance FromJSON UsersMessagesInsertInternalDateSource where+ parseJSON = parseJSONText "UsersMessagesInsertInternalDateSource"++instance ToJSON UsersMessagesInsertInternalDateSource where+ toJSON = toJSONText
+ gen/Network/Google/Resource/Gmail/Users/Drafts/Create.hs view
@@ -0,0 +1,123 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Drafts.Create+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Creates a new draft with the DRAFT label.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.drafts.create@.+module Network.Google.Resource.Gmail.Users.Drafts.Create+ (+ -- * REST Resource+ UsersDraftsCreateResource++ -- * Creating a Request+ , usersDraftsCreate+ , UsersDraftsCreate++ -- * Request Lenses+ , udcPayload+ , udcUserId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.drafts.create@ method which the+-- 'UsersDraftsCreate' request conforms to.+type UsersDraftsCreateResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "drafts" :>+ QueryParam "alt" AltJSON :>+ ReqBody '[JSON] Draft :> Post '[JSON] Draft+ :<|>+ "upload" :>+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "drafts" :>+ QueryParam "alt" AltJSON :>+ QueryParam "uploadType" AltMedia :>+ MultipartRelated '[JSON] Draft RequestBody :>+ Post '[JSON] Draft++-- | Creates a new draft with the DRAFT label.+--+-- /See:/ 'usersDraftsCreate' smart constructor.+data UsersDraftsCreate = UsersDraftsCreate+ { _udcPayload :: !Draft+ , _udcUserId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersDraftsCreate' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'udcPayload'+--+-- * 'udcUserId'+usersDraftsCreate+ :: Draft -- ^ 'udcPayload'+ -> Text+ -> UsersDraftsCreate+usersDraftsCreate pUdcPayload_ pUdcUserId_ =+ UsersDraftsCreate+ { _udcPayload = pUdcPayload_+ , _udcUserId = "me"+ }++-- | Multipart request metadata.+udcPayload :: Lens' UsersDraftsCreate Draft+udcPayload+ = lens _udcPayload (\ s a -> s{_udcPayload = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+udcUserId :: Lens' UsersDraftsCreate Text+udcUserId+ = lens _udcUserId (\ s a -> s{_udcUserId = a})++instance GoogleRequest UsersDraftsCreate where+ type Rs UsersDraftsCreate = Draft+ requestClient UsersDraftsCreate{..}+ = go _udcUserId (Just AltJSON) _udcPayload+ gmailService+ where go :<|> _+ = buildClient+ (Proxy :: Proxy UsersDraftsCreateResource)+ mempty++instance GoogleRequest+ (MediaUpload UsersDraftsCreate) where+ type Rs (MediaUpload UsersDraftsCreate) = Draft+ requestClient+ (MediaUpload UsersDraftsCreate{..} body)+ = go _udcUserId (Just AltJSON) (Just AltMedia)+ _udcPayload+ body+ gmailService+ where _ :<|> go+ = buildClient+ (Proxy :: Proxy UsersDraftsCreateResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Drafts/Delete.hs view
@@ -0,0 +1,98 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Drafts.Delete+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Immediately and permanently deletes the specified draft. Does not simply+-- trash it.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.drafts.delete@.+module Network.Google.Resource.Gmail.Users.Drafts.Delete+ (+ -- * REST Resource+ UsersDraftsDeleteResource++ -- * Creating a Request+ , usersDraftsDelete+ , UsersDraftsDelete++ -- * Request Lenses+ , uddUserId+ , uddId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.drafts.delete@ method which the+-- 'UsersDraftsDelete' request conforms to.+type UsersDraftsDeleteResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "drafts" :>+ Capture "id" Text :>+ QueryParam "alt" AltJSON :> Delete '[JSON] ()++-- | Immediately and permanently deletes the specified draft. Does not simply+-- trash it.+--+-- /See:/ 'usersDraftsDelete' smart constructor.+data UsersDraftsDelete = UsersDraftsDelete+ { _uddUserId :: !Text+ , _uddId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersDraftsDelete' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'uddUserId'+--+-- * 'uddId'+usersDraftsDelete+ :: Text -- ^ 'uddId'+ -> Text+ -> UsersDraftsDelete+usersDraftsDelete pUddUserId_ pUddId_ =+ UsersDraftsDelete+ { _uddUserId = "me"+ , _uddId = pUddId_+ }++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+uddUserId :: Lens' UsersDraftsDelete Text+uddUserId+ = lens _uddUserId (\ s a -> s{_uddUserId = a})++-- | The ID of the draft to delete.+uddId :: Lens' UsersDraftsDelete Text+uddId = lens _uddId (\ s a -> s{_uddId = a})++instance GoogleRequest UsersDraftsDelete where+ type Rs UsersDraftsDelete = ()+ requestClient UsersDraftsDelete{..}+ = go _uddUserId _uddId (Just AltJSON) gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersDraftsDeleteResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Drafts/Get.hs view
@@ -0,0 +1,108 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Drafts.Get+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Gets the specified draft.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.drafts.get@.+module Network.Google.Resource.Gmail.Users.Drafts.Get+ (+ -- * REST Resource+ UsersDraftsGetResource++ -- * Creating a Request+ , usersDraftsGet+ , UsersDraftsGet++ -- * Request Lenses+ , udgFormat+ , udgUserId+ , udgId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.drafts.get@ method which the+-- 'UsersDraftsGet' request conforms to.+type UsersDraftsGetResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "drafts" :>+ Capture "id" Text :>+ QueryParam "format" UsersDraftsGetFormat :>+ QueryParam "alt" AltJSON :> Get '[JSON] Draft++-- | Gets the specified draft.+--+-- /See:/ 'usersDraftsGet' smart constructor.+data UsersDraftsGet = UsersDraftsGet+ { _udgFormat :: !UsersDraftsGetFormat+ , _udgUserId :: !Text+ , _udgId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersDraftsGet' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'udgFormat'+--+-- * 'udgUserId'+--+-- * 'udgId'+usersDraftsGet+ :: Text -- ^ 'udgId'+ -> Text+ -> UsersDraftsGet+usersDraftsGet pUdgUserId_ pUdgId_ =+ UsersDraftsGet+ { _udgFormat = UDGFFull+ , _udgUserId = "me"+ , _udgId = pUdgId_+ }++-- | The format to return the draft in.+udgFormat :: Lens' UsersDraftsGet UsersDraftsGetFormat+udgFormat+ = lens _udgFormat (\ s a -> s{_udgFormat = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+udgUserId :: Lens' UsersDraftsGet Text+udgUserId+ = lens _udgUserId (\ s a -> s{_udgUserId = a})++-- | The ID of the draft to retrieve.+udgId :: Lens' UsersDraftsGet Text+udgId = lens _udgId (\ s a -> s{_udgId = a})++instance GoogleRequest UsersDraftsGet where+ type Rs UsersDraftsGet = Draft+ requestClient UsersDraftsGet{..}+ = go _udgUserId _udgId (Just _udgFormat)+ (Just AltJSON)+ gmailService+ where go+ = buildClient (Proxy :: Proxy UsersDraftsGetResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Drafts/List.hs view
@@ -0,0 +1,112 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Drafts.List+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Lists the drafts in the user\'s mailbox.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.drafts.list@.+module Network.Google.Resource.Gmail.Users.Drafts.List+ (+ -- * REST Resource+ UsersDraftsListResource++ -- * Creating a Request+ , usersDraftsList+ , UsersDraftsList++ -- * Request Lenses+ , udlUserId+ , udlPageToken+ , udlMaxResults+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.drafts.list@ method which the+-- 'UsersDraftsList' request conforms to.+type UsersDraftsListResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "drafts" :>+ QueryParam "pageToken" Text :>+ QueryParam "maxResults" (Textual Word32) :>+ QueryParam "alt" AltJSON :>+ Get '[JSON] ListDraftsResponse++-- | Lists the drafts in the user\'s mailbox.+--+-- /See:/ 'usersDraftsList' smart constructor.+data UsersDraftsList = UsersDraftsList+ { _udlUserId :: !Text+ , _udlPageToken :: !(Maybe Text)+ , _udlMaxResults :: !(Textual Word32)+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersDraftsList' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'udlUserId'+--+-- * 'udlPageToken'+--+-- * 'udlMaxResults'+usersDraftsList+ :: Text+ -> UsersDraftsList+usersDraftsList pUdlUserId_ =+ UsersDraftsList+ { _udlUserId = "me"+ , _udlPageToken = Nothing+ , _udlMaxResults = 100+ }++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+udlUserId :: Lens' UsersDraftsList Text+udlUserId+ = lens _udlUserId (\ s a -> s{_udlUserId = a})++-- | Page token to retrieve a specific page of results in the list.+udlPageToken :: Lens' UsersDraftsList (Maybe Text)+udlPageToken+ = lens _udlPageToken (\ s a -> s{_udlPageToken = a})++-- | Maximum number of drafts to return.+udlMaxResults :: Lens' UsersDraftsList Word32+udlMaxResults+ = lens _udlMaxResults+ (\ s a -> s{_udlMaxResults = a})+ . _Coerce++instance GoogleRequest UsersDraftsList where+ type Rs UsersDraftsList = ListDraftsResponse+ requestClient UsersDraftsList{..}+ = go _udlUserId _udlPageToken (Just _udlMaxResults)+ (Just AltJSON)+ gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersDraftsListResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Drafts/Send.hs view
@@ -0,0 +1,126 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Drafts.Send+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Sends the specified, existing draft to the recipients in the To, Cc, and+-- Bcc headers.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.drafts.send@.+module Network.Google.Resource.Gmail.Users.Drafts.Send+ (+ -- * REST Resource+ UsersDraftsSendResource++ -- * Creating a Request+ , usersDraftsSend+ , UsersDraftsSend++ -- * Request Lenses+ , udsPayload+ , udsUserId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.drafts.send@ method which the+-- 'UsersDraftsSend' request conforms to.+type UsersDraftsSendResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "drafts" :>+ "send" :>+ QueryParam "alt" AltJSON :>+ ReqBody '[JSON] Draft :> Post '[JSON] Message+ :<|>+ "upload" :>+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "drafts" :>+ "send" :>+ QueryParam "alt" AltJSON :>+ QueryParam "uploadType" AltMedia :>+ MultipartRelated '[JSON] Draft RequestBody :>+ Post '[JSON] Message++-- | Sends the specified, existing draft to the recipients in the To, Cc, and+-- Bcc headers.+--+-- /See:/ 'usersDraftsSend' smart constructor.+data UsersDraftsSend = UsersDraftsSend+ { _udsPayload :: !Draft+ , _udsUserId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersDraftsSend' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'udsPayload'+--+-- * 'udsUserId'+usersDraftsSend+ :: Draft -- ^ 'udsPayload'+ -> Text+ -> UsersDraftsSend+usersDraftsSend pUdsPayload_ pUdsUserId_ =+ UsersDraftsSend+ { _udsPayload = pUdsPayload_+ , _udsUserId = "me"+ }++-- | Multipart request metadata.+udsPayload :: Lens' UsersDraftsSend Draft+udsPayload+ = lens _udsPayload (\ s a -> s{_udsPayload = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+udsUserId :: Lens' UsersDraftsSend Text+udsUserId+ = lens _udsUserId (\ s a -> s{_udsUserId = a})++instance GoogleRequest UsersDraftsSend where+ type Rs UsersDraftsSend = Message+ requestClient UsersDraftsSend{..}+ = go _udsUserId (Just AltJSON) _udsPayload+ gmailService+ where go :<|> _+ = buildClient+ (Proxy :: Proxy UsersDraftsSendResource)+ mempty++instance GoogleRequest (MediaUpload UsersDraftsSend)+ where+ type Rs (MediaUpload UsersDraftsSend) = Message+ requestClient (MediaUpload UsersDraftsSend{..} body)+ = go _udsUserId (Just AltJSON) (Just AltMedia)+ _udsPayload+ body+ gmailService+ where _ :<|> go+ = buildClient+ (Proxy :: Proxy UsersDraftsSendResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Drafts/Update.hs view
@@ -0,0 +1,135 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Drafts.Update+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Replaces a draft\'s content.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.drafts.update@.+module Network.Google.Resource.Gmail.Users.Drafts.Update+ (+ -- * REST Resource+ UsersDraftsUpdateResource++ -- * Creating a Request+ , usersDraftsUpdate+ , UsersDraftsUpdate++ -- * Request Lenses+ , uduPayload+ , uduUserId+ , uduId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.drafts.update@ method which the+-- 'UsersDraftsUpdate' request conforms to.+type UsersDraftsUpdateResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "drafts" :>+ Capture "id" Text :>+ QueryParam "alt" AltJSON :>+ ReqBody '[JSON] Draft :> Put '[JSON] Draft+ :<|>+ "upload" :>+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "drafts" :>+ Capture "id" Text :>+ QueryParam "alt" AltJSON :>+ QueryParam "uploadType" AltMedia :>+ MultipartRelated '[JSON] Draft RequestBody :>+ Put '[JSON] Draft++-- | Replaces a draft\'s content.+--+-- /See:/ 'usersDraftsUpdate' smart constructor.+data UsersDraftsUpdate = UsersDraftsUpdate+ { _uduPayload :: !Draft+ , _uduUserId :: !Text+ , _uduId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersDraftsUpdate' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'uduPayload'+--+-- * 'uduUserId'+--+-- * 'uduId'+usersDraftsUpdate+ :: Draft -- ^ 'uduPayload'+ -> Text -- ^ 'uduId'+ -> Text+ -> UsersDraftsUpdate+usersDraftsUpdate pUduPayload_ pUduUserId_ pUduId_ =+ UsersDraftsUpdate+ { _uduPayload = pUduPayload_+ , _uduUserId = "me"+ , _uduId = pUduId_+ }++-- | Multipart request metadata.+uduPayload :: Lens' UsersDraftsUpdate Draft+uduPayload+ = lens _uduPayload (\ s a -> s{_uduPayload = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+uduUserId :: Lens' UsersDraftsUpdate Text+uduUserId+ = lens _uduUserId (\ s a -> s{_uduUserId = a})++-- | The ID of the draft to update.+uduId :: Lens' UsersDraftsUpdate Text+uduId = lens _uduId (\ s a -> s{_uduId = a})++instance GoogleRequest UsersDraftsUpdate where+ type Rs UsersDraftsUpdate = Draft+ requestClient UsersDraftsUpdate{..}+ = go _uduUserId _uduId (Just AltJSON) _uduPayload+ gmailService+ where go :<|> _+ = buildClient+ (Proxy :: Proxy UsersDraftsUpdateResource)+ mempty++instance GoogleRequest+ (MediaUpload UsersDraftsUpdate) where+ type Rs (MediaUpload UsersDraftsUpdate) = Draft+ requestClient+ (MediaUpload UsersDraftsUpdate{..} body)+ = go _uduUserId _uduId (Just AltJSON) (Just AltMedia)+ _uduPayload+ body+ gmailService+ where _ :<|> go+ = buildClient+ (Proxy :: Proxy UsersDraftsUpdateResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/GetProFile.hs view
@@ -0,0 +1,85 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.GetProFile+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Gets the current user\'s Gmail profile.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.getProfile@.+module Network.Google.Resource.Gmail.Users.GetProFile+ (+ -- * REST Resource+ UsersGetProFileResource++ -- * Creating a Request+ , usersGetProFile+ , UsersGetProFile++ -- * Request Lenses+ , ugpfUserId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.getProfile@ method which the+-- 'UsersGetProFile' request conforms to.+type UsersGetProFileResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "profile" :>+ QueryParam "alt" AltJSON :> Get '[JSON] ProFile++-- | Gets the current user\'s Gmail profile.+--+-- /See:/ 'usersGetProFile' smart constructor.+newtype UsersGetProFile = UsersGetProFile+ { _ugpfUserId :: Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersGetProFile' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'ugpfUserId'+usersGetProFile+ :: Text+ -> UsersGetProFile+usersGetProFile pUgpfUserId_ =+ UsersGetProFile+ { _ugpfUserId = "me"+ }++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+ugpfUserId :: Lens' UsersGetProFile Text+ugpfUserId+ = lens _ugpfUserId (\ s a -> s{_ugpfUserId = a})++instance GoogleRequest UsersGetProFile where+ type Rs UsersGetProFile = ProFile+ requestClient UsersGetProFile{..}+ = go _ugpfUserId (Just AltJSON) gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersGetProFileResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/History/List.hs view
@@ -0,0 +1,150 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.History.List+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Lists the history of all changes to the given mailbox. History results+-- are returned in chronological order (increasing historyId).+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.history.list@.+module Network.Google.Resource.Gmail.Users.History.List+ (+ -- * REST Resource+ UsersHistoryListResource++ -- * Creating a Request+ , usersHistoryList+ , UsersHistoryList++ -- * Request Lenses+ , uhlUserId+ , uhlStartHistoryId+ , uhlPageToken+ , uhlLabelId+ , uhlMaxResults+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.history.list@ method which the+-- 'UsersHistoryList' request conforms to.+type UsersHistoryListResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "history" :>+ QueryParam "startHistoryId" (Textual Word64) :>+ QueryParam "pageToken" Text :>+ QueryParam "labelId" Text :>+ QueryParam "maxResults" (Textual Word32) :>+ QueryParam "alt" AltJSON :>+ Get '[JSON] ListHistoryResponse++-- | Lists the history of all changes to the given mailbox. History results+-- are returned in chronological order (increasing historyId).+--+-- /See:/ 'usersHistoryList' smart constructor.+data UsersHistoryList = UsersHistoryList+ { _uhlUserId :: !Text+ , _uhlStartHistoryId :: !(Maybe (Textual Word64))+ , _uhlPageToken :: !(Maybe Text)+ , _uhlLabelId :: !(Maybe Text)+ , _uhlMaxResults :: !(Textual Word32)+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersHistoryList' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'uhlUserId'+--+-- * 'uhlStartHistoryId'+--+-- * 'uhlPageToken'+--+-- * 'uhlLabelId'+--+-- * 'uhlMaxResults'+usersHistoryList+ :: Text+ -> UsersHistoryList+usersHistoryList pUhlUserId_ =+ UsersHistoryList+ { _uhlUserId = "me"+ , _uhlStartHistoryId = Nothing+ , _uhlPageToken = Nothing+ , _uhlLabelId = Nothing+ , _uhlMaxResults = 100+ }++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+uhlUserId :: Lens' UsersHistoryList Text+uhlUserId+ = lens _uhlUserId (\ s a -> s{_uhlUserId = a})++-- | Required. Returns history records after the specified startHistoryId.+-- The supplied startHistoryId should be obtained from the historyId of a+-- message, thread, or previous list response. History IDs increase+-- chronologically but are not contiguous with random gaps in between valid+-- IDs. Supplying an invalid or out of date startHistoryId typically+-- returns an HTTP 404 error code. A historyId is typically valid for at+-- least a week, but in some rare circumstances may be valid for only a few+-- hours. If you receive an HTTP 404 error response, your application+-- should perform a full sync. If you receive no nextPageToken in the+-- response, there are no updates to retrieve and you can store the+-- returned historyId for a future request.+uhlStartHistoryId :: Lens' UsersHistoryList (Maybe Word64)+uhlStartHistoryId+ = lens _uhlStartHistoryId+ (\ s a -> s{_uhlStartHistoryId = a})+ . mapping _Coerce++-- | Page token to retrieve a specific page of results in the list.+uhlPageToken :: Lens' UsersHistoryList (Maybe Text)+uhlPageToken+ = lens _uhlPageToken (\ s a -> s{_uhlPageToken = a})++-- | Only return messages with a label matching the ID.+uhlLabelId :: Lens' UsersHistoryList (Maybe Text)+uhlLabelId+ = lens _uhlLabelId (\ s a -> s{_uhlLabelId = a})++-- | The maximum number of history records to return.+uhlMaxResults :: Lens' UsersHistoryList Word32+uhlMaxResults+ = lens _uhlMaxResults+ (\ s a -> s{_uhlMaxResults = a})+ . _Coerce++instance GoogleRequest UsersHistoryList where+ type Rs UsersHistoryList = ListHistoryResponse+ requestClient UsersHistoryList{..}+ = go _uhlUserId _uhlStartHistoryId _uhlPageToken+ _uhlLabelId+ (Just _uhlMaxResults)+ (Just AltJSON)+ gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersHistoryListResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Labels/Create.hs view
@@ -0,0 +1,98 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Labels.Create+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Creates a new label.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.labels.create@.+module Network.Google.Resource.Gmail.Users.Labels.Create+ (+ -- * REST Resource+ UsersLabelsCreateResource++ -- * Creating a Request+ , usersLabelsCreate+ , UsersLabelsCreate++ -- * Request Lenses+ , ulcPayload+ , ulcUserId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.labels.create@ method which the+-- 'UsersLabelsCreate' request conforms to.+type UsersLabelsCreateResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "labels" :>+ QueryParam "alt" AltJSON :>+ ReqBody '[JSON] Label :> Post '[JSON] Label++-- | Creates a new label.+--+-- /See:/ 'usersLabelsCreate' smart constructor.+data UsersLabelsCreate = UsersLabelsCreate+ { _ulcPayload :: !Label+ , _ulcUserId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersLabelsCreate' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'ulcPayload'+--+-- * 'ulcUserId'+usersLabelsCreate+ :: Label -- ^ 'ulcPayload'+ -> Text+ -> UsersLabelsCreate+usersLabelsCreate pUlcPayload_ pUlcUserId_ =+ UsersLabelsCreate+ { _ulcPayload = pUlcPayload_+ , _ulcUserId = "me"+ }++-- | Multipart request metadata.+ulcPayload :: Lens' UsersLabelsCreate Label+ulcPayload+ = lens _ulcPayload (\ s a -> s{_ulcPayload = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+ulcUserId :: Lens' UsersLabelsCreate Text+ulcUserId+ = lens _ulcUserId (\ s a -> s{_ulcUserId = a})++instance GoogleRequest UsersLabelsCreate where+ type Rs UsersLabelsCreate = Label+ requestClient UsersLabelsCreate{..}+ = go _ulcUserId (Just AltJSON) _ulcPayload+ gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersLabelsCreateResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Labels/Delete.hs view
@@ -0,0 +1,98 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Labels.Delete+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Immediately and permanently deletes the specified label and removes it+-- from any messages and threads that it is applied to.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.labels.delete@.+module Network.Google.Resource.Gmail.Users.Labels.Delete+ (+ -- * REST Resource+ UsersLabelsDeleteResource++ -- * Creating a Request+ , usersLabelsDelete+ , UsersLabelsDelete++ -- * Request Lenses+ , uldUserId+ , uldId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.labels.delete@ method which the+-- 'UsersLabelsDelete' request conforms to.+type UsersLabelsDeleteResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "labels" :>+ Capture "id" Text :>+ QueryParam "alt" AltJSON :> Delete '[JSON] ()++-- | Immediately and permanently deletes the specified label and removes it+-- from any messages and threads that it is applied to.+--+-- /See:/ 'usersLabelsDelete' smart constructor.+data UsersLabelsDelete = UsersLabelsDelete+ { _uldUserId :: !Text+ , _uldId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersLabelsDelete' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'uldUserId'+--+-- * 'uldId'+usersLabelsDelete+ :: Text -- ^ 'uldId'+ -> Text+ -> UsersLabelsDelete+usersLabelsDelete pUldUserId_ pUldId_ =+ UsersLabelsDelete+ { _uldUserId = "me"+ , _uldId = pUldId_+ }++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+uldUserId :: Lens' UsersLabelsDelete Text+uldUserId+ = lens _uldUserId (\ s a -> s{_uldUserId = a})++-- | The ID of the label to delete.+uldId :: Lens' UsersLabelsDelete Text+uldId = lens _uldId (\ s a -> s{_uldId = a})++instance GoogleRequest UsersLabelsDelete where+ type Rs UsersLabelsDelete = ()+ requestClient UsersLabelsDelete{..}+ = go _uldUserId _uldId (Just AltJSON) gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersLabelsDeleteResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Labels/Get.hs view
@@ -0,0 +1,95 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Labels.Get+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Gets the specified label.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.labels.get@.+module Network.Google.Resource.Gmail.Users.Labels.Get+ (+ -- * REST Resource+ UsersLabelsGetResource++ -- * Creating a Request+ , usersLabelsGet+ , UsersLabelsGet++ -- * Request Lenses+ , ulgUserId+ , ulgId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.labels.get@ method which the+-- 'UsersLabelsGet' request conforms to.+type UsersLabelsGetResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "labels" :>+ Capture "id" Text :>+ QueryParam "alt" AltJSON :> Get '[JSON] Label++-- | Gets the specified label.+--+-- /See:/ 'usersLabelsGet' smart constructor.+data UsersLabelsGet = UsersLabelsGet+ { _ulgUserId :: !Text+ , _ulgId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersLabelsGet' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'ulgUserId'+--+-- * 'ulgId'+usersLabelsGet+ :: Text -- ^ 'ulgId'+ -> Text+ -> UsersLabelsGet+usersLabelsGet pUlgUserId_ pUlgId_ =+ UsersLabelsGet+ { _ulgUserId = "me"+ , _ulgId = pUlgId_+ }++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+ulgUserId :: Lens' UsersLabelsGet Text+ulgUserId+ = lens _ulgUserId (\ s a -> s{_ulgUserId = a})++-- | The ID of the label to retrieve.+ulgId :: Lens' UsersLabelsGet Text+ulgId = lens _ulgId (\ s a -> s{_ulgId = a})++instance GoogleRequest UsersLabelsGet where+ type Rs UsersLabelsGet = Label+ requestClient UsersLabelsGet{..}+ = go _ulgUserId _ulgId (Just AltJSON) gmailService+ where go+ = buildClient (Proxy :: Proxy UsersLabelsGetResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Labels/List.hs view
@@ -0,0 +1,86 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Labels.List+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Lists all labels in the user\'s mailbox.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.labels.list@.+module Network.Google.Resource.Gmail.Users.Labels.List+ (+ -- * REST Resource+ UsersLabelsListResource++ -- * Creating a Request+ , usersLabelsList+ , UsersLabelsList++ -- * Request Lenses+ , ullUserId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.labels.list@ method which the+-- 'UsersLabelsList' request conforms to.+type UsersLabelsListResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "labels" :>+ QueryParam "alt" AltJSON :>+ Get '[JSON] ListLabelsResponse++-- | Lists all labels in the user\'s mailbox.+--+-- /See:/ 'usersLabelsList' smart constructor.+newtype UsersLabelsList = UsersLabelsList+ { _ullUserId :: Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersLabelsList' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'ullUserId'+usersLabelsList+ :: Text+ -> UsersLabelsList+usersLabelsList pUllUserId_ =+ UsersLabelsList+ { _ullUserId = "me"+ }++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+ullUserId :: Lens' UsersLabelsList Text+ullUserId+ = lens _ullUserId (\ s a -> s{_ullUserId = a})++instance GoogleRequest UsersLabelsList where+ type Rs UsersLabelsList = ListLabelsResponse+ requestClient UsersLabelsList{..}+ = go _ullUserId (Just AltJSON) gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersLabelsListResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Labels/Patch.hs view
@@ -0,0 +1,109 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Labels.Patch+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Updates the specified label. This method supports patch semantics.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.labels.patch@.+module Network.Google.Resource.Gmail.Users.Labels.Patch+ (+ -- * REST Resource+ UsersLabelsPatchResource++ -- * Creating a Request+ , usersLabelsPatch+ , UsersLabelsPatch++ -- * Request Lenses+ , ulpPayload+ , ulpUserId+ , ulpId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.labels.patch@ method which the+-- 'UsersLabelsPatch' request conforms to.+type UsersLabelsPatchResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "labels" :>+ Capture "id" Text :>+ QueryParam "alt" AltJSON :>+ ReqBody '[JSON] Label :> Patch '[JSON] Label++-- | Updates the specified label. This method supports patch semantics.+--+-- /See:/ 'usersLabelsPatch' smart constructor.+data UsersLabelsPatch = UsersLabelsPatch+ { _ulpPayload :: !Label+ , _ulpUserId :: !Text+ , _ulpId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersLabelsPatch' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'ulpPayload'+--+-- * 'ulpUserId'+--+-- * 'ulpId'+usersLabelsPatch+ :: Label -- ^ 'ulpPayload'+ -> Text -- ^ 'ulpId'+ -> Text+ -> UsersLabelsPatch+usersLabelsPatch pUlpPayload_ pUlpUserId_ pUlpId_ =+ UsersLabelsPatch+ { _ulpPayload = pUlpPayload_+ , _ulpUserId = "me"+ , _ulpId = pUlpId_+ }++-- | Multipart request metadata.+ulpPayload :: Lens' UsersLabelsPatch Label+ulpPayload+ = lens _ulpPayload (\ s a -> s{_ulpPayload = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+ulpUserId :: Lens' UsersLabelsPatch Text+ulpUserId+ = lens _ulpUserId (\ s a -> s{_ulpUserId = a})++-- | The ID of the label to update.+ulpId :: Lens' UsersLabelsPatch Text+ulpId = lens _ulpId (\ s a -> s{_ulpId = a})++instance GoogleRequest UsersLabelsPatch where+ type Rs UsersLabelsPatch = Label+ requestClient UsersLabelsPatch{..}+ = go _ulpUserId _ulpId (Just AltJSON) _ulpPayload+ gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersLabelsPatchResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Labels/Update.hs view
@@ -0,0 +1,109 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Labels.Update+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Updates the specified label.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.labels.update@.+module Network.Google.Resource.Gmail.Users.Labels.Update+ (+ -- * REST Resource+ UsersLabelsUpdateResource++ -- * Creating a Request+ , usersLabelsUpdate+ , UsersLabelsUpdate++ -- * Request Lenses+ , uluPayload+ , uluUserId+ , uluId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.labels.update@ method which the+-- 'UsersLabelsUpdate' request conforms to.+type UsersLabelsUpdateResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "labels" :>+ Capture "id" Text :>+ QueryParam "alt" AltJSON :>+ ReqBody '[JSON] Label :> Put '[JSON] Label++-- | Updates the specified label.+--+-- /See:/ 'usersLabelsUpdate' smart constructor.+data UsersLabelsUpdate = UsersLabelsUpdate+ { _uluPayload :: !Label+ , _uluUserId :: !Text+ , _uluId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersLabelsUpdate' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'uluPayload'+--+-- * 'uluUserId'+--+-- * 'uluId'+usersLabelsUpdate+ :: Label -- ^ 'uluPayload'+ -> Text -- ^ 'uluId'+ -> Text+ -> UsersLabelsUpdate+usersLabelsUpdate pUluPayload_ pUluUserId_ pUluId_ =+ UsersLabelsUpdate+ { _uluPayload = pUluPayload_+ , _uluUserId = "me"+ , _uluId = pUluId_+ }++-- | Multipart request metadata.+uluPayload :: Lens' UsersLabelsUpdate Label+uluPayload+ = lens _uluPayload (\ s a -> s{_uluPayload = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+uluUserId :: Lens' UsersLabelsUpdate Text+uluUserId+ = lens _uluUserId (\ s a -> s{_uluUserId = a})++-- | The ID of the label to update.+uluId :: Lens' UsersLabelsUpdate Text+uluId = lens _uluId (\ s a -> s{_uluId = a})++instance GoogleRequest UsersLabelsUpdate where+ type Rs UsersLabelsUpdate = Label+ requestClient UsersLabelsUpdate{..}+ = go _uluUserId _uluId (Just AltJSON) _uluPayload+ gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersLabelsUpdateResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Messages/Attachments/Get.hs view
@@ -0,0 +1,114 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Messages.Attachments.Get+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Gets the specified message attachment.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.messages.attachments.get@.+module Network.Google.Resource.Gmail.Users.Messages.Attachments.Get+ (+ -- * REST Resource+ UsersMessagesAttachmentsGetResource++ -- * Creating a Request+ , usersMessagesAttachmentsGet+ , UsersMessagesAttachmentsGet++ -- * Request Lenses+ , umagUserId+ , umagId+ , umagMessageId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.messages.attachments.get@ method which the+-- 'UsersMessagesAttachmentsGet' request conforms to.+type UsersMessagesAttachmentsGetResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "messages" :>+ Capture "messageId" Text :>+ "attachments" :>+ Capture "id" Text :>+ QueryParam "alt" AltJSON :>+ Get '[JSON] MessagePartBody++-- | Gets the specified message attachment.+--+-- /See:/ 'usersMessagesAttachmentsGet' smart constructor.+data UsersMessagesAttachmentsGet = UsersMessagesAttachmentsGet+ { _umagUserId :: !Text+ , _umagId :: !Text+ , _umagMessageId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersMessagesAttachmentsGet' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'umagUserId'+--+-- * 'umagId'+--+-- * 'umagMessageId'+usersMessagesAttachmentsGet+ :: Text -- ^ 'umagId'+ -> Text -- ^ 'umagMessageId'+ -> Text+ -> UsersMessagesAttachmentsGet+usersMessagesAttachmentsGet pUmagUserId_ pUmagId_ pUmagMessageId_ =+ UsersMessagesAttachmentsGet+ { _umagUserId = "me"+ , _umagId = pUmagId_+ , _umagMessageId = pUmagMessageId_+ }++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+umagUserId :: Lens' UsersMessagesAttachmentsGet Text+umagUserId+ = lens _umagUserId (\ s a -> s{_umagUserId = a})++-- | The ID of the attachment.+umagId :: Lens' UsersMessagesAttachmentsGet Text+umagId = lens _umagId (\ s a -> s{_umagId = a})++-- | The ID of the message containing the attachment.+umagMessageId :: Lens' UsersMessagesAttachmentsGet Text+umagMessageId+ = lens _umagMessageId+ (\ s a -> s{_umagMessageId = a})++instance GoogleRequest UsersMessagesAttachmentsGet+ where+ type Rs UsersMessagesAttachmentsGet = MessagePartBody+ requestClient UsersMessagesAttachmentsGet{..}+ = go _umagUserId _umagMessageId _umagId+ (Just AltJSON)+ gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersMessagesAttachmentsGetResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Messages/Delete.hs view
@@ -0,0 +1,98 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Messages.Delete+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Immediately and permanently deletes the specified message. This+-- operation cannot be undone. Prefer messages.trash instead.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.messages.delete@.+module Network.Google.Resource.Gmail.Users.Messages.Delete+ (+ -- * REST Resource+ UsersMessagesDeleteResource++ -- * Creating a Request+ , usersMessagesDelete+ , UsersMessagesDelete++ -- * Request Lenses+ , umdUserId+ , umdId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.messages.delete@ method which the+-- 'UsersMessagesDelete' request conforms to.+type UsersMessagesDeleteResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "messages" :>+ Capture "id" Text :>+ QueryParam "alt" AltJSON :> Delete '[JSON] ()++-- | Immediately and permanently deletes the specified message. This+-- operation cannot be undone. Prefer messages.trash instead.+--+-- /See:/ 'usersMessagesDelete' smart constructor.+data UsersMessagesDelete = UsersMessagesDelete+ { _umdUserId :: !Text+ , _umdId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersMessagesDelete' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'umdUserId'+--+-- * 'umdId'+usersMessagesDelete+ :: Text -- ^ 'umdId'+ -> Text+ -> UsersMessagesDelete+usersMessagesDelete pUmdUserId_ pUmdId_ =+ UsersMessagesDelete+ { _umdUserId = "me"+ , _umdId = pUmdId_+ }++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+umdUserId :: Lens' UsersMessagesDelete Text+umdUserId+ = lens _umdUserId (\ s a -> s{_umdUserId = a})++-- | The ID of the message to delete.+umdId :: Lens' UsersMessagesDelete Text+umdId = lens _umdId (\ s a -> s{_umdId = a})++instance GoogleRequest UsersMessagesDelete where+ type Rs UsersMessagesDelete = ()+ requestClient UsersMessagesDelete{..}+ = go _umdUserId _umdId (Just AltJSON) gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersMessagesDeleteResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Messages/Get.hs view
@@ -0,0 +1,124 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Messages.Get+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Gets the specified message.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.messages.get@.+module Network.Google.Resource.Gmail.Users.Messages.Get+ (+ -- * REST Resource+ UsersMessagesGetResource++ -- * Creating a Request+ , usersMessagesGet+ , UsersMessagesGet++ -- * Request Lenses+ , umgFormat+ , umgUserId+ , umgId+ , umgMetadataHeaders+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.messages.get@ method which the+-- 'UsersMessagesGet' request conforms to.+type UsersMessagesGetResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "messages" :>+ Capture "id" Text :>+ QueryParam "format" UsersMessagesGetFormat :>+ QueryParams "metadataHeaders" Text :>+ QueryParam "alt" AltJSON :> Get '[JSON] Message++-- | Gets the specified message.+--+-- /See:/ 'usersMessagesGet' smart constructor.+data UsersMessagesGet = UsersMessagesGet+ { _umgFormat :: !UsersMessagesGetFormat+ , _umgUserId :: !Text+ , _umgId :: !Text+ , _umgMetadataHeaders :: !(Maybe [Text])+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersMessagesGet' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'umgFormat'+--+-- * 'umgUserId'+--+-- * 'umgId'+--+-- * 'umgMetadataHeaders'+usersMessagesGet+ :: Text -- ^ 'umgId'+ -> Text+ -> UsersMessagesGet+usersMessagesGet pUmgUserId_ pUmgId_ =+ UsersMessagesGet+ { _umgFormat = Full+ , _umgUserId = "me"+ , _umgId = pUmgId_+ , _umgMetadataHeaders = Nothing+ }++-- | The format to return the message in.+umgFormat :: Lens' UsersMessagesGet UsersMessagesGetFormat+umgFormat+ = lens _umgFormat (\ s a -> s{_umgFormat = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+umgUserId :: Lens' UsersMessagesGet Text+umgUserId+ = lens _umgUserId (\ s a -> s{_umgUserId = a})++-- | The ID of the message to retrieve.+umgId :: Lens' UsersMessagesGet Text+umgId = lens _umgId (\ s a -> s{_umgId = a})++-- | When given and format is METADATA, only include headers specified.+umgMetadataHeaders :: Lens' UsersMessagesGet [Text]+umgMetadataHeaders+ = lens _umgMetadataHeaders+ (\ s a -> s{_umgMetadataHeaders = a})+ . _Default+ . _Coerce++instance GoogleRequest UsersMessagesGet where+ type Rs UsersMessagesGet = Message+ requestClient UsersMessagesGet{..}+ = go _umgUserId _umgId (Just _umgFormat)+ (_umgMetadataHeaders ^. _Default)+ (Just AltJSON)+ gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersMessagesGetResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Messages/Import.hs view
@@ -0,0 +1,198 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Messages.Import+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Imports a message into only this user\'s mailbox, with standard email+-- delivery scanning and classification similar to receiving via SMTP. Does+-- not send a message.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.messages.import@.+module Network.Google.Resource.Gmail.Users.Messages.Import+ (+ -- * REST Resource+ UsersMessagesImportResource++ -- * Creating a Request+ , usersMessagesImport+ , UsersMessagesImport++ -- * Request Lenses+ , umiPayload+ , umiUserId+ , umiProcessForCalendar+ , umiDeleted+ , umiNeverMarkSpam+ , umiInternalDateSource+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.messages.import@ method which the+-- 'UsersMessagesImport' request conforms to.+type UsersMessagesImportResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "messages" :>+ "import" :>+ QueryParam "processForCalendar" Bool :>+ QueryParam "deleted" Bool :>+ QueryParam "neverMarkSpam" Bool :>+ QueryParam "internalDateSource"+ UsersMessagesImportInternalDateSource+ :>+ QueryParam "alt" AltJSON :>+ ReqBody '[JSON] Message :> Post '[JSON] Message+ :<|>+ "upload" :>+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "messages" :>+ "import" :>+ QueryParam "processForCalendar" Bool :>+ QueryParam "deleted" Bool :>+ QueryParam "neverMarkSpam" Bool :>+ QueryParam "internalDateSource"+ UsersMessagesImportInternalDateSource+ :>+ QueryParam "alt" AltJSON :>+ QueryParam "uploadType" AltMedia :>+ MultipartRelated '[JSON] Message RequestBody :>+ Post '[JSON] Message++-- | Imports a message into only this user\'s mailbox, with standard email+-- delivery scanning and classification similar to receiving via SMTP. Does+-- not send a message.+--+-- /See:/ 'usersMessagesImport' smart constructor.+data UsersMessagesImport = UsersMessagesImport+ { _umiPayload :: !Message+ , _umiUserId :: !Text+ , _umiProcessForCalendar :: !Bool+ , _umiDeleted :: !Bool+ , _umiNeverMarkSpam :: !Bool+ , _umiInternalDateSource :: !UsersMessagesImportInternalDateSource+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersMessagesImport' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'umiPayload'+--+-- * 'umiUserId'+--+-- * 'umiProcessForCalendar'+--+-- * 'umiDeleted'+--+-- * 'umiNeverMarkSpam'+--+-- * 'umiInternalDateSource'+usersMessagesImport+ :: Message -- ^ 'umiPayload'+ -> Text+ -> UsersMessagesImport+usersMessagesImport pUmiPayload_ pUmiUserId_ =+ UsersMessagesImport+ { _umiPayload = pUmiPayload_+ , _umiUserId = "me"+ , _umiProcessForCalendar = False+ , _umiDeleted = False+ , _umiNeverMarkSpam = False+ , _umiInternalDateSource = DateHeader+ }++-- | Multipart request metadata.+umiPayload :: Lens' UsersMessagesImport Message+umiPayload+ = lens _umiPayload (\ s a -> s{_umiPayload = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+umiUserId :: Lens' UsersMessagesImport Text+umiUserId+ = lens _umiUserId (\ s a -> s{_umiUserId = a})++-- | Process calendar invites in the email and add any extracted meetings to+-- the Google Calendar for this user.+umiProcessForCalendar :: Lens' UsersMessagesImport Bool+umiProcessForCalendar+ = lens _umiProcessForCalendar+ (\ s a -> s{_umiProcessForCalendar = a})++-- | Mark the email as permanently deleted (not TRASH) and only visible in+-- Google Apps Vault to a Vault administrator. Only used for Google Apps+-- for Work accounts.+umiDeleted :: Lens' UsersMessagesImport Bool+umiDeleted+ = lens _umiDeleted (\ s a -> s{_umiDeleted = a})++-- | Ignore the Gmail spam classifier decision and never mark this email as+-- SPAM in the mailbox.+umiNeverMarkSpam :: Lens' UsersMessagesImport Bool+umiNeverMarkSpam+ = lens _umiNeverMarkSpam+ (\ s a -> s{_umiNeverMarkSpam = a})++-- | Source for Gmail\'s internal date of the message.+umiInternalDateSource :: Lens' UsersMessagesImport UsersMessagesImportInternalDateSource+umiInternalDateSource+ = lens _umiInternalDateSource+ (\ s a -> s{_umiInternalDateSource = a})++instance GoogleRequest UsersMessagesImport where+ type Rs UsersMessagesImport = Message+ requestClient UsersMessagesImport{..}+ = go _umiUserId (Just _umiProcessForCalendar)+ (Just _umiDeleted)+ (Just _umiNeverMarkSpam)+ (Just _umiInternalDateSource)+ (Just AltJSON)+ _umiPayload+ gmailService+ where go :<|> _+ = buildClient+ (Proxy :: Proxy UsersMessagesImportResource)+ mempty++instance GoogleRequest+ (MediaUpload UsersMessagesImport) where+ type Rs (MediaUpload UsersMessagesImport) = Message+ requestClient+ (MediaUpload UsersMessagesImport{..} body)+ = go _umiUserId (Just _umiProcessForCalendar)+ (Just _umiDeleted)+ (Just _umiNeverMarkSpam)+ (Just _umiInternalDateSource)+ (Just AltJSON)+ (Just AltMedia)+ _umiPayload+ body+ gmailService+ where _ :<|> go+ = buildClient+ (Proxy :: Proxy UsersMessagesImportResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Messages/Insert.hs view
@@ -0,0 +1,161 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Messages.Insert+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Directly inserts a message into only this user\'s mailbox similar to+-- IMAP APPEND, bypassing most scanning and classification. Does not send a+-- message.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.messages.insert@.+module Network.Google.Resource.Gmail.Users.Messages.Insert+ (+ -- * REST Resource+ UsersMessagesInsertResource++ -- * Creating a Request+ , usersMessagesInsert+ , UsersMessagesInsert++ -- * Request Lenses+ , uPayload+ , uUserId+ , uDeleted+ , uInternalDateSource+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.messages.insert@ method which the+-- 'UsersMessagesInsert' request conforms to.+type UsersMessagesInsertResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "messages" :>+ QueryParam "deleted" Bool :>+ QueryParam "internalDateSource"+ UsersMessagesInsertInternalDateSource+ :>+ QueryParam "alt" AltJSON :>+ ReqBody '[JSON] Message :> Post '[JSON] Message+ :<|>+ "upload" :>+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "messages" :>+ QueryParam "deleted" Bool :>+ QueryParam "internalDateSource"+ UsersMessagesInsertInternalDateSource+ :>+ QueryParam "alt" AltJSON :>+ QueryParam "uploadType" AltMedia :>+ MultipartRelated '[JSON] Message RequestBody :>+ Post '[JSON] Message++-- | Directly inserts a message into only this user\'s mailbox similar to+-- IMAP APPEND, bypassing most scanning and classification. Does not send a+-- message.+--+-- /See:/ 'usersMessagesInsert' smart constructor.+data UsersMessagesInsert = UsersMessagesInsert+ { _uPayload :: !Message+ , _uUserId :: !Text+ , _uDeleted :: !Bool+ , _uInternalDateSource :: !UsersMessagesInsertInternalDateSource+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersMessagesInsert' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'uPayload'+--+-- * 'uUserId'+--+-- * 'uDeleted'+--+-- * 'uInternalDateSource'+usersMessagesInsert+ :: Message -- ^ 'uPayload'+ -> Text+ -> UsersMessagesInsert+usersMessagesInsert pUPayload_ pUUserId_ =+ UsersMessagesInsert+ { _uPayload = pUPayload_+ , _uUserId = "me"+ , _uDeleted = False+ , _uInternalDateSource = UMIIDSReceivedTime+ }++-- | Multipart request metadata.+uPayload :: Lens' UsersMessagesInsert Message+uPayload = lens _uPayload (\ s a -> s{_uPayload = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+uUserId :: Lens' UsersMessagesInsert Text+uUserId = lens _uUserId (\ s a -> s{_uUserId = a})++-- | Mark the email as permanently deleted (not TRASH) and only visible in+-- Google Apps Vault to a Vault administrator. Only used for Google Apps+-- for Work accounts.+uDeleted :: Lens' UsersMessagesInsert Bool+uDeleted = lens _uDeleted (\ s a -> s{_uDeleted = a})++-- | Source for Gmail\'s internal date of the message.+uInternalDateSource :: Lens' UsersMessagesInsert UsersMessagesInsertInternalDateSource+uInternalDateSource+ = lens _uInternalDateSource+ (\ s a -> s{_uInternalDateSource = a})++instance GoogleRequest UsersMessagesInsert where+ type Rs UsersMessagesInsert = Message+ requestClient UsersMessagesInsert{..}+ = go _uUserId (Just _uDeleted)+ (Just _uInternalDateSource)+ (Just AltJSON)+ _uPayload+ gmailService+ where go :<|> _+ = buildClient+ (Proxy :: Proxy UsersMessagesInsertResource)+ mempty++instance GoogleRequest+ (MediaUpload UsersMessagesInsert) where+ type Rs (MediaUpload UsersMessagesInsert) = Message+ requestClient+ (MediaUpload UsersMessagesInsert{..} body)+ = go _uUserId (Just _uDeleted)+ (Just _uInternalDateSource)+ (Just AltJSON)+ (Just AltMedia)+ _uPayload+ body+ gmailService+ where _ :<|> go+ = buildClient+ (Proxy :: Proxy UsersMessagesInsertResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Messages/List.hs view
@@ -0,0 +1,153 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Messages.List+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Lists the messages in the user\'s mailbox.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.messages.list@.+module Network.Google.Resource.Gmail.Users.Messages.List+ (+ -- * REST Resource+ UsersMessagesListResource++ -- * Creating a Request+ , usersMessagesList+ , UsersMessagesList++ -- * Request Lenses+ , umlQ+ , umlUserId+ , umlIncludeSpamTrash+ , umlLabelIds+ , umlPageToken+ , umlMaxResults+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.messages.list@ method which the+-- 'UsersMessagesList' request conforms to.+type UsersMessagesListResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "messages" :>+ QueryParam "q" Text :>+ QueryParam "includeSpamTrash" Bool :>+ QueryParams "labelIds" Text :>+ QueryParam "pageToken" Text :>+ QueryParam "maxResults" (Textual Word32) :>+ QueryParam "alt" AltJSON :>+ Get '[JSON] ListMessagesResponse++-- | Lists the messages in the user\'s mailbox.+--+-- /See:/ 'usersMessagesList' smart constructor.+data UsersMessagesList = UsersMessagesList+ { _umlQ :: !(Maybe Text)+ , _umlUserId :: !Text+ , _umlIncludeSpamTrash :: !Bool+ , _umlLabelIds :: !(Maybe [Text])+ , _umlPageToken :: !(Maybe Text)+ , _umlMaxResults :: !(Textual Word32)+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersMessagesList' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'umlQ'+--+-- * 'umlUserId'+--+-- * 'umlIncludeSpamTrash'+--+-- * 'umlLabelIds'+--+-- * 'umlPageToken'+--+-- * 'umlMaxResults'+usersMessagesList+ :: Text+ -> UsersMessagesList+usersMessagesList pUmlUserId_ =+ UsersMessagesList+ { _umlQ = Nothing+ , _umlUserId = "me"+ , _umlIncludeSpamTrash = False+ , _umlLabelIds = Nothing+ , _umlPageToken = Nothing+ , _umlMaxResults = 100+ }++-- | Only return messages matching the specified query. Supports the same+-- query format as the Gmail search box. For example,+-- \"from:someuser\'example.com rfc822msgid: is:unread\".+umlQ :: Lens' UsersMessagesList (Maybe Text)+umlQ = lens _umlQ (\ s a -> s{_umlQ = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+umlUserId :: Lens' UsersMessagesList Text+umlUserId+ = lens _umlUserId (\ s a -> s{_umlUserId = a})++-- | Include messages from SPAM and TRASH in the results.+umlIncludeSpamTrash :: Lens' UsersMessagesList Bool+umlIncludeSpamTrash+ = lens _umlIncludeSpamTrash+ (\ s a -> s{_umlIncludeSpamTrash = a})++-- | Only return messages with labels that match all of the specified label+-- IDs.+umlLabelIds :: Lens' UsersMessagesList [Text]+umlLabelIds+ = lens _umlLabelIds (\ s a -> s{_umlLabelIds = a}) .+ _Default+ . _Coerce++-- | Page token to retrieve a specific page of results in the list.+umlPageToken :: Lens' UsersMessagesList (Maybe Text)+umlPageToken+ = lens _umlPageToken (\ s a -> s{_umlPageToken = a})++-- | Maximum number of messages to return.+umlMaxResults :: Lens' UsersMessagesList Word32+umlMaxResults+ = lens _umlMaxResults+ (\ s a -> s{_umlMaxResults = a})+ . _Coerce++instance GoogleRequest UsersMessagesList where+ type Rs UsersMessagesList = ListMessagesResponse+ requestClient UsersMessagesList{..}+ = go _umlUserId _umlQ (Just _umlIncludeSpamTrash)+ (_umlLabelIds ^. _Default)+ _umlPageToken+ (Just _umlMaxResults)+ (Just AltJSON)+ gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersMessagesListResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Messages/Modify.hs view
@@ -0,0 +1,111 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Messages.Modify+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Modifies the labels on the specified message.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.messages.modify@.+module Network.Google.Resource.Gmail.Users.Messages.Modify+ (+ -- * REST Resource+ UsersMessagesModifyResource++ -- * Creating a Request+ , usersMessagesModify+ , UsersMessagesModify++ -- * Request Lenses+ , ummPayload+ , ummUserId+ , ummId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.messages.modify@ method which the+-- 'UsersMessagesModify' request conforms to.+type UsersMessagesModifyResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "messages" :>+ Capture "id" Text :>+ "modify" :>+ QueryParam "alt" AltJSON :>+ ReqBody '[JSON] ModifyMessageRequest :>+ Post '[JSON] Message++-- | Modifies the labels on the specified message.+--+-- /See:/ 'usersMessagesModify' smart constructor.+data UsersMessagesModify = UsersMessagesModify+ { _ummPayload :: !ModifyMessageRequest+ , _ummUserId :: !Text+ , _ummId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersMessagesModify' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'ummPayload'+--+-- * 'ummUserId'+--+-- * 'ummId'+usersMessagesModify+ :: ModifyMessageRequest -- ^ 'ummPayload'+ -> Text -- ^ 'ummId'+ -> Text+ -> UsersMessagesModify+usersMessagesModify pUmmPayload_ pUmmUserId_ pUmmId_ =+ UsersMessagesModify+ { _ummPayload = pUmmPayload_+ , _ummUserId = "me"+ , _ummId = pUmmId_+ }++-- | Multipart request metadata.+ummPayload :: Lens' UsersMessagesModify ModifyMessageRequest+ummPayload+ = lens _ummPayload (\ s a -> s{_ummPayload = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+ummUserId :: Lens' UsersMessagesModify Text+ummUserId+ = lens _ummUserId (\ s a -> s{_ummUserId = a})++-- | The ID of the message to modify.+ummId :: Lens' UsersMessagesModify Text+ummId = lens _ummId (\ s a -> s{_ummId = a})++instance GoogleRequest UsersMessagesModify where+ type Rs UsersMessagesModify = Message+ requestClient UsersMessagesModify{..}+ = go _ummUserId _ummId (Just AltJSON) _ummPayload+ gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersMessagesModifyResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Messages/Send.hs view
@@ -0,0 +1,127 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Messages.Send+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Sends the specified message to the recipients in the To, Cc, and Bcc+-- headers.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.messages.send@.+module Network.Google.Resource.Gmail.Users.Messages.Send+ (+ -- * REST Resource+ UsersMessagesSendResource++ -- * Creating a Request+ , usersMessagesSend+ , UsersMessagesSend++ -- * Request Lenses+ , umsPayload+ , umsUserId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.messages.send@ method which the+-- 'UsersMessagesSend' request conforms to.+type UsersMessagesSendResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "messages" :>+ "send" :>+ QueryParam "alt" AltJSON :>+ ReqBody '[JSON] Message :> Post '[JSON] Message+ :<|>+ "upload" :>+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "messages" :>+ "send" :>+ QueryParam "alt" AltJSON :>+ QueryParam "uploadType" AltMedia :>+ MultipartRelated '[JSON] Message RequestBody :>+ Post '[JSON] Message++-- | Sends the specified message to the recipients in the To, Cc, and Bcc+-- headers.+--+-- /See:/ 'usersMessagesSend' smart constructor.+data UsersMessagesSend = UsersMessagesSend+ { _umsPayload :: !Message+ , _umsUserId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersMessagesSend' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'umsPayload'+--+-- * 'umsUserId'+usersMessagesSend+ :: Message -- ^ 'umsPayload'+ -> Text+ -> UsersMessagesSend+usersMessagesSend pUmsPayload_ pUmsUserId_ =+ UsersMessagesSend+ { _umsPayload = pUmsPayload_+ , _umsUserId = "me"+ }++-- | Multipart request metadata.+umsPayload :: Lens' UsersMessagesSend Message+umsPayload+ = lens _umsPayload (\ s a -> s{_umsPayload = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+umsUserId :: Lens' UsersMessagesSend Text+umsUserId+ = lens _umsUserId (\ s a -> s{_umsUserId = a})++instance GoogleRequest UsersMessagesSend where+ type Rs UsersMessagesSend = Message+ requestClient UsersMessagesSend{..}+ = go _umsUserId (Just AltJSON) _umsPayload+ gmailService+ where go :<|> _+ = buildClient+ (Proxy :: Proxy UsersMessagesSendResource)+ mempty++instance GoogleRequest+ (MediaUpload UsersMessagesSend) where+ type Rs (MediaUpload UsersMessagesSend) = Message+ requestClient+ (MediaUpload UsersMessagesSend{..} body)+ = go _umsUserId (Just AltJSON) (Just AltMedia)+ _umsPayload+ body+ gmailService+ where _ :<|> go+ = buildClient+ (Proxy :: Proxy UsersMessagesSendResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Messages/Trash.hs view
@@ -0,0 +1,97 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Messages.Trash+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Moves the specified message to the trash.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.messages.trash@.+module Network.Google.Resource.Gmail.Users.Messages.Trash+ (+ -- * REST Resource+ UsersMessagesTrashResource++ -- * Creating a Request+ , usersMessagesTrash+ , UsersMessagesTrash++ -- * Request Lenses+ , umtUserId+ , umtId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.messages.trash@ method which the+-- 'UsersMessagesTrash' request conforms to.+type UsersMessagesTrashResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "messages" :>+ Capture "id" Text :>+ "trash" :>+ QueryParam "alt" AltJSON :> Post '[JSON] Message++-- | Moves the specified message to the trash.+--+-- /See:/ 'usersMessagesTrash' smart constructor.+data UsersMessagesTrash = UsersMessagesTrash+ { _umtUserId :: !Text+ , _umtId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersMessagesTrash' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'umtUserId'+--+-- * 'umtId'+usersMessagesTrash+ :: Text -- ^ 'umtId'+ -> Text+ -> UsersMessagesTrash+usersMessagesTrash pUmtUserId_ pUmtId_ =+ UsersMessagesTrash+ { _umtUserId = "me"+ , _umtId = pUmtId_+ }++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+umtUserId :: Lens' UsersMessagesTrash Text+umtUserId+ = lens _umtUserId (\ s a -> s{_umtUserId = a})++-- | The ID of the message to Trash.+umtId :: Lens' UsersMessagesTrash Text+umtId = lens _umtId (\ s a -> s{_umtId = a})++instance GoogleRequest UsersMessagesTrash where+ type Rs UsersMessagesTrash = Message+ requestClient UsersMessagesTrash{..}+ = go _umtUserId _umtId (Just AltJSON) gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersMessagesTrashResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Messages/Untrash.hs view
@@ -0,0 +1,97 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Messages.Untrash+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Removes the specified message from the trash.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.messages.untrash@.+module Network.Google.Resource.Gmail.Users.Messages.Untrash+ (+ -- * REST Resource+ UsersMessagesUntrashResource++ -- * Creating a Request+ , usersMessagesUntrash+ , UsersMessagesUntrash++ -- * Request Lenses+ , umuUserId+ , umuId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.messages.untrash@ method which the+-- 'UsersMessagesUntrash' request conforms to.+type UsersMessagesUntrashResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "messages" :>+ Capture "id" Text :>+ "untrash" :>+ QueryParam "alt" AltJSON :> Post '[JSON] Message++-- | Removes the specified message from the trash.+--+-- /See:/ 'usersMessagesUntrash' smart constructor.+data UsersMessagesUntrash = UsersMessagesUntrash+ { _umuUserId :: !Text+ , _umuId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersMessagesUntrash' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'umuUserId'+--+-- * 'umuId'+usersMessagesUntrash+ :: Text -- ^ 'umuId'+ -> Text+ -> UsersMessagesUntrash+usersMessagesUntrash pUmuUserId_ pUmuId_ =+ UsersMessagesUntrash+ { _umuUserId = "me"+ , _umuId = pUmuId_+ }++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+umuUserId :: Lens' UsersMessagesUntrash Text+umuUserId+ = lens _umuUserId (\ s a -> s{_umuUserId = a})++-- | The ID of the message to remove from Trash.+umuId :: Lens' UsersMessagesUntrash Text+umuId = lens _umuId (\ s a -> s{_umuId = a})++instance GoogleRequest UsersMessagesUntrash where+ type Rs UsersMessagesUntrash = Message+ requestClient UsersMessagesUntrash{..}+ = go _umuUserId _umuId (Just AltJSON) gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersMessagesUntrashResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Stop.hs view
@@ -0,0 +1,82 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Stop+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Stop receiving push notifications for the given user mailbox.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.stop@.+module Network.Google.Resource.Gmail.Users.Stop+ (+ -- * REST Resource+ UsersStopResource++ -- * Creating a Request+ , usersStop+ , UsersStop++ -- * Request Lenses+ , usUserId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.stop@ method which the+-- 'UsersStop' request conforms to.+type UsersStopResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "stop" :> QueryParam "alt" AltJSON :> Post '[JSON] ()++-- | Stop receiving push notifications for the given user mailbox.+--+-- /See:/ 'usersStop' smart constructor.+newtype UsersStop = UsersStop+ { _usUserId :: Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersStop' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'usUserId'+usersStop+ :: Text+ -> UsersStop+usersStop pUsUserId_ =+ UsersStop+ { _usUserId = "me"+ }++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+usUserId :: Lens' UsersStop Text+usUserId = lens _usUserId (\ s a -> s{_usUserId = a})++instance GoogleRequest UsersStop where+ type Rs UsersStop = ()+ requestClient UsersStop{..}+ = go _usUserId (Just AltJSON) gmailService+ where go+ = buildClient (Proxy :: Proxy UsersStopResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Threads/Delete.hs view
@@ -0,0 +1,98 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Threads.Delete+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Immediately and permanently deletes the specified thread. This operation+-- cannot be undone. Prefer threads.trash instead.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.threads.delete@.+module Network.Google.Resource.Gmail.Users.Threads.Delete+ (+ -- * REST Resource+ UsersThreadsDeleteResource++ -- * Creating a Request+ , usersThreadsDelete+ , UsersThreadsDelete++ -- * Request Lenses+ , utdUserId+ , utdId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.threads.delete@ method which the+-- 'UsersThreadsDelete' request conforms to.+type UsersThreadsDeleteResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "threads" :>+ Capture "id" Text :>+ QueryParam "alt" AltJSON :> Delete '[JSON] ()++-- | Immediately and permanently deletes the specified thread. This operation+-- cannot be undone. Prefer threads.trash instead.+--+-- /See:/ 'usersThreadsDelete' smart constructor.+data UsersThreadsDelete = UsersThreadsDelete+ { _utdUserId :: !Text+ , _utdId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersThreadsDelete' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'utdUserId'+--+-- * 'utdId'+usersThreadsDelete+ :: Text -- ^ 'utdId'+ -> Text+ -> UsersThreadsDelete+usersThreadsDelete pUtdUserId_ pUtdId_ =+ UsersThreadsDelete+ { _utdUserId = "me"+ , _utdId = pUtdId_+ }++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+utdUserId :: Lens' UsersThreadsDelete Text+utdUserId+ = lens _utdUserId (\ s a -> s{_utdUserId = a})++-- | ID of the Thread to delete.+utdId :: Lens' UsersThreadsDelete Text+utdId = lens _utdId (\ s a -> s{_utdId = a})++instance GoogleRequest UsersThreadsDelete where+ type Rs UsersThreadsDelete = ()+ requestClient UsersThreadsDelete{..}+ = go _utdUserId _utdId (Just AltJSON) gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersThreadsDeleteResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Threads/Get.hs view
@@ -0,0 +1,124 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Threads.Get+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Gets the specified thread.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.threads.get@.+module Network.Google.Resource.Gmail.Users.Threads.Get+ (+ -- * REST Resource+ UsersThreadsGetResource++ -- * Creating a Request+ , usersThreadsGet+ , UsersThreadsGet++ -- * Request Lenses+ , utgFormat+ , utgUserId+ , utgId+ , utgMetadataHeaders+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.threads.get@ method which the+-- 'UsersThreadsGet' request conforms to.+type UsersThreadsGetResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "threads" :>+ Capture "id" Text :>+ QueryParam "format" UsersThreadsGetFormat :>+ QueryParams "metadataHeaders" Text :>+ QueryParam "alt" AltJSON :> Get '[JSON] Thread++-- | Gets the specified thread.+--+-- /See:/ 'usersThreadsGet' smart constructor.+data UsersThreadsGet = UsersThreadsGet+ { _utgFormat :: !UsersThreadsGetFormat+ , _utgUserId :: !Text+ , _utgId :: !Text+ , _utgMetadataHeaders :: !(Maybe [Text])+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersThreadsGet' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'utgFormat'+--+-- * 'utgUserId'+--+-- * 'utgId'+--+-- * 'utgMetadataHeaders'+usersThreadsGet+ :: Text -- ^ 'utgId'+ -> Text+ -> UsersThreadsGet+usersThreadsGet pUtgUserId_ pUtgId_ =+ UsersThreadsGet+ { _utgFormat = UTGFFull+ , _utgUserId = "me"+ , _utgId = pUtgId_+ , _utgMetadataHeaders = Nothing+ }++-- | The format to return the messages in.+utgFormat :: Lens' UsersThreadsGet UsersThreadsGetFormat+utgFormat+ = lens _utgFormat (\ s a -> s{_utgFormat = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+utgUserId :: Lens' UsersThreadsGet Text+utgUserId+ = lens _utgUserId (\ s a -> s{_utgUserId = a})++-- | The ID of the thread to retrieve.+utgId :: Lens' UsersThreadsGet Text+utgId = lens _utgId (\ s a -> s{_utgId = a})++-- | When given and format is METADATA, only include headers specified.+utgMetadataHeaders :: Lens' UsersThreadsGet [Text]+utgMetadataHeaders+ = lens _utgMetadataHeaders+ (\ s a -> s{_utgMetadataHeaders = a})+ . _Default+ . _Coerce++instance GoogleRequest UsersThreadsGet where+ type Rs UsersThreadsGet = Thread+ requestClient UsersThreadsGet{..}+ = go _utgUserId _utgId (Just _utgFormat)+ (_utgMetadataHeaders ^. _Default)+ (Just AltJSON)+ gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersThreadsGetResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Threads/List.hs view
@@ -0,0 +1,153 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Threads.List+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Lists the threads in the user\'s mailbox.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.threads.list@.+module Network.Google.Resource.Gmail.Users.Threads.List+ (+ -- * REST Resource+ UsersThreadsListResource++ -- * Creating a Request+ , usersThreadsList+ , UsersThreadsList++ -- * Request Lenses+ , utlQ+ , utlUserId+ , utlIncludeSpamTrash+ , utlLabelIds+ , utlPageToken+ , utlMaxResults+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.threads.list@ method which the+-- 'UsersThreadsList' request conforms to.+type UsersThreadsListResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "threads" :>+ QueryParam "q" Text :>+ QueryParam "includeSpamTrash" Bool :>+ QueryParams "labelIds" Text :>+ QueryParam "pageToken" Text :>+ QueryParam "maxResults" (Textual Word32) :>+ QueryParam "alt" AltJSON :>+ Get '[JSON] ListThreadsResponse++-- | Lists the threads in the user\'s mailbox.+--+-- /See:/ 'usersThreadsList' smart constructor.+data UsersThreadsList = UsersThreadsList+ { _utlQ :: !(Maybe Text)+ , _utlUserId :: !Text+ , _utlIncludeSpamTrash :: !Bool+ , _utlLabelIds :: !(Maybe [Text])+ , _utlPageToken :: !(Maybe Text)+ , _utlMaxResults :: !(Textual Word32)+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersThreadsList' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'utlQ'+--+-- * 'utlUserId'+--+-- * 'utlIncludeSpamTrash'+--+-- * 'utlLabelIds'+--+-- * 'utlPageToken'+--+-- * 'utlMaxResults'+usersThreadsList+ :: Text+ -> UsersThreadsList+usersThreadsList pUtlUserId_ =+ UsersThreadsList+ { _utlQ = Nothing+ , _utlUserId = "me"+ , _utlIncludeSpamTrash = False+ , _utlLabelIds = Nothing+ , _utlPageToken = Nothing+ , _utlMaxResults = 100+ }++-- | Only return threads matching the specified query. Supports the same+-- query format as the Gmail search box. For example,+-- \"from:someuser\'example.com rfc822msgid: is:unread\".+utlQ :: Lens' UsersThreadsList (Maybe Text)+utlQ = lens _utlQ (\ s a -> s{_utlQ = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+utlUserId :: Lens' UsersThreadsList Text+utlUserId+ = lens _utlUserId (\ s a -> s{_utlUserId = a})++-- | Include threads from SPAM and TRASH in the results.+utlIncludeSpamTrash :: Lens' UsersThreadsList Bool+utlIncludeSpamTrash+ = lens _utlIncludeSpamTrash+ (\ s a -> s{_utlIncludeSpamTrash = a})++-- | Only return threads with labels that match all of the specified label+-- IDs.+utlLabelIds :: Lens' UsersThreadsList [Text]+utlLabelIds+ = lens _utlLabelIds (\ s a -> s{_utlLabelIds = a}) .+ _Default+ . _Coerce++-- | Page token to retrieve a specific page of results in the list.+utlPageToken :: Lens' UsersThreadsList (Maybe Text)+utlPageToken+ = lens _utlPageToken (\ s a -> s{_utlPageToken = a})++-- | Maximum number of threads to return.+utlMaxResults :: Lens' UsersThreadsList Word32+utlMaxResults+ = lens _utlMaxResults+ (\ s a -> s{_utlMaxResults = a})+ . _Coerce++instance GoogleRequest UsersThreadsList where+ type Rs UsersThreadsList = ListThreadsResponse+ requestClient UsersThreadsList{..}+ = go _utlUserId _utlQ (Just _utlIncludeSpamTrash)+ (_utlLabelIds ^. _Default)+ _utlPageToken+ (Just _utlMaxResults)+ (Just AltJSON)+ gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersThreadsListResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Threads/Modify.hs view
@@ -0,0 +1,113 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Threads.Modify+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Modifies the labels applied to the thread. This applies to all messages+-- in the thread.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.threads.modify@.+module Network.Google.Resource.Gmail.Users.Threads.Modify+ (+ -- * REST Resource+ UsersThreadsModifyResource++ -- * Creating a Request+ , usersThreadsModify+ , UsersThreadsModify++ -- * Request Lenses+ , utmPayload+ , utmUserId+ , utmId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.threads.modify@ method which the+-- 'UsersThreadsModify' request conforms to.+type UsersThreadsModifyResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "threads" :>+ Capture "id" Text :>+ "modify" :>+ QueryParam "alt" AltJSON :>+ ReqBody '[JSON] ModifyThreadRequest :>+ Post '[JSON] Thread++-- | Modifies the labels applied to the thread. This applies to all messages+-- in the thread.+--+-- /See:/ 'usersThreadsModify' smart constructor.+data UsersThreadsModify = UsersThreadsModify+ { _utmPayload :: !ModifyThreadRequest+ , _utmUserId :: !Text+ , _utmId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersThreadsModify' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'utmPayload'+--+-- * 'utmUserId'+--+-- * 'utmId'+usersThreadsModify+ :: ModifyThreadRequest -- ^ 'utmPayload'+ -> Text -- ^ 'utmId'+ -> Text+ -> UsersThreadsModify+usersThreadsModify pUtmPayload_ pUtmUserId_ pUtmId_ =+ UsersThreadsModify+ { _utmPayload = pUtmPayload_+ , _utmUserId = "me"+ , _utmId = pUtmId_+ }++-- | Multipart request metadata.+utmPayload :: Lens' UsersThreadsModify ModifyThreadRequest+utmPayload+ = lens _utmPayload (\ s a -> s{_utmPayload = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+utmUserId :: Lens' UsersThreadsModify Text+utmUserId+ = lens _utmUserId (\ s a -> s{_utmUserId = a})++-- | The ID of the thread to modify.+utmId :: Lens' UsersThreadsModify Text+utmId = lens _utmId (\ s a -> s{_utmId = a})++instance GoogleRequest UsersThreadsModify where+ type Rs UsersThreadsModify = Thread+ requestClient UsersThreadsModify{..}+ = go _utmUserId _utmId (Just AltJSON) _utmPayload+ gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersThreadsModifyResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Threads/Trash.hs view
@@ -0,0 +1,97 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Threads.Trash+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Moves the specified thread to the trash.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.threads.trash@.+module Network.Google.Resource.Gmail.Users.Threads.Trash+ (+ -- * REST Resource+ UsersThreadsTrashResource++ -- * Creating a Request+ , usersThreadsTrash+ , UsersThreadsTrash++ -- * Request Lenses+ , uttUserId+ , uttId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.threads.trash@ method which the+-- 'UsersThreadsTrash' request conforms to.+type UsersThreadsTrashResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "threads" :>+ Capture "id" Text :>+ "trash" :>+ QueryParam "alt" AltJSON :> Post '[JSON] Thread++-- | Moves the specified thread to the trash.+--+-- /See:/ 'usersThreadsTrash' smart constructor.+data UsersThreadsTrash = UsersThreadsTrash+ { _uttUserId :: !Text+ , _uttId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersThreadsTrash' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'uttUserId'+--+-- * 'uttId'+usersThreadsTrash+ :: Text -- ^ 'uttId'+ -> Text+ -> UsersThreadsTrash+usersThreadsTrash pUttUserId_ pUttId_ =+ UsersThreadsTrash+ { _uttUserId = "me"+ , _uttId = pUttId_+ }++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+uttUserId :: Lens' UsersThreadsTrash Text+uttUserId+ = lens _uttUserId (\ s a -> s{_uttUserId = a})++-- | The ID of the thread to Trash.+uttId :: Lens' UsersThreadsTrash Text+uttId = lens _uttId (\ s a -> s{_uttId = a})++instance GoogleRequest UsersThreadsTrash where+ type Rs UsersThreadsTrash = Thread+ requestClient UsersThreadsTrash{..}+ = go _uttUserId _uttId (Just AltJSON) gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersThreadsTrashResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Threads/Untrash.hs view
@@ -0,0 +1,97 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Threads.Untrash+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Removes the specified thread from the trash.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.threads.untrash@.+module Network.Google.Resource.Gmail.Users.Threads.Untrash+ (+ -- * REST Resource+ UsersThreadsUntrashResource++ -- * Creating a Request+ , usersThreadsUntrash+ , UsersThreadsUntrash++ -- * Request Lenses+ , utuUserId+ , utuId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.threads.untrash@ method which the+-- 'UsersThreadsUntrash' request conforms to.+type UsersThreadsUntrashResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "threads" :>+ Capture "id" Text :>+ "untrash" :>+ QueryParam "alt" AltJSON :> Post '[JSON] Thread++-- | Removes the specified thread from the trash.+--+-- /See:/ 'usersThreadsUntrash' smart constructor.+data UsersThreadsUntrash = UsersThreadsUntrash+ { _utuUserId :: !Text+ , _utuId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersThreadsUntrash' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'utuUserId'+--+-- * 'utuId'+usersThreadsUntrash+ :: Text -- ^ 'utuId'+ -> Text+ -> UsersThreadsUntrash+usersThreadsUntrash pUtuUserId_ pUtuId_ =+ UsersThreadsUntrash+ { _utuUserId = "me"+ , _utuId = pUtuId_+ }++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+utuUserId :: Lens' UsersThreadsUntrash Text+utuUserId+ = lens _utuUserId (\ s a -> s{_utuUserId = a})++-- | The ID of the thread to remove from Trash.+utuId :: Lens' UsersThreadsUntrash Text+utuId = lens _utuId (\ s a -> s{_utuId = a})++instance GoogleRequest UsersThreadsUntrash where+ type Rs UsersThreadsUntrash = Thread+ requestClient UsersThreadsUntrash{..}+ = go _utuUserId _utuId (Just AltJSON) gmailService+ where go+ = buildClient+ (Proxy :: Proxy UsersThreadsUntrashResource)+ mempty
+ gen/Network/Google/Resource/Gmail/Users/Watch.hs view
@@ -0,0 +1,96 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.Gmail.Users.Watch+-- Copyright : (c) 2015 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Set up or update a push notification watch on the given user mailbox.+--+-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.watch@.+module Network.Google.Resource.Gmail.Users.Watch+ (+ -- * REST Resource+ UsersWatchResource++ -- * Creating a Request+ , usersWatch+ , UsersWatch++ -- * Request Lenses+ , uwPayload+ , uwUserId+ ) where++import Network.Google.Gmail.Types+import Network.Google.Prelude++-- | A resource alias for @gmail.users.watch@ method which the+-- 'UsersWatch' request conforms to.+type UsersWatchResource =+ "gmail" :>+ "v1" :>+ "users" :>+ Capture "userId" Text :>+ "watch" :>+ QueryParam "alt" AltJSON :>+ ReqBody '[JSON] WatchRequest :>+ Post '[JSON] WatchResponse++-- | Set up or update a push notification watch on the given user mailbox.+--+-- /See:/ 'usersWatch' smart constructor.+data UsersWatch = UsersWatch+ { _uwPayload :: !WatchRequest+ , _uwUserId :: !Text+ } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'UsersWatch' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'uwPayload'+--+-- * 'uwUserId'+usersWatch+ :: WatchRequest -- ^ 'uwPayload'+ -> Text+ -> UsersWatch+usersWatch pUwPayload_ pUwUserId_ =+ UsersWatch+ { _uwPayload = pUwPayload_+ , _uwUserId = "me"+ }++-- | Multipart request metadata.+uwPayload :: Lens' UsersWatch WatchRequest+uwPayload+ = lens _uwPayload (\ s a -> s{_uwPayload = a})++-- | The user\'s email address. The special value me can be used to indicate+-- the authenticated user.+uwUserId :: Lens' UsersWatch Text+uwUserId = lens _uwUserId (\ s a -> s{_uwUserId = a})++instance GoogleRequest UsersWatch where+ type Rs UsersWatch = WatchResponse+ requestClient UsersWatch{..}+ = go _uwUserId (Just AltJSON) _uwPayload gmailService+ where go+ = buildClient (Proxy :: Proxy UsersWatchResource)+ mempty
+ gogol-gmail.cabal view
@@ -0,0 +1,77 @@+name: gogol-gmail+version: 0.0.1+synopsis: Google Gmail SDK.+homepage: https://github.com/brendanhay/gogol+bug-reports: https://github.com/brendanhay/gogol/issues+license: OtherLicense+license-file: LICENSE+author: Brendan Hay+maintainer: Brendan Hay <brendan.g.hay@gmail.com>+copyright: Copyright (c) 2015 Brendan Hay+category: Network, Google, Cloud+build-type: Simple+cabal-version: >= 1.10+extra-source-files: README.md++description:+ The Gmail REST API.+ .+ /Warning:/ This is an experimental prototype/preview release which is still+ under exploratory development and not intended for public use, caveat emptor!+ .+ This library is compatible with version @v1@+ of the API.++source-repository head+ type: git+ location: git://github.com/brendanhay/gogol.git++library+ default-language: Haskell2010+ hs-source-dirs: src gen++ ghc-options: -Wall++ exposed-modules:+ Network.Google.Gmail+ , Network.Google.Gmail.Types+ , Network.Google.Resource.Gmail.Users.Drafts.Create+ , Network.Google.Resource.Gmail.Users.Drafts.Delete+ , Network.Google.Resource.Gmail.Users.Drafts.Get+ , Network.Google.Resource.Gmail.Users.Drafts.List+ , Network.Google.Resource.Gmail.Users.Drafts.Send+ , Network.Google.Resource.Gmail.Users.Drafts.Update+ , Network.Google.Resource.Gmail.Users.GetProFile+ , Network.Google.Resource.Gmail.Users.History.List+ , Network.Google.Resource.Gmail.Users.Labels.Create+ , Network.Google.Resource.Gmail.Users.Labels.Delete+ , Network.Google.Resource.Gmail.Users.Labels.Get+ , Network.Google.Resource.Gmail.Users.Labels.List+ , Network.Google.Resource.Gmail.Users.Labels.Patch+ , Network.Google.Resource.Gmail.Users.Labels.Update+ , Network.Google.Resource.Gmail.Users.Messages.Attachments.Get+ , Network.Google.Resource.Gmail.Users.Messages.Delete+ , Network.Google.Resource.Gmail.Users.Messages.Get+ , Network.Google.Resource.Gmail.Users.Messages.Import+ , Network.Google.Resource.Gmail.Users.Messages.Insert+ , Network.Google.Resource.Gmail.Users.Messages.List+ , Network.Google.Resource.Gmail.Users.Messages.Modify+ , Network.Google.Resource.Gmail.Users.Messages.Send+ , Network.Google.Resource.Gmail.Users.Messages.Trash+ , Network.Google.Resource.Gmail.Users.Messages.Untrash+ , Network.Google.Resource.Gmail.Users.Stop+ , Network.Google.Resource.Gmail.Users.Threads.Delete+ , Network.Google.Resource.Gmail.Users.Threads.Get+ , Network.Google.Resource.Gmail.Users.Threads.List+ , Network.Google.Resource.Gmail.Users.Threads.Modify+ , Network.Google.Resource.Gmail.Users.Threads.Trash+ , Network.Google.Resource.Gmail.Users.Threads.Untrash+ , Network.Google.Resource.Gmail.Users.Watch++ other-modules:+ Network.Google.Gmail.Types.Product+ , Network.Google.Gmail.Types.Sum++ build-depends:+ gogol-core == 0.0.1.*+ , base >= 4.7 && < 5