12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957 |
- unit googlecivicinfo;
- {$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; const AValue : TAdministrativeBody); virtual;
- Procedure Setid(AIndex : Integer; const AValue : String); virtual;
- Procedure Setlocal_jurisdiction(AIndex : Integer; const AValue : TAdministrationRegion); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure Setsources(AIndex : Integer; const 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; const AValue : TSimpleAddressType); virtual;
- Procedure SetelectionInfoUrl(AIndex : Integer; const AValue : String); virtual;
- Procedure SetelectionOfficials(AIndex : Integer; const 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; const AValue : TSimpleAddressType); virtual;
- Procedure Setvoter_services(AIndex : Integer; const 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; const 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;
- FreferendumBallotResponses : TStringArray;
- FreferendumBrief : String;
- FreferendumConStatement : String;
- FreferendumEffectOfAbstain : String;
- FreferendumPassageThreshold : String;
- FreferendumProStatement : String;
- FreferendumSubtitle : String;
- FreferendumText : 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; const AValue : TContestTypecandidatesArray); virtual;
- Procedure Setdistrict(AIndex : Integer; const AValue : TElectoralDistrict); virtual;
- Procedure SetelectorateSpecifications(AIndex : Integer; const AValue : String); virtual;
- Procedure Setid(AIndex : Integer; const AValue : String); virtual;
- Procedure Setlevel(AIndex : Integer; const 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 SetreferendumBallotResponses(AIndex : Integer; const AValue : TStringArray); virtual;
- Procedure SetreferendumBrief(AIndex : Integer; const AValue : String); virtual;
- Procedure SetreferendumConStatement(AIndex : Integer; const AValue : String); virtual;
- Procedure SetreferendumEffectOfAbstain(AIndex : Integer; const AValue : String); virtual;
- Procedure SetreferendumPassageThreshold(AIndex : Integer; const AValue : String); virtual;
- Procedure SetreferendumProStatement(AIndex : Integer; const AValue : String); virtual;
- Procedure SetreferendumSubtitle(AIndex : Integer; const AValue : String); virtual;
- Procedure SetreferendumText(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; const AValue : TStringArray); virtual;
- Procedure Setsources(AIndex : Integer; const 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 referendumBallotResponses : TStringArray Index 80 Read FreferendumBallotResponses Write SetreferendumBallotResponses;
- Property referendumBrief : String Index 88 Read FreferendumBrief Write SetreferendumBrief;
- Property referendumConStatement : String Index 96 Read FreferendumConStatement Write SetreferendumConStatement;
- Property referendumEffectOfAbstain : String Index 104 Read FreferendumEffectOfAbstain Write SetreferendumEffectOfAbstain;
- Property referendumPassageThreshold : String Index 112 Read FreferendumPassageThreshold Write SetreferendumPassageThreshold;
- Property referendumProStatement : String Index 120 Read FreferendumProStatement Write SetreferendumProStatement;
- Property referendumSubtitle : String Index 128 Read FreferendumSubtitle Write SetreferendumSubtitle;
- Property referendumText : String Index 136 Read FreferendumText Write SetreferendumText;
- Property referendumTitle : String Index 144 Read FreferendumTitle Write SetreferendumTitle;
- Property referendumUrl : String Index 152 Read FreferendumUrl Write SetreferendumUrl;
- Property roles : TStringArray Index 160 Read Froles Write Setroles;
- Property sources : TContestTypesourcesArray Index 168 Read Fsources Write Setsources;
- Property special : String Index 176 Read Fspecial Write Setspecial;
- Property _type : String Index 184 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; const 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; const 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;
- FocdDivisionId : 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;
- Procedure SetocdDivisionId(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;
- Property ocdDivisionId : String Index 24 Read FocdDivisionId Write SetocdDivisionId;
- 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; const 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; const AValue : TStringArray); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure SetofficeIndices(AIndex : Integer; const 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; const AValue : TStringArray); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure SetofficialIndices(AIndex : Integer; const AValue : TintegerArray); virtual;
- Procedure Setroles(AIndex : Integer; const AValue : TStringArray); virtual;
- Procedure Setsources(AIndex : Integer; const 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; const AValue : TOfficialTypeaddressArray); virtual;
- Procedure Setchannels(AIndex : Integer; const AValue : TOfficialTypechannelsArray); virtual;
- Procedure Setemails(AIndex : Integer; const AValue : TStringArray); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure Setparty(AIndex : Integer; const AValue : String); virtual;
- Procedure Setphones(AIndex : Integer; const AValue : TStringArray); virtual;
- Procedure SetphotoUrl(AIndex : Integer; const AValue : String); virtual;
- Procedure Seturls(AIndex : Integer; const 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; const 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; const 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; const AValue : TRepresentativeInfoDataTypedivisions); virtual;
- Procedure Setoffices(AIndex : Integer; const AValue : TRepresentativeInfoDataTypeofficesArray); virtual;
- Procedure Setofficials(AIndex : Integer; const 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; const AValue : TRepresentativeInfoResponseTypedivisions); virtual;
- Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
- Procedure SetnormalizedInput(AIndex : Integer; const AValue : TSimpleAddressType); virtual;
- Procedure Setoffices(AIndex : Integer; const AValue : TRepresentativeInfoResponseTypeofficesArray); virtual;
- Procedure Setofficials(AIndex : Integer; const 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; const 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;
- FmailOnly : boolean;
- FnormalizedInput : TSimpleAddressType;
- FotherElections : TVoterInfoResponseTypeotherElectionsArray;
- FpollingLocations : TVoterInfoResponseTypepollingLocationsArray;
- FprecinctId : String;
- Fstate : TVoterInfoResponseTypestateArray;
- Protected
- //Property setters
- Procedure Setcontests(AIndex : Integer; const AValue : TVoterInfoResponseTypecontestsArray); virtual;
- Procedure SetdropOffLocations(AIndex : Integer; const AValue : TVoterInfoResponseTypedropOffLocationsArray); virtual;
- Procedure SetearlyVoteSites(AIndex : Integer; const AValue : TVoterInfoResponseTypeearlyVoteSitesArray); virtual;
- Procedure Setelection(AIndex : Integer; const AValue : TElection); virtual;
- Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
- Procedure SetmailOnly(AIndex : Integer; const AValue : boolean); virtual;
- Procedure SetnormalizedInput(AIndex : Integer; const AValue : TSimpleAddressType); virtual;
- Procedure SetotherElections(AIndex : Integer; const AValue : TVoterInfoResponseTypeotherElectionsArray); virtual;
- Procedure SetpollingLocations(AIndex : Integer; const AValue : TVoterInfoResponseTypepollingLocationsArray); virtual;
- Procedure SetprecinctId(AIndex : Integer; const AValue : String); virtual;
- Procedure Setstate(AIndex : Integer; const 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 mailOnly : boolean Index 40 Read FmailOnly Write SetmailOnly;
- Property normalizedInput : TSimpleAddressType Index 48 Read FnormalizedInput Write SetnormalizedInput;
- Property otherElections : TVoterInfoResponseTypeotherElectionsArray Index 56 Read FotherElections Write SetotherElections;
- Property pollingLocations : TVoterInfoResponseTypepollingLocationsArray Index 64 Read FpollingLocations Write SetpollingLocations;
- Property precinctId : String Index 72 Read FprecinctId Write SetprecinctId;
- Property state : TVoterInfoResponseTypestateArray Index 80 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; const 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; const 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; const 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; const 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; const 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; const AValue : TSimpleAddressType);
- begin
- If (FphysicalAddress=AValue) then exit;
- FphysicalAddress:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TAdministrativeBody.Setvoter_services(AIndex : Integer; const 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; const 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; const AValue : TContestTypecandidatesArray);
- begin
- If (Fcandidates=AValue) then exit;
- Fcandidates:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.Setdistrict(AIndex : Integer; const 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; const 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.SetreferendumBallotResponses(AIndex : Integer; const AValue : TStringArray);
- begin
- If (FreferendumBallotResponses=AValue) then exit;
- FreferendumBallotResponses:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.SetreferendumBrief(AIndex : Integer; const AValue : String);
- begin
- If (FreferendumBrief=AValue) then exit;
- FreferendumBrief:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.SetreferendumConStatement(AIndex : Integer; const AValue : String);
- begin
- If (FreferendumConStatement=AValue) then exit;
- FreferendumConStatement:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.SetreferendumEffectOfAbstain(AIndex : Integer; const AValue : String);
- begin
- If (FreferendumEffectOfAbstain=AValue) then exit;
- FreferendumEffectOfAbstain:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.SetreferendumPassageThreshold(AIndex : Integer; const AValue : String);
- begin
- If (FreferendumPassageThreshold=AValue) then exit;
- FreferendumPassageThreshold:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.SetreferendumProStatement(AIndex : Integer; const AValue : String);
- begin
- If (FreferendumProStatement=AValue) then exit;
- FreferendumProStatement:=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.SetreferendumText(AIndex : Integer; const AValue : String);
- begin
- If (FreferendumText=AValue) then exit;
- FreferendumText:=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; const AValue : TStringArray);
- begin
- If (Froles=AValue) then exit;
- Froles:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TContest.Setsources(AIndex : Integer; const 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);
- 'referendumballotresponses' : SetLength(FreferendumBallotResponses,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; const 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; const 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;
- Procedure TElection.SetocdDivisionId(AIndex : Integer; const AValue : String);
- begin
- If (FocdDivisionId=AValue) then exit;
- FocdDivisionId:=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; const 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; const 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; const 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; const 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; const AValue : TintegerArray);
- begin
- If (FofficialIndices=AValue) then exit;
- FofficialIndices:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TOffice.Setroles(AIndex : Integer; const AValue : TStringArray);
- begin
- If (Froles=AValue) then exit;
- Froles:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TOffice.Setsources(AIndex : Integer; const 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; const AValue : TOfficialTypeaddressArray);
- begin
- If (Faddress=AValue) then exit;
- Faddress:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TOfficial.Setchannels(AIndex : Integer; const AValue : TOfficialTypechannelsArray);
- begin
- If (Fchannels=AValue) then exit;
- Fchannels:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TOfficial.Setemails(AIndex : Integer; const 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; const 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; const 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; const 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; const 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; const AValue : TRepresentativeInfoDataTypedivisions);
- begin
- If (Fdivisions=AValue) then exit;
- Fdivisions:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TRepresentativeInfoData.Setoffices(AIndex : Integer; const AValue : TRepresentativeInfoDataTypeofficesArray);
- begin
- If (Foffices=AValue) then exit;
- Foffices:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TRepresentativeInfoData.Setofficials(AIndex : Integer; const 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; const 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; const AValue : TSimpleAddressType);
- begin
- If (FnormalizedInput=AValue) then exit;
- FnormalizedInput:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TRepresentativeInfoResponse.Setoffices(AIndex : Integer; const AValue : TRepresentativeInfoResponseTypeofficesArray);
- begin
- If (Foffices=AValue) then exit;
- Foffices:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TRepresentativeInfoResponse.Setofficials(AIndex : Integer; const 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; const AValue : boolean);
- begin
- If (Fofficial=AValue) then exit;
- Fofficial:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TVoterInfoResponse
- --------------------------------------------------------------------}
- Procedure TVoterInfoResponse.Setcontests(AIndex : Integer; const AValue : TVoterInfoResponseTypecontestsArray);
- begin
- If (Fcontests=AValue) then exit;
- Fcontests:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TVoterInfoResponse.SetdropOffLocations(AIndex : Integer; const AValue : TVoterInfoResponseTypedropOffLocationsArray);
- begin
- If (FdropOffLocations=AValue) then exit;
- FdropOffLocations:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TVoterInfoResponse.SetearlyVoteSites(AIndex : Integer; const AValue : TVoterInfoResponseTypeearlyVoteSitesArray);
- begin
- If (FearlyVoteSites=AValue) then exit;
- FearlyVoteSites:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TVoterInfoResponse.Setelection(AIndex : Integer; const 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.SetmailOnly(AIndex : Integer; const AValue : boolean);
- begin
- If (FmailOnly=AValue) then exit;
- FmailOnly:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TVoterInfoResponse.SetnormalizedInput(AIndex : Integer; const AValue : TSimpleAddressType);
- begin
- If (FnormalizedInput=AValue) then exit;
- FnormalizedInput:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TVoterInfoResponse.SetotherElections(AIndex : Integer; const AValue : TVoterInfoResponseTypeotherElectionsArray);
- begin
- If (FotherElections=AValue) then exit;
- FotherElections:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TVoterInfoResponse.SetpollingLocations(AIndex : Integer; const 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; const 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:='20150820';
- 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/';
- end;
- Class Function TCivicinfoAPI.APIbasePath : string;
- begin
- Result:='/civicinfo/v2/';
- end;
- Class Function TCivicinfoAPI.APIbaseURL : String;
- begin
- Result:='https://www.googleapis.com/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.
|