packages feed

gogol-civicinfo (empty) → 0.0.1

raw patch · 13 files changed

+3981/−0 lines, 13 filesdep +basedep +gogol-coresetup-changed

Dependencies added: base, gogol-core

Files

+ 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-civicinfo++* [Version](#version)+* [Description](#description)+* [Contribute](#contribute)+* [Licence](#licence)+++## Version++`0.0.1`+++## Description++A client library for the Google Civic Information.+++## 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-civicinfo` 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/CivicInfo.hs view
@@ -0,0 +1,294 @@+{-# LANGUAGE DataKinds         #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE TypeOperators     #-}++{-# OPTIONS_GHC -fno-warn-unused-imports    #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}++-- |+-- Module      : Network.Google.CivicInfo+-- 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)+--+-- An API for accessing civic information.+--+-- /See:/ <https://developers.google.com/civic-information Google Civic Information API Reference>+module Network.Google.CivicInfo+    (+    -- * Service Configuration+      civicInfoService++    -- * API Declaration+    , CivicInfoAPI++    -- * Resources++    -- ** civicinfo.divisions.search+    , module Network.Google.Resource.CivicInfo.Divisions.Search++    -- ** civicinfo.elections.electionQuery+    , module Network.Google.Resource.CivicInfo.Elections.ElectionQuery++    -- ** civicinfo.elections.voterInfoQuery+    , module Network.Google.Resource.CivicInfo.Elections.VoterInfoQuery++    -- ** civicinfo.representatives.representativeInfoByAddress+    , module Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByAddress++    -- ** civicinfo.representatives.representativeInfoByDivision+    , module Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByDivision++    -- * Types++    -- ** RepresentativeInfoResponseDivisions+    , RepresentativeInfoResponseDivisions+    , representativeInfoResponseDivisions+    , rirdAddtional++    -- ** VoterInfoResponse+    , VoterInfoResponse+    , voterInfoResponse+    , virOtherElections+    , virContests+    , virState+    , virKind+    , virDropOffLocations+    , virElection+    , virNormalizedInput+    , virMailOnly+    , virEarlyVoteSites+    , virPollingLocations+    , virPrecinctId++    -- ** PollingLocation+    , PollingLocation+    , pollingLocation+    , plVoterServices+    , plEndDate+    , plSources+    , plAddress+    , plStartDate+    , plPollingHours+    , plName+    , plId+    , plNotes++    -- ** RepresentativesRepresentativeInfoByDivisionLevels+    , RepresentativesRepresentativeInfoByDivisionLevels (..)++    -- ** GeographicDivision+    , GeographicDivision+    , geographicDivision+    , gdName+    , gdOfficeIndices+    , gdAlsoKnownAs++    -- ** Candidate+    , Candidate+    , candidate+    , cEmail+    , cPhone+    , cPhotoURL+    , cChannels+    , cCandidateURL+    , cOrderOnBallot+    , cName+    , cParty++    -- ** RepresentativesRepresentativeInfoByAddressLevels+    , RepresentativesRepresentativeInfoByAddressLevels (..)++    -- ** Office+    , Office+    , office+    , oDivisionId+    , oRoles+    , oOfficialIndices+    , oSources+    , oName+    , oLevels++    -- ** RepresentativesRepresentativeInfoByDivisionRoles+    , RepresentativesRepresentativeInfoByDivisionRoles (..)++    -- ** Channel+    , Channel+    , channel+    , cId+    , cType++    -- ** Election+    , Election+    , election+    , eOcdDivisionId+    , eElectionDay+    , eName+    , eId++    -- ** RepresentativeInfoResponse+    , RepresentativeInfoResponse+    , representativeInfoResponse+    , rirKind+    , rirNormalizedInput+    , rirOfficials+    , rirDivisions+    , rirOffices++    -- ** DivisionSearchResult+    , DivisionSearchResult+    , divisionSearchResult+    , dsrAliases+    , dsrName+    , dsrOcdId++    -- ** AdministrativeBody+    , AdministrativeBody+    , administrativeBody+    , abCorrespondenceAddress+    , abAbsenteeVotingInfoURL+    , abHoursOfOperation+    , abBallotInfoURL+    , abPhysicalAddress+    , abElectionRegistrationConfirmationURL+    , abElectionInfoURL+    , abVotingLocationFinderURL+    , abElectionOfficials+    , abName+    , abElectionRulesURL+    , abVoterServices+    , abElectionRegistrationURL++    -- ** Contest+    , Contest+    , contest+    , conReferendumPassageThreshold+    , conRoles+    , conReferendumURL+    , conReferendumEffectOfAbstain+    , conReferendumSubtitle+    , conNumberVotingFor+    , conOffice+    , conReferendumConStatement+    , conSources+    , conReferendumProStatement+    , conReferendumBallotResponses+    , conNumberElected+    , conSpecial+    , conReferendumText+    , conPrimaryParty+    , conId+    , conType+    , conElectorateSpecifications+    , conReferendumBrief+    , conDistrict+    , conLevel+    , conCandidates+    , conReferendumTitle+    , conBallotPlacement++    -- ** DivisionSearchResponse+    , DivisionSearchResponse+    , divisionSearchResponse+    , dsrResults+    , dsrKind++    -- ** RepresentativeInfoDataDivisions+    , RepresentativeInfoDataDivisions+    , representativeInfoDataDivisions+    , riddAddtional++    -- ** RepresentativesRepresentativeInfoByAddressRoles+    , RepresentativesRepresentativeInfoByAddressRoles (..)++    -- ** ElectionOfficial+    , ElectionOfficial+    , electionOfficial+    , eoFaxNumber+    , eoName+    , eoOfficePhoneNumber+    , eoEmailAddress+    , eoTitle++    -- ** RepresentativeInfoData+    , RepresentativeInfoData+    , representativeInfoData+    , ridOfficials+    , ridDivisions+    , ridOffices++    -- ** Source+    , Source+    , source+    , sName+    , sOfficial++    -- ** ElectoralDistrict+    , ElectoralDistrict+    , electoralDistrict+    , edName+    , edScope+    , edId++    -- ** SimpleAddressType+    , SimpleAddressType+    , simpleAddressType+    , satLine2+    , satState+    , satLine3+    , satZip+    , satCity+    , satLine1+    , satLocationName++    -- ** AdministrationRegion+    , AdministrationRegion+    , administrationRegion+    , arLocalJurisdiction+    , arSources+    , arName+    , arElectionAdministrationBody+    , arId++    -- ** ElectionsQueryResponse+    , ElectionsQueryResponse+    , electionsQueryResponse+    , eqrKind+    , eqrElections++    -- ** Official+    , Official+    , official+    , offPhotoURL+    , offURLs+    , offChannels+    , offAddress+    , offPhones+    , offName+    , offEmails+    , offParty+    ) where++import           Network.Google.CivicInfo.Types+import           Network.Google.Prelude+import           Network.Google.Resource.CivicInfo.Divisions.Search+import           Network.Google.Resource.CivicInfo.Elections.ElectionQuery+import           Network.Google.Resource.CivicInfo.Elections.VoterInfoQuery+import           Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByAddress+import           Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByDivision++{- $resources+TODO+-}++-- | Represents the entirety of the methods and resources available for the Google Civic Information API service.+type CivicInfoAPI =+     ElectionsVoterInfoQueryResource :<|>+       ElectionsElectionQueryResource+       :<|> DivisionsSearchResource+       :<|>+       RepresentativesRepresentativeInfoByDivisionResource+       :<|>+       RepresentativesRepresentativeInfoByAddressResource
+ gen/Network/Google/CivicInfo/Types.hs view
@@ -0,0 +1,257 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric      #-}+{-# LANGUAGE NoImplicitPrelude  #-}+{-# LANGUAGE OverloadedStrings  #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module      : Network.Google.CivicInfo.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.CivicInfo.Types+    (+    -- * Service Configuration+      civicInfoService++    -- * RepresentativeInfoResponseDivisions+    , RepresentativeInfoResponseDivisions+    , representativeInfoResponseDivisions+    , rirdAddtional++    -- * VoterInfoResponse+    , VoterInfoResponse+    , voterInfoResponse+    , virOtherElections+    , virContests+    , virState+    , virKind+    , virDropOffLocations+    , virElection+    , virNormalizedInput+    , virMailOnly+    , virEarlyVoteSites+    , virPollingLocations+    , virPrecinctId++    -- * PollingLocation+    , PollingLocation+    , pollingLocation+    , plVoterServices+    , plEndDate+    , plSources+    , plAddress+    , plStartDate+    , plPollingHours+    , plName+    , plId+    , plNotes++    -- * RepresentativesRepresentativeInfoByDivisionLevels+    , RepresentativesRepresentativeInfoByDivisionLevels (..)++    -- * GeographicDivision+    , GeographicDivision+    , geographicDivision+    , gdName+    , gdOfficeIndices+    , gdAlsoKnownAs++    -- * Candidate+    , Candidate+    , candidate+    , cEmail+    , cPhone+    , cPhotoURL+    , cChannels+    , cCandidateURL+    , cOrderOnBallot+    , cName+    , cParty++    -- * RepresentativesRepresentativeInfoByAddressLevels+    , RepresentativesRepresentativeInfoByAddressLevels (..)++    -- * Office+    , Office+    , office+    , oDivisionId+    , oRoles+    , oOfficialIndices+    , oSources+    , oName+    , oLevels++    -- * RepresentativesRepresentativeInfoByDivisionRoles+    , RepresentativesRepresentativeInfoByDivisionRoles (..)++    -- * Channel+    , Channel+    , channel+    , cId+    , cType++    -- * Election+    , Election+    , election+    , eOcdDivisionId+    , eElectionDay+    , eName+    , eId++    -- * RepresentativeInfoResponse+    , RepresentativeInfoResponse+    , representativeInfoResponse+    , rirKind+    , rirNormalizedInput+    , rirOfficials+    , rirDivisions+    , rirOffices++    -- * DivisionSearchResult+    , DivisionSearchResult+    , divisionSearchResult+    , dsrAliases+    , dsrName+    , dsrOcdId++    -- * AdministrativeBody+    , AdministrativeBody+    , administrativeBody+    , abCorrespondenceAddress+    , abAbsenteeVotingInfoURL+    , abHoursOfOperation+    , abBallotInfoURL+    , abPhysicalAddress+    , abElectionRegistrationConfirmationURL+    , abElectionInfoURL+    , abVotingLocationFinderURL+    , abElectionOfficials+    , abName+    , abElectionRulesURL+    , abVoterServices+    , abElectionRegistrationURL++    -- * Contest+    , Contest+    , contest+    , conReferendumPassageThreshold+    , conRoles+    , conReferendumURL+    , conReferendumEffectOfAbstain+    , conReferendumSubtitle+    , conNumberVotingFor+    , conOffice+    , conReferendumConStatement+    , conSources+    , conReferendumProStatement+    , conReferendumBallotResponses+    , conNumberElected+    , conSpecial+    , conReferendumText+    , conPrimaryParty+    , conId+    , conType+    , conElectorateSpecifications+    , conReferendumBrief+    , conDistrict+    , conLevel+    , conCandidates+    , conReferendumTitle+    , conBallotPlacement++    -- * DivisionSearchResponse+    , DivisionSearchResponse+    , divisionSearchResponse+    , dsrResults+    , dsrKind++    -- * RepresentativeInfoDataDivisions+    , RepresentativeInfoDataDivisions+    , representativeInfoDataDivisions+    , riddAddtional++    -- * RepresentativesRepresentativeInfoByAddressRoles+    , RepresentativesRepresentativeInfoByAddressRoles (..)++    -- * ElectionOfficial+    , ElectionOfficial+    , electionOfficial+    , eoFaxNumber+    , eoName+    , eoOfficePhoneNumber+    , eoEmailAddress+    , eoTitle++    -- * RepresentativeInfoData+    , RepresentativeInfoData+    , representativeInfoData+    , ridOfficials+    , ridDivisions+    , ridOffices++    -- * Source+    , Source+    , source+    , sName+    , sOfficial++    -- * ElectoralDistrict+    , ElectoralDistrict+    , electoralDistrict+    , edName+    , edScope+    , edId++    -- * SimpleAddressType+    , SimpleAddressType+    , simpleAddressType+    , satLine2+    , satState+    , satLine3+    , satZip+    , satCity+    , satLine1+    , satLocationName++    -- * AdministrationRegion+    , AdministrationRegion+    , administrationRegion+    , arLocalJurisdiction+    , arSources+    , arName+    , arElectionAdministrationBody+    , arId++    -- * ElectionsQueryResponse+    , ElectionsQueryResponse+    , electionsQueryResponse+    , eqrKind+    , eqrElections++    -- * Official+    , Official+    , official+    , offPhotoURL+    , offURLs+    , offChannels+    , offAddress+    , offPhones+    , offName+    , offEmails+    , offParty+    ) where++import           Network.Google.CivicInfo.Types.Product+import           Network.Google.CivicInfo.Types.Sum+import           Network.Google.Prelude++-- | Default request referring to version 'v2' of the Google Civic Information API. This contains the host and root path used as a starting point for constructing service requests.+civicInfoService :: Service+civicInfoService+  = defaultService (ServiceId "civicinfo:v2")+      "www.googleapis.com"
+ gen/Network/Google/CivicInfo/Types/Product.hs view
@@ -0,0 +1,2162 @@+{-# 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.CivicInfo.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.CivicInfo.Types.Product where++import           Network.Google.CivicInfo.Types.Sum+import           Network.Google.Prelude++-- | Political geographic divisions that contain the requested address.+--+-- /See:/ 'representativeInfoResponseDivisions' smart constructor.+newtype RepresentativeInfoResponseDivisions = RepresentativeInfoResponseDivisions+    { _rirdAddtional :: HashMap Text GeographicDivision+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'RepresentativeInfoResponseDivisions' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'rirdAddtional'+representativeInfoResponseDivisions+    :: HashMap Text GeographicDivision -- ^ 'rirdAddtional'+    -> RepresentativeInfoResponseDivisions+representativeInfoResponseDivisions pRirdAddtional_ =+    RepresentativeInfoResponseDivisions+    { _rirdAddtional = _Coerce # pRirdAddtional_+    }++-- | The unique Open Civic Data identifier for this division.+rirdAddtional :: Lens' RepresentativeInfoResponseDivisions (HashMap Text GeographicDivision)+rirdAddtional+  = lens _rirdAddtional+      (\ s a -> s{_rirdAddtional = a})+      . _Coerce++instance FromJSON RepresentativeInfoResponseDivisions+         where+        parseJSON+          = withObject "RepresentativeInfoResponseDivisions"+              (\ o ->+                 RepresentativeInfoResponseDivisions <$>+                   (parseJSONObject o))++instance ToJSON RepresentativeInfoResponseDivisions+         where+        toJSON = toJSON . _rirdAddtional++-- | The result of a voter info lookup query.+--+-- /See:/ 'voterInfoResponse' smart constructor.+data VoterInfoResponse = VoterInfoResponse+    { _virOtherElections   :: !(Maybe [Election])+    , _virContests         :: !(Maybe [Contest])+    , _virState            :: !(Maybe [AdministrationRegion])+    , _virKind             :: !Text+    , _virDropOffLocations :: !(Maybe [PollingLocation])+    , _virElection         :: !(Maybe Election)+    , _virNormalizedInput  :: !(Maybe SimpleAddressType)+    , _virMailOnly         :: !(Maybe Bool)+    , _virEarlyVoteSites   :: !(Maybe [PollingLocation])+    , _virPollingLocations :: !(Maybe [PollingLocation])+    , _virPrecinctId       :: !(Maybe Text)+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'VoterInfoResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'virOtherElections'+--+-- * 'virContests'+--+-- * 'virState'+--+-- * 'virKind'+--+-- * 'virDropOffLocations'+--+-- * 'virElection'+--+-- * 'virNormalizedInput'+--+-- * 'virMailOnly'+--+-- * 'virEarlyVoteSites'+--+-- * 'virPollingLocations'+--+-- * 'virPrecinctId'+voterInfoResponse+    :: VoterInfoResponse+voterInfoResponse =+    VoterInfoResponse+    { _virOtherElections = Nothing+    , _virContests = Nothing+    , _virState = Nothing+    , _virKind = "civicinfo#voterInfoResponse"+    , _virDropOffLocations = Nothing+    , _virElection = Nothing+    , _virNormalizedInput = Nothing+    , _virMailOnly = Nothing+    , _virEarlyVoteSites = Nothing+    , _virPollingLocations = Nothing+    , _virPrecinctId = Nothing+    }++-- | If no election ID was specified in the query, and there was more than+-- one election with data for the given voter, this will contain+-- information about the other elections that could apply.+virOtherElections :: Lens' VoterInfoResponse [Election]+virOtherElections+  = lens _virOtherElections+      (\ s a -> s{_virOtherElections = a})+      . _Default+      . _Coerce++-- | Contests that will appear on the voter\'s ballot.+virContests :: Lens' VoterInfoResponse [Contest]+virContests+  = lens _virContests (\ s a -> s{_virContests = a}) .+      _Default+      . _Coerce++-- | Local Election Information for the state that the voter votes in. For+-- the US, there will only be one element in this array.+virState :: Lens' VoterInfoResponse [AdministrationRegion]+virState+  = lens _virState (\ s a -> s{_virState = a}) .+      _Default+      . _Coerce++-- | Identifies what kind of resource this is. Value: the fixed string+-- \"civicinfo#voterInfoResponse\".+virKind :: Lens' VoterInfoResponse Text+virKind = lens _virKind (\ s a -> s{_virKind = a})++-- | Locations where a voter is eligible to drop off a completed ballot. The+-- voter must have received and completed a ballot prior to arriving at the+-- location. The location may not have ballots available on the premises.+-- These locations could be open on or before election day as indicated in+-- the pollingHours field.+virDropOffLocations :: Lens' VoterInfoResponse [PollingLocation]+virDropOffLocations+  = lens _virDropOffLocations+      (\ s a -> s{_virDropOffLocations = a})+      . _Default+      . _Coerce++-- | The election that was queried.+virElection :: Lens' VoterInfoResponse (Maybe Election)+virElection+  = lens _virElection (\ s a -> s{_virElection = a})++-- | The normalized version of the requested address+virNormalizedInput :: Lens' VoterInfoResponse (Maybe SimpleAddressType)+virNormalizedInput+  = lens _virNormalizedInput+      (\ s a -> s{_virNormalizedInput = a})++-- | Specifies whether voters in the precinct vote only by mailing their+-- ballots (with the possible option of dropping off their ballots as+-- well).+virMailOnly :: Lens' VoterInfoResponse (Maybe Bool)+virMailOnly+  = lens _virMailOnly (\ s a -> s{_virMailOnly = a})++-- | Locations where the voter is eligible to vote early, prior to election+-- day.+virEarlyVoteSites :: Lens' VoterInfoResponse [PollingLocation]+virEarlyVoteSites+  = lens _virEarlyVoteSites+      (\ s a -> s{_virEarlyVoteSites = a})+      . _Default+      . _Coerce++-- | Locations where the voter is eligible to vote on election day.+virPollingLocations :: Lens' VoterInfoResponse [PollingLocation]+virPollingLocations+  = lens _virPollingLocations+      (\ s a -> s{_virPollingLocations = a})+      . _Default+      . _Coerce++virPrecinctId :: Lens' VoterInfoResponse (Maybe Text)+virPrecinctId+  = lens _virPrecinctId+      (\ s a -> s{_virPrecinctId = a})++instance FromJSON VoterInfoResponse where+        parseJSON+          = withObject "VoterInfoResponse"+              (\ o ->+                 VoterInfoResponse <$>+                   (o .:? "otherElections" .!= mempty) <*>+                     (o .:? "contests" .!= mempty)+                     <*> (o .:? "state" .!= mempty)+                     <*> (o .:? "kind" .!= "civicinfo#voterInfoResponse")+                     <*> (o .:? "dropOffLocations" .!= mempty)+                     <*> (o .:? "election")+                     <*> (o .:? "normalizedInput")+                     <*> (o .:? "mailOnly")+                     <*> (o .:? "earlyVoteSites" .!= mempty)+                     <*> (o .:? "pollingLocations" .!= mempty)+                     <*> (o .:? "precinctId"))++instance ToJSON VoterInfoResponse where+        toJSON VoterInfoResponse{..}+          = object+              (catMaybes+                 [("otherElections" .=) <$> _virOtherElections,+                  ("contests" .=) <$> _virContests,+                  ("state" .=) <$> _virState,+                  Just ("kind" .= _virKind),+                  ("dropOffLocations" .=) <$> _virDropOffLocations,+                  ("election" .=) <$> _virElection,+                  ("normalizedInput" .=) <$> _virNormalizedInput,+                  ("mailOnly" .=) <$> _virMailOnly,+                  ("earlyVoteSites" .=) <$> _virEarlyVoteSites,+                  ("pollingLocations" .=) <$> _virPollingLocations,+                  ("precinctId" .=) <$> _virPrecinctId])++-- | A location where a voter can vote. This may be an early vote site, an+-- election day voting location, or a drop off location for a completed+-- ballot.+--+-- /See:/ 'pollingLocation' smart constructor.+data PollingLocation = PollingLocation+    { _plVoterServices :: !(Maybe Text)+    , _plEndDate       :: !(Maybe Text)+    , _plSources       :: !(Maybe [Source])+    , _plAddress       :: !(Maybe SimpleAddressType)+    , _plStartDate     :: !(Maybe Text)+    , _plPollingHours  :: !(Maybe Text)+    , _plName          :: !(Maybe Text)+    , _plId            :: !(Maybe Text)+    , _plNotes         :: !(Maybe Text)+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'PollingLocation' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'plVoterServices'+--+-- * 'plEndDate'+--+-- * 'plSources'+--+-- * 'plAddress'+--+-- * 'plStartDate'+--+-- * 'plPollingHours'+--+-- * 'plName'+--+-- * 'plId'+--+-- * 'plNotes'+pollingLocation+    :: PollingLocation+pollingLocation =+    PollingLocation+    { _plVoterServices = Nothing+    , _plEndDate = Nothing+    , _plSources = Nothing+    , _plAddress = Nothing+    , _plStartDate = Nothing+    , _plPollingHours = Nothing+    , _plName = Nothing+    , _plId = Nothing+    , _plNotes = Nothing+    }++-- | The services provided by this early vote site or drop off location. This+-- field is not populated for polling locations.+plVoterServices :: Lens' PollingLocation (Maybe Text)+plVoterServices+  = lens _plVoterServices+      (\ s a -> s{_plVoterServices = a})++-- | The last date that this early vote site or drop off location may be+-- used. This field is not populated for polling locations.+plEndDate :: Lens' PollingLocation (Maybe Text)+plEndDate+  = lens _plEndDate (\ s a -> s{_plEndDate = a})++-- | A list of sources for this location. If multiple sources are listed the+-- data has been aggregated from those sources.+plSources :: Lens' PollingLocation [Source]+plSources+  = lens _plSources (\ s a -> s{_plSources = a}) .+      _Default+      . _Coerce++-- | The address of the location.+plAddress :: Lens' PollingLocation (Maybe SimpleAddressType)+plAddress+  = lens _plAddress (\ s a -> s{_plAddress = a})++-- | The first date that this early vote site or drop off location may be+-- used. This field is not populated for polling locations.+plStartDate :: Lens' PollingLocation (Maybe Text)+plStartDate+  = lens _plStartDate (\ s a -> s{_plStartDate = a})++-- | A description of when this location is open.+plPollingHours :: Lens' PollingLocation (Maybe Text)+plPollingHours+  = lens _plPollingHours+      (\ s a -> s{_plPollingHours = a})++-- | The name of the early vote site or drop off location. This field is not+-- populated for polling locations.+plName :: Lens' PollingLocation (Maybe Text)+plName = lens _plName (\ s a -> s{_plName = a})++-- | An ID for this object. IDs may change in future requests and should not+-- be cached. Access to this field requires special access that can be+-- requested from the Request more link on the Quotas page.+plId :: Lens' PollingLocation (Maybe Text)+plId = lens _plId (\ s a -> s{_plId = a})++-- | Notes about this location (e.g. accessibility ramp or entrance to use).+plNotes :: Lens' PollingLocation (Maybe Text)+plNotes = lens _plNotes (\ s a -> s{_plNotes = a})++instance FromJSON PollingLocation where+        parseJSON+          = withObject "PollingLocation"+              (\ o ->+                 PollingLocation <$>+                   (o .:? "voterServices") <*> (o .:? "endDate") <*>+                     (o .:? "sources" .!= mempty)+                     <*> (o .:? "address")+                     <*> (o .:? "startDate")+                     <*> (o .:? "pollingHours")+                     <*> (o .:? "name")+                     <*> (o .:? "id")+                     <*> (o .:? "notes"))++instance ToJSON PollingLocation where+        toJSON PollingLocation{..}+          = object+              (catMaybes+                 [("voterServices" .=) <$> _plVoterServices,+                  ("endDate" .=) <$> _plEndDate,+                  ("sources" .=) <$> _plSources,+                  ("address" .=) <$> _plAddress,+                  ("startDate" .=) <$> _plStartDate,+                  ("pollingHours" .=) <$> _plPollingHours,+                  ("name" .=) <$> _plName, ("id" .=) <$> _plId,+                  ("notes" .=) <$> _plNotes])++-- | Describes a political geography.+--+-- /See:/ 'geographicDivision' smart constructor.+data GeographicDivision = GeographicDivision+    { _gdName          :: !(Maybe Text)+    , _gdOfficeIndices :: !(Maybe [Textual Word32])+    , _gdAlsoKnownAs   :: !(Maybe [Text])+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'GeographicDivision' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'gdName'+--+-- * 'gdOfficeIndices'+--+-- * 'gdAlsoKnownAs'+geographicDivision+    :: GeographicDivision+geographicDivision =+    GeographicDivision+    { _gdName = Nothing+    , _gdOfficeIndices = Nothing+    , _gdAlsoKnownAs = Nothing+    }++-- | The name of the division.+gdName :: Lens' GeographicDivision (Maybe Text)+gdName = lens _gdName (\ s a -> s{_gdName = a})++-- | List of indices in the offices array, one for each office elected from+-- this division. Will only be present if includeOffices was true (or+-- absent) in the request.+gdOfficeIndices :: Lens' GeographicDivision [Word32]+gdOfficeIndices+  = lens _gdOfficeIndices+      (\ s a -> s{_gdOfficeIndices = a})+      . _Default+      . _Coerce++-- | Any other valid OCD IDs that refer to the same division. Because OCD IDs+-- are meant to be human-readable and at least somewhat predictable, there+-- are occasionally several identifiers for a single division. These+-- identifiers are defined to be equivalent to one another, and one is+-- always indicated as the primary identifier. The primary identifier will+-- be returned in ocd_id above, and any other equivalent valid identifiers+-- will be returned in this list. For example, if this division\'s OCD ID+-- is ocd-division\/country:us\/district:dc, this will contain+-- ocd-division\/country:us\/state:dc.+gdAlsoKnownAs :: Lens' GeographicDivision [Text]+gdAlsoKnownAs+  = lens _gdAlsoKnownAs+      (\ s a -> s{_gdAlsoKnownAs = a})+      . _Default+      . _Coerce++instance FromJSON GeographicDivision where+        parseJSON+          = withObject "GeographicDivision"+              (\ o ->+                 GeographicDivision <$>+                   (o .:? "name") <*> (o .:? "officeIndices" .!= mempty)+                     <*> (o .:? "alsoKnownAs" .!= mempty))++instance ToJSON GeographicDivision where+        toJSON GeographicDivision{..}+          = object+              (catMaybes+                 [("name" .=) <$> _gdName,+                  ("officeIndices" .=) <$> _gdOfficeIndices,+                  ("alsoKnownAs" .=) <$> _gdAlsoKnownAs])++-- | Information about a candidate running for elected office.+--+-- /See:/ 'candidate' smart constructor.+data Candidate = Candidate+    { _cEmail         :: !(Maybe Text)+    , _cPhone         :: !(Maybe Text)+    , _cPhotoURL      :: !(Maybe Text)+    , _cChannels      :: !(Maybe [Channel])+    , _cCandidateURL  :: !(Maybe Text)+    , _cOrderOnBallot :: !(Maybe (Textual Int64))+    , _cName          :: !(Maybe Text)+    , _cParty         :: !(Maybe Text)+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'Candidate' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'cEmail'+--+-- * 'cPhone'+--+-- * 'cPhotoURL'+--+-- * 'cChannels'+--+-- * 'cCandidateURL'+--+-- * 'cOrderOnBallot'+--+-- * 'cName'+--+-- * 'cParty'+candidate+    :: Candidate+candidate =+    Candidate+    { _cEmail = Nothing+    , _cPhone = Nothing+    , _cPhotoURL = Nothing+    , _cChannels = Nothing+    , _cCandidateURL = Nothing+    , _cOrderOnBallot = Nothing+    , _cName = Nothing+    , _cParty = Nothing+    }++-- | The email address for the candidate\'s campaign.+cEmail :: Lens' Candidate (Maybe Text)+cEmail = lens _cEmail (\ s a -> s{_cEmail = a})++-- | The voice phone number for the candidate\'s campaign office.+cPhone :: Lens' Candidate (Maybe Text)+cPhone = lens _cPhone (\ s a -> s{_cPhone = a})++-- | A URL for a photo of the candidate.+cPhotoURL :: Lens' Candidate (Maybe Text)+cPhotoURL+  = lens _cPhotoURL (\ s a -> s{_cPhotoURL = a})++-- | A list of known (social) media channels for this candidate.+cChannels :: Lens' Candidate [Channel]+cChannels+  = lens _cChannels (\ s a -> s{_cChannels = a}) .+      _Default+      . _Coerce++-- | The URL for the candidate\'s campaign web site.+cCandidateURL :: Lens' Candidate (Maybe Text)+cCandidateURL+  = lens _cCandidateURL+      (\ s a -> s{_cCandidateURL = a})++-- | The order the candidate appears on the ballot for this contest.+cOrderOnBallot :: Lens' Candidate (Maybe Int64)+cOrderOnBallot+  = lens _cOrderOnBallot+      (\ s a -> s{_cOrderOnBallot = a})+      . mapping _Coerce++-- | The candidate\'s name.+cName :: Lens' Candidate (Maybe Text)+cName = lens _cName (\ s a -> s{_cName = a})++-- | The full name of the party the candidate is a member of.+cParty :: Lens' Candidate (Maybe Text)+cParty = lens _cParty (\ s a -> s{_cParty = a})++instance FromJSON Candidate where+        parseJSON+          = withObject "Candidate"+              (\ o ->+                 Candidate <$>+                   (o .:? "email") <*> (o .:? "phone") <*>+                     (o .:? "photoUrl")+                     <*> (o .:? "channels" .!= mempty)+                     <*> (o .:? "candidateUrl")+                     <*> (o .:? "orderOnBallot")+                     <*> (o .:? "name")+                     <*> (o .:? "party"))++instance ToJSON Candidate where+        toJSON Candidate{..}+          = object+              (catMaybes+                 [("email" .=) <$> _cEmail, ("phone" .=) <$> _cPhone,+                  ("photoUrl" .=) <$> _cPhotoURL,+                  ("channels" .=) <$> _cChannels,+                  ("candidateUrl" .=) <$> _cCandidateURL,+                  ("orderOnBallot" .=) <$> _cOrderOnBallot,+                  ("name" .=) <$> _cName, ("party" .=) <$> _cParty])++-- | Information about an Office held by one or more Officials.+--+-- /See:/ 'office' smart constructor.+data Office = Office+    { _oDivisionId      :: !(Maybe Text)+    , _oRoles           :: !(Maybe [Text])+    , _oOfficialIndices :: !(Maybe [Textual Word32])+    , _oSources         :: !(Maybe [Source])+    , _oName            :: !(Maybe Text)+    , _oLevels          :: !(Maybe [Text])+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'Office' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'oDivisionId'+--+-- * 'oRoles'+--+-- * 'oOfficialIndices'+--+-- * 'oSources'+--+-- * 'oName'+--+-- * 'oLevels'+office+    :: Office+office =+    Office+    { _oDivisionId = Nothing+    , _oRoles = Nothing+    , _oOfficialIndices = Nothing+    , _oSources = Nothing+    , _oName = Nothing+    , _oLevels = Nothing+    }++-- | The OCD ID of the division with which this office is associated.+oDivisionId :: Lens' Office (Maybe Text)+oDivisionId+  = lens _oDivisionId (\ s a -> s{_oDivisionId = a})++-- | The roles which this office fulfills. Roles are not meant to be+-- exhaustive, or to exactly specify the entire set of responsibilities of+-- a given office, but are meant to be rough categories that are useful for+-- general selection from or sorting of a list of offices.+oRoles :: Lens' Office [Text]+oRoles+  = lens _oRoles (\ s a -> s{_oRoles = a}) . _Default .+      _Coerce++-- | List of indices in the officials array of people who presently hold this+-- office.+oOfficialIndices :: Lens' Office [Word32]+oOfficialIndices+  = lens _oOfficialIndices+      (\ s a -> s{_oOfficialIndices = a})+      . _Default+      . _Coerce++-- | A list of sources for this office. If multiple sources are listed, the+-- data has been aggregated from those sources.+oSources :: Lens' Office [Source]+oSources+  = lens _oSources (\ s a -> s{_oSources = a}) .+      _Default+      . _Coerce++-- | The human-readable name of the office.+oName :: Lens' Office (Maybe Text)+oName = lens _oName (\ s a -> s{_oName = a})++-- | The levels of government of which this office is part. There may be more+-- than one in cases where a jurisdiction effectively acts at two different+-- levels of government; for example, the mayor of the District of Columbia+-- acts at \"locality\" level, but also effectively at both+-- \"administrative-area-2\" and \"administrative-area-1\".+oLevels :: Lens' Office [Text]+oLevels+  = lens _oLevels (\ s a -> s{_oLevels = a}) . _Default+      . _Coerce++instance FromJSON Office where+        parseJSON+          = withObject "Office"+              (\ o ->+                 Office <$>+                   (o .:? "divisionId") <*> (o .:? "roles" .!= mempty)+                     <*> (o .:? "officialIndices" .!= mempty)+                     <*> (o .:? "sources" .!= mempty)+                     <*> (o .:? "name")+                     <*> (o .:? "levels" .!= mempty))++instance ToJSON Office where+        toJSON Office{..}+          = object+              (catMaybes+                 [("divisionId" .=) <$> _oDivisionId,+                  ("roles" .=) <$> _oRoles,+                  ("officialIndices" .=) <$> _oOfficialIndices,+                  ("sources" .=) <$> _oSources, ("name" .=) <$> _oName,+                  ("levels" .=) <$> _oLevels])++-- | A social media or web channel for a candidate.+--+-- /See:/ 'channel' smart constructor.+data Channel = Channel+    { _cId   :: !(Maybe Text)+    , _cType :: !(Maybe Text)+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'Channel' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'cId'+--+-- * 'cType'+channel+    :: Channel+channel =+    Channel+    { _cId = Nothing+    , _cType = Nothing+    }++-- | The unique public identifier for the candidate\'s channel.+cId :: Lens' Channel (Maybe Text)+cId = lens _cId (\ s a -> s{_cId = a})++-- | The type of channel. The following is a list of types of channels, but+-- is not exhaustive. More channel types may be added at a later time. One+-- of: GooglePlus, YouTube, Facebook, Twitter+cType :: Lens' Channel (Maybe Text)+cType = lens _cType (\ s a -> s{_cType = a})++instance FromJSON Channel where+        parseJSON+          = withObject "Channel"+              (\ o -> Channel <$> (o .:? "id") <*> (o .:? "type"))++instance ToJSON Channel where+        toJSON Channel{..}+          = object+              (catMaybes+                 [("id" .=) <$> _cId, ("type" .=) <$> _cType])++-- | Information about the election that was queried.+--+-- /See:/ 'election' smart constructor.+data Election = Election+    { _eOcdDivisionId :: !(Maybe Text)+    , _eElectionDay   :: !(Maybe Text)+    , _eName          :: !(Maybe Text)+    , _eId            :: !(Maybe (Textual Int64))+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'Election' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'eOcdDivisionId'+--+-- * 'eElectionDay'+--+-- * 'eName'+--+-- * 'eId'+election+    :: Election+election =+    Election+    { _eOcdDivisionId = Nothing+    , _eElectionDay = Nothing+    , _eName = Nothing+    , _eId = Nothing+    }++-- | The political division of the election. Represented as an OCD Division+-- ID. Voters within these political jurisdictions are covered by this+-- election. This is typically a state such as+-- ocd-division\/country:us\/state:ca or for the midterms or general+-- election the entire US (i.e. ocd-division\/country:us).+eOcdDivisionId :: Lens' Election (Maybe Text)+eOcdDivisionId+  = lens _eOcdDivisionId+      (\ s a -> s{_eOcdDivisionId = a})++-- | Day of the election in YYYY-MM-DD format.+eElectionDay :: Lens' Election (Maybe Text)+eElectionDay+  = lens _eElectionDay (\ s a -> s{_eElectionDay = a})++-- | A displayable name for the election.+eName :: Lens' Election (Maybe Text)+eName = lens _eName (\ s a -> s{_eName = a})++-- | The unique ID of this election.+eId :: Lens' Election (Maybe Int64)+eId+  = lens _eId (\ s a -> s{_eId = a}) . mapping _Coerce++instance FromJSON Election where+        parseJSON+          = withObject "Election"+              (\ o ->+                 Election <$>+                   (o .:? "ocdDivisionId") <*> (o .:? "electionDay") <*>+                     (o .:? "name")+                     <*> (o .:? "id"))++instance ToJSON Election where+        toJSON Election{..}+          = object+              (catMaybes+                 [("ocdDivisionId" .=) <$> _eOcdDivisionId,+                  ("electionDay" .=) <$> _eElectionDay,+                  ("name" .=) <$> _eName, ("id" .=) <$> _eId])++-- | The result of a representative info lookup query.+--+-- /See:/ 'representativeInfoResponse' smart constructor.+data RepresentativeInfoResponse = RepresentativeInfoResponse+    { _rirKind            :: !Text+    , _rirNormalizedInput :: !(Maybe SimpleAddressType)+    , _rirOfficials       :: !(Maybe [Official])+    , _rirDivisions       :: !(Maybe RepresentativeInfoResponseDivisions)+    , _rirOffices         :: !(Maybe [Office])+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'RepresentativeInfoResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'rirKind'+--+-- * 'rirNormalizedInput'+--+-- * 'rirOfficials'+--+-- * 'rirDivisions'+--+-- * 'rirOffices'+representativeInfoResponse+    :: RepresentativeInfoResponse+representativeInfoResponse =+    RepresentativeInfoResponse+    { _rirKind = "civicinfo#representativeInfoResponse"+    , _rirNormalizedInput = Nothing+    , _rirOfficials = Nothing+    , _rirDivisions = Nothing+    , _rirOffices = Nothing+    }++-- | Identifies what kind of resource this is. Value: the fixed string+-- \"civicinfo#representativeInfoResponse\".+rirKind :: Lens' RepresentativeInfoResponse Text+rirKind = lens _rirKind (\ s a -> s{_rirKind = a})++-- | The normalized version of the requested address+rirNormalizedInput :: Lens' RepresentativeInfoResponse (Maybe SimpleAddressType)+rirNormalizedInput+  = lens _rirNormalizedInput+      (\ s a -> s{_rirNormalizedInput = a})++-- | Officials holding the offices listed above. Will only be present if+-- includeOffices was true in the request.+rirOfficials :: Lens' RepresentativeInfoResponse [Official]+rirOfficials+  = lens _rirOfficials (\ s a -> s{_rirOfficials = a})+      . _Default+      . _Coerce++-- | Political geographic divisions that contain the requested address.+rirDivisions :: Lens' RepresentativeInfoResponse (Maybe RepresentativeInfoResponseDivisions)+rirDivisions+  = lens _rirDivisions (\ s a -> s{_rirDivisions = a})++-- | Elected offices referenced by the divisions listed above. Will only be+-- present if includeOffices was true in the request.+rirOffices :: Lens' RepresentativeInfoResponse [Office]+rirOffices+  = lens _rirOffices (\ s a -> s{_rirOffices = a}) .+      _Default+      . _Coerce++instance FromJSON RepresentativeInfoResponse where+        parseJSON+          = withObject "RepresentativeInfoResponse"+              (\ o ->+                 RepresentativeInfoResponse <$>+                   (o .:? "kind" .!=+                      "civicinfo#representativeInfoResponse")+                     <*> (o .:? "normalizedInput")+                     <*> (o .:? "officials" .!= mempty)+                     <*> (o .:? "divisions")+                     <*> (o .:? "offices" .!= mempty))++instance ToJSON RepresentativeInfoResponse where+        toJSON RepresentativeInfoResponse{..}+          = object+              (catMaybes+                 [Just ("kind" .= _rirKind),+                  ("normalizedInput" .=) <$> _rirNormalizedInput,+                  ("officials" .=) <$> _rirOfficials,+                  ("divisions" .=) <$> _rirDivisions,+                  ("offices" .=) <$> _rirOffices])++-- | Represents a political geographic division that matches the requested+-- query.+--+-- /See:/ 'divisionSearchResult' smart constructor.+data DivisionSearchResult = DivisionSearchResult+    { _dsrAliases :: !(Maybe [Text])+    , _dsrName    :: !(Maybe Text)+    , _dsrOcdId   :: !(Maybe Text)+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'DivisionSearchResult' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'dsrAliases'+--+-- * 'dsrName'+--+-- * 'dsrOcdId'+divisionSearchResult+    :: DivisionSearchResult+divisionSearchResult =+    DivisionSearchResult+    { _dsrAliases = Nothing+    , _dsrName = Nothing+    , _dsrOcdId = Nothing+    }++-- | Other Open Civic Data identifiers that refer to the same division -- for+-- example, those that refer to other political divisions whose boundaries+-- are defined to be coterminous with this one. For example,+-- ocd-division\/country:us\/state:wy will include an alias of+-- ocd-division\/country:us\/state:wy\/cd:1, since Wyoming has only one+-- Congressional district.+dsrAliases :: Lens' DivisionSearchResult [Text]+dsrAliases+  = lens _dsrAliases (\ s a -> s{_dsrAliases = a}) .+      _Default+      . _Coerce++-- | The name of the division.+dsrName :: Lens' DivisionSearchResult (Maybe Text)+dsrName = lens _dsrName (\ s a -> s{_dsrName = a})++-- | The unique Open Civic Data identifier for this division.+dsrOcdId :: Lens' DivisionSearchResult (Maybe Text)+dsrOcdId = lens _dsrOcdId (\ s a -> s{_dsrOcdId = a})++instance FromJSON DivisionSearchResult where+        parseJSON+          = withObject "DivisionSearchResult"+              (\ o ->+                 DivisionSearchResult <$>+                   (o .:? "aliases" .!= mempty) <*> (o .:? "name") <*>+                     (o .:? "ocdId"))++instance ToJSON DivisionSearchResult where+        toJSON DivisionSearchResult{..}+          = object+              (catMaybes+                 [("aliases" .=) <$> _dsrAliases,+                  ("name" .=) <$> _dsrName,+                  ("ocdId" .=) <$> _dsrOcdId])++-- | Information about an election administrative body (e.g. County Board of+-- Elections).+--+-- /See:/ 'administrativeBody' smart constructor.+data AdministrativeBody = AdministrativeBody+    { _abCorrespondenceAddress               :: !(Maybe SimpleAddressType)+    , _abAbsenteeVotingInfoURL               :: !(Maybe Text)+    , _abHoursOfOperation                    :: !(Maybe Text)+    , _abBallotInfoURL                       :: !(Maybe Text)+    , _abPhysicalAddress                     :: !(Maybe SimpleAddressType)+    , _abElectionRegistrationConfirmationURL :: !(Maybe Text)+    , _abElectionInfoURL                     :: !(Maybe Text)+    , _abVotingLocationFinderURL             :: !(Maybe Text)+    , _abElectionOfficials                   :: !(Maybe [ElectionOfficial])+    , _abName                                :: !(Maybe Text)+    , _abElectionRulesURL                    :: !(Maybe Text)+    , _abVoterServices                       :: !(Maybe [Text])+    , _abElectionRegistrationURL             :: !(Maybe Text)+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'AdministrativeBody' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'abCorrespondenceAddress'+--+-- * 'abAbsenteeVotingInfoURL'+--+-- * 'abHoursOfOperation'+--+-- * 'abBallotInfoURL'+--+-- * 'abPhysicalAddress'+--+-- * 'abElectionRegistrationConfirmationURL'+--+-- * 'abElectionInfoURL'+--+-- * 'abVotingLocationFinderURL'+--+-- * 'abElectionOfficials'+--+-- * 'abName'+--+-- * 'abElectionRulesURL'+--+-- * 'abVoterServices'+--+-- * 'abElectionRegistrationURL'+administrativeBody+    :: AdministrativeBody+administrativeBody =+    AdministrativeBody+    { _abCorrespondenceAddress = Nothing+    , _abAbsenteeVotingInfoURL = Nothing+    , _abHoursOfOperation = Nothing+    , _abBallotInfoURL = Nothing+    , _abPhysicalAddress = Nothing+    , _abElectionRegistrationConfirmationURL = Nothing+    , _abElectionInfoURL = Nothing+    , _abVotingLocationFinderURL = Nothing+    , _abElectionOfficials = Nothing+    , _abName = Nothing+    , _abElectionRulesURL = Nothing+    , _abVoterServices = Nothing+    , _abElectionRegistrationURL = Nothing+    }++-- | The mailing address of this administrative body.+abCorrespondenceAddress :: Lens' AdministrativeBody (Maybe SimpleAddressType)+abCorrespondenceAddress+  = lens _abCorrespondenceAddress+      (\ s a -> s{_abCorrespondenceAddress = a})++-- | A URL provided by this administrative body for information on absentee+-- voting.+abAbsenteeVotingInfoURL :: Lens' AdministrativeBody (Maybe Text)+abAbsenteeVotingInfoURL+  = lens _abAbsenteeVotingInfoURL+      (\ s a -> s{_abAbsenteeVotingInfoURL = a})++-- | A description of the hours of operation for this administrative body.+abHoursOfOperation :: Lens' AdministrativeBody (Maybe Text)+abHoursOfOperation+  = lens _abHoursOfOperation+      (\ s a -> s{_abHoursOfOperation = a})++-- | A URL provided by this administrative body to give contest information+-- to the voter.+abBallotInfoURL :: Lens' AdministrativeBody (Maybe Text)+abBallotInfoURL+  = lens _abBallotInfoURL+      (\ s a -> s{_abBallotInfoURL = a})++-- | The physical address of this administrative body.+abPhysicalAddress :: Lens' AdministrativeBody (Maybe SimpleAddressType)+abPhysicalAddress+  = lens _abPhysicalAddress+      (\ s a -> s{_abPhysicalAddress = a})++-- | A URL provided by this administrative body for confirming that the voter+-- is registered to vote.+abElectionRegistrationConfirmationURL :: Lens' AdministrativeBody (Maybe Text)+abElectionRegistrationConfirmationURL+  = lens _abElectionRegistrationConfirmationURL+      (\ s a ->+         s{_abElectionRegistrationConfirmationURL = a})++-- | A URL provided by this administrative body for looking up general+-- election information.+abElectionInfoURL :: Lens' AdministrativeBody (Maybe Text)+abElectionInfoURL+  = lens _abElectionInfoURL+      (\ s a -> s{_abElectionInfoURL = a})++-- | A URL provided by this administrative body for looking up where to vote.+abVotingLocationFinderURL :: Lens' AdministrativeBody (Maybe Text)+abVotingLocationFinderURL+  = lens _abVotingLocationFinderURL+      (\ s a -> s{_abVotingLocationFinderURL = a})++-- | The election officials for this election administrative body.+abElectionOfficials :: Lens' AdministrativeBody [ElectionOfficial]+abElectionOfficials+  = lens _abElectionOfficials+      (\ s a -> s{_abElectionOfficials = a})+      . _Default+      . _Coerce++-- | The name of this election administrative body.+abName :: Lens' AdministrativeBody (Maybe Text)+abName = lens _abName (\ s a -> s{_abName = a})++-- | A URL provided by this administrative body describing election rules to+-- the voter.+abElectionRulesURL :: Lens' AdministrativeBody (Maybe Text)+abElectionRulesURL+  = lens _abElectionRulesURL+      (\ s a -> s{_abElectionRulesURL = a})++-- | A description of the services this administrative body may provide.+abVoterServices :: Lens' AdministrativeBody [Text]+abVoterServices+  = lens _abVoterServices+      (\ s a -> s{_abVoterServices = a})+      . _Default+      . _Coerce++-- | A URL provided by this administrative body for looking up how to+-- register to vote.+abElectionRegistrationURL :: Lens' AdministrativeBody (Maybe Text)+abElectionRegistrationURL+  = lens _abElectionRegistrationURL+      (\ s a -> s{_abElectionRegistrationURL = a})++instance FromJSON AdministrativeBody where+        parseJSON+          = withObject "AdministrativeBody"+              (\ o ->+                 AdministrativeBody <$>+                   (o .:? "correspondenceAddress") <*>+                     (o .:? "absenteeVotingInfoUrl")+                     <*> (o .:? "hoursOfOperation")+                     <*> (o .:? "ballotInfoUrl")+                     <*> (o .:? "physicalAddress")+                     <*> (o .:? "electionRegistrationConfirmationUrl")+                     <*> (o .:? "electionInfoUrl")+                     <*> (o .:? "votingLocationFinderUrl")+                     <*> (o .:? "electionOfficials" .!= mempty)+                     <*> (o .:? "name")+                     <*> (o .:? "electionRulesUrl")+                     <*> (o .:? "voter_services" .!= mempty)+                     <*> (o .:? "electionRegistrationUrl"))++instance ToJSON AdministrativeBody where+        toJSON AdministrativeBody{..}+          = object+              (catMaybes+                 [("correspondenceAddress" .=) <$>+                    _abCorrespondenceAddress,+                  ("absenteeVotingInfoUrl" .=) <$>+                    _abAbsenteeVotingInfoURL,+                  ("hoursOfOperation" .=) <$> _abHoursOfOperation,+                  ("ballotInfoUrl" .=) <$> _abBallotInfoURL,+                  ("physicalAddress" .=) <$> _abPhysicalAddress,+                  ("electionRegistrationConfirmationUrl" .=) <$>+                    _abElectionRegistrationConfirmationURL,+                  ("electionInfoUrl" .=) <$> _abElectionInfoURL,+                  ("votingLocationFinderUrl" .=) <$>+                    _abVotingLocationFinderURL,+                  ("electionOfficials" .=) <$> _abElectionOfficials,+                  ("name" .=) <$> _abName,+                  ("electionRulesUrl" .=) <$> _abElectionRulesURL,+                  ("voter_services" .=) <$> _abVoterServices,+                  ("electionRegistrationUrl" .=) <$>+                    _abElectionRegistrationURL])++-- | Information about a contest that appears on a voter\'s ballot.+--+-- /See:/ 'contest' smart constructor.+data Contest = Contest+    { _conReferendumPassageThreshold :: !(Maybe Text)+    , _conRoles                      :: !(Maybe [Text])+    , _conReferendumURL              :: !(Maybe Text)+    , _conReferendumEffectOfAbstain  :: !(Maybe Text)+    , _conReferendumSubtitle         :: !(Maybe Text)+    , _conNumberVotingFor            :: !(Maybe (Textual Int64))+    , _conOffice                     :: !(Maybe Text)+    , _conReferendumConStatement     :: !(Maybe Text)+    , _conSources                    :: !(Maybe [Source])+    , _conReferendumProStatement     :: !(Maybe Text)+    , _conReferendumBallotResponses  :: !(Maybe [Text])+    , _conNumberElected              :: !(Maybe (Textual Int64))+    , _conSpecial                    :: !(Maybe Text)+    , _conReferendumText             :: !(Maybe Text)+    , _conPrimaryParty               :: !(Maybe Text)+    , _conId                         :: !(Maybe Text)+    , _conType                       :: !(Maybe Text)+    , _conElectorateSpecifications   :: !(Maybe Text)+    , _conReferendumBrief            :: !(Maybe Text)+    , _conDistrict                   :: !(Maybe ElectoralDistrict)+    , _conLevel                      :: !(Maybe [Text])+    , _conCandidates                 :: !(Maybe [Candidate])+    , _conReferendumTitle            :: !(Maybe Text)+    , _conBallotPlacement            :: !(Maybe (Textual Int64))+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'Contest' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'conReferendumPassageThreshold'+--+-- * 'conRoles'+--+-- * 'conReferendumURL'+--+-- * 'conReferendumEffectOfAbstain'+--+-- * 'conReferendumSubtitle'+--+-- * 'conNumberVotingFor'+--+-- * 'conOffice'+--+-- * 'conReferendumConStatement'+--+-- * 'conSources'+--+-- * 'conReferendumProStatement'+--+-- * 'conReferendumBallotResponses'+--+-- * 'conNumberElected'+--+-- * 'conSpecial'+--+-- * 'conReferendumText'+--+-- * 'conPrimaryParty'+--+-- * 'conId'+--+-- * 'conType'+--+-- * 'conElectorateSpecifications'+--+-- * 'conReferendumBrief'+--+-- * 'conDistrict'+--+-- * 'conLevel'+--+-- * 'conCandidates'+--+-- * 'conReferendumTitle'+--+-- * 'conBallotPlacement'+contest+    :: Contest+contest =+    Contest+    { _conReferendumPassageThreshold = Nothing+    , _conRoles = Nothing+    , _conReferendumURL = Nothing+    , _conReferendumEffectOfAbstain = Nothing+    , _conReferendumSubtitle = Nothing+    , _conNumberVotingFor = Nothing+    , _conOffice = Nothing+    , _conReferendumConStatement = Nothing+    , _conSources = Nothing+    , _conReferendumProStatement = Nothing+    , _conReferendumBallotResponses = Nothing+    , _conNumberElected = Nothing+    , _conSpecial = Nothing+    , _conReferendumText = Nothing+    , _conPrimaryParty = Nothing+    , _conId = Nothing+    , _conType = Nothing+    , _conElectorateSpecifications = Nothing+    , _conReferendumBrief = Nothing+    , _conDistrict = Nothing+    , _conLevel = Nothing+    , _conCandidates = Nothing+    , _conReferendumTitle = Nothing+    , _conBallotPlacement = Nothing+    }++-- | The threshold of votes that the referendum needs in order to pass, e.g.+-- \"two-thirds\". This field is only populated for contests of type+-- \'Referendum\'.+conReferendumPassageThreshold :: Lens' Contest (Maybe Text)+conReferendumPassageThreshold+  = lens _conReferendumPassageThreshold+      (\ s a -> s{_conReferendumPassageThreshold = a})++-- | The roles which this office fulfills.+conRoles :: Lens' Contest [Text]+conRoles+  = lens _conRoles (\ s a -> s{_conRoles = a}) .+      _Default+      . _Coerce++-- | A link to the referendum. This field is only populated for contests of+-- type \'Referendum\'.+conReferendumURL :: Lens' Contest (Maybe Text)+conReferendumURL+  = lens _conReferendumURL+      (\ s a -> s{_conReferendumURL = a})++-- | Specifies what effect abstaining (not voting) on the proposition will+-- have (i.e. whether abstaining is considered a vote against it). This+-- field is only populated for contests of type \'Referendum\'.+conReferendumEffectOfAbstain :: Lens' Contest (Maybe Text)+conReferendumEffectOfAbstain+  = lens _conReferendumEffectOfAbstain+      (\ s a -> s{_conReferendumEffectOfAbstain = a})++-- | A brief description of the referendum. This field is only populated for+-- contests of type \'Referendum\'.+conReferendumSubtitle :: Lens' Contest (Maybe Text)+conReferendumSubtitle+  = lens _conReferendumSubtitle+      (\ s a -> s{_conReferendumSubtitle = a})++-- | The number of candidates that a voter may vote for in this contest.+conNumberVotingFor :: Lens' Contest (Maybe Int64)+conNumberVotingFor+  = lens _conNumberVotingFor+      (\ s a -> s{_conNumberVotingFor = a})+      . mapping _Coerce++-- | The name of the office for this contest.+conOffice :: Lens' Contest (Maybe Text)+conOffice+  = lens _conOffice (\ s a -> s{_conOffice = a})++-- | A statement in opposition to the referendum. It does not necessarily+-- appear on the ballot. This field is only populated for contests of type+-- \'Referendum\'.+conReferendumConStatement :: Lens' Contest (Maybe Text)+conReferendumConStatement+  = lens _conReferendumConStatement+      (\ s a -> s{_conReferendumConStatement = a})++-- | A list of sources for this contest. If multiple sources are listed, the+-- data has been aggregated from those sources.+conSources :: Lens' Contest [Source]+conSources+  = lens _conSources (\ s a -> s{_conSources = a}) .+      _Default+      . _Coerce++-- | A statement in favor of the referendum. It does not necessarily appear+-- on the ballot. This field is only populated for contests of type+-- \'Referendum\'.+conReferendumProStatement :: Lens' Contest (Maybe Text)+conReferendumProStatement+  = lens _conReferendumProStatement+      (\ s a -> s{_conReferendumProStatement = a})++-- | The set of ballot responses for the referendum. A ballot response+-- represents a line on the ballot. Common examples might include \"yes\"+-- or \"no\" for referenda, or a judge\'s name for a retention contest.+-- This field is only populated for contests of type \'Referendum\'.+conReferendumBallotResponses :: Lens' Contest [Text]+conReferendumBallotResponses+  = lens _conReferendumBallotResponses+      (\ s a -> s{_conReferendumBallotResponses = a})+      . _Default+      . _Coerce++-- | The number of candidates that will be elected to office in this contest.+conNumberElected :: Lens' Contest (Maybe Int64)+conNumberElected+  = lens _conNumberElected+      (\ s a -> s{_conNumberElected = a})+      . mapping _Coerce++-- | \"Yes\" or \"No\" depending on whether this a contest being held outside+-- the normal election cycle.+conSpecial :: Lens' Contest (Maybe Text)+conSpecial+  = lens _conSpecial (\ s a -> s{_conSpecial = a})++-- | The full text of the referendum. This field is only populated for+-- contests of type \'Referendum\'.+conReferendumText :: Lens' Contest (Maybe Text)+conReferendumText+  = lens _conReferendumText+      (\ s a -> s{_conReferendumText = a})++-- | If this is a partisan election, the name of the party it is for.+conPrimaryParty :: Lens' Contest (Maybe Text)+conPrimaryParty+  = lens _conPrimaryParty+      (\ s a -> s{_conPrimaryParty = a})++-- | An ID for this object. IDs may change in future requests and should not+-- be cached. Access to this field requires special access that can be+-- requested from the Request more link on the Quotas page.+conId :: Lens' Contest (Maybe Text)+conId = lens _conId (\ s a -> s{_conId = a})++-- | The type of contest. Usually this will be \'General\', \'Primary\', or+-- \'Run-off\' for contests with candidates. For referenda this will be+-- \'Referendum\'.+conType :: Lens' Contest (Maybe Text)+conType = lens _conType (\ s a -> s{_conType = a})++-- | A description of any additional eligibility requirements for voting in+-- this contest.+conElectorateSpecifications :: Lens' Contest (Maybe Text)+conElectorateSpecifications+  = lens _conElectorateSpecifications+      (\ s a -> s{_conElectorateSpecifications = a})++-- | Specifies a short summary of the referendum that is typically on the+-- ballot below the title but above the text. This field is only populated+-- for contests of type \'Referendum\'.+conReferendumBrief :: Lens' Contest (Maybe Text)+conReferendumBrief+  = lens _conReferendumBrief+      (\ s a -> s{_conReferendumBrief = a})++-- | Information about the electoral district that this contest is in.+conDistrict :: Lens' Contest (Maybe ElectoralDistrict)+conDistrict+  = lens _conDistrict (\ s a -> s{_conDistrict = a})++-- | The levels of government of the office for this contest. There may be+-- more than one in cases where a jurisdiction effectively acts at two+-- different levels of government; for example, the mayor of the District+-- of Columbia acts at \"locality\" level, but also effectively at both+-- \"administrative-area-2\" and \"administrative-area-1\".+conLevel :: Lens' Contest [Text]+conLevel+  = lens _conLevel (\ s a -> s{_conLevel = a}) .+      _Default+      . _Coerce++-- | The candidate choices for this contest.+conCandidates :: Lens' Contest [Candidate]+conCandidates+  = lens _conCandidates+      (\ s a -> s{_conCandidates = a})+      . _Default+      . _Coerce++-- | The title of the referendum (e.g. \'Proposition 42\'). This field is+-- only populated for contests of type \'Referendum\'.+conReferendumTitle :: Lens' Contest (Maybe Text)+conReferendumTitle+  = lens _conReferendumTitle+      (\ s a -> s{_conReferendumTitle = a})++-- | A number specifying the position of this contest on the voter\'s ballot.+conBallotPlacement :: Lens' Contest (Maybe Int64)+conBallotPlacement+  = lens _conBallotPlacement+      (\ s a -> s{_conBallotPlacement = a})+      . mapping _Coerce++instance FromJSON Contest where+        parseJSON+          = withObject "Contest"+              (\ o ->+                 Contest <$>+                   (o .:? "referendumPassageThreshold") <*>+                     (o .:? "roles" .!= mempty)+                     <*> (o .:? "referendumUrl")+                     <*> (o .:? "referendumEffectOfAbstain")+                     <*> (o .:? "referendumSubtitle")+                     <*> (o .:? "numberVotingFor")+                     <*> (o .:? "office")+                     <*> (o .:? "referendumConStatement")+                     <*> (o .:? "sources" .!= mempty)+                     <*> (o .:? "referendumProStatement")+                     <*> (o .:? "referendumBallotResponses" .!= mempty)+                     <*> (o .:? "numberElected")+                     <*> (o .:? "special")+                     <*> (o .:? "referendumText")+                     <*> (o .:? "primaryParty")+                     <*> (o .:? "id")+                     <*> (o .:? "type")+                     <*> (o .:? "electorateSpecifications")+                     <*> (o .:? "referendumBrief")+                     <*> (o .:? "district")+                     <*> (o .:? "level" .!= mempty)+                     <*> (o .:? "candidates" .!= mempty)+                     <*> (o .:? "referendumTitle")+                     <*> (o .:? "ballotPlacement"))++instance ToJSON Contest where+        toJSON Contest{..}+          = object+              (catMaybes+                 [("referendumPassageThreshold" .=) <$>+                    _conReferendumPassageThreshold,+                  ("roles" .=) <$> _conRoles,+                  ("referendumUrl" .=) <$> _conReferendumURL,+                  ("referendumEffectOfAbstain" .=) <$>+                    _conReferendumEffectOfAbstain,+                  ("referendumSubtitle" .=) <$> _conReferendumSubtitle,+                  ("numberVotingFor" .=) <$> _conNumberVotingFor,+                  ("office" .=) <$> _conOffice,+                  ("referendumConStatement" .=) <$>+                    _conReferendumConStatement,+                  ("sources" .=) <$> _conSources,+                  ("referendumProStatement" .=) <$>+                    _conReferendumProStatement,+                  ("referendumBallotResponses" .=) <$>+                    _conReferendumBallotResponses,+                  ("numberElected" .=) <$> _conNumberElected,+                  ("special" .=) <$> _conSpecial,+                  ("referendumText" .=) <$> _conReferendumText,+                  ("primaryParty" .=) <$> _conPrimaryParty,+                  ("id" .=) <$> _conId, ("type" .=) <$> _conType,+                  ("electorateSpecifications" .=) <$>+                    _conElectorateSpecifications,+                  ("referendumBrief" .=) <$> _conReferendumBrief,+                  ("district" .=) <$> _conDistrict,+                  ("level" .=) <$> _conLevel,+                  ("candidates" .=) <$> _conCandidates,+                  ("referendumTitle" .=) <$> _conReferendumTitle,+                  ("ballotPlacement" .=) <$> _conBallotPlacement])++-- | The result of a division search query.+--+-- /See:/ 'divisionSearchResponse' smart constructor.+data DivisionSearchResponse = DivisionSearchResponse+    { _dsrResults :: !(Maybe [DivisionSearchResult])+    , _dsrKind    :: !Text+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'DivisionSearchResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'dsrResults'+--+-- * 'dsrKind'+divisionSearchResponse+    :: DivisionSearchResponse+divisionSearchResponse =+    DivisionSearchResponse+    { _dsrResults = Nothing+    , _dsrKind = "civicinfo#divisionSearchResponse"+    }++dsrResults :: Lens' DivisionSearchResponse [DivisionSearchResult]+dsrResults+  = lens _dsrResults (\ s a -> s{_dsrResults = a}) .+      _Default+      . _Coerce++-- | Identifies what kind of resource this is. Value: the fixed string+-- \"civicinfo#divisionSearchResponse\".+dsrKind :: Lens' DivisionSearchResponse Text+dsrKind = lens _dsrKind (\ s a -> s{_dsrKind = a})++instance FromJSON DivisionSearchResponse where+        parseJSON+          = withObject "DivisionSearchResponse"+              (\ o ->+                 DivisionSearchResponse <$>+                   (o .:? "results" .!= mempty) <*>+                     (o .:? "kind" .!=+                        "civicinfo#divisionSearchResponse"))++instance ToJSON DivisionSearchResponse where+        toJSON DivisionSearchResponse{..}+          = object+              (catMaybes+                 [("results" .=) <$> _dsrResults,+                  Just ("kind" .= _dsrKind)])++-- | Political geographic divisions that contain the requested address.+--+-- /See:/ 'representativeInfoDataDivisions' smart constructor.+newtype RepresentativeInfoDataDivisions = RepresentativeInfoDataDivisions+    { _riddAddtional :: HashMap Text GeographicDivision+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'RepresentativeInfoDataDivisions' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'riddAddtional'+representativeInfoDataDivisions+    :: HashMap Text GeographicDivision -- ^ 'riddAddtional'+    -> RepresentativeInfoDataDivisions+representativeInfoDataDivisions pRiddAddtional_ =+    RepresentativeInfoDataDivisions+    { _riddAddtional = _Coerce # pRiddAddtional_+    }++-- | The unique Open Civic Data identifier for this division.+riddAddtional :: Lens' RepresentativeInfoDataDivisions (HashMap Text GeographicDivision)+riddAddtional+  = lens _riddAddtional+      (\ s a -> s{_riddAddtional = a})+      . _Coerce++instance FromJSON RepresentativeInfoDataDivisions+         where+        parseJSON+          = withObject "RepresentativeInfoDataDivisions"+              (\ o ->+                 RepresentativeInfoDataDivisions <$>+                   (parseJSONObject o))++instance ToJSON RepresentativeInfoDataDivisions where+        toJSON = toJSON . _riddAddtional++-- | Information about individual election officials.+--+-- /See:/ 'electionOfficial' smart constructor.+data ElectionOfficial = ElectionOfficial+    { _eoFaxNumber         :: !(Maybe Text)+    , _eoName              :: !(Maybe Text)+    , _eoOfficePhoneNumber :: !(Maybe Text)+    , _eoEmailAddress      :: !(Maybe Text)+    , _eoTitle             :: !(Maybe Text)+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'ElectionOfficial' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'eoFaxNumber'+--+-- * 'eoName'+--+-- * 'eoOfficePhoneNumber'+--+-- * 'eoEmailAddress'+--+-- * 'eoTitle'+electionOfficial+    :: ElectionOfficial+electionOfficial =+    ElectionOfficial+    { _eoFaxNumber = Nothing+    , _eoName = Nothing+    , _eoOfficePhoneNumber = Nothing+    , _eoEmailAddress = Nothing+    , _eoTitle = Nothing+    }++-- | The fax number of the election official.+eoFaxNumber :: Lens' ElectionOfficial (Maybe Text)+eoFaxNumber+  = lens _eoFaxNumber (\ s a -> s{_eoFaxNumber = a})++-- | The full name of the election official.+eoName :: Lens' ElectionOfficial (Maybe Text)+eoName = lens _eoName (\ s a -> s{_eoName = a})++-- | The office phone number of the election official.+eoOfficePhoneNumber :: Lens' ElectionOfficial (Maybe Text)+eoOfficePhoneNumber+  = lens _eoOfficePhoneNumber+      (\ s a -> s{_eoOfficePhoneNumber = a})++-- | The email address of the election official.+eoEmailAddress :: Lens' ElectionOfficial (Maybe Text)+eoEmailAddress+  = lens _eoEmailAddress+      (\ s a -> s{_eoEmailAddress = a})++-- | The title of the election official.+eoTitle :: Lens' ElectionOfficial (Maybe Text)+eoTitle = lens _eoTitle (\ s a -> s{_eoTitle = a})++instance FromJSON ElectionOfficial where+        parseJSON+          = withObject "ElectionOfficial"+              (\ o ->+                 ElectionOfficial <$>+                   (o .:? "faxNumber") <*> (o .:? "name") <*>+                     (o .:? "officePhoneNumber")+                     <*> (o .:? "emailAddress")+                     <*> (o .:? "title"))++instance ToJSON ElectionOfficial where+        toJSON ElectionOfficial{..}+          = object+              (catMaybes+                 [("faxNumber" .=) <$> _eoFaxNumber,+                  ("name" .=) <$> _eoName,+                  ("officePhoneNumber" .=) <$> _eoOfficePhoneNumber,+                  ("emailAddress" .=) <$> _eoEmailAddress,+                  ("title" .=) <$> _eoTitle])++--+-- /See:/ 'representativeInfoData' smart constructor.+data RepresentativeInfoData = RepresentativeInfoData+    { _ridOfficials :: !(Maybe [Official])+    , _ridDivisions :: !(Maybe RepresentativeInfoDataDivisions)+    , _ridOffices   :: !(Maybe [Office])+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'RepresentativeInfoData' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'ridOfficials'+--+-- * 'ridDivisions'+--+-- * 'ridOffices'+representativeInfoData+    :: RepresentativeInfoData+representativeInfoData =+    RepresentativeInfoData+    { _ridOfficials = Nothing+    , _ridDivisions = Nothing+    , _ridOffices = Nothing+    }++-- | Officials holding the offices listed above. Will only be present if+-- includeOffices was true in the request.+ridOfficials :: Lens' RepresentativeInfoData [Official]+ridOfficials+  = lens _ridOfficials (\ s a -> s{_ridOfficials = a})+      . _Default+      . _Coerce++-- | Political geographic divisions that contain the requested address.+ridDivisions :: Lens' RepresentativeInfoData (Maybe RepresentativeInfoDataDivisions)+ridDivisions+  = lens _ridDivisions (\ s a -> s{_ridDivisions = a})++-- | Elected offices referenced by the divisions listed above. Will only be+-- present if includeOffices was true in the request.+ridOffices :: Lens' RepresentativeInfoData [Office]+ridOffices+  = lens _ridOffices (\ s a -> s{_ridOffices = a}) .+      _Default+      . _Coerce++instance FromJSON RepresentativeInfoData where+        parseJSON+          = withObject "RepresentativeInfoData"+              (\ o ->+                 RepresentativeInfoData <$>+                   (o .:? "officials" .!= mempty) <*>+                     (o .:? "divisions")+                     <*> (o .:? "offices" .!= mempty))++instance ToJSON RepresentativeInfoData where+        toJSON RepresentativeInfoData{..}+          = object+              (catMaybes+                 [("officials" .=) <$> _ridOfficials,+                  ("divisions" .=) <$> _ridDivisions,+                  ("offices" .=) <$> _ridOffices])++-- | Contains information about the data source for the element containing+-- it.+--+-- /See:/ 'source' smart constructor.+data Source = Source+    { _sName     :: !(Maybe Text)+    , _sOfficial :: !(Maybe Bool)+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'Source' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'sName'+--+-- * 'sOfficial'+source+    :: Source+source =+    Source+    { _sName = Nothing+    , _sOfficial = Nothing+    }++-- | The name of the data source.+sName :: Lens' Source (Maybe Text)+sName = lens _sName (\ s a -> s{_sName = a})++-- | Whether this data comes from an official government source.+sOfficial :: Lens' Source (Maybe Bool)+sOfficial+  = lens _sOfficial (\ s a -> s{_sOfficial = a})++instance FromJSON Source where+        parseJSON+          = withObject "Source"+              (\ o ->+                 Source <$> (o .:? "name") <*> (o .:? "official"))++instance ToJSON Source where+        toJSON Source{..}+          = object+              (catMaybes+                 [("name" .=) <$> _sName,+                  ("official" .=) <$> _sOfficial])++-- | Describes the geographic scope of a contest.+--+-- /See:/ 'electoralDistrict' smart constructor.+data ElectoralDistrict = ElectoralDistrict+    { _edName  :: !(Maybe Text)+    , _edScope :: !(Maybe Text)+    , _edId    :: !(Maybe Text)+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'ElectoralDistrict' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'edName'+--+-- * 'edScope'+--+-- * 'edId'+electoralDistrict+    :: ElectoralDistrict+electoralDistrict =+    ElectoralDistrict+    { _edName = Nothing+    , _edScope = Nothing+    , _edId = Nothing+    }++-- | The name of the district.+edName :: Lens' ElectoralDistrict (Maybe Text)+edName = lens _edName (\ s a -> s{_edName = a})++-- | The geographic scope of this district. If unspecified the district\'s+-- geography is not known. One of: national, statewide, congressional,+-- stateUpper, stateLower, countywide, judicial, schoolBoard, cityWide,+-- township, countyCouncil, cityCouncil, ward, special+edScope :: Lens' ElectoralDistrict (Maybe Text)+edScope = lens _edScope (\ s a -> s{_edScope = a})++-- | An identifier for this district, relative to its scope. For example, the+-- 34th State Senate district would have id \"34\" and a scope of+-- stateUpper.+edId :: Lens' ElectoralDistrict (Maybe Text)+edId = lens _edId (\ s a -> s{_edId = a})++instance FromJSON ElectoralDistrict where+        parseJSON+          = withObject "ElectoralDistrict"+              (\ o ->+                 ElectoralDistrict <$>+                   (o .:? "name") <*> (o .:? "scope") <*> (o .:? "id"))++instance ToJSON ElectoralDistrict where+        toJSON ElectoralDistrict{..}+          = object+              (catMaybes+                 [("name" .=) <$> _edName, ("scope" .=) <$> _edScope,+                  ("id" .=) <$> _edId])++-- | A simple representation of an address.+--+-- /See:/ 'simpleAddressType' smart constructor.+data SimpleAddressType = SimpleAddressType+    { _satLine2        :: !(Maybe Text)+    , _satState        :: !(Maybe Text)+    , _satLine3        :: !(Maybe Text)+    , _satZip          :: !(Maybe Text)+    , _satCity         :: !(Maybe Text)+    , _satLine1        :: !(Maybe Text)+    , _satLocationName :: !(Maybe Text)+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'SimpleAddressType' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'satLine2'+--+-- * 'satState'+--+-- * 'satLine3'+--+-- * 'satZip'+--+-- * 'satCity'+--+-- * 'satLine1'+--+-- * 'satLocationName'+simpleAddressType+    :: SimpleAddressType+simpleAddressType =+    SimpleAddressType+    { _satLine2 = Nothing+    , _satState = Nothing+    , _satLine3 = Nothing+    , _satZip = Nothing+    , _satCity = Nothing+    , _satLine1 = Nothing+    , _satLocationName = Nothing+    }++-- | The second line the address, if needed.+satLine2 :: Lens' SimpleAddressType (Maybe Text)+satLine2 = lens _satLine2 (\ s a -> s{_satLine2 = a})++-- | The US two letter state abbreviation of the address.+satState :: Lens' SimpleAddressType (Maybe Text)+satState = lens _satState (\ s a -> s{_satState = a})++-- | The third line of the address, if needed.+satLine3 :: Lens' SimpleAddressType (Maybe Text)+satLine3 = lens _satLine3 (\ s a -> s{_satLine3 = a})++-- | The US Postal Zip Code of the address.+satZip :: Lens' SimpleAddressType (Maybe Text)+satZip = lens _satZip (\ s a -> s{_satZip = a})++-- | The city or town for the address.+satCity :: Lens' SimpleAddressType (Maybe Text)+satCity = lens _satCity (\ s a -> s{_satCity = a})++-- | The street name and number of this address.+satLine1 :: Lens' SimpleAddressType (Maybe Text)+satLine1 = lens _satLine1 (\ s a -> s{_satLine1 = a})++-- | The name of the location.+satLocationName :: Lens' SimpleAddressType (Maybe Text)+satLocationName+  = lens _satLocationName+      (\ s a -> s{_satLocationName = a})++instance FromJSON SimpleAddressType where+        parseJSON+          = withObject "SimpleAddressType"+              (\ o ->+                 SimpleAddressType <$>+                   (o .:? "line2") <*> (o .:? "state") <*>+                     (o .:? "line3")+                     <*> (o .:? "zip")+                     <*> (o .:? "city")+                     <*> (o .:? "line1")+                     <*> (o .:? "locationName"))++instance ToJSON SimpleAddressType where+        toJSON SimpleAddressType{..}+          = object+              (catMaybes+                 [("line2" .=) <$> _satLine2,+                  ("state" .=) <$> _satState,+                  ("line3" .=) <$> _satLine3, ("zip" .=) <$> _satZip,+                  ("city" .=) <$> _satCity, ("line1" .=) <$> _satLine1,+                  ("locationName" .=) <$> _satLocationName])++-- | Describes information about a regional election administrative area.+--+-- /See:/ 'administrationRegion' smart constructor.+data AdministrationRegion = AdministrationRegion+    { _arLocalJurisdiction          :: !(Maybe AdministrationRegion)+    , _arSources                    :: !(Maybe [Source])+    , _arName                       :: !(Maybe Text)+    , _arElectionAdministrationBody :: !(Maybe AdministrativeBody)+    , _arId                         :: !(Maybe Text)+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'AdministrationRegion' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'arLocalJurisdiction'+--+-- * 'arSources'+--+-- * 'arName'+--+-- * 'arElectionAdministrationBody'+--+-- * 'arId'+administrationRegion+    :: AdministrationRegion+administrationRegion =+    AdministrationRegion+    { _arLocalJurisdiction = Nothing+    , _arSources = Nothing+    , _arName = Nothing+    , _arElectionAdministrationBody = Nothing+    , _arId = Nothing+    }++-- | The city or county that provides election information for this voter.+-- This object can have the same elements as state.+arLocalJurisdiction :: Lens' AdministrationRegion (Maybe AdministrationRegion)+arLocalJurisdiction+  = lens _arLocalJurisdiction+      (\ s a -> s{_arLocalJurisdiction = a})++-- | A list of sources for this area. If multiple sources are listed the data+-- has been aggregated from those sources.+arSources :: Lens' AdministrationRegion [Source]+arSources+  = lens _arSources (\ s a -> s{_arSources = a}) .+      _Default+      . _Coerce++-- | The name of the jurisdiction.+arName :: Lens' AdministrationRegion (Maybe Text)+arName = lens _arName (\ s a -> s{_arName = a})++-- | The election administration body for this area.+arElectionAdministrationBody :: Lens' AdministrationRegion (Maybe AdministrativeBody)+arElectionAdministrationBody+  = lens _arElectionAdministrationBody+      (\ s a -> s{_arElectionAdministrationBody = a})++-- | An ID for this object. IDs may change in future requests and should not+-- be cached. Access to this field requires special access that can be+-- requested from the Request more link on the Quotas page.+arId :: Lens' AdministrationRegion (Maybe Text)+arId = lens _arId (\ s a -> s{_arId = a})++instance FromJSON AdministrationRegion where+        parseJSON+          = withObject "AdministrationRegion"+              (\ o ->+                 AdministrationRegion <$>+                   (o .:? "local_jurisdiction") <*>+                     (o .:? "sources" .!= mempty)+                     <*> (o .:? "name")+                     <*> (o .:? "electionAdministrationBody")+                     <*> (o .:? "id"))++instance ToJSON AdministrationRegion where+        toJSON AdministrationRegion{..}+          = object+              (catMaybes+                 [("local_jurisdiction" .=) <$> _arLocalJurisdiction,+                  ("sources" .=) <$> _arSources,+                  ("name" .=) <$> _arName,+                  ("electionAdministrationBody" .=) <$>+                    _arElectionAdministrationBody,+                  ("id" .=) <$> _arId])++-- | The list of elections available for this version of the API.+--+-- /See:/ 'electionsQueryResponse' smart constructor.+data ElectionsQueryResponse = ElectionsQueryResponse+    { _eqrKind      :: !Text+    , _eqrElections :: !(Maybe [Election])+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'ElectionsQueryResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'eqrKind'+--+-- * 'eqrElections'+electionsQueryResponse+    :: ElectionsQueryResponse+electionsQueryResponse =+    ElectionsQueryResponse+    { _eqrKind = "civicinfo#electionsQueryResponse"+    , _eqrElections = Nothing+    }++-- | Identifies what kind of resource this is. Value: the fixed string+-- \"civicinfo#electionsQueryResponse\".+eqrKind :: Lens' ElectionsQueryResponse Text+eqrKind = lens _eqrKind (\ s a -> s{_eqrKind = a})++-- | A list of available elections+eqrElections :: Lens' ElectionsQueryResponse [Election]+eqrElections+  = lens _eqrElections (\ s a -> s{_eqrElections = a})+      . _Default+      . _Coerce++instance FromJSON ElectionsQueryResponse where+        parseJSON+          = withObject "ElectionsQueryResponse"+              (\ o ->+                 ElectionsQueryResponse <$>+                   (o .:? "kind" .!= "civicinfo#electionsQueryResponse")+                     <*> (o .:? "elections" .!= mempty))++instance ToJSON ElectionsQueryResponse where+        toJSON ElectionsQueryResponse{..}+          = object+              (catMaybes+                 [Just ("kind" .= _eqrKind),+                  ("elections" .=) <$> _eqrElections])++-- | Information about a person holding an elected office.+--+-- /See:/ 'official' smart constructor.+data Official = Official+    { _offPhotoURL :: !(Maybe Text)+    , _offURLs     :: !(Maybe [Text])+    , _offChannels :: !(Maybe [Channel])+    , _offAddress  :: !(Maybe [SimpleAddressType])+    , _offPhones   :: !(Maybe [Text])+    , _offName     :: !(Maybe Text)+    , _offEmails   :: !(Maybe [Text])+    , _offParty    :: !(Maybe Text)+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'Official' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'offPhotoURL'+--+-- * 'offURLs'+--+-- * 'offChannels'+--+-- * 'offAddress'+--+-- * 'offPhones'+--+-- * 'offName'+--+-- * 'offEmails'+--+-- * 'offParty'+official+    :: Official+official =+    Official+    { _offPhotoURL = Nothing+    , _offURLs = Nothing+    , _offChannels = Nothing+    , _offAddress = Nothing+    , _offPhones = Nothing+    , _offName = Nothing+    , _offEmails = Nothing+    , _offParty = Nothing+    }++-- | A URL for a photo of the official.+offPhotoURL :: Lens' Official (Maybe Text)+offPhotoURL+  = lens _offPhotoURL (\ s a -> s{_offPhotoURL = a})++-- | The official\'s public website URLs.+offURLs :: Lens' Official [Text]+offURLs+  = lens _offURLs (\ s a -> s{_offURLs = a}) . _Default+      . _Coerce++-- | A list of known (social) media channels for this official.+offChannels :: Lens' Official [Channel]+offChannels+  = lens _offChannels (\ s a -> s{_offChannels = a}) .+      _Default+      . _Coerce++-- | Addresses at which to contact the official.+offAddress :: Lens' Official [SimpleAddressType]+offAddress+  = lens _offAddress (\ s a -> s{_offAddress = a}) .+      _Default+      . _Coerce++-- | The official\'s public contact phone numbers.+offPhones :: Lens' Official [Text]+offPhones+  = lens _offPhones (\ s a -> s{_offPhones = a}) .+      _Default+      . _Coerce++-- | The official\'s name.+offName :: Lens' Official (Maybe Text)+offName = lens _offName (\ s a -> s{_offName = a})++-- | The direct email addresses for the official.+offEmails :: Lens' Official [Text]+offEmails+  = lens _offEmails (\ s a -> s{_offEmails = a}) .+      _Default+      . _Coerce++-- | The full name of the party the official belongs to.+offParty :: Lens' Official (Maybe Text)+offParty = lens _offParty (\ s a -> s{_offParty = a})++instance FromJSON Official where+        parseJSON+          = withObject "Official"+              (\ o ->+                 Official <$>+                   (o .:? "photoUrl") <*> (o .:? "urls" .!= mempty) <*>+                     (o .:? "channels" .!= mempty)+                     <*> (o .:? "address" .!= mempty)+                     <*> (o .:? "phones" .!= mempty)+                     <*> (o .:? "name")+                     <*> (o .:? "emails" .!= mempty)+                     <*> (o .:? "party"))++instance ToJSON Official where+        toJSON Official{..}+          = object+              (catMaybes+                 [("photoUrl" .=) <$> _offPhotoURL,+                  ("urls" .=) <$> _offURLs,+                  ("channels" .=) <$> _offChannels,+                  ("address" .=) <$> _offAddress,+                  ("phones" .=) <$> _offPhones,+                  ("name" .=) <$> _offName,+                  ("emails" .=) <$> _offEmails,+                  ("party" .=) <$> _offParty])
+ gen/Network/Google/CivicInfo/Types/Sum.hs view
@@ -0,0 +1,263 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric      #-}+{-# LANGUAGE LambdaCase         #-}+{-# LANGUAGE NoImplicitPrelude  #-}+{-# LANGUAGE OverloadedStrings  #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module      : Network.Google.CivicInfo.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.CivicInfo.Types.Sum where++import           Network.Google.Prelude++-- | A list of office levels to filter by. Only offices that serve at least+-- one of these levels will be returned. Divisions that don\'t contain a+-- matching office will not be returned.+data RepresentativesRepresentativeInfoByDivisionLevels+    = ADMINISTRATIVEAREA1+      -- ^ @administrativeArea1@+    | ADMINISTRATIVEAREA2+      -- ^ @administrativeArea2@+    | Country+      -- ^ @country@+    | International+      -- ^ @international@+    | Locality+      -- ^ @locality@+    | Regional+      -- ^ @regional@+    | Special+      -- ^ @special@+    | SUBLOCALITY1+      -- ^ @subLocality1@+    | SUBLOCALITY2+      -- ^ @subLocality2@+      deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)++instance Hashable RepresentativesRepresentativeInfoByDivisionLevels++instance FromText RepresentativesRepresentativeInfoByDivisionLevels where+    fromText = \case+        "administrativeArea1" -> Just ADMINISTRATIVEAREA1+        "administrativeArea2" -> Just ADMINISTRATIVEAREA2+        "country" -> Just Country+        "international" -> Just International+        "locality" -> Just Locality+        "regional" -> Just Regional+        "special" -> Just Special+        "subLocality1" -> Just SUBLOCALITY1+        "subLocality2" -> Just SUBLOCALITY2+        _ -> Nothing++instance ToText RepresentativesRepresentativeInfoByDivisionLevels where+    toText = \case+        ADMINISTRATIVEAREA1 -> "administrativeArea1"+        ADMINISTRATIVEAREA2 -> "administrativeArea2"+        Country -> "country"+        International -> "international"+        Locality -> "locality"+        Regional -> "regional"+        Special -> "special"+        SUBLOCALITY1 -> "subLocality1"+        SUBLOCALITY2 -> "subLocality2"++instance FromJSON RepresentativesRepresentativeInfoByDivisionLevels where+    parseJSON = parseJSONText "RepresentativesRepresentativeInfoByDivisionLevels"++instance ToJSON RepresentativesRepresentativeInfoByDivisionLevels where+    toJSON = toJSONText++-- | A list of office levels to filter by. Only offices that serve at least+-- one of these levels will be returned. Divisions that don\'t contain a+-- matching office will not be returned.+data RepresentativesRepresentativeInfoByAddressLevels+    = RRIBALADMINISTRATIVEAREA1+      -- ^ @administrativeArea1@+    | RRIBALADMINISTRATIVEAREA2+      -- ^ @administrativeArea2@+    | RRIBALCountry+      -- ^ @country@+    | RRIBALInternational+      -- ^ @international@+    | RRIBALLocality+      -- ^ @locality@+    | RRIBALRegional+      -- ^ @regional@+    | RRIBALSpecial+      -- ^ @special@+    | RRIBALSUBLOCALITY1+      -- ^ @subLocality1@+    | RRIBALSUBLOCALITY2+      -- ^ @subLocality2@+      deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)++instance Hashable RepresentativesRepresentativeInfoByAddressLevels++instance FromText RepresentativesRepresentativeInfoByAddressLevels where+    fromText = \case+        "administrativeArea1" -> Just RRIBALADMINISTRATIVEAREA1+        "administrativeArea2" -> Just RRIBALADMINISTRATIVEAREA2+        "country" -> Just RRIBALCountry+        "international" -> Just RRIBALInternational+        "locality" -> Just RRIBALLocality+        "regional" -> Just RRIBALRegional+        "special" -> Just RRIBALSpecial+        "subLocality1" -> Just RRIBALSUBLOCALITY1+        "subLocality2" -> Just RRIBALSUBLOCALITY2+        _ -> Nothing++instance ToText RepresentativesRepresentativeInfoByAddressLevels where+    toText = \case+        RRIBALADMINISTRATIVEAREA1 -> "administrativeArea1"+        RRIBALADMINISTRATIVEAREA2 -> "administrativeArea2"+        RRIBALCountry -> "country"+        RRIBALInternational -> "international"+        RRIBALLocality -> "locality"+        RRIBALRegional -> "regional"+        RRIBALSpecial -> "special"+        RRIBALSUBLOCALITY1 -> "subLocality1"+        RRIBALSUBLOCALITY2 -> "subLocality2"++instance FromJSON RepresentativesRepresentativeInfoByAddressLevels where+    parseJSON = parseJSONText "RepresentativesRepresentativeInfoByAddressLevels"++instance ToJSON RepresentativesRepresentativeInfoByAddressLevels where+    toJSON = toJSONText++-- | A list of office roles to filter by. Only offices fulfilling one of+-- these roles will be returned. Divisions that don\'t contain a matching+-- office will not be returned.+data RepresentativesRepresentativeInfoByDivisionRoles+    = DeputyHeadOfGovernment+      -- ^ @deputyHeadOfGovernment@+    | ExecutiveCouncil+      -- ^ @executiveCouncil@+    | GovernmentOfficer+      -- ^ @governmentOfficer@+    | HeadOfGovernment+      -- ^ @headOfGovernment@+    | HeadOfState+      -- ^ @headOfState@+    | HighestCourtJudge+      -- ^ @highestCourtJudge@+    | Judge+      -- ^ @judge@+    | LegislatorLowerBody+      -- ^ @legislatorLowerBody@+    | LegislatorUpperBody+      -- ^ @legislatorUpperBody@+    | SchoolBoard+      -- ^ @schoolBoard@+    | SpecialPurposeOfficer+      -- ^ @specialPurposeOfficer@+      deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)++instance Hashable RepresentativesRepresentativeInfoByDivisionRoles++instance FromText RepresentativesRepresentativeInfoByDivisionRoles where+    fromText = \case+        "deputyHeadOfGovernment" -> Just DeputyHeadOfGovernment+        "executiveCouncil" -> Just ExecutiveCouncil+        "governmentOfficer" -> Just GovernmentOfficer+        "headOfGovernment" -> Just HeadOfGovernment+        "headOfState" -> Just HeadOfState+        "highestCourtJudge" -> Just HighestCourtJudge+        "judge" -> Just Judge+        "legislatorLowerBody" -> Just LegislatorLowerBody+        "legislatorUpperBody" -> Just LegislatorUpperBody+        "schoolBoard" -> Just SchoolBoard+        "specialPurposeOfficer" -> Just SpecialPurposeOfficer+        _ -> Nothing++instance ToText RepresentativesRepresentativeInfoByDivisionRoles where+    toText = \case+        DeputyHeadOfGovernment -> "deputyHeadOfGovernment"+        ExecutiveCouncil -> "executiveCouncil"+        GovernmentOfficer -> "governmentOfficer"+        HeadOfGovernment -> "headOfGovernment"+        HeadOfState -> "headOfState"+        HighestCourtJudge -> "highestCourtJudge"+        Judge -> "judge"+        LegislatorLowerBody -> "legislatorLowerBody"+        LegislatorUpperBody -> "legislatorUpperBody"+        SchoolBoard -> "schoolBoard"+        SpecialPurposeOfficer -> "specialPurposeOfficer"++instance FromJSON RepresentativesRepresentativeInfoByDivisionRoles where+    parseJSON = parseJSONText "RepresentativesRepresentativeInfoByDivisionRoles"++instance ToJSON RepresentativesRepresentativeInfoByDivisionRoles where+    toJSON = toJSONText++-- | A list of office roles to filter by. Only offices fulfilling one of+-- these roles will be returned. Divisions that don\'t contain a matching+-- office will not be returned.+data RepresentativesRepresentativeInfoByAddressRoles+    = RRIBARDeputyHeadOfGovernment+      -- ^ @deputyHeadOfGovernment@+    | RRIBARExecutiveCouncil+      -- ^ @executiveCouncil@+    | RRIBARGovernmentOfficer+      -- ^ @governmentOfficer@+    | RRIBARHeadOfGovernment+      -- ^ @headOfGovernment@+    | RRIBARHeadOfState+      -- ^ @headOfState@+    | RRIBARHighestCourtJudge+      -- ^ @highestCourtJudge@+    | RRIBARJudge+      -- ^ @judge@+    | RRIBARLegislatorLowerBody+      -- ^ @legislatorLowerBody@+    | RRIBARLegislatorUpperBody+      -- ^ @legislatorUpperBody@+    | RRIBARSchoolBoard+      -- ^ @schoolBoard@+    | RRIBARSpecialPurposeOfficer+      -- ^ @specialPurposeOfficer@+      deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)++instance Hashable RepresentativesRepresentativeInfoByAddressRoles++instance FromText RepresentativesRepresentativeInfoByAddressRoles where+    fromText = \case+        "deputyHeadOfGovernment" -> Just RRIBARDeputyHeadOfGovernment+        "executiveCouncil" -> Just RRIBARExecutiveCouncil+        "governmentOfficer" -> Just RRIBARGovernmentOfficer+        "headOfGovernment" -> Just RRIBARHeadOfGovernment+        "headOfState" -> Just RRIBARHeadOfState+        "highestCourtJudge" -> Just RRIBARHighestCourtJudge+        "judge" -> Just RRIBARJudge+        "legislatorLowerBody" -> Just RRIBARLegislatorLowerBody+        "legislatorUpperBody" -> Just RRIBARLegislatorUpperBody+        "schoolBoard" -> Just RRIBARSchoolBoard+        "specialPurposeOfficer" -> Just RRIBARSpecialPurposeOfficer+        _ -> Nothing++instance ToText RepresentativesRepresentativeInfoByAddressRoles where+    toText = \case+        RRIBARDeputyHeadOfGovernment -> "deputyHeadOfGovernment"+        RRIBARExecutiveCouncil -> "executiveCouncil"+        RRIBARGovernmentOfficer -> "governmentOfficer"+        RRIBARHeadOfGovernment -> "headOfGovernment"+        RRIBARHeadOfState -> "headOfState"+        RRIBARHighestCourtJudge -> "highestCourtJudge"+        RRIBARJudge -> "judge"+        RRIBARLegislatorLowerBody -> "legislatorLowerBody"+        RRIBARLegislatorUpperBody -> "legislatorUpperBody"+        RRIBARSchoolBoard -> "schoolBoard"+        RRIBARSpecialPurposeOfficer -> "specialPurposeOfficer"++instance FromJSON RepresentativesRepresentativeInfoByAddressRoles where+    parseJSON = parseJSONText "RepresentativesRepresentativeInfoByAddressRoles"++instance ToJSON RepresentativesRepresentativeInfoByAddressRoles where+    toJSON = toJSONText
+ gen/Network/Google/Resource/CivicInfo/Divisions/Search.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.CivicInfo.Divisions.Search+-- 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)+--+-- Searches for political divisions by their natural name or OCD ID.+--+-- /See:/ <https://developers.google.com/civic-information Google Civic Information API Reference> for @civicinfo.divisions.search@.+module Network.Google.Resource.CivicInfo.Divisions.Search+    (+    -- * REST Resource+      DivisionsSearchResource++    -- * Creating a Request+    , divisionsSearch+    , DivisionsSearch++    -- * Request Lenses+    , dsQuery+    ) where++import           Network.Google.CivicInfo.Types+import           Network.Google.Prelude++-- | A resource alias for @civicinfo.divisions.search@ method which the+-- 'DivisionsSearch' request conforms to.+type DivisionsSearchResource =+     "civicinfo" :>+       "v2" :>+         "divisions" :>+           QueryParam "query" Text :>+             QueryParam "alt" AltJSON :>+               Get '[JSON] DivisionSearchResponse++-- | Searches for political divisions by their natural name or OCD ID.+--+-- /See:/ 'divisionsSearch' smart constructor.+newtype DivisionsSearch = DivisionsSearch+    { _dsQuery :: Maybe Text+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'DivisionsSearch' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'dsQuery'+divisionsSearch+    :: DivisionsSearch+divisionsSearch =+    DivisionsSearch+    { _dsQuery = Nothing+    }++-- | The search query. Queries can cover any parts of a OCD ID or a human+-- readable division name. All words given in the query are treated as+-- required patterns. In addition to that, most query operators of the+-- Apache Lucene library are supported. See+-- http:\/\/lucene.apache.org\/core\/2_9_4\/queryparsersyntax.html+dsQuery :: Lens' DivisionsSearch (Maybe Text)+dsQuery = lens _dsQuery (\ s a -> s{_dsQuery = a})++instance GoogleRequest DivisionsSearch where+        type Rs DivisionsSearch = DivisionSearchResponse+        requestClient DivisionsSearch{..}+          = go _dsQuery (Just AltJSON) civicInfoService+          where go+                  = buildClient+                      (Proxy :: Proxy DivisionsSearchResource)+                      mempty
+ gen/Network/Google/Resource/CivicInfo/Elections/ElectionQuery.hs view
@@ -0,0 +1,70 @@+{-# 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.CivicInfo.Elections.ElectionQuery+-- 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)+--+-- List of available elections to query.+--+-- /See:/ <https://developers.google.com/civic-information Google Civic Information API Reference> for @civicinfo.elections.electionQuery@.+module Network.Google.Resource.CivicInfo.Elections.ElectionQuery+    (+    -- * REST Resource+      ElectionsElectionQueryResource++    -- * Creating a Request+    , electionsElectionQuery+    , ElectionsElectionQuery++    ) where++import           Network.Google.CivicInfo.Types+import           Network.Google.Prelude++-- | A resource alias for @civicinfo.elections.electionQuery@ method which the+-- 'ElectionsElectionQuery' request conforms to.+type ElectionsElectionQueryResource =+     "civicinfo" :>+       "v2" :>+         "elections" :>+           QueryParam "alt" AltJSON :>+             Get '[JSON] ElectionsQueryResponse++-- | List of available elections to query.+--+-- /See:/ 'electionsElectionQuery' smart constructor.+data ElectionsElectionQuery =+    ElectionsElectionQuery+    deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'ElectionsElectionQuery' with the minimum fields required to make a request.+--+electionsElectionQuery+    :: ElectionsElectionQuery+electionsElectionQuery = ElectionsElectionQuery++instance GoogleRequest ElectionsElectionQuery where+        type Rs ElectionsElectionQuery =+             ElectionsQueryResponse+        requestClient ElectionsElectionQuery{}+          = go (Just AltJSON) civicInfoService+          where go+                  = buildClient+                      (Proxy :: Proxy ElectionsElectionQueryResource)+                      mempty
+ gen/Network/Google/Resource/CivicInfo/Elections/VoterInfoQuery.hs view
@@ -0,0 +1,116 @@+{-# 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.CivicInfo.Elections.VoterInfoQuery+-- 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)+--+-- Looks up information relevant to a voter based on the voter\'s+-- registered address.+--+-- /See:/ <https://developers.google.com/civic-information Google Civic Information API Reference> for @civicinfo.elections.voterInfoQuery@.+module Network.Google.Resource.CivicInfo.Elections.VoterInfoQuery+    (+    -- * REST Resource+      ElectionsVoterInfoQueryResource++    -- * Creating a Request+    , electionsVoterInfoQuery+    , ElectionsVoterInfoQuery++    -- * Request Lenses+    , eviqElectionId+    , eviqAddress+    , eviqOfficialOnly+    ) where++import           Network.Google.CivicInfo.Types+import           Network.Google.Prelude++-- | A resource alias for @civicinfo.elections.voterInfoQuery@ method which the+-- 'ElectionsVoterInfoQuery' request conforms to.+type ElectionsVoterInfoQueryResource =+     "civicinfo" :>+       "v2" :>+         "voterinfo" :>+           QueryParam "address" Text :>+             QueryParam "electionId" (Textual Int64) :>+               QueryParam "officialOnly" Bool :>+                 QueryParam "alt" AltJSON :>+                   Get '[JSON] VoterInfoResponse++-- | Looks up information relevant to a voter based on the voter\'s+-- registered address.+--+-- /See:/ 'electionsVoterInfoQuery' smart constructor.+data ElectionsVoterInfoQuery = ElectionsVoterInfoQuery+    { _eviqElectionId   :: !(Textual Int64)+    , _eviqAddress      :: !Text+    , _eviqOfficialOnly :: !Bool+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'ElectionsVoterInfoQuery' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'eviqElectionId'+--+-- * 'eviqAddress'+--+-- * 'eviqOfficialOnly'+electionsVoterInfoQuery+    :: Text -- ^ 'eviqAddress'+    -> ElectionsVoterInfoQuery+electionsVoterInfoQuery pEviqAddress_ =+    ElectionsVoterInfoQuery+    { _eviqElectionId = 0+    , _eviqAddress = pEviqAddress_+    , _eviqOfficialOnly = False+    }++-- | The unique ID of the election to look up. A list of election IDs can be+-- obtained at+-- https:\/\/www.googleapis.com\/civicinfo\/{version}\/elections+eviqElectionId :: Lens' ElectionsVoterInfoQuery Int64+eviqElectionId+  = lens _eviqElectionId+      (\ s a -> s{_eviqElectionId = a})+      . _Coerce++-- | The registered address of the voter to look up.+eviqAddress :: Lens' ElectionsVoterInfoQuery Text+eviqAddress+  = lens _eviqAddress (\ s a -> s{_eviqAddress = a})++-- | If set to true, only data from official state sources will be returned.+eviqOfficialOnly :: Lens' ElectionsVoterInfoQuery Bool+eviqOfficialOnly+  = lens _eviqOfficialOnly+      (\ s a -> s{_eviqOfficialOnly = a})++instance GoogleRequest ElectionsVoterInfoQuery where+        type Rs ElectionsVoterInfoQuery = VoterInfoResponse+        requestClient ElectionsVoterInfoQuery{..}+          = go (Just _eviqAddress) (Just _eviqElectionId)+              (Just _eviqOfficialOnly)+              (Just AltJSON)+              civicInfoService+          where go+                  = buildClient+                      (Proxy :: Proxy ElectionsVoterInfoQueryResource)+                      mempty
+ gen/Network/Google/Resource/CivicInfo/Representatives/RepresentativeInfoByAddress.hs view
@@ -0,0 +1,143 @@+{-# 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.CivicInfo.Representatives.RepresentativeInfoByAddress+-- 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)+--+-- Looks up political geography and representative information for a single+-- address.+--+-- /See:/ <https://developers.google.com/civic-information Google Civic Information API Reference> for @civicinfo.representatives.representativeInfoByAddress@.+module Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByAddress+    (+    -- * REST Resource+      RepresentativesRepresentativeInfoByAddressResource++    -- * Creating a Request+    , representativesRepresentativeInfoByAddress+    , RepresentativesRepresentativeInfoByAddress++    -- * Request Lenses+    , rribaRoles+    , rribaAddress+    , rribaIncludeOffices+    , rribaLevels+    ) where++import           Network.Google.CivicInfo.Types+import           Network.Google.Prelude++-- | A resource alias for @civicinfo.representatives.representativeInfoByAddress@ method which the+-- 'RepresentativesRepresentativeInfoByAddress' request conforms to.+type RepresentativesRepresentativeInfoByAddressResource+     =+     "civicinfo" :>+       "v2" :>+         "representatives" :>+           QueryParams "roles"+             RepresentativesRepresentativeInfoByAddressRoles+             :>+             QueryParam "address" Text :>+               QueryParam "includeOffices" Bool :>+                 QueryParams "levels"+                   RepresentativesRepresentativeInfoByAddressLevels+                   :>+                   QueryParam "alt" AltJSON :>+                     Get '[JSON] RepresentativeInfoResponse++-- | Looks up political geography and representative information for a single+-- address.+--+-- /See:/ 'representativesRepresentativeInfoByAddress' smart constructor.+data RepresentativesRepresentativeInfoByAddress = RepresentativesRepresentativeInfoByAddress+    { _rribaRoles          :: !(Maybe [RepresentativesRepresentativeInfoByAddressRoles])+    , _rribaAddress        :: !(Maybe Text)+    , _rribaIncludeOffices :: !Bool+    , _rribaLevels         :: !(Maybe [RepresentativesRepresentativeInfoByAddressLevels])+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'RepresentativesRepresentativeInfoByAddress' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'rribaRoles'+--+-- * 'rribaAddress'+--+-- * 'rribaIncludeOffices'+--+-- * 'rribaLevels'+representativesRepresentativeInfoByAddress+    :: RepresentativesRepresentativeInfoByAddress+representativesRepresentativeInfoByAddress =+    RepresentativesRepresentativeInfoByAddress+    { _rribaRoles = Nothing+    , _rribaAddress = Nothing+    , _rribaIncludeOffices = True+    , _rribaLevels = Nothing+    }++-- | A list of office roles to filter by. Only offices fulfilling one of+-- these roles will be returned. Divisions that don\'t contain a matching+-- office will not be returned.+rribaRoles :: Lens' RepresentativesRepresentativeInfoByAddress [RepresentativesRepresentativeInfoByAddressRoles]+rribaRoles+  = lens _rribaRoles (\ s a -> s{_rribaRoles = a}) .+      _Default+      . _Coerce++-- | The address to look up. May only be specified if the field ocdId is not+-- given in the URL.+rribaAddress :: Lens' RepresentativesRepresentativeInfoByAddress (Maybe Text)+rribaAddress+  = lens _rribaAddress (\ s a -> s{_rribaAddress = a})++-- | Whether to return information about offices and officials. If false,+-- only the top-level district information will be returned.+rribaIncludeOffices :: Lens' RepresentativesRepresentativeInfoByAddress Bool+rribaIncludeOffices+  = lens _rribaIncludeOffices+      (\ s a -> s{_rribaIncludeOffices = a})++-- | A list of office levels to filter by. Only offices that serve at least+-- one of these levels will be returned. Divisions that don\'t contain a+-- matching office will not be returned.+rribaLevels :: Lens' RepresentativesRepresentativeInfoByAddress [RepresentativesRepresentativeInfoByAddressLevels]+rribaLevels+  = lens _rribaLevels (\ s a -> s{_rribaLevels = a}) .+      _Default+      . _Coerce++instance GoogleRequest+         RepresentativesRepresentativeInfoByAddress where+        type Rs RepresentativesRepresentativeInfoByAddress =+             RepresentativeInfoResponse+        requestClient+          RepresentativesRepresentativeInfoByAddress{..}+          = go (_rribaRoles ^. _Default) _rribaAddress+              (Just _rribaIncludeOffices)+              (_rribaLevels ^. _Default)+              (Just AltJSON)+              civicInfoService+          where go+                  = buildClient+                      (Proxy ::+                         Proxy+                           RepresentativesRepresentativeInfoByAddressResource)+                      mempty
+ gen/Network/Google/Resource/CivicInfo/Representatives/RepresentativeInfoByDivision.hs view
@@ -0,0 +1,143 @@+{-# 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.CivicInfo.Representatives.RepresentativeInfoByDivision+-- 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)+--+-- Looks up representative information for a single geographic division.+--+-- /See:/ <https://developers.google.com/civic-information Google Civic Information API Reference> for @civicinfo.representatives.representativeInfoByDivision@.+module Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByDivision+    (+    -- * REST Resource+      RepresentativesRepresentativeInfoByDivisionResource++    -- * Creating a Request+    , representativesRepresentativeInfoByDivision+    , RepresentativesRepresentativeInfoByDivision++    -- * Request Lenses+    , rribdRoles+    , rribdRecursive+    , rribdOcdId+    , rribdLevels+    ) where++import           Network.Google.CivicInfo.Types+import           Network.Google.Prelude++-- | A resource alias for @civicinfo.representatives.representativeInfoByDivision@ method which the+-- 'RepresentativesRepresentativeInfoByDivision' request conforms to.+type RepresentativesRepresentativeInfoByDivisionResource+     =+     "civicinfo" :>+       "v2" :>+         "representatives" :>+           Capture "ocdId" Text :>+             QueryParams "roles"+               RepresentativesRepresentativeInfoByDivisionRoles+               :>+               QueryParam "recursive" Bool :>+                 QueryParams "levels"+                   RepresentativesRepresentativeInfoByDivisionLevels+                   :>+                   QueryParam "alt" AltJSON :>+                     Get '[JSON] RepresentativeInfoData++-- | Looks up representative information for a single geographic division.+--+-- /See:/ 'representativesRepresentativeInfoByDivision' smart constructor.+data RepresentativesRepresentativeInfoByDivision = RepresentativesRepresentativeInfoByDivision+    { _rribdRoles     :: !(Maybe [RepresentativesRepresentativeInfoByDivisionRoles])+    , _rribdRecursive :: !(Maybe Bool)+    , _rribdOcdId     :: !Text+    , _rribdLevels    :: !(Maybe [RepresentativesRepresentativeInfoByDivisionLevels])+    } deriving (Eq,Show,Data,Typeable,Generic)++-- | Creates a value of 'RepresentativesRepresentativeInfoByDivision' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'rribdRoles'+--+-- * 'rribdRecursive'+--+-- * 'rribdOcdId'+--+-- * 'rribdLevels'+representativesRepresentativeInfoByDivision+    :: Text -- ^ 'rribdOcdId'+    -> RepresentativesRepresentativeInfoByDivision+representativesRepresentativeInfoByDivision pRribdOcdId_ =+    RepresentativesRepresentativeInfoByDivision+    { _rribdRoles = Nothing+    , _rribdRecursive = Nothing+    , _rribdOcdId = pRribdOcdId_+    , _rribdLevels = Nothing+    }++-- | A list of office roles to filter by. Only offices fulfilling one of+-- these roles will be returned. Divisions that don\'t contain a matching+-- office will not be returned.+rribdRoles :: Lens' RepresentativesRepresentativeInfoByDivision [RepresentativesRepresentativeInfoByDivisionRoles]+rribdRoles+  = lens _rribdRoles (\ s a -> s{_rribdRoles = a}) .+      _Default+      . _Coerce++-- | If true, information about all divisions contained in the division+-- requested will be included as well. For example, if querying+-- ocd-division\/country:us\/district:dc, this would also return all DC\'s+-- wards and ANCs.+rribdRecursive :: Lens' RepresentativesRepresentativeInfoByDivision (Maybe Bool)+rribdRecursive+  = lens _rribdRecursive+      (\ s a -> s{_rribdRecursive = a})++-- | The Open Civic Data division identifier of the division to look up.+rribdOcdId :: Lens' RepresentativesRepresentativeInfoByDivision Text+rribdOcdId+  = lens _rribdOcdId (\ s a -> s{_rribdOcdId = a})++-- | A list of office levels to filter by. Only offices that serve at least+-- one of these levels will be returned. Divisions that don\'t contain a+-- matching office will not be returned.+rribdLevels :: Lens' RepresentativesRepresentativeInfoByDivision [RepresentativesRepresentativeInfoByDivisionLevels]+rribdLevels+  = lens _rribdLevels (\ s a -> s{_rribdLevels = a}) .+      _Default+      . _Coerce++instance GoogleRequest+         RepresentativesRepresentativeInfoByDivision where+        type Rs RepresentativesRepresentativeInfoByDivision =+             RepresentativeInfoData+        requestClient+          RepresentativesRepresentativeInfoByDivision{..}+          = go _rribdOcdId (_rribdRoles ^. _Default)+              _rribdRecursive+              (_rribdLevels ^. _Default)+              (Just AltJSON)+              civicInfoService+          where go+                  = buildClient+                      (Proxy ::+                         Proxy+                           RepresentativesRepresentativeInfoByDivisionResource)+                      mempty
+ gogol-civicinfo.cabal view
@@ -0,0 +1,50 @@+name:                  gogol-civicinfo+version:               0.0.1+synopsis:              Google Civic Information 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:+    An API for accessing civic information.+    .+    /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 @v2@+    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.CivicInfo+        , Network.Google.CivicInfo.Types+        , Network.Google.Resource.CivicInfo.Divisions.Search+        , Network.Google.Resource.CivicInfo.Elections.ElectionQuery+        , Network.Google.Resource.CivicInfo.Elections.VoterInfoQuery+        , Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByAddress+        , Network.Google.Resource.CivicInfo.Representatives.RepresentativeInfoByDivision++    other-modules:+          Network.Google.CivicInfo.Types.Product+        , Network.Google.CivicInfo.Types.Sum++    build-depends:+          gogol-core == 0.0.1.*+        , base       >= 4.7 && < 5