| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854 |
- unit googlecivicinfo;
- {
- **********************************************************************
- This file is part of the Free Component Library (FCL)
- Copyright (c) 2015 The free pascal team.
-
- See the file COPYING.FPC, included in this distribution,
- for details about the copyright.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- **********************************************************************
- }
- //Generated on: 16-5-15 08:53:00
- {$MODE objfpc}
- {$H+}
- interface
- uses sysutils, classes, googleservice, restbase, googlebase;
- type
-
- //Top-level schema types
- TAdministrationRegion = Class;
- TAdministrativeBody = Class;
- TCandidate = Class;
- TChannel = Class;
- TContest = Class;
- TDivisionSearchResponse = Class;
- TDivisionSearchResult = Class;
- TElection = Class;
- TElectionOfficial = Class;
- TElectionsQueryResponse = Class;
- TElectoralDistrict = Class;
- TGeographicDivision = Class;
- TOffice = Class;
- TOfficial = Class;
- TPollingLocation = Class;
- TRepresentativeInfoData = Class;
- TRepresentativeInfoResponse = Class;
- TSimpleAddressType = Class;
- TSource = Class;
- TVoterInfoResponse = Class;
- TAdministrationRegionArray = Array of TAdministrationRegion;
- TAdministrativeBodyArray = Array of TAdministrativeBody;
- TCandidateArray = Array of TCandidate;
- TChannelArray = Array of TChannel;
- TContestArray = Array of TContest;
- TDivisionSearchResponseArray = Array of TDivisionSearchResponse;
- TDivisionSearchResultArray = Array of TDivisionSearchResult;
- TElectionArray = Array of TElection;
- TElectionOfficialArray = Array of TElectionOfficial;
- TElectionsQueryResponseArray = Array of TElectionsQueryResponse;
- TElectoralDistrictArray = Array of TElectoralDistrict;
- TGeographicDivisionArray = Array of TGeographicDivision;
- TOfficeArray = Array of TOffice;
- TOfficialArray = Array of TOfficial;
- TPollingLocationArray = Array of TPollingLocation;
- TRepresentativeInfoDataArray = Array of TRepresentativeInfoData;
- TRepresentativeInfoResponseArray = Array of TRepresentativeInfoResponse;
- TSimpleAddressTypeArray = Array of TSimpleAddressType;
- TSourceArray = Array of TSource;
- TVoterInfoResponseArray = Array of TVoterInfoResponse;
- //Anonymous types, using auto-generated names
- TRepresentativeInfoDataTypedivisions = Class;
- TRepresentativeInfoResponseTypedivisions = Class;
- TAdministrationRegionTypesourcesArray = Array of TSource;
- TAdministrativeBodyTypeelectionOfficialsArray = Array of TElectionOfficial;
- TCandidateTypechannelsArray = Array of TChannel;
- TContestTypecandidatesArray = Array of TCandidate;
- TContestTypesourcesArray = Array of TSource;
- TDivisionSearchResponseTyperesultsArray = Array of TDivisionSearchResult;
- TElectionsQueryResponseTypeelectionsArray = Array of TElection;
- TOfficeTypesourcesArray = Array of TSource;
- TOfficialTypeaddressArray = Array of TSimpleAddressType;
- TOfficialTypechannelsArray = Array of TChannel;
- TPollingLocationTypesourcesArray = Array of TSource;
- TRepresentativeInfoDataTypeofficesArray = Array of TOffice;
- TRepresentativeInfoDataTypeofficialsArray = Array of TOfficial;
- TRepresentativeInfoResponseTypeofficesArray = Array of TOffice;
- TRepresentativeInfoResponseTypeofficialsArray = Array of TOfficial;
- TVoterInfoResponseTypecontestsArray = Array of TContest;
- TVoterInfoResponseTypedropOffLocationsArray = Array of TPollingLocation;
- TVoterInfoResponseTypeearlyVoteSitesArray = Array of TPollingLocation;
- TVoterInfoResponseTypeotherElectionsArray = Array of TElection;
- TVoterInfoResponseTypepollingLocationsArray = Array of TPollingLocation;
- TVoterInfoResponseTypestateArray = Array of TAdministrationRegion;
-
- { --------------------------------------------------------------------
- TAdministrationRegion
- --------------------------------------------------------------------}
-
- TAdministrationRegion = Class(TGoogleBaseObject)
- Private
- FelectionAdministrationBody : TAdministrativeBody;
- Fid : String;
- Flocal_jurisdiction : TAdministrationRegion;
- Fname : String;
- Fsources : TAdministrationRegionTypesourcesArray;
- Protected
- //Property setters
- Procedure SetelectionAdministrationBody(AIndex : Integer; AValue : TAdministrativeBody); virtual;
- Procedure Setid(AIndex : Integer; const AValue : String); virtual;
- Procedure Setlocal_jurisdiction(AIndex : Integer; AValue : TAdministrationRegion); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure Setsources(AIndex : Integer; AValue : TAdministrationRegionTypesourcesArray); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property electionAdministrationBody : TAdministrativeBody Index 0 Read FelectionAdministrationBody Write SetelectionAdministrationBody;
- Property id : String Index 8 Read Fid Write Setid;
- Property local_jurisdiction : TAdministrationRegion Index 16 Read Flocal_jurisdiction Write Setlocal_jurisdiction;
- Property name : String Index 24 Read Fname Write Setname;
- Property sources : TAdministrationRegionTypesourcesArray Index 32 Read Fsources Write Setsources;
- end;
- TAdministrationRegionClass = Class of TAdministrationRegion;
-
- { --------------------------------------------------------------------
- TAdministrativeBody
- --------------------------------------------------------------------}
-
- TAdministrativeBody = Class(TGoogleBaseObject)
- Private
- FabsenteeVotingInfoUrl : String;
- FballotInfoUrl : String;
- FcorrespondenceAddress : TSimpleAddressType;
- FelectionInfoUrl : String;
- FelectionOfficials : TAdministrativeBodyTypeelectionOfficialsArray;
- FelectionRegistrationConfirmationUrl : String;
- FelectionRegistrationUrl : String;
- FelectionRulesUrl : String;
- FhoursOfOperation : String;
- Fname : String;
- FphysicalAddress : TSimpleAddressType;
- Fvoter_services : TStringArray;
- FvotingLocationFinderUrl : String;
- Protected
- //Property setters
- Procedure SetabsenteeVotingInfoUrl(AIndex : Integer; const AValue : String); virtual;
- Procedure SetballotInfoUrl(AIndex : Integer; const AValue : String); virtual;
- Procedure SetcorrespondenceAddress(AIndex : Integer; AValue : TSimpleAddressType); virtual;
- Procedure SetelectionInfoUrl(AIndex : Integer; const AValue : String); virtual;
- Procedure SetelectionOfficials(AIndex : Integer; AValue : TAdministrativeBodyTypeelectionOfficialsArray); virtual;
- Procedure SetelectionRegistrationConfirmationUrl(AIndex : Integer; const AValue : String); virtual;
- Procedure SetelectionRegistrationUrl(AIndex : Integer; const AValue : String); virtual;
- Procedure SetelectionRulesUrl(AIndex : Integer; const AValue : String); virtual;
- Procedure SethoursOfOperation(AIndex : Integer; const AValue : String); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure SetphysicalAddress(AIndex : Integer; AValue : TSimpleAddressType); virtual;
- Procedure Setvoter_services(AIndex : Integer; AValue : TStringArray); virtual;
- Procedure SetvotingLocationFinderUrl(AIndex : Integer; const AValue : String); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property absenteeVotingInfoUrl : String Index 0 Read FabsenteeVotingInfoUrl Write SetabsenteeVotingInfoUrl;
- Property ballotInfoUrl : String Index 8 Read FballotInfoUrl Write SetballotInfoUrl;
- Property correspondenceAddress : TSimpleAddressType Index 16 Read FcorrespondenceAddress Write SetcorrespondenceAddress;
- Property electionInfoUrl : String Index 24 Read FelectionInfoUrl Write SetelectionInfoUrl;
- Property electionOfficials : TAdministrativeBodyTypeelectionOfficialsArray Index 32 Read FelectionOfficials Write SetelectionOfficials;
- Property electionRegistrationConfirmationUrl : String Index 40 Read FelectionRegistrationConfirmationUrl Write SetelectionRegistrationConfirmationUrl;
- Property electionRegistrationUrl : String Index 48 Read FelectionRegistrationUrl Write SetelectionRegistrationUrl;
- Property electionRulesUrl : String Index 56 Read FelectionRulesUrl Write SetelectionRulesUrl;
- Property hoursOfOperation : String Index 64 Read FhoursOfOperation Write SethoursOfOperation;
- Property name : String Index 72 Read Fname Write Setname;
- Property physicalAddress : TSimpleAddressType Index 80 Read FphysicalAddress Write SetphysicalAddress;
- Property voter_services : TStringArray Index 88 Read Fvoter_services Write Setvoter_services;
- Property votingLocationFinderUrl : String Index 96 Read FvotingLocationFinderUrl Write SetvotingLocationFinderUrl;
- end;
- TAdministrativeBodyClass = Class of TAdministrativeBody;
-
- { --------------------------------------------------------------------
- TCandidate
- --------------------------------------------------------------------}
-
- TCandidate = Class(TGoogleBaseObject)
- Private
- FcandidateUrl : String;
- Fchannels : TCandidateTypechannelsArray;
- Femail : String;
- Fname : String;
- ForderOnBallot : String;
- Fparty : String;
- Fphone : String;
- FphotoUrl : String;
- Protected
- //Property setters
- Procedure SetcandidateUrl(AIndex : Integer; const AValue : String); virtual;
- Procedure Setchannels(AIndex : Integer; AValue : TCandidateTypechannelsArray); virtual;
- Procedure Setemail(AIndex : Integer; const AValue : String); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure SetorderOnBallot(AIndex : Integer; const AValue : String); virtual;
- Procedure Setparty(AIndex : Integer; const AValue : String); virtual;
- Procedure Setphone(AIndex : Integer; const AValue : String); virtual;
- Procedure SetphotoUrl(AIndex : Integer; const AValue : String); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property candidateUrl : String Index 0 Read FcandidateUrl Write SetcandidateUrl;
- Property channels : TCandidateTypechannelsArray Index 8 Read Fchannels Write Setchannels;
- Property email : String Index 16 Read Femail Write Setemail;
- Property name : String Index 24 Read Fname Write Setname;
- Property orderOnBallot : String Index 32 Read ForderOnBallot Write SetorderOnBallot;
- Property party : String Index 40 Read Fparty Write Setparty;
- Property phone : String Index 48 Read Fphone Write Setphone;
- Property photoUrl : String Index 56 Read FphotoUrl Write SetphotoUrl;
- end;
- TCandidateClass = Class of TCandidate;
-
- { --------------------------------------------------------------------
- TChannel
- --------------------------------------------------------------------}
-
- TChannel = Class(TGoogleBaseObject)
- Private
- Fid : String;
- F_type : String;
- Protected
- Class Function ExportPropertyName(Const AName : String) : string; override;
- //Property setters
- Procedure Setid(AIndex : Integer; const AValue : String); virtual;
- Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
- Public
- Published
- Property id : String Index 0 Read Fid Write Setid;
- Property _type : String Index 8 Read F_type Write Set_type;
- end;
- TChannelClass = Class of TChannel;
-
- { --------------------------------------------------------------------
- TContest
- --------------------------------------------------------------------}
-
- TContest = Class(TGoogleBaseObject)
- Private
- FballotPlacement : String;
- Fcandidates : TContestTypecandidatesArray;
- Fdistrict : TElectoralDistrict;
- FelectorateSpecifications : String;
- Fid : String;
- Flevel : TStringArray;
- FnumberElected : String;
- FnumberVotingFor : String;
- Foffice : String;
- FprimaryParty : String;
- FreferendumSubtitle : String;
- FreferendumTitle : String;
- FreferendumUrl : String;
- Froles : TStringArray;
- Fsources : TContestTypesourcesArray;
- Fspecial : String;
- F_type : String;
- Protected
- Class Function ExportPropertyName(Const AName : String) : string; override;
- //Property setters
- Procedure SetballotPlacement(AIndex : Integer; const AValue : String); virtual;
- Procedure Setcandidates(AIndex : Integer; AValue : TContestTypecandidatesArray); virtual;
- Procedure Setdistrict(AIndex : Integer; AValue : TElectoralDistrict); virtual;
- Procedure SetelectorateSpecifications(AIndex : Integer; const AValue : String); virtual;
- Procedure Setid(AIndex : Integer; const AValue : String); virtual;
- Procedure Setlevel(AIndex : Integer; AValue : TStringArray); virtual;
- Procedure SetnumberElected(AIndex : Integer; const AValue : String); virtual;
- Procedure SetnumberVotingFor(AIndex : Integer; const AValue : String); virtual;
- Procedure Setoffice(AIndex : Integer; const AValue : String); virtual;
- Procedure SetprimaryParty(AIndex : Integer; const AValue : String); virtual;
- Procedure SetreferendumSubtitle(AIndex : Integer; const AValue : String); virtual;
- Procedure SetreferendumTitle(AIndex : Integer; const AValue : String); virtual;
- Procedure SetreferendumUrl(AIndex : Integer; const AValue : String); virtual;
- Procedure Setroles(AIndex : Integer; AValue : TStringArray); virtual;
- Procedure Setsources(AIndex : Integer; AValue : TContestTypesourcesArray); virtual;
- Procedure Setspecial(AIndex : Integer; const AValue : String); virtual;
- Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property ballotPlacement : String Index 0 Read FballotPlacement Write SetballotPlacement;
- Property candidates : TContestTypecandidatesArray Index 8 Read Fcandidates Write Setcandidates;
- Property district : TElectoralDistrict Index 16 Read Fdistrict Write Setdistrict;
- Property electorateSpecifications : String Index 24 Read FelectorateSpecifications Write SetelectorateSpecifications;
- Property id : String Index 32 Read Fid Write Setid;
- Property level : TStringArray Index 40 Read Flevel Write Setlevel;
- Property numberElected : String Index 48 Read FnumberElected Write SetnumberElected;
- Property numberVotingFor : String Index 56 Read FnumberVotingFor Write SetnumberVotingFor;
- Property office : String Index 64 Read Foffice Write Setoffice;
- Property primaryParty : String Index 72 Read FprimaryParty Write SetprimaryParty;
- Property referendumSubtitle : String Index 80 Read FreferendumSubtitle Write SetreferendumSubtitle;
- Property referendumTitle : String Index 88 Read FreferendumTitle Write SetreferendumTitle;
- Property referendumUrl : String Index 96 Read FreferendumUrl Write SetreferendumUrl;
- Property roles : TStringArray Index 104 Read Froles Write Setroles;
- Property sources : TContestTypesourcesArray Index 112 Read Fsources Write Setsources;
- Property special : String Index 120 Read Fspecial Write Setspecial;
- Property _type : String Index 128 Read F_type Write Set_type;
- end;
- TContestClass = Class of TContest;
-
- { --------------------------------------------------------------------
- TDivisionSearchResponse
- --------------------------------------------------------------------}
-
- TDivisionSearchResponse = Class(TGoogleBaseObject)
- Private
- Fkind : String;
- Fresults : TDivisionSearchResponseTyperesultsArray;
- Protected
- //Property setters
- Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
- Procedure Setresults(AIndex : Integer; AValue : TDivisionSearchResponseTyperesultsArray); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property kind : String Index 0 Read Fkind Write Setkind;
- Property results : TDivisionSearchResponseTyperesultsArray Index 8 Read Fresults Write Setresults;
- end;
- TDivisionSearchResponseClass = Class of TDivisionSearchResponse;
-
- { --------------------------------------------------------------------
- TDivisionSearchResult
- --------------------------------------------------------------------}
-
- TDivisionSearchResult = Class(TGoogleBaseObject)
- Private
- Faliases : TStringArray;
- Fname : String;
- FocdId : String;
- Protected
- //Property setters
- Procedure Setaliases(AIndex : Integer; AValue : TStringArray); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure SetocdId(AIndex : Integer; const AValue : String); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property aliases : TStringArray Index 0 Read Faliases Write Setaliases;
- Property name : String Index 8 Read Fname Write Setname;
- Property ocdId : String Index 16 Read FocdId Write SetocdId;
- end;
- TDivisionSearchResultClass = Class of TDivisionSearchResult;
-
- { --------------------------------------------------------------------
- TElection
- --------------------------------------------------------------------}
-
- TElection = Class(TGoogleBaseObject)
- Private
- FelectionDay : String;
- Fid : String;
- Fname : String;
- Protected
- //Property setters
- Procedure SetelectionDay(AIndex : Integer; const AValue : String); virtual;
- Procedure Setid(AIndex : Integer; const AValue : String); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Public
- Published
- Property electionDay : String Index 0 Read FelectionDay Write SetelectionDay;
- Property id : String Index 8 Read Fid Write Setid;
- Property name : String Index 16 Read Fname Write Setname;
- end;
- TElectionClass = Class of TElection;
-
- { --------------------------------------------------------------------
- TElectionOfficial
- --------------------------------------------------------------------}
-
- TElectionOfficial = Class(TGoogleBaseObject)
- Private
- FemailAddress : String;
- FfaxNumber : String;
- Fname : String;
- FofficePhoneNumber : String;
- Ftitle : String;
- Protected
- //Property setters
- Procedure SetemailAddress(AIndex : Integer; const AValue : String); virtual;
- Procedure SetfaxNumber(AIndex : Integer; const AValue : String); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure SetofficePhoneNumber(AIndex : Integer; const AValue : String); virtual;
- Procedure Settitle(AIndex : Integer; const AValue : String); virtual;
- Public
- Published
- Property emailAddress : String Index 0 Read FemailAddress Write SetemailAddress;
- Property faxNumber : String Index 8 Read FfaxNumber Write SetfaxNumber;
- Property name : String Index 16 Read Fname Write Setname;
- Property officePhoneNumber : String Index 24 Read FofficePhoneNumber Write SetofficePhoneNumber;
- Property title : String Index 32 Read Ftitle Write Settitle;
- end;
- TElectionOfficialClass = Class of TElectionOfficial;
-
- { --------------------------------------------------------------------
- TElectionsQueryResponse
- --------------------------------------------------------------------}
-
- TElectionsQueryResponse = Class(TGoogleBaseObject)
- Private
- Felections : TElectionsQueryResponseTypeelectionsArray;
- Fkind : String;
- Protected
- //Property setters
- Procedure Setelections(AIndex : Integer; AValue : TElectionsQueryResponseTypeelectionsArray); virtual;
- Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property elections : TElectionsQueryResponseTypeelectionsArray Index 0 Read Felections Write Setelections;
- Property kind : String Index 8 Read Fkind Write Setkind;
- end;
- TElectionsQueryResponseClass = Class of TElectionsQueryResponse;
-
- { --------------------------------------------------------------------
- TElectoralDistrict
- --------------------------------------------------------------------}
-
- TElectoralDistrict = Class(TGoogleBaseObject)
- Private
- Fid : String;
- Fname : String;
- Fscope : String;
- Protected
- //Property setters
- Procedure Setid(AIndex : Integer; const AValue : String); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure Setscope(AIndex : Integer; const AValue : String); virtual;
- Public
- Published
- Property id : String Index 0 Read Fid Write Setid;
- Property name : String Index 8 Read Fname Write Setname;
- Property scope : String Index 16 Read Fscope Write Setscope;
- end;
- TElectoralDistrictClass = Class of TElectoralDistrict;
-
- { --------------------------------------------------------------------
- TGeographicDivision
- --------------------------------------------------------------------}
-
- TGeographicDivision = Class(TGoogleBaseObject)
- Private
- FalsoKnownAs : TStringArray;
- Fname : String;
- FofficeIndices : TintegerArray;
- Protected
- //Property setters
- Procedure SetalsoKnownAs(AIndex : Integer; AValue : TStringArray); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure SetofficeIndices(AIndex : Integer; AValue : TintegerArray); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property alsoKnownAs : TStringArray Index 0 Read FalsoKnownAs Write SetalsoKnownAs;
- Property name : String Index 8 Read Fname Write Setname;
- Property officeIndices : TintegerArray Index 16 Read FofficeIndices Write SetofficeIndices;
- end;
- TGeographicDivisionClass = Class of TGeographicDivision;
-
- { --------------------------------------------------------------------
- TOffice
- --------------------------------------------------------------------}
-
- TOffice = Class(TGoogleBaseObject)
- Private
- FdivisionId : String;
- Flevels : TStringArray;
- Fname : String;
- FofficialIndices : TintegerArray;
- Froles : TStringArray;
- Fsources : TOfficeTypesourcesArray;
- Protected
- //Property setters
- Procedure SetdivisionId(AIndex : Integer; const AValue : String); virtual;
- Procedure Setlevels(AIndex : Integer; AValue : TStringArray); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure SetofficialIndices(AIndex : Integer; AValue : TintegerArray); virtual;
- Procedure Setroles(AIndex : Integer; AValue : TStringArray); virtual;
- Procedure Setsources(AIndex : Integer; AValue : TOfficeTypesourcesArray); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property divisionId : String Index 0 Read FdivisionId Write SetdivisionId;
- Property levels : TStringArray Index 8 Read Flevels Write Setlevels;
- Property name : String Index 16 Read Fname Write Setname;
- Property officialIndices : TintegerArray Index 24 Read FofficialIndices Write SetofficialIndices;
- Property roles : TStringArray Index 32 Read Froles Write Setroles;
- Property sources : TOfficeTypesourcesArray Index 40 Read Fsources Write Setsources;
- end;
- TOfficeClass = Class of TOffice;
-
- { --------------------------------------------------------------------
- TOfficial
- --------------------------------------------------------------------}
-
- TOfficial = Class(TGoogleBaseObject)
- Private
- Faddress : TOfficialTypeaddressArray;
- Fchannels : TOfficialTypechannelsArray;
- Femails : TStringArray;
- Fname : String;
- Fparty : String;
- Fphones : TStringArray;
- FphotoUrl : String;
- Furls : TStringArray;
- Protected
- //Property setters
- Procedure Setaddress(AIndex : Integer; AValue : TOfficialTypeaddressArray); virtual;
- Procedure Setchannels(AIndex : Integer; AValue : TOfficialTypechannelsArray); virtual;
- Procedure Setemails(AIndex : Integer; AValue : TStringArray); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure Setparty(AIndex : Integer; const AValue : String); virtual;
- Procedure Setphones(AIndex : Integer; AValue : TStringArray); virtual;
- Procedure SetphotoUrl(AIndex : Integer; const AValue : String); virtual;
- Procedure Seturls(AIndex : Integer; AValue : TStringArray); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property address : TOfficialTypeaddressArray Index 0 Read Faddress Write Setaddress;
- Property channels : TOfficialTypechannelsArray Index 8 Read Fchannels Write Setchannels;
- Property emails : TStringArray Index 16 Read Femails Write Setemails;
- Property name : String Index 24 Read Fname Write Setname;
- Property party : String Index 32 Read Fparty Write Setparty;
- Property phones : TStringArray Index 40 Read Fphones Write Setphones;
- Property photoUrl : String Index 48 Read FphotoUrl Write SetphotoUrl;
- Property urls : TStringArray Index 56 Read Furls Write Seturls;
- end;
- TOfficialClass = Class of TOfficial;
-
- { --------------------------------------------------------------------
- TPollingLocation
- --------------------------------------------------------------------}
-
- TPollingLocation = Class(TGoogleBaseObject)
- Private
- Faddress : TSimpleAddressType;
- FendDate : String;
- Fid : String;
- Fname : String;
- Fnotes : String;
- FpollingHours : String;
- Fsources : TPollingLocationTypesourcesArray;
- FstartDate : String;
- FvoterServices : String;
- Protected
- //Property setters
- Procedure Setaddress(AIndex : Integer; AValue : TSimpleAddressType); virtual;
- Procedure SetendDate(AIndex : Integer; const AValue : String); virtual;
- Procedure Setid(AIndex : Integer; const AValue : String); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure Setnotes(AIndex : Integer; const AValue : String); virtual;
- Procedure SetpollingHours(AIndex : Integer; const AValue : String); virtual;
- Procedure Setsources(AIndex : Integer; AValue : TPollingLocationTypesourcesArray); virtual;
- Procedure SetstartDate(AIndex : Integer; const AValue : String); virtual;
- Procedure SetvoterServices(AIndex : Integer; const AValue : String); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property address : TSimpleAddressType Index 0 Read Faddress Write Setaddress;
- Property endDate : String Index 8 Read FendDate Write SetendDate;
- Property id : String Index 16 Read Fid Write Setid;
- Property name : String Index 24 Read Fname Write Setname;
- Property notes : String Index 32 Read Fnotes Write Setnotes;
- Property pollingHours : String Index 40 Read FpollingHours Write SetpollingHours;
- Property sources : TPollingLocationTypesourcesArray Index 48 Read Fsources Write Setsources;
- Property startDate : String Index 56 Read FstartDate Write SetstartDate;
- Property voterServices : String Index 64 Read FvoterServices Write SetvoterServices;
- end;
- TPollingLocationClass = Class of TPollingLocation;
-
- { --------------------------------------------------------------------
- TRepresentativeInfoDataTypedivisions
- --------------------------------------------------------------------}
-
- TRepresentativeInfoDataTypedivisions = Class(TGoogleBaseObject)
- Private
- Protected
- //Property setters
- Public
- Class Function AllowAdditionalProperties : Boolean; override;
- Published
- end;
- TRepresentativeInfoDataTypedivisionsClass = Class of TRepresentativeInfoDataTypedivisions;
-
- { --------------------------------------------------------------------
- TRepresentativeInfoData
- --------------------------------------------------------------------}
-
- TRepresentativeInfoData = Class(TGoogleBaseObject)
- Private
- Fdivisions : TRepresentativeInfoDataTypedivisions;
- Foffices : TRepresentativeInfoDataTypeofficesArray;
- Fofficials : TRepresentativeInfoDataTypeofficialsArray;
- Protected
- //Property setters
- Procedure Setdivisions(AIndex : Integer; AValue : TRepresentativeInfoDataTypedivisions); virtual;
- Procedure Setoffices(AIndex : Integer; AValue : TRepresentativeInfoDataTypeofficesArray); virtual;
- Procedure Setofficials(AIndex : Integer; AValue : TRepresentativeInfoDataTypeofficialsArray); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property divisions : TRepresentativeInfoDataTypedivisions Index 0 Read Fdivisions Write Setdivisions;
- Property offices : TRepresentativeInfoDataTypeofficesArray Index 8 Read Foffices Write Setoffices;
- Property officials : TRepresentativeInfoDataTypeofficialsArray Index 16 Read Fofficials Write Setofficials;
- end;
- TRepresentativeInfoDataClass = Class of TRepresentativeInfoData;
-
- { --------------------------------------------------------------------
- TRepresentativeInfoResponseTypedivisions
- --------------------------------------------------------------------}
-
- TRepresentativeInfoResponseTypedivisions = Class(TGoogleBaseObject)
- Private
- Protected
- //Property setters
- Public
- Class Function AllowAdditionalProperties : Boolean; override;
- Published
- end;
- TRepresentativeInfoResponseTypedivisionsClass = Class of TRepresentativeInfoResponseTypedivisions;
-
- { --------------------------------------------------------------------
- TRepresentativeInfoResponse
- --------------------------------------------------------------------}
-
- TRepresentativeInfoResponse = Class(TGoogleBaseObject)
- Private
- Fdivisions : TRepresentativeInfoResponseTypedivisions;
- Fkind : String;
- FnormalizedInput : TSimpleAddressType;
- Foffices : TRepresentativeInfoResponseTypeofficesArray;
- Fofficials : TRepresentativeInfoResponseTypeofficialsArray;
- Protected
- //Property setters
- Procedure Setdivisions(AIndex : Integer; AValue : TRepresentativeInfoResponseTypedivisions); virtual;
- Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
- Procedure SetnormalizedInput(AIndex : Integer; AValue : TSimpleAddressType); virtual;
- Procedure Setoffices(AIndex : Integer; AValue : TRepresentativeInfoResponseTypeofficesArray); virtual;
- Procedure Setofficials(AIndex : Integer; AValue : TRepresentativeInfoResponseTypeofficialsArray); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property divisions : TRepresentativeInfoResponseTypedivisions Index 0 Read Fdivisions Write Setdivisions;
- Property kind : String Index 8 Read Fkind Write Setkind;
- Property normalizedInput : TSimpleAddressType Index 16 Read FnormalizedInput Write SetnormalizedInput;
- Property offices : TRepresentativeInfoResponseTypeofficesArray Index 24 Read Foffices Write Setoffices;
- Property officials : TRepresentativeInfoResponseTypeofficialsArray Index 32 Read Fofficials Write Setofficials;
- end;
- TRepresentativeInfoResponseClass = Class of TRepresentativeInfoResponse;
-
- { --------------------------------------------------------------------
- TSimpleAddressType
- --------------------------------------------------------------------}
-
- TSimpleAddressType = Class(TGoogleBaseObject)
- Private
- Fcity : String;
- Fline1 : String;
- Fline2 : String;
- Fline3 : String;
- FlocationName : String;
- Fstate : String;
- Fzip : String;
- Protected
- //Property setters
- Procedure Setcity(AIndex : Integer; const AValue : String); virtual;
- Procedure Setline1(AIndex : Integer; const AValue : String); virtual;
- Procedure Setline2(AIndex : Integer; const AValue : String); virtual;
- Procedure Setline3(AIndex : Integer; const AValue : String); virtual;
- Procedure SetlocationName(AIndex : Integer; const AValue : String); virtual;
- Procedure Setstate(AIndex : Integer; const AValue : String); virtual;
- Procedure Setzip(AIndex : Integer; const AValue : String); virtual;
- Public
- Published
- Property city : String Index 0 Read Fcity Write Setcity;
- Property line1 : String Index 8 Read Fline1 Write Setline1;
- Property line2 : String Index 16 Read Fline2 Write Setline2;
- Property line3 : String Index 24 Read Fline3 Write Setline3;
- Property locationName : String Index 32 Read FlocationName Write SetlocationName;
- Property state : String Index 40 Read Fstate Write Setstate;
- Property zip : String Index 48 Read Fzip Write Setzip;
- end;
- TSimpleAddressTypeClass = Class of TSimpleAddressType;
-
- { --------------------------------------------------------------------
- TSource
- --------------------------------------------------------------------}
-
- TSource = Class(TGoogleBaseObject)
- Private
- Fname : String;
- Fofficial : boolean;
- Protected
- //Property setters
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure Setofficial(AIndex : Integer; AValue : boolean); virtual;
- Public
- Published
- Property name : String Index 0 Read Fname Write Setname;
- Property official : boolean Index 8 Read Fofficial Write Setofficial;
- end;
- TSourceClass = Class of TSource;
-
- { --------------------------------------------------------------------
- TVoterInfoResponse
- --------------------------------------------------------------------}
-
- TVoterInfoResponse = Class(TGoogleBaseObject)
- Private
- Fcontests : TVoterInfoResponseTypecontestsArray;
- FdropOffLocations : TVoterInfoResponseTypedropOffLocationsArray;
- FearlyVoteSites : TVoterInfoResponseTypeearlyVoteSitesArray;
- Felection : TElection;
- Fkind : String;
- FnormalizedInput : TSimpleAddressType;
- FotherElections : TVoterInfoResponseTypeotherElectionsArray;
- FpollingLocations : TVoterInfoResponseTypepollingLocationsArray;
- FprecinctId : String;
- Fstate : TVoterInfoResponseTypestateArray;
- Protected
- //Property setters
- Procedure Setcontests(AIndex : Integer; AValue : TVoterInfoResponseTypecontestsArray); virtual;
- Procedure SetdropOffLocations(AIndex : Integer; AValue : TVoterInfoResponseTypedropOffLocationsArray); virtual;
- Procedure SetearlyVoteSites(AIndex : Integer; AValue : TVoterInfoResponseTypeearlyVoteSitesArray); virtual;
- Procedure Setelection(AIndex : Integer; AValue : TElection); virtual;
- Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
- Procedure SetnormalizedInput(AIndex : Integer; AValue : TSimpleAddressType); virtual;
- Procedure SetotherElections(AIndex : Integer; AValue : TVoterInfoResponseTypeotherElectionsArray); virtual;
- Procedure SetpollingLocations(AIndex : Integer; AValue : TVoterInfoResponseTypepollingLocationsArray); virtual;
- Procedure SetprecinctId(AIndex : Integer; const AValue : String); virtual;
- Procedure Setstate(AIndex : Integer; AValue : TVoterInfoResponseTypestateArray); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property contests : TVoterInfoResponseTypecontestsArray Index 0 Read Fcontests Write Setcontests;
- Property dropOffLocations : TVoterInfoResponseTypedropOffLocationsArray Index 8 Read FdropOffLocations Write SetdropOffLocations;
- Property earlyVoteSites : TVoterInfoResponseTypeearlyVoteSitesArray Index 16 Read FearlyVoteSites Write SetearlyVoteSites;
- Property election : TElection Index 24 Read Felection Write Setelection;
- Property kind : String Index 32 Read Fkind Write Setkind;
- Property normalizedInput : TSimpleAddressType Index 40 Read FnormalizedInput Write SetnormalizedInput;
- Property otherElections : TVoterInfoResponseTypeotherElectionsArray Index 48 Read FotherElections Write SetotherElections;
- Property pollingLocations : TVoterInfoResponseTypepollingLocationsArray Index 56 Read FpollingLocations Write SetpollingLocations;
- Property precinctId : String Index 64 Read FprecinctId Write SetprecinctId;
- Property state : TVoterInfoResponseTypestateArray Index 72 Read Fstate Write Setstate;
- end;
- TVoterInfoResponseClass = Class of TVoterInfoResponse;
-
- { --------------------------------------------------------------------
- TDivisionsResource
- --------------------------------------------------------------------}
-
-
- //Optional query Options for TDivisionsResource, method Search
-
- TDivisionsSearchOptions = Record
- query : String;
- end;
-
- TDivisionsResource = Class(TGoogleResource)
- Public
- Class Function ResourceName : String; override;
- Class Function DefaultAPI : TGoogleAPIClass; override;
- Function Search(AQuery : string = '') : TDivisionSearchResponse;
- Function Search(AQuery : TDivisionssearchOptions) : TDivisionSearchResponse;
- end;
-
-
- { --------------------------------------------------------------------
- TElectionsResource
- --------------------------------------------------------------------}
-
-
- //Optional query Options for TElectionsResource, method VoterInfoQuery
-
- TElectionsVoterInfoQueryOptions = Record
- address : String;
- electionId : int64;
- officialOnly : boolean;
- end;
-
- TElectionsResource = Class(TGoogleResource)
- Public
- Class Function ResourceName : String; override;
- Class Function DefaultAPI : TGoogleAPIClass; override;
- Function ElectionQuery : TElectionsQueryResponse;
- Function VoterInfoQuery(AQuery : string = '') : TVoterInfoResponse;
- Function VoterInfoQuery(AQuery : TElectionsvoterInfoQueryOptions) : TVoterInfoResponse;
- end;
-
-
- { --------------------------------------------------------------------
- TRepresentativesResource
- --------------------------------------------------------------------}
-
-
- //Optional query Options for TRepresentativesResource, method RepresentativeInfoByAddress
-
- TRepresentativesRepresentativeInfoByAddressOptions = Record
- address : String;
- includeOffices : boolean;
- levels : String;
- roles : String;
- end;
-
-
- //Optional query Options for TRepresentativesResource, method RepresentativeInfoByDivision
-
- TRepresentativesRepresentativeInfoByDivisionOptions = Record
- levels : String;
- recursive : boolean;
- roles : String;
- end;
-
- TRepresentativesResource = Class(TGoogleResource)
- Public
- Class Function ResourceName : String; override;
- Class Function DefaultAPI : TGoogleAPIClass; override;
- Function RepresentativeInfoByAddress(AQuery : string = '') : TRepresentativeInfoResponse;
- Function RepresentativeInfoByAddress(AQuery : TRepresentativesrepresentativeInfoByAddressOptions) : TRepresentativeInfoResponse;
- Function RepresentativeInfoByDivision(ocdId: string; AQuery : string = '') : TRepresentativeInfoData;
- Function RepresentativeInfoByDivision(ocdId: string; AQuery : TRepresentativesrepresentativeInfoByDivisionOptions) : TRepresentativeInfoData;
- end;
-
-
- { --------------------------------------------------------------------
- TCivicinfoAPI
- --------------------------------------------------------------------}
-
- TCivicinfoAPI = Class(TGoogleAPI)
- Private
- FDivisionsInstance : TDivisionsResource;
- FElectionsInstance : TElectionsResource;
- FRepresentativesInstance : TRepresentativesResource;
- Function GetDivisionsInstance : TDivisionsResource;virtual;
- Function GetElectionsInstance : TElectionsResource;virtual;
- Function GetRepresentativesInstance : TRepresentativesResource;virtual;
- Public
- //Override class functions with API info
- Class Function APIName : String; override;
- Class Function APIVersion : String; override;
- Class Function APIRevision : String; override;
- Class Function APIID : String; override;
- Class Function APITitle : String; override;
- Class Function APIDescription : String; override;
- Class Function APIOwnerDomain : String; override;
- Class Function APIOwnerName : String; override;
- Class Function APIIcon16 : String; override;
- Class Function APIIcon32 : String; override;
- Class Function APIdocumentationLink : String; override;
- Class Function APIrootUrl : string; override;
- Class Function APIbasePath : string;override;
- Class Function APIbaseURL : String;override;
- Class Function APIProtocol : string;override;
- Class Function APIservicePath : string;override;
- Class Function APIbatchPath : String;override;
- Class Function APIAuthScopes : TScopeInfoArray;override;
- Class Function APINeedsAuth : Boolean;override;
- Class Procedure RegisterAPIResources; override;
- //Add create function for resources
- Function CreateDivisionsResource(AOwner : TComponent) : TDivisionsResource;virtual;overload;
- Function CreateDivisionsResource : TDivisionsResource;virtual;overload;
- Function CreateElectionsResource(AOwner : TComponent) : TElectionsResource;virtual;overload;
- Function CreateElectionsResource : TElectionsResource;virtual;overload;
- Function CreateRepresentativesResource(AOwner : TComponent) : TRepresentativesResource;virtual;overload;
- Function CreateRepresentativesResource : TRepresentativesResource;virtual;overload;
- //Add default on-demand instances for resources
- Property DivisionsResource : TDivisionsResource Read GetDivisionsInstance;
- Property ElectionsResource : TElectionsResource Read GetElectionsInstance;
- Property RepresentativesResource : TRepresentativesResource Read GetRepresentativesInstance;
- end;
- implementation
- { --------------------------------------------------------------------
- TAdministrationRegion
- --------------------------------------------------------------------}
- Procedure TAdministrationRegion.SetelectionAdministrationBody(AIndex : Integer; AValue : TAdministrativeBody);
- begin
- If (FelectionAdministrationBody=AValue) then exit;
- FelectionAdministrationBody:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrationRegion.Setid(AIndex : Integer; const AValue : String);
- begin
- If (Fid=AValue) then exit;
- Fid:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrationRegion.Setlocal_jurisdiction(AIndex : Integer; AValue : TAdministrationRegion);
- begin
- If (Flocal_jurisdiction=AValue) then exit;
- Flocal_jurisdiction:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrationRegion.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrationRegion.Setsources(AIndex : Integer; AValue : TAdministrationRegionTypesourcesArray);
- begin
- If (Fsources=AValue) then exit;
- Fsources:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TAdministrationRegion.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'sources' : SetLength(Fsources,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TAdministrativeBody
- --------------------------------------------------------------------}
- Procedure TAdministrativeBody.SetabsenteeVotingInfoUrl(AIndex : Integer; const AValue : String);
- begin
- If (FabsenteeVotingInfoUrl=AValue) then exit;
- FabsenteeVotingInfoUrl:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrativeBody.SetballotInfoUrl(AIndex : Integer; const AValue : String);
- begin
- If (FballotInfoUrl=AValue) then exit;
- FballotInfoUrl:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrativeBody.SetcorrespondenceAddress(AIndex : Integer; AValue : TSimpleAddressType);
- begin
- If (FcorrespondenceAddress=AValue) then exit;
- FcorrespondenceAddress:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrativeBody.SetelectionInfoUrl(AIndex : Integer; const AValue : String);
- begin
- If (FelectionInfoUrl=AValue) then exit;
- FelectionInfoUrl:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrativeBody.SetelectionOfficials(AIndex : Integer; AValue : TAdministrativeBodyTypeelectionOfficialsArray);
- begin
- If (FelectionOfficials=AValue) then exit;
- FelectionOfficials:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrativeBody.SetelectionRegistrationConfirmationUrl(AIndex : Integer; const AValue : String);
- begin
- If (FelectionRegistrationConfirmationUrl=AValue) then exit;
- FelectionRegistrationConfirmationUrl:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrativeBody.SetelectionRegistrationUrl(AIndex : Integer; const AValue : String);
- begin
- If (FelectionRegistrationUrl=AValue) then exit;
- FelectionRegistrationUrl:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrativeBody.SetelectionRulesUrl(AIndex : Integer; const AValue : String);
- begin
- If (FelectionRulesUrl=AValue) then exit;
- FelectionRulesUrl:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrativeBody.SethoursOfOperation(AIndex : Integer; const AValue : String);
- begin
- If (FhoursOfOperation=AValue) then exit;
- FhoursOfOperation:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrativeBody.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrativeBody.SetphysicalAddress(AIndex : Integer; AValue : TSimpleAddressType);
- begin
- If (FphysicalAddress=AValue) then exit;
- FphysicalAddress:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrativeBody.Setvoter_services(AIndex : Integer; AValue : TStringArray);
- begin
- If (Fvoter_services=AValue) then exit;
- Fvoter_services:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrativeBody.SetvotingLocationFinderUrl(AIndex : Integer; const AValue : String);
- begin
- If (FvotingLocationFinderUrl=AValue) then exit;
- FvotingLocationFinderUrl:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TAdministrativeBody.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'electionofficials' : SetLength(FelectionOfficials,ALength);
- 'voter_services' : SetLength(Fvoter_services,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TCandidate
- --------------------------------------------------------------------}
- Procedure TCandidate.SetcandidateUrl(AIndex : Integer; const AValue : String);
- begin
- If (FcandidateUrl=AValue) then exit;
- FcandidateUrl:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TCandidate.Setchannels(AIndex : Integer; AValue : TCandidateTypechannelsArray);
- begin
- If (Fchannels=AValue) then exit;
- Fchannels:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TCandidate.Setemail(AIndex : Integer; const AValue : String);
- begin
- If (Femail=AValue) then exit;
- Femail:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TCandidate.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TCandidate.SetorderOnBallot(AIndex : Integer; const AValue : String);
- begin
- If (ForderOnBallot=AValue) then exit;
- ForderOnBallot:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TCandidate.Setparty(AIndex : Integer; const AValue : String);
- begin
- If (Fparty=AValue) then exit;
- Fparty:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TCandidate.Setphone(AIndex : Integer; const AValue : String);
- begin
- If (Fphone=AValue) then exit;
- Fphone:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TCandidate.SetphotoUrl(AIndex : Integer; const AValue : String);
- begin
- If (FphotoUrl=AValue) then exit;
- FphotoUrl:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TCandidate.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'channels' : SetLength(Fchannels,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TChannel
- --------------------------------------------------------------------}
- Procedure TChannel.Setid(AIndex : Integer; const AValue : String);
- begin
- If (Fid=AValue) then exit;
- Fid:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TChannel.Set_type(AIndex : Integer; const AValue : String);
- begin
- If (F_type=AValue) then exit;
- F_type:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Class Function TChannel.ExportPropertyName(Const AName : String) :String;
- begin
- Case AName of
- '_type' : Result:='type';
- else
- Result:=Inherited ExportPropertyName(AName);
- end;
- end;
- { --------------------------------------------------------------------
- TContest
- --------------------------------------------------------------------}
- Procedure TContest.SetballotPlacement(AIndex : Integer; const AValue : String);
- begin
- If (FballotPlacement=AValue) then exit;
- FballotPlacement:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.Setcandidates(AIndex : Integer; AValue : TContestTypecandidatesArray);
- begin
- If (Fcandidates=AValue) then exit;
- Fcandidates:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.Setdistrict(AIndex : Integer; AValue : TElectoralDistrict);
- begin
- If (Fdistrict=AValue) then exit;
- Fdistrict:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.SetelectorateSpecifications(AIndex : Integer; const AValue : String);
- begin
- If (FelectorateSpecifications=AValue) then exit;
- FelectorateSpecifications:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.Setid(AIndex : Integer; const AValue : String);
- begin
- If (Fid=AValue) then exit;
- Fid:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.Setlevel(AIndex : Integer; AValue : TStringArray);
- begin
- If (Flevel=AValue) then exit;
- Flevel:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.SetnumberElected(AIndex : Integer; const AValue : String);
- begin
- If (FnumberElected=AValue) then exit;
- FnumberElected:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.SetnumberVotingFor(AIndex : Integer; const AValue : String);
- begin
- If (FnumberVotingFor=AValue) then exit;
- FnumberVotingFor:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.Setoffice(AIndex : Integer; const AValue : String);
- begin
- If (Foffice=AValue) then exit;
- Foffice:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.SetprimaryParty(AIndex : Integer; const AValue : String);
- begin
- If (FprimaryParty=AValue) then exit;
- FprimaryParty:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.SetreferendumSubtitle(AIndex : Integer; const AValue : String);
- begin
- If (FreferendumSubtitle=AValue) then exit;
- FreferendumSubtitle:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.SetreferendumTitle(AIndex : Integer; const AValue : String);
- begin
- If (FreferendumTitle=AValue) then exit;
- FreferendumTitle:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.SetreferendumUrl(AIndex : Integer; const AValue : String);
- begin
- If (FreferendumUrl=AValue) then exit;
- FreferendumUrl:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.Setroles(AIndex : Integer; AValue : TStringArray);
- begin
- If (Froles=AValue) then exit;
- Froles:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.Setsources(AIndex : Integer; AValue : TContestTypesourcesArray);
- begin
- If (Fsources=AValue) then exit;
- Fsources:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.Setspecial(AIndex : Integer; const AValue : String);
- begin
- If (Fspecial=AValue) then exit;
- Fspecial:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.Set_type(AIndex : Integer; const AValue : String);
- begin
- If (F_type=AValue) then exit;
- F_type:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Class Function TContest.ExportPropertyName(Const AName : String) :String;
- begin
- Case AName of
- '_type' : Result:='type';
- else
- Result:=Inherited ExportPropertyName(AName);
- end;
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TContest.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'candidates' : SetLength(Fcandidates,ALength);
- 'level' : SetLength(Flevel,ALength);
- 'roles' : SetLength(Froles,ALength);
- 'sources' : SetLength(Fsources,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TDivisionSearchResponse
- --------------------------------------------------------------------}
- Procedure TDivisionSearchResponse.Setkind(AIndex : Integer; const AValue : String);
- begin
- If (Fkind=AValue) then exit;
- Fkind:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TDivisionSearchResponse.Setresults(AIndex : Integer; AValue : TDivisionSearchResponseTyperesultsArray);
- begin
- If (Fresults=AValue) then exit;
- Fresults:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TDivisionSearchResponse.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'results' : SetLength(Fresults,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TDivisionSearchResult
- --------------------------------------------------------------------}
- Procedure TDivisionSearchResult.Setaliases(AIndex : Integer; AValue : TStringArray);
- begin
- If (Faliases=AValue) then exit;
- Faliases:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TDivisionSearchResult.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TDivisionSearchResult.SetocdId(AIndex : Integer; const AValue : String);
- begin
- If (FocdId=AValue) then exit;
- FocdId:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TDivisionSearchResult.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'aliases' : SetLength(Faliases,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TElection
- --------------------------------------------------------------------}
- Procedure TElection.SetelectionDay(AIndex : Integer; const AValue : String);
- begin
- If (FelectionDay=AValue) then exit;
- FelectionDay:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TElection.Setid(AIndex : Integer; const AValue : String);
- begin
- If (Fid=AValue) then exit;
- Fid:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TElection.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TElectionOfficial
- --------------------------------------------------------------------}
- Procedure TElectionOfficial.SetemailAddress(AIndex : Integer; const AValue : String);
- begin
- If (FemailAddress=AValue) then exit;
- FemailAddress:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TElectionOfficial.SetfaxNumber(AIndex : Integer; const AValue : String);
- begin
- If (FfaxNumber=AValue) then exit;
- FfaxNumber:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TElectionOfficial.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TElectionOfficial.SetofficePhoneNumber(AIndex : Integer; const AValue : String);
- begin
- If (FofficePhoneNumber=AValue) then exit;
- FofficePhoneNumber:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TElectionOfficial.Settitle(AIndex : Integer; const AValue : String);
- begin
- If (Ftitle=AValue) then exit;
- Ftitle:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TElectionsQueryResponse
- --------------------------------------------------------------------}
- Procedure TElectionsQueryResponse.Setelections(AIndex : Integer; AValue : TElectionsQueryResponseTypeelectionsArray);
- begin
- If (Felections=AValue) then exit;
- Felections:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TElectionsQueryResponse.Setkind(AIndex : Integer; const AValue : String);
- begin
- If (Fkind=AValue) then exit;
- Fkind:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TElectionsQueryResponse.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'elections' : SetLength(Felections,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TElectoralDistrict
- --------------------------------------------------------------------}
- Procedure TElectoralDistrict.Setid(AIndex : Integer; const AValue : String);
- begin
- If (Fid=AValue) then exit;
- Fid:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TElectoralDistrict.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TElectoralDistrict.Setscope(AIndex : Integer; const AValue : String);
- begin
- If (Fscope=AValue) then exit;
- Fscope:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TGeographicDivision
- --------------------------------------------------------------------}
- Procedure TGeographicDivision.SetalsoKnownAs(AIndex : Integer; AValue : TStringArray);
- begin
- If (FalsoKnownAs=AValue) then exit;
- FalsoKnownAs:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGeographicDivision.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGeographicDivision.SetofficeIndices(AIndex : Integer; AValue : TintegerArray);
- begin
- If (FofficeIndices=AValue) then exit;
- FofficeIndices:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TGeographicDivision.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'alsoknownas' : SetLength(FalsoKnownAs,ALength);
- 'officeindices' : SetLength(FofficeIndices,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TOffice
- --------------------------------------------------------------------}
- Procedure TOffice.SetdivisionId(AIndex : Integer; const AValue : String);
- begin
- If (FdivisionId=AValue) then exit;
- FdivisionId:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TOffice.Setlevels(AIndex : Integer; AValue : TStringArray);
- begin
- If (Flevels=AValue) then exit;
- Flevels:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TOffice.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TOffice.SetofficialIndices(AIndex : Integer; AValue : TintegerArray);
- begin
- If (FofficialIndices=AValue) then exit;
- FofficialIndices:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TOffice.Setroles(AIndex : Integer; AValue : TStringArray);
- begin
- If (Froles=AValue) then exit;
- Froles:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TOffice.Setsources(AIndex : Integer; AValue : TOfficeTypesourcesArray);
- begin
- If (Fsources=AValue) then exit;
- Fsources:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TOffice.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'levels' : SetLength(Flevels,ALength);
- 'officialindices' : SetLength(FofficialIndices,ALength);
- 'roles' : SetLength(Froles,ALength);
- 'sources' : SetLength(Fsources,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TOfficial
- --------------------------------------------------------------------}
- Procedure TOfficial.Setaddress(AIndex : Integer; AValue : TOfficialTypeaddressArray);
- begin
- If (Faddress=AValue) then exit;
- Faddress:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TOfficial.Setchannels(AIndex : Integer; AValue : TOfficialTypechannelsArray);
- begin
- If (Fchannels=AValue) then exit;
- Fchannels:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TOfficial.Setemails(AIndex : Integer; AValue : TStringArray);
- begin
- If (Femails=AValue) then exit;
- Femails:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TOfficial.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TOfficial.Setparty(AIndex : Integer; const AValue : String);
- begin
- If (Fparty=AValue) then exit;
- Fparty:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TOfficial.Setphones(AIndex : Integer; AValue : TStringArray);
- begin
- If (Fphones=AValue) then exit;
- Fphones:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TOfficial.SetphotoUrl(AIndex : Integer; const AValue : String);
- begin
- If (FphotoUrl=AValue) then exit;
- FphotoUrl:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TOfficial.Seturls(AIndex : Integer; AValue : TStringArray);
- begin
- If (Furls=AValue) then exit;
- Furls:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TOfficial.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'address' : SetLength(Faddress,ALength);
- 'channels' : SetLength(Fchannels,ALength);
- 'emails' : SetLength(Femails,ALength);
- 'phones' : SetLength(Fphones,ALength);
- 'urls' : SetLength(Furls,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TPollingLocation
- --------------------------------------------------------------------}
- Procedure TPollingLocation.Setaddress(AIndex : Integer; AValue : TSimpleAddressType);
- begin
- If (Faddress=AValue) then exit;
- Faddress:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TPollingLocation.SetendDate(AIndex : Integer; const AValue : String);
- begin
- If (FendDate=AValue) then exit;
- FendDate:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TPollingLocation.Setid(AIndex : Integer; const AValue : String);
- begin
- If (Fid=AValue) then exit;
- Fid:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TPollingLocation.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TPollingLocation.Setnotes(AIndex : Integer; const AValue : String);
- begin
- If (Fnotes=AValue) then exit;
- Fnotes:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TPollingLocation.SetpollingHours(AIndex : Integer; const AValue : String);
- begin
- If (FpollingHours=AValue) then exit;
- FpollingHours:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TPollingLocation.Setsources(AIndex : Integer; AValue : TPollingLocationTypesourcesArray);
- begin
- If (Fsources=AValue) then exit;
- Fsources:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TPollingLocation.SetstartDate(AIndex : Integer; const AValue : String);
- begin
- If (FstartDate=AValue) then exit;
- FstartDate:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TPollingLocation.SetvoterServices(AIndex : Integer; const AValue : String);
- begin
- If (FvoterServices=AValue) then exit;
- FvoterServices:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TPollingLocation.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'sources' : SetLength(Fsources,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TRepresentativeInfoDataTypedivisions
- --------------------------------------------------------------------}
- Class Function TRepresentativeInfoDataTypedivisions.AllowAdditionalProperties : Boolean;
- begin
- Result:=True;
- end;
- { --------------------------------------------------------------------
- TRepresentativeInfoData
- --------------------------------------------------------------------}
- Procedure TRepresentativeInfoData.Setdivisions(AIndex : Integer; AValue : TRepresentativeInfoDataTypedivisions);
- begin
- If (Fdivisions=AValue) then exit;
- Fdivisions:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TRepresentativeInfoData.Setoffices(AIndex : Integer; AValue : TRepresentativeInfoDataTypeofficesArray);
- begin
- If (Foffices=AValue) then exit;
- Foffices:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TRepresentativeInfoData.Setofficials(AIndex : Integer; AValue : TRepresentativeInfoDataTypeofficialsArray);
- begin
- If (Fofficials=AValue) then exit;
- Fofficials:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TRepresentativeInfoData.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'offices' : SetLength(Foffices,ALength);
- 'officials' : SetLength(Fofficials,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TRepresentativeInfoResponseTypedivisions
- --------------------------------------------------------------------}
- Class Function TRepresentativeInfoResponseTypedivisions.AllowAdditionalProperties : Boolean;
- begin
- Result:=True;
- end;
- { --------------------------------------------------------------------
- TRepresentativeInfoResponse
- --------------------------------------------------------------------}
- Procedure TRepresentativeInfoResponse.Setdivisions(AIndex : Integer; AValue : TRepresentativeInfoResponseTypedivisions);
- begin
- If (Fdivisions=AValue) then exit;
- Fdivisions:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TRepresentativeInfoResponse.Setkind(AIndex : Integer; const AValue : String);
- begin
- If (Fkind=AValue) then exit;
- Fkind:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TRepresentativeInfoResponse.SetnormalizedInput(AIndex : Integer; AValue : TSimpleAddressType);
- begin
- If (FnormalizedInput=AValue) then exit;
- FnormalizedInput:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TRepresentativeInfoResponse.Setoffices(AIndex : Integer; AValue : TRepresentativeInfoResponseTypeofficesArray);
- begin
- If (Foffices=AValue) then exit;
- Foffices:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TRepresentativeInfoResponse.Setofficials(AIndex : Integer; AValue : TRepresentativeInfoResponseTypeofficialsArray);
- begin
- If (Fofficials=AValue) then exit;
- Fofficials:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TRepresentativeInfoResponse.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'offices' : SetLength(Foffices,ALength);
- 'officials' : SetLength(Fofficials,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TSimpleAddressType
- --------------------------------------------------------------------}
- Procedure TSimpleAddressType.Setcity(AIndex : Integer; const AValue : String);
- begin
- If (Fcity=AValue) then exit;
- Fcity:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TSimpleAddressType.Setline1(AIndex : Integer; const AValue : String);
- begin
- If (Fline1=AValue) then exit;
- Fline1:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TSimpleAddressType.Setline2(AIndex : Integer; const AValue : String);
- begin
- If (Fline2=AValue) then exit;
- Fline2:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TSimpleAddressType.Setline3(AIndex : Integer; const AValue : String);
- begin
- If (Fline3=AValue) then exit;
- Fline3:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TSimpleAddressType.SetlocationName(AIndex : Integer; const AValue : String);
- begin
- If (FlocationName=AValue) then exit;
- FlocationName:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TSimpleAddressType.Setstate(AIndex : Integer; const AValue : String);
- begin
- If (Fstate=AValue) then exit;
- Fstate:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TSimpleAddressType.Setzip(AIndex : Integer; const AValue : String);
- begin
- If (Fzip=AValue) then exit;
- Fzip:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TSource
- --------------------------------------------------------------------}
- Procedure TSource.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TSource.Setofficial(AIndex : Integer; AValue : boolean);
- begin
- If (Fofficial=AValue) then exit;
- Fofficial:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TVoterInfoResponse
- --------------------------------------------------------------------}
- Procedure TVoterInfoResponse.Setcontests(AIndex : Integer; AValue : TVoterInfoResponseTypecontestsArray);
- begin
- If (Fcontests=AValue) then exit;
- Fcontests:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TVoterInfoResponse.SetdropOffLocations(AIndex : Integer; AValue : TVoterInfoResponseTypedropOffLocationsArray);
- begin
- If (FdropOffLocations=AValue) then exit;
- FdropOffLocations:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TVoterInfoResponse.SetearlyVoteSites(AIndex : Integer; AValue : TVoterInfoResponseTypeearlyVoteSitesArray);
- begin
- If (FearlyVoteSites=AValue) then exit;
- FearlyVoteSites:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TVoterInfoResponse.Setelection(AIndex : Integer; AValue : TElection);
- begin
- If (Felection=AValue) then exit;
- Felection:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TVoterInfoResponse.Setkind(AIndex : Integer; const AValue : String);
- begin
- If (Fkind=AValue) then exit;
- Fkind:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TVoterInfoResponse.SetnormalizedInput(AIndex : Integer; AValue : TSimpleAddressType);
- begin
- If (FnormalizedInput=AValue) then exit;
- FnormalizedInput:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TVoterInfoResponse.SetotherElections(AIndex : Integer; AValue : TVoterInfoResponseTypeotherElectionsArray);
- begin
- If (FotherElections=AValue) then exit;
- FotherElections:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TVoterInfoResponse.SetpollingLocations(AIndex : Integer; AValue : TVoterInfoResponseTypepollingLocationsArray);
- begin
- If (FpollingLocations=AValue) then exit;
- FpollingLocations:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TVoterInfoResponse.SetprecinctId(AIndex : Integer; const AValue : String);
- begin
- If (FprecinctId=AValue) then exit;
- FprecinctId:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TVoterInfoResponse.Setstate(AIndex : Integer; AValue : TVoterInfoResponseTypestateArray);
- begin
- If (Fstate=AValue) then exit;
- Fstate:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TVoterInfoResponse.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'contests' : SetLength(Fcontests,ALength);
- 'dropofflocations' : SetLength(FdropOffLocations,ALength);
- 'earlyvotesites' : SetLength(FearlyVoteSites,ALength);
- 'otherelections' : SetLength(FotherElections,ALength);
- 'pollinglocations' : SetLength(FpollingLocations,ALength);
- 'state' : SetLength(Fstate,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TDivisionsResource
- --------------------------------------------------------------------}
- Class Function TDivisionsResource.ResourceName : String;
- begin
- Result:='divisions';
- end;
- Class Function TDivisionsResource.DefaultAPI : TGoogleAPIClass;
- begin
- Result:=TcivicinfoAPI;
- end;
- Function TDivisionsResource.Search(AQuery : string = '') : TDivisionSearchResponse;
- Const
- _HTTPMethod = 'GET';
- _Path = 'divisions';
- _Methodid = 'civicinfo.divisions.search';
- begin
- Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TDivisionSearchResponse) as TDivisionSearchResponse;
- end;
- Function TDivisionsResource.Search(AQuery : TDivisionssearchOptions) : TDivisionSearchResponse;
- Var
- _Q : String;
- begin
- _Q:='';
- AddToQuery(_Q,'query',AQuery.query);
- Result:=Search(_Q);
- end;
- { --------------------------------------------------------------------
- TElectionsResource
- --------------------------------------------------------------------}
- Class Function TElectionsResource.ResourceName : String;
- begin
- Result:='elections';
- end;
- Class Function TElectionsResource.DefaultAPI : TGoogleAPIClass;
- begin
- Result:=TcivicinfoAPI;
- end;
- Function TElectionsResource.ElectionQuery : TElectionsQueryResponse;
- Const
- _HTTPMethod = 'GET';
- _Path = 'elections';
- _Methodid = 'civicinfo.elections.electionQuery';
- begin
- Result:=ServiceCall(_HTTPMethod,_Path,'',Nil,TElectionsQueryResponse) as TElectionsQueryResponse;
- end;
- Function TElectionsResource.VoterInfoQuery(AQuery : string = '') : TVoterInfoResponse;
- Const
- _HTTPMethod = 'GET';
- _Path = 'voterinfo';
- _Methodid = 'civicinfo.elections.voterInfoQuery';
- begin
- Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TVoterInfoResponse) as TVoterInfoResponse;
- end;
- Function TElectionsResource.VoterInfoQuery(AQuery : TElectionsvoterInfoQueryOptions) : TVoterInfoResponse;
- Var
- _Q : String;
- begin
- _Q:='';
- AddToQuery(_Q,'address',AQuery.address);
- AddToQuery(_Q,'electionId',AQuery.electionId);
- AddToQuery(_Q,'officialOnly',AQuery.officialOnly);
- Result:=VoterInfoQuery(_Q);
- end;
- { --------------------------------------------------------------------
- TRepresentativesResource
- --------------------------------------------------------------------}
- Class Function TRepresentativesResource.ResourceName : String;
- begin
- Result:='representatives';
- end;
- Class Function TRepresentativesResource.DefaultAPI : TGoogleAPIClass;
- begin
- Result:=TcivicinfoAPI;
- end;
- Function TRepresentativesResource.RepresentativeInfoByAddress(AQuery : string = '') : TRepresentativeInfoResponse;
- Const
- _HTTPMethod = 'GET';
- _Path = 'representatives';
- _Methodid = 'civicinfo.representatives.representativeInfoByAddress';
- begin
- Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TRepresentativeInfoResponse) as TRepresentativeInfoResponse;
- end;
- Function TRepresentativesResource.RepresentativeInfoByAddress(AQuery : TRepresentativesrepresentativeInfoByAddressOptions) : TRepresentativeInfoResponse;
- Var
- _Q : String;
- begin
- _Q:='';
- AddToQuery(_Q,'address',AQuery.address);
- AddToQuery(_Q,'includeOffices',AQuery.includeOffices);
- AddToQuery(_Q,'levels',AQuery.levels);
- AddToQuery(_Q,'roles',AQuery.roles);
- Result:=RepresentativeInfoByAddress(_Q);
- end;
- Function TRepresentativesResource.RepresentativeInfoByDivision(ocdId: string; AQuery : string = '') : TRepresentativeInfoData;
- Const
- _HTTPMethod = 'GET';
- _Path = 'representatives/{ocdId}';
- _Methodid = 'civicinfo.representatives.representativeInfoByDivision';
- Var
- _P : String;
- begin
- _P:=SubstitutePath(_Path,['ocdId',ocdId]);
- Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TRepresentativeInfoData) as TRepresentativeInfoData;
- end;
- Function TRepresentativesResource.RepresentativeInfoByDivision(ocdId: string; AQuery : TRepresentativesrepresentativeInfoByDivisionOptions) : TRepresentativeInfoData;
- Var
- _Q : String;
- begin
- _Q:='';
- AddToQuery(_Q,'levels',AQuery.levels);
- AddToQuery(_Q,'recursive',AQuery.recursive);
- AddToQuery(_Q,'roles',AQuery.roles);
- Result:=RepresentativeInfoByDivision(ocdId,_Q);
- end;
- { --------------------------------------------------------------------
- TCivicinfoAPI
- --------------------------------------------------------------------}
- Class Function TCivicinfoAPI.APIName : String;
- begin
- Result:='civicinfo';
- end;
- Class Function TCivicinfoAPI.APIVersion : String;
- begin
- Result:='v2';
- end;
- Class Function TCivicinfoAPI.APIRevision : String;
- begin
- Result:='20150302';
- end;
- Class Function TCivicinfoAPI.APIID : String;
- begin
- Result:='civicinfo:v2';
- end;
- Class Function TCivicinfoAPI.APITitle : String;
- begin
- Result:='Google Civic Information API';
- end;
- Class Function TCivicinfoAPI.APIDescription : String;
- begin
- Result:='An API for accessing civic information.';
- end;
- Class Function TCivicinfoAPI.APIOwnerDomain : String;
- begin
- Result:='google.com';
- end;
- Class Function TCivicinfoAPI.APIOwnerName : String;
- begin
- Result:='Google';
- end;
- Class Function TCivicinfoAPI.APIIcon16 : String;
- begin
- Result:='http://www.google.com/images/icons/product/search-16.gif';
- end;
- Class Function TCivicinfoAPI.APIIcon32 : String;
- begin
- Result:='http://www.google.com/images/icons/product/search-32.gif';
- end;
- Class Function TCivicinfoAPI.APIdocumentationLink : String;
- begin
- Result:='https://developers.google.com/civic-information';
- end;
- Class Function TCivicinfoAPI.APIrootUrl : string;
- begin
- Result:='https://www.googleapis.com:443/';
- end;
- Class Function TCivicinfoAPI.APIbasePath : string;
- begin
- Result:='/civicinfo/v2/';
- end;
- Class Function TCivicinfoAPI.APIbaseURL : String;
- begin
- Result:='https://www.googleapis.com:443/civicinfo/v2/';
- end;
- Class Function TCivicinfoAPI.APIProtocol : string;
- begin
- Result:='rest';
- end;
- Class Function TCivicinfoAPI.APIservicePath : string;
- begin
- Result:='civicinfo/v2/';
- end;
- Class Function TCivicinfoAPI.APIbatchPath : String;
- begin
- Result:='batch';
- end;
- Class Function TCivicinfoAPI.APIAuthScopes : TScopeInfoArray;
- begin
- SetLength(Result,0);
-
- end;
- Class Function TCivicinfoAPI.APINeedsAuth : Boolean;
- begin
- Result:=False;
- end;
- Class Procedure TCivicinfoAPI.RegisterAPIResources;
- begin
- TAdministrationRegion.RegisterObject;
- TAdministrativeBody.RegisterObject;
- TCandidate.RegisterObject;
- TChannel.RegisterObject;
- TContest.RegisterObject;
- TDivisionSearchResponse.RegisterObject;
- TDivisionSearchResult.RegisterObject;
- TElection.RegisterObject;
- TElectionOfficial.RegisterObject;
- TElectionsQueryResponse.RegisterObject;
- TElectoralDistrict.RegisterObject;
- TGeographicDivision.RegisterObject;
- TOffice.RegisterObject;
- TOfficial.RegisterObject;
- TPollingLocation.RegisterObject;
- TRepresentativeInfoDataTypedivisions.RegisterObject;
- TRepresentativeInfoData.RegisterObject;
- TRepresentativeInfoResponseTypedivisions.RegisterObject;
- TRepresentativeInfoResponse.RegisterObject;
- TSimpleAddressType.RegisterObject;
- TSource.RegisterObject;
- TVoterInfoResponse.RegisterObject;
- end;
- Function TCivicinfoAPI.GetDivisionsInstance : TDivisionsResource;
- begin
- if (FDivisionsInstance=Nil) then
- FDivisionsInstance:=CreateDivisionsResource;
- Result:=FDivisionsInstance;
- end;
- Function TCivicinfoAPI.CreateDivisionsResource : TDivisionsResource;
- begin
- Result:=CreateDivisionsResource(Self);
- end;
- Function TCivicinfoAPI.CreateDivisionsResource(AOwner : TComponent) : TDivisionsResource;
- begin
- Result:=TDivisionsResource.Create(AOwner);
- Result.API:=Self.API;
- end;
- Function TCivicinfoAPI.GetElectionsInstance : TElectionsResource;
- begin
- if (FElectionsInstance=Nil) then
- FElectionsInstance:=CreateElectionsResource;
- Result:=FElectionsInstance;
- end;
- Function TCivicinfoAPI.CreateElectionsResource : TElectionsResource;
- begin
- Result:=CreateElectionsResource(Self);
- end;
- Function TCivicinfoAPI.CreateElectionsResource(AOwner : TComponent) : TElectionsResource;
- begin
- Result:=TElectionsResource.Create(AOwner);
- Result.API:=Self.API;
- end;
- Function TCivicinfoAPI.GetRepresentativesInstance : TRepresentativesResource;
- begin
- if (FRepresentativesInstance=Nil) then
- FRepresentativesInstance:=CreateRepresentativesResource;
- Result:=FRepresentativesInstance;
- end;
- Function TCivicinfoAPI.CreateRepresentativesResource : TRepresentativesResource;
- begin
- Result:=CreateRepresentativesResource(Self);
- end;
- Function TCivicinfoAPI.CreateRepresentativesResource(AOwner : TComponent) : TRepresentativesResource;
- begin
- Result:=TRepresentativesResource.Create(AOwner);
- Result.API:=Self.API;
- end;
- initialization
- TCivicinfoAPI.RegisterAPI;
- end.
|