googlecivicinfo.pp 81 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854
  1. unit googlecivicinfo;
  2. {
  3. **********************************************************************
  4. This file is part of the Free Component Library (FCL)
  5. Copyright (c) 2015 The free pascal team.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************
  12. }
  13. //Generated on: 16-5-15 08:53:00
  14. {$MODE objfpc}
  15. {$H+}
  16. interface
  17. uses sysutils, classes, googleservice, restbase, googlebase;
  18. type
  19. //Top-level schema types
  20. TAdministrationRegion = Class;
  21. TAdministrativeBody = Class;
  22. TCandidate = Class;
  23. TChannel = Class;
  24. TContest = Class;
  25. TDivisionSearchResponse = Class;
  26. TDivisionSearchResult = Class;
  27. TElection = Class;
  28. TElectionOfficial = Class;
  29. TElectionsQueryResponse = Class;
  30. TElectoralDistrict = Class;
  31. TGeographicDivision = Class;
  32. TOffice = Class;
  33. TOfficial = Class;
  34. TPollingLocation = Class;
  35. TRepresentativeInfoData = Class;
  36. TRepresentativeInfoResponse = Class;
  37. TSimpleAddressType = Class;
  38. TSource = Class;
  39. TVoterInfoResponse = Class;
  40. TAdministrationRegionArray = Array of TAdministrationRegion;
  41. TAdministrativeBodyArray = Array of TAdministrativeBody;
  42. TCandidateArray = Array of TCandidate;
  43. TChannelArray = Array of TChannel;
  44. TContestArray = Array of TContest;
  45. TDivisionSearchResponseArray = Array of TDivisionSearchResponse;
  46. TDivisionSearchResultArray = Array of TDivisionSearchResult;
  47. TElectionArray = Array of TElection;
  48. TElectionOfficialArray = Array of TElectionOfficial;
  49. TElectionsQueryResponseArray = Array of TElectionsQueryResponse;
  50. TElectoralDistrictArray = Array of TElectoralDistrict;
  51. TGeographicDivisionArray = Array of TGeographicDivision;
  52. TOfficeArray = Array of TOffice;
  53. TOfficialArray = Array of TOfficial;
  54. TPollingLocationArray = Array of TPollingLocation;
  55. TRepresentativeInfoDataArray = Array of TRepresentativeInfoData;
  56. TRepresentativeInfoResponseArray = Array of TRepresentativeInfoResponse;
  57. TSimpleAddressTypeArray = Array of TSimpleAddressType;
  58. TSourceArray = Array of TSource;
  59. TVoterInfoResponseArray = Array of TVoterInfoResponse;
  60. //Anonymous types, using auto-generated names
  61. TRepresentativeInfoDataTypedivisions = Class;
  62. TRepresentativeInfoResponseTypedivisions = Class;
  63. TAdministrationRegionTypesourcesArray = Array of TSource;
  64. TAdministrativeBodyTypeelectionOfficialsArray = Array of TElectionOfficial;
  65. TCandidateTypechannelsArray = Array of TChannel;
  66. TContestTypecandidatesArray = Array of TCandidate;
  67. TContestTypesourcesArray = Array of TSource;
  68. TDivisionSearchResponseTyperesultsArray = Array of TDivisionSearchResult;
  69. TElectionsQueryResponseTypeelectionsArray = Array of TElection;
  70. TOfficeTypesourcesArray = Array of TSource;
  71. TOfficialTypeaddressArray = Array of TSimpleAddressType;
  72. TOfficialTypechannelsArray = Array of TChannel;
  73. TPollingLocationTypesourcesArray = Array of TSource;
  74. TRepresentativeInfoDataTypeofficesArray = Array of TOffice;
  75. TRepresentativeInfoDataTypeofficialsArray = Array of TOfficial;
  76. TRepresentativeInfoResponseTypeofficesArray = Array of TOffice;
  77. TRepresentativeInfoResponseTypeofficialsArray = Array of TOfficial;
  78. TVoterInfoResponseTypecontestsArray = Array of TContest;
  79. TVoterInfoResponseTypedropOffLocationsArray = Array of TPollingLocation;
  80. TVoterInfoResponseTypeearlyVoteSitesArray = Array of TPollingLocation;
  81. TVoterInfoResponseTypeotherElectionsArray = Array of TElection;
  82. TVoterInfoResponseTypepollingLocationsArray = Array of TPollingLocation;
  83. TVoterInfoResponseTypestateArray = Array of TAdministrationRegion;
  84. { --------------------------------------------------------------------
  85. TAdministrationRegion
  86. --------------------------------------------------------------------}
  87. TAdministrationRegion = Class(TGoogleBaseObject)
  88. Private
  89. FelectionAdministrationBody : TAdministrativeBody;
  90. Fid : String;
  91. Flocal_jurisdiction : TAdministrationRegion;
  92. Fname : String;
  93. Fsources : TAdministrationRegionTypesourcesArray;
  94. Protected
  95. //Property setters
  96. Procedure SetelectionAdministrationBody(AIndex : Integer; AValue : TAdministrativeBody); virtual;
  97. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  98. Procedure Setlocal_jurisdiction(AIndex : Integer; AValue : TAdministrationRegion); virtual;
  99. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  100. Procedure Setsources(AIndex : Integer; AValue : TAdministrationRegionTypesourcesArray); virtual;
  101. //2.6.4. bug workaround
  102. {$IFDEF VER2_6}
  103. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  104. {$ENDIF VER2_6}
  105. Public
  106. Published
  107. Property electionAdministrationBody : TAdministrativeBody Index 0 Read FelectionAdministrationBody Write SetelectionAdministrationBody;
  108. Property id : String Index 8 Read Fid Write Setid;
  109. Property local_jurisdiction : TAdministrationRegion Index 16 Read Flocal_jurisdiction Write Setlocal_jurisdiction;
  110. Property name : String Index 24 Read Fname Write Setname;
  111. Property sources : TAdministrationRegionTypesourcesArray Index 32 Read Fsources Write Setsources;
  112. end;
  113. TAdministrationRegionClass = Class of TAdministrationRegion;
  114. { --------------------------------------------------------------------
  115. TAdministrativeBody
  116. --------------------------------------------------------------------}
  117. TAdministrativeBody = Class(TGoogleBaseObject)
  118. Private
  119. FabsenteeVotingInfoUrl : String;
  120. FballotInfoUrl : String;
  121. FcorrespondenceAddress : TSimpleAddressType;
  122. FelectionInfoUrl : String;
  123. FelectionOfficials : TAdministrativeBodyTypeelectionOfficialsArray;
  124. FelectionRegistrationConfirmationUrl : String;
  125. FelectionRegistrationUrl : String;
  126. FelectionRulesUrl : String;
  127. FhoursOfOperation : String;
  128. Fname : String;
  129. FphysicalAddress : TSimpleAddressType;
  130. Fvoter_services : TStringArray;
  131. FvotingLocationFinderUrl : String;
  132. Protected
  133. //Property setters
  134. Procedure SetabsenteeVotingInfoUrl(AIndex : Integer; const AValue : String); virtual;
  135. Procedure SetballotInfoUrl(AIndex : Integer; const AValue : String); virtual;
  136. Procedure SetcorrespondenceAddress(AIndex : Integer; AValue : TSimpleAddressType); virtual;
  137. Procedure SetelectionInfoUrl(AIndex : Integer; const AValue : String); virtual;
  138. Procedure SetelectionOfficials(AIndex : Integer; AValue : TAdministrativeBodyTypeelectionOfficialsArray); virtual;
  139. Procedure SetelectionRegistrationConfirmationUrl(AIndex : Integer; const AValue : String); virtual;
  140. Procedure SetelectionRegistrationUrl(AIndex : Integer; const AValue : String); virtual;
  141. Procedure SetelectionRulesUrl(AIndex : Integer; const AValue : String); virtual;
  142. Procedure SethoursOfOperation(AIndex : Integer; const AValue : String); virtual;
  143. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  144. Procedure SetphysicalAddress(AIndex : Integer; AValue : TSimpleAddressType); virtual;
  145. Procedure Setvoter_services(AIndex : Integer; AValue : TStringArray); virtual;
  146. Procedure SetvotingLocationFinderUrl(AIndex : Integer; const AValue : String); virtual;
  147. //2.6.4. bug workaround
  148. {$IFDEF VER2_6}
  149. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  150. {$ENDIF VER2_6}
  151. Public
  152. Published
  153. Property absenteeVotingInfoUrl : String Index 0 Read FabsenteeVotingInfoUrl Write SetabsenteeVotingInfoUrl;
  154. Property ballotInfoUrl : String Index 8 Read FballotInfoUrl Write SetballotInfoUrl;
  155. Property correspondenceAddress : TSimpleAddressType Index 16 Read FcorrespondenceAddress Write SetcorrespondenceAddress;
  156. Property electionInfoUrl : String Index 24 Read FelectionInfoUrl Write SetelectionInfoUrl;
  157. Property electionOfficials : TAdministrativeBodyTypeelectionOfficialsArray Index 32 Read FelectionOfficials Write SetelectionOfficials;
  158. Property electionRegistrationConfirmationUrl : String Index 40 Read FelectionRegistrationConfirmationUrl Write SetelectionRegistrationConfirmationUrl;
  159. Property electionRegistrationUrl : String Index 48 Read FelectionRegistrationUrl Write SetelectionRegistrationUrl;
  160. Property electionRulesUrl : String Index 56 Read FelectionRulesUrl Write SetelectionRulesUrl;
  161. Property hoursOfOperation : String Index 64 Read FhoursOfOperation Write SethoursOfOperation;
  162. Property name : String Index 72 Read Fname Write Setname;
  163. Property physicalAddress : TSimpleAddressType Index 80 Read FphysicalAddress Write SetphysicalAddress;
  164. Property voter_services : TStringArray Index 88 Read Fvoter_services Write Setvoter_services;
  165. Property votingLocationFinderUrl : String Index 96 Read FvotingLocationFinderUrl Write SetvotingLocationFinderUrl;
  166. end;
  167. TAdministrativeBodyClass = Class of TAdministrativeBody;
  168. { --------------------------------------------------------------------
  169. TCandidate
  170. --------------------------------------------------------------------}
  171. TCandidate = Class(TGoogleBaseObject)
  172. Private
  173. FcandidateUrl : String;
  174. Fchannels : TCandidateTypechannelsArray;
  175. Femail : String;
  176. Fname : String;
  177. ForderOnBallot : String;
  178. Fparty : String;
  179. Fphone : String;
  180. FphotoUrl : String;
  181. Protected
  182. //Property setters
  183. Procedure SetcandidateUrl(AIndex : Integer; const AValue : String); virtual;
  184. Procedure Setchannels(AIndex : Integer; AValue : TCandidateTypechannelsArray); virtual;
  185. Procedure Setemail(AIndex : Integer; const AValue : String); virtual;
  186. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  187. Procedure SetorderOnBallot(AIndex : Integer; const AValue : String); virtual;
  188. Procedure Setparty(AIndex : Integer; const AValue : String); virtual;
  189. Procedure Setphone(AIndex : Integer; const AValue : String); virtual;
  190. Procedure SetphotoUrl(AIndex : Integer; const AValue : String); virtual;
  191. //2.6.4. bug workaround
  192. {$IFDEF VER2_6}
  193. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  194. {$ENDIF VER2_6}
  195. Public
  196. Published
  197. Property candidateUrl : String Index 0 Read FcandidateUrl Write SetcandidateUrl;
  198. Property channels : TCandidateTypechannelsArray Index 8 Read Fchannels Write Setchannels;
  199. Property email : String Index 16 Read Femail Write Setemail;
  200. Property name : String Index 24 Read Fname Write Setname;
  201. Property orderOnBallot : String Index 32 Read ForderOnBallot Write SetorderOnBallot;
  202. Property party : String Index 40 Read Fparty Write Setparty;
  203. Property phone : String Index 48 Read Fphone Write Setphone;
  204. Property photoUrl : String Index 56 Read FphotoUrl Write SetphotoUrl;
  205. end;
  206. TCandidateClass = Class of TCandidate;
  207. { --------------------------------------------------------------------
  208. TChannel
  209. --------------------------------------------------------------------}
  210. TChannel = Class(TGoogleBaseObject)
  211. Private
  212. Fid : String;
  213. F_type : String;
  214. Protected
  215. Class Function ExportPropertyName(Const AName : String) : string; override;
  216. //Property setters
  217. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  218. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  219. Public
  220. Published
  221. Property id : String Index 0 Read Fid Write Setid;
  222. Property _type : String Index 8 Read F_type Write Set_type;
  223. end;
  224. TChannelClass = Class of TChannel;
  225. { --------------------------------------------------------------------
  226. TContest
  227. --------------------------------------------------------------------}
  228. TContest = Class(TGoogleBaseObject)
  229. Private
  230. FballotPlacement : String;
  231. Fcandidates : TContestTypecandidatesArray;
  232. Fdistrict : TElectoralDistrict;
  233. FelectorateSpecifications : String;
  234. Fid : String;
  235. Flevel : TStringArray;
  236. FnumberElected : String;
  237. FnumberVotingFor : String;
  238. Foffice : String;
  239. FprimaryParty : String;
  240. FreferendumSubtitle : String;
  241. FreferendumTitle : String;
  242. FreferendumUrl : String;
  243. Froles : TStringArray;
  244. Fsources : TContestTypesourcesArray;
  245. Fspecial : String;
  246. F_type : String;
  247. Protected
  248. Class Function ExportPropertyName(Const AName : String) : string; override;
  249. //Property setters
  250. Procedure SetballotPlacement(AIndex : Integer; const AValue : String); virtual;
  251. Procedure Setcandidates(AIndex : Integer; AValue : TContestTypecandidatesArray); virtual;
  252. Procedure Setdistrict(AIndex : Integer; AValue : TElectoralDistrict); virtual;
  253. Procedure SetelectorateSpecifications(AIndex : Integer; const AValue : String); virtual;
  254. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  255. Procedure Setlevel(AIndex : Integer; AValue : TStringArray); virtual;
  256. Procedure SetnumberElected(AIndex : Integer; const AValue : String); virtual;
  257. Procedure SetnumberVotingFor(AIndex : Integer; const AValue : String); virtual;
  258. Procedure Setoffice(AIndex : Integer; const AValue : String); virtual;
  259. Procedure SetprimaryParty(AIndex : Integer; const AValue : String); virtual;
  260. Procedure SetreferendumSubtitle(AIndex : Integer; const AValue : String); virtual;
  261. Procedure SetreferendumTitle(AIndex : Integer; const AValue : String); virtual;
  262. Procedure SetreferendumUrl(AIndex : Integer; const AValue : String); virtual;
  263. Procedure Setroles(AIndex : Integer; AValue : TStringArray); virtual;
  264. Procedure Setsources(AIndex : Integer; AValue : TContestTypesourcesArray); virtual;
  265. Procedure Setspecial(AIndex : Integer; const AValue : String); virtual;
  266. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  267. //2.6.4. bug workaround
  268. {$IFDEF VER2_6}
  269. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  270. {$ENDIF VER2_6}
  271. Public
  272. Published
  273. Property ballotPlacement : String Index 0 Read FballotPlacement Write SetballotPlacement;
  274. Property candidates : TContestTypecandidatesArray Index 8 Read Fcandidates Write Setcandidates;
  275. Property district : TElectoralDistrict Index 16 Read Fdistrict Write Setdistrict;
  276. Property electorateSpecifications : String Index 24 Read FelectorateSpecifications Write SetelectorateSpecifications;
  277. Property id : String Index 32 Read Fid Write Setid;
  278. Property level : TStringArray Index 40 Read Flevel Write Setlevel;
  279. Property numberElected : String Index 48 Read FnumberElected Write SetnumberElected;
  280. Property numberVotingFor : String Index 56 Read FnumberVotingFor Write SetnumberVotingFor;
  281. Property office : String Index 64 Read Foffice Write Setoffice;
  282. Property primaryParty : String Index 72 Read FprimaryParty Write SetprimaryParty;
  283. Property referendumSubtitle : String Index 80 Read FreferendumSubtitle Write SetreferendumSubtitle;
  284. Property referendumTitle : String Index 88 Read FreferendumTitle Write SetreferendumTitle;
  285. Property referendumUrl : String Index 96 Read FreferendumUrl Write SetreferendumUrl;
  286. Property roles : TStringArray Index 104 Read Froles Write Setroles;
  287. Property sources : TContestTypesourcesArray Index 112 Read Fsources Write Setsources;
  288. Property special : String Index 120 Read Fspecial Write Setspecial;
  289. Property _type : String Index 128 Read F_type Write Set_type;
  290. end;
  291. TContestClass = Class of TContest;
  292. { --------------------------------------------------------------------
  293. TDivisionSearchResponse
  294. --------------------------------------------------------------------}
  295. TDivisionSearchResponse = Class(TGoogleBaseObject)
  296. Private
  297. Fkind : String;
  298. Fresults : TDivisionSearchResponseTyperesultsArray;
  299. Protected
  300. //Property setters
  301. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  302. Procedure Setresults(AIndex : Integer; AValue : TDivisionSearchResponseTyperesultsArray); virtual;
  303. //2.6.4. bug workaround
  304. {$IFDEF VER2_6}
  305. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  306. {$ENDIF VER2_6}
  307. Public
  308. Published
  309. Property kind : String Index 0 Read Fkind Write Setkind;
  310. Property results : TDivisionSearchResponseTyperesultsArray Index 8 Read Fresults Write Setresults;
  311. end;
  312. TDivisionSearchResponseClass = Class of TDivisionSearchResponse;
  313. { --------------------------------------------------------------------
  314. TDivisionSearchResult
  315. --------------------------------------------------------------------}
  316. TDivisionSearchResult = Class(TGoogleBaseObject)
  317. Private
  318. Faliases : TStringArray;
  319. Fname : String;
  320. FocdId : String;
  321. Protected
  322. //Property setters
  323. Procedure Setaliases(AIndex : Integer; AValue : TStringArray); virtual;
  324. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  325. Procedure SetocdId(AIndex : Integer; const AValue : String); virtual;
  326. //2.6.4. bug workaround
  327. {$IFDEF VER2_6}
  328. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  329. {$ENDIF VER2_6}
  330. Public
  331. Published
  332. Property aliases : TStringArray Index 0 Read Faliases Write Setaliases;
  333. Property name : String Index 8 Read Fname Write Setname;
  334. Property ocdId : String Index 16 Read FocdId Write SetocdId;
  335. end;
  336. TDivisionSearchResultClass = Class of TDivisionSearchResult;
  337. { --------------------------------------------------------------------
  338. TElection
  339. --------------------------------------------------------------------}
  340. TElection = Class(TGoogleBaseObject)
  341. Private
  342. FelectionDay : String;
  343. Fid : String;
  344. Fname : String;
  345. Protected
  346. //Property setters
  347. Procedure SetelectionDay(AIndex : Integer; const AValue : String); virtual;
  348. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  349. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  350. Public
  351. Published
  352. Property electionDay : String Index 0 Read FelectionDay Write SetelectionDay;
  353. Property id : String Index 8 Read Fid Write Setid;
  354. Property name : String Index 16 Read Fname Write Setname;
  355. end;
  356. TElectionClass = Class of TElection;
  357. { --------------------------------------------------------------------
  358. TElectionOfficial
  359. --------------------------------------------------------------------}
  360. TElectionOfficial = Class(TGoogleBaseObject)
  361. Private
  362. FemailAddress : String;
  363. FfaxNumber : String;
  364. Fname : String;
  365. FofficePhoneNumber : String;
  366. Ftitle : String;
  367. Protected
  368. //Property setters
  369. Procedure SetemailAddress(AIndex : Integer; const AValue : String); virtual;
  370. Procedure SetfaxNumber(AIndex : Integer; const AValue : String); virtual;
  371. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  372. Procedure SetofficePhoneNumber(AIndex : Integer; const AValue : String); virtual;
  373. Procedure Settitle(AIndex : Integer; const AValue : String); virtual;
  374. Public
  375. Published
  376. Property emailAddress : String Index 0 Read FemailAddress Write SetemailAddress;
  377. Property faxNumber : String Index 8 Read FfaxNumber Write SetfaxNumber;
  378. Property name : String Index 16 Read Fname Write Setname;
  379. Property officePhoneNumber : String Index 24 Read FofficePhoneNumber Write SetofficePhoneNumber;
  380. Property title : String Index 32 Read Ftitle Write Settitle;
  381. end;
  382. TElectionOfficialClass = Class of TElectionOfficial;
  383. { --------------------------------------------------------------------
  384. TElectionsQueryResponse
  385. --------------------------------------------------------------------}
  386. TElectionsQueryResponse = Class(TGoogleBaseObject)
  387. Private
  388. Felections : TElectionsQueryResponseTypeelectionsArray;
  389. Fkind : String;
  390. Protected
  391. //Property setters
  392. Procedure Setelections(AIndex : Integer; AValue : TElectionsQueryResponseTypeelectionsArray); virtual;
  393. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  394. //2.6.4. bug workaround
  395. {$IFDEF VER2_6}
  396. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  397. {$ENDIF VER2_6}
  398. Public
  399. Published
  400. Property elections : TElectionsQueryResponseTypeelectionsArray Index 0 Read Felections Write Setelections;
  401. Property kind : String Index 8 Read Fkind Write Setkind;
  402. end;
  403. TElectionsQueryResponseClass = Class of TElectionsQueryResponse;
  404. { --------------------------------------------------------------------
  405. TElectoralDistrict
  406. --------------------------------------------------------------------}
  407. TElectoralDistrict = Class(TGoogleBaseObject)
  408. Private
  409. Fid : String;
  410. Fname : String;
  411. Fscope : String;
  412. Protected
  413. //Property setters
  414. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  415. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  416. Procedure Setscope(AIndex : Integer; const AValue : String); virtual;
  417. Public
  418. Published
  419. Property id : String Index 0 Read Fid Write Setid;
  420. Property name : String Index 8 Read Fname Write Setname;
  421. Property scope : String Index 16 Read Fscope Write Setscope;
  422. end;
  423. TElectoralDistrictClass = Class of TElectoralDistrict;
  424. { --------------------------------------------------------------------
  425. TGeographicDivision
  426. --------------------------------------------------------------------}
  427. TGeographicDivision = Class(TGoogleBaseObject)
  428. Private
  429. FalsoKnownAs : TStringArray;
  430. Fname : String;
  431. FofficeIndices : TintegerArray;
  432. Protected
  433. //Property setters
  434. Procedure SetalsoKnownAs(AIndex : Integer; AValue : TStringArray); virtual;
  435. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  436. Procedure SetofficeIndices(AIndex : Integer; AValue : TintegerArray); virtual;
  437. //2.6.4. bug workaround
  438. {$IFDEF VER2_6}
  439. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  440. {$ENDIF VER2_6}
  441. Public
  442. Published
  443. Property alsoKnownAs : TStringArray Index 0 Read FalsoKnownAs Write SetalsoKnownAs;
  444. Property name : String Index 8 Read Fname Write Setname;
  445. Property officeIndices : TintegerArray Index 16 Read FofficeIndices Write SetofficeIndices;
  446. end;
  447. TGeographicDivisionClass = Class of TGeographicDivision;
  448. { --------------------------------------------------------------------
  449. TOffice
  450. --------------------------------------------------------------------}
  451. TOffice = Class(TGoogleBaseObject)
  452. Private
  453. FdivisionId : String;
  454. Flevels : TStringArray;
  455. Fname : String;
  456. FofficialIndices : TintegerArray;
  457. Froles : TStringArray;
  458. Fsources : TOfficeTypesourcesArray;
  459. Protected
  460. //Property setters
  461. Procedure SetdivisionId(AIndex : Integer; const AValue : String); virtual;
  462. Procedure Setlevels(AIndex : Integer; AValue : TStringArray); virtual;
  463. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  464. Procedure SetofficialIndices(AIndex : Integer; AValue : TintegerArray); virtual;
  465. Procedure Setroles(AIndex : Integer; AValue : TStringArray); virtual;
  466. Procedure Setsources(AIndex : Integer; AValue : TOfficeTypesourcesArray); virtual;
  467. //2.6.4. bug workaround
  468. {$IFDEF VER2_6}
  469. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  470. {$ENDIF VER2_6}
  471. Public
  472. Published
  473. Property divisionId : String Index 0 Read FdivisionId Write SetdivisionId;
  474. Property levels : TStringArray Index 8 Read Flevels Write Setlevels;
  475. Property name : String Index 16 Read Fname Write Setname;
  476. Property officialIndices : TintegerArray Index 24 Read FofficialIndices Write SetofficialIndices;
  477. Property roles : TStringArray Index 32 Read Froles Write Setroles;
  478. Property sources : TOfficeTypesourcesArray Index 40 Read Fsources Write Setsources;
  479. end;
  480. TOfficeClass = Class of TOffice;
  481. { --------------------------------------------------------------------
  482. TOfficial
  483. --------------------------------------------------------------------}
  484. TOfficial = Class(TGoogleBaseObject)
  485. Private
  486. Faddress : TOfficialTypeaddressArray;
  487. Fchannels : TOfficialTypechannelsArray;
  488. Femails : TStringArray;
  489. Fname : String;
  490. Fparty : String;
  491. Fphones : TStringArray;
  492. FphotoUrl : String;
  493. Furls : TStringArray;
  494. Protected
  495. //Property setters
  496. Procedure Setaddress(AIndex : Integer; AValue : TOfficialTypeaddressArray); virtual;
  497. Procedure Setchannels(AIndex : Integer; AValue : TOfficialTypechannelsArray); virtual;
  498. Procedure Setemails(AIndex : Integer; AValue : TStringArray); virtual;
  499. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  500. Procedure Setparty(AIndex : Integer; const AValue : String); virtual;
  501. Procedure Setphones(AIndex : Integer; AValue : TStringArray); virtual;
  502. Procedure SetphotoUrl(AIndex : Integer; const AValue : String); virtual;
  503. Procedure Seturls(AIndex : Integer; AValue : TStringArray); virtual;
  504. //2.6.4. bug workaround
  505. {$IFDEF VER2_6}
  506. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  507. {$ENDIF VER2_6}
  508. Public
  509. Published
  510. Property address : TOfficialTypeaddressArray Index 0 Read Faddress Write Setaddress;
  511. Property channels : TOfficialTypechannelsArray Index 8 Read Fchannels Write Setchannels;
  512. Property emails : TStringArray Index 16 Read Femails Write Setemails;
  513. Property name : String Index 24 Read Fname Write Setname;
  514. Property party : String Index 32 Read Fparty Write Setparty;
  515. Property phones : TStringArray Index 40 Read Fphones Write Setphones;
  516. Property photoUrl : String Index 48 Read FphotoUrl Write SetphotoUrl;
  517. Property urls : TStringArray Index 56 Read Furls Write Seturls;
  518. end;
  519. TOfficialClass = Class of TOfficial;
  520. { --------------------------------------------------------------------
  521. TPollingLocation
  522. --------------------------------------------------------------------}
  523. TPollingLocation = Class(TGoogleBaseObject)
  524. Private
  525. Faddress : TSimpleAddressType;
  526. FendDate : String;
  527. Fid : String;
  528. Fname : String;
  529. Fnotes : String;
  530. FpollingHours : String;
  531. Fsources : TPollingLocationTypesourcesArray;
  532. FstartDate : String;
  533. FvoterServices : String;
  534. Protected
  535. //Property setters
  536. Procedure Setaddress(AIndex : Integer; AValue : TSimpleAddressType); virtual;
  537. Procedure SetendDate(AIndex : Integer; const AValue : String); virtual;
  538. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  539. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  540. Procedure Setnotes(AIndex : Integer; const AValue : String); virtual;
  541. Procedure SetpollingHours(AIndex : Integer; const AValue : String); virtual;
  542. Procedure Setsources(AIndex : Integer; AValue : TPollingLocationTypesourcesArray); virtual;
  543. Procedure SetstartDate(AIndex : Integer; const AValue : String); virtual;
  544. Procedure SetvoterServices(AIndex : Integer; const AValue : String); virtual;
  545. //2.6.4. bug workaround
  546. {$IFDEF VER2_6}
  547. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  548. {$ENDIF VER2_6}
  549. Public
  550. Published
  551. Property address : TSimpleAddressType Index 0 Read Faddress Write Setaddress;
  552. Property endDate : String Index 8 Read FendDate Write SetendDate;
  553. Property id : String Index 16 Read Fid Write Setid;
  554. Property name : String Index 24 Read Fname Write Setname;
  555. Property notes : String Index 32 Read Fnotes Write Setnotes;
  556. Property pollingHours : String Index 40 Read FpollingHours Write SetpollingHours;
  557. Property sources : TPollingLocationTypesourcesArray Index 48 Read Fsources Write Setsources;
  558. Property startDate : String Index 56 Read FstartDate Write SetstartDate;
  559. Property voterServices : String Index 64 Read FvoterServices Write SetvoterServices;
  560. end;
  561. TPollingLocationClass = Class of TPollingLocation;
  562. { --------------------------------------------------------------------
  563. TRepresentativeInfoDataTypedivisions
  564. --------------------------------------------------------------------}
  565. TRepresentativeInfoDataTypedivisions = Class(TGoogleBaseObject)
  566. Private
  567. Protected
  568. //Property setters
  569. Public
  570. Class Function AllowAdditionalProperties : Boolean; override;
  571. Published
  572. end;
  573. TRepresentativeInfoDataTypedivisionsClass = Class of TRepresentativeInfoDataTypedivisions;
  574. { --------------------------------------------------------------------
  575. TRepresentativeInfoData
  576. --------------------------------------------------------------------}
  577. TRepresentativeInfoData = Class(TGoogleBaseObject)
  578. Private
  579. Fdivisions : TRepresentativeInfoDataTypedivisions;
  580. Foffices : TRepresentativeInfoDataTypeofficesArray;
  581. Fofficials : TRepresentativeInfoDataTypeofficialsArray;
  582. Protected
  583. //Property setters
  584. Procedure Setdivisions(AIndex : Integer; AValue : TRepresentativeInfoDataTypedivisions); virtual;
  585. Procedure Setoffices(AIndex : Integer; AValue : TRepresentativeInfoDataTypeofficesArray); virtual;
  586. Procedure Setofficials(AIndex : Integer; AValue : TRepresentativeInfoDataTypeofficialsArray); virtual;
  587. //2.6.4. bug workaround
  588. {$IFDEF VER2_6}
  589. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  590. {$ENDIF VER2_6}
  591. Public
  592. Published
  593. Property divisions : TRepresentativeInfoDataTypedivisions Index 0 Read Fdivisions Write Setdivisions;
  594. Property offices : TRepresentativeInfoDataTypeofficesArray Index 8 Read Foffices Write Setoffices;
  595. Property officials : TRepresentativeInfoDataTypeofficialsArray Index 16 Read Fofficials Write Setofficials;
  596. end;
  597. TRepresentativeInfoDataClass = Class of TRepresentativeInfoData;
  598. { --------------------------------------------------------------------
  599. TRepresentativeInfoResponseTypedivisions
  600. --------------------------------------------------------------------}
  601. TRepresentativeInfoResponseTypedivisions = Class(TGoogleBaseObject)
  602. Private
  603. Protected
  604. //Property setters
  605. Public
  606. Class Function AllowAdditionalProperties : Boolean; override;
  607. Published
  608. end;
  609. TRepresentativeInfoResponseTypedivisionsClass = Class of TRepresentativeInfoResponseTypedivisions;
  610. { --------------------------------------------------------------------
  611. TRepresentativeInfoResponse
  612. --------------------------------------------------------------------}
  613. TRepresentativeInfoResponse = Class(TGoogleBaseObject)
  614. Private
  615. Fdivisions : TRepresentativeInfoResponseTypedivisions;
  616. Fkind : String;
  617. FnormalizedInput : TSimpleAddressType;
  618. Foffices : TRepresentativeInfoResponseTypeofficesArray;
  619. Fofficials : TRepresentativeInfoResponseTypeofficialsArray;
  620. Protected
  621. //Property setters
  622. Procedure Setdivisions(AIndex : Integer; AValue : TRepresentativeInfoResponseTypedivisions); virtual;
  623. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  624. Procedure SetnormalizedInput(AIndex : Integer; AValue : TSimpleAddressType); virtual;
  625. Procedure Setoffices(AIndex : Integer; AValue : TRepresentativeInfoResponseTypeofficesArray); virtual;
  626. Procedure Setofficials(AIndex : Integer; AValue : TRepresentativeInfoResponseTypeofficialsArray); virtual;
  627. //2.6.4. bug workaround
  628. {$IFDEF VER2_6}
  629. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  630. {$ENDIF VER2_6}
  631. Public
  632. Published
  633. Property divisions : TRepresentativeInfoResponseTypedivisions Index 0 Read Fdivisions Write Setdivisions;
  634. Property kind : String Index 8 Read Fkind Write Setkind;
  635. Property normalizedInput : TSimpleAddressType Index 16 Read FnormalizedInput Write SetnormalizedInput;
  636. Property offices : TRepresentativeInfoResponseTypeofficesArray Index 24 Read Foffices Write Setoffices;
  637. Property officials : TRepresentativeInfoResponseTypeofficialsArray Index 32 Read Fofficials Write Setofficials;
  638. end;
  639. TRepresentativeInfoResponseClass = Class of TRepresentativeInfoResponse;
  640. { --------------------------------------------------------------------
  641. TSimpleAddressType
  642. --------------------------------------------------------------------}
  643. TSimpleAddressType = Class(TGoogleBaseObject)
  644. Private
  645. Fcity : String;
  646. Fline1 : String;
  647. Fline2 : String;
  648. Fline3 : String;
  649. FlocationName : String;
  650. Fstate : String;
  651. Fzip : String;
  652. Protected
  653. //Property setters
  654. Procedure Setcity(AIndex : Integer; const AValue : String); virtual;
  655. Procedure Setline1(AIndex : Integer; const AValue : String); virtual;
  656. Procedure Setline2(AIndex : Integer; const AValue : String); virtual;
  657. Procedure Setline3(AIndex : Integer; const AValue : String); virtual;
  658. Procedure SetlocationName(AIndex : Integer; const AValue : String); virtual;
  659. Procedure Setstate(AIndex : Integer; const AValue : String); virtual;
  660. Procedure Setzip(AIndex : Integer; const AValue : String); virtual;
  661. Public
  662. Published
  663. Property city : String Index 0 Read Fcity Write Setcity;
  664. Property line1 : String Index 8 Read Fline1 Write Setline1;
  665. Property line2 : String Index 16 Read Fline2 Write Setline2;
  666. Property line3 : String Index 24 Read Fline3 Write Setline3;
  667. Property locationName : String Index 32 Read FlocationName Write SetlocationName;
  668. Property state : String Index 40 Read Fstate Write Setstate;
  669. Property zip : String Index 48 Read Fzip Write Setzip;
  670. end;
  671. TSimpleAddressTypeClass = Class of TSimpleAddressType;
  672. { --------------------------------------------------------------------
  673. TSource
  674. --------------------------------------------------------------------}
  675. TSource = Class(TGoogleBaseObject)
  676. Private
  677. Fname : String;
  678. Fofficial : boolean;
  679. Protected
  680. //Property setters
  681. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  682. Procedure Setofficial(AIndex : Integer; AValue : boolean); virtual;
  683. Public
  684. Published
  685. Property name : String Index 0 Read Fname Write Setname;
  686. Property official : boolean Index 8 Read Fofficial Write Setofficial;
  687. end;
  688. TSourceClass = Class of TSource;
  689. { --------------------------------------------------------------------
  690. TVoterInfoResponse
  691. --------------------------------------------------------------------}
  692. TVoterInfoResponse = Class(TGoogleBaseObject)
  693. Private
  694. Fcontests : TVoterInfoResponseTypecontestsArray;
  695. FdropOffLocations : TVoterInfoResponseTypedropOffLocationsArray;
  696. FearlyVoteSites : TVoterInfoResponseTypeearlyVoteSitesArray;
  697. Felection : TElection;
  698. Fkind : String;
  699. FnormalizedInput : TSimpleAddressType;
  700. FotherElections : TVoterInfoResponseTypeotherElectionsArray;
  701. FpollingLocations : TVoterInfoResponseTypepollingLocationsArray;
  702. FprecinctId : String;
  703. Fstate : TVoterInfoResponseTypestateArray;
  704. Protected
  705. //Property setters
  706. Procedure Setcontests(AIndex : Integer; AValue : TVoterInfoResponseTypecontestsArray); virtual;
  707. Procedure SetdropOffLocations(AIndex : Integer; AValue : TVoterInfoResponseTypedropOffLocationsArray); virtual;
  708. Procedure SetearlyVoteSites(AIndex : Integer; AValue : TVoterInfoResponseTypeearlyVoteSitesArray); virtual;
  709. Procedure Setelection(AIndex : Integer; AValue : TElection); virtual;
  710. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  711. Procedure SetnormalizedInput(AIndex : Integer; AValue : TSimpleAddressType); virtual;
  712. Procedure SetotherElections(AIndex : Integer; AValue : TVoterInfoResponseTypeotherElectionsArray); virtual;
  713. Procedure SetpollingLocations(AIndex : Integer; AValue : TVoterInfoResponseTypepollingLocationsArray); virtual;
  714. Procedure SetprecinctId(AIndex : Integer; const AValue : String); virtual;
  715. Procedure Setstate(AIndex : Integer; AValue : TVoterInfoResponseTypestateArray); virtual;
  716. //2.6.4. bug workaround
  717. {$IFDEF VER2_6}
  718. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  719. {$ENDIF VER2_6}
  720. Public
  721. Published
  722. Property contests : TVoterInfoResponseTypecontestsArray Index 0 Read Fcontests Write Setcontests;
  723. Property dropOffLocations : TVoterInfoResponseTypedropOffLocationsArray Index 8 Read FdropOffLocations Write SetdropOffLocations;
  724. Property earlyVoteSites : TVoterInfoResponseTypeearlyVoteSitesArray Index 16 Read FearlyVoteSites Write SetearlyVoteSites;
  725. Property election : TElection Index 24 Read Felection Write Setelection;
  726. Property kind : String Index 32 Read Fkind Write Setkind;
  727. Property normalizedInput : TSimpleAddressType Index 40 Read FnormalizedInput Write SetnormalizedInput;
  728. Property otherElections : TVoterInfoResponseTypeotherElectionsArray Index 48 Read FotherElections Write SetotherElections;
  729. Property pollingLocations : TVoterInfoResponseTypepollingLocationsArray Index 56 Read FpollingLocations Write SetpollingLocations;
  730. Property precinctId : String Index 64 Read FprecinctId Write SetprecinctId;
  731. Property state : TVoterInfoResponseTypestateArray Index 72 Read Fstate Write Setstate;
  732. end;
  733. TVoterInfoResponseClass = Class of TVoterInfoResponse;
  734. { --------------------------------------------------------------------
  735. TDivisionsResource
  736. --------------------------------------------------------------------}
  737. //Optional query Options for TDivisionsResource, method Search
  738. TDivisionsSearchOptions = Record
  739. query : String;
  740. end;
  741. TDivisionsResource = Class(TGoogleResource)
  742. Public
  743. Class Function ResourceName : String; override;
  744. Class Function DefaultAPI : TGoogleAPIClass; override;
  745. Function Search(AQuery : string = '') : TDivisionSearchResponse;
  746. Function Search(AQuery : TDivisionssearchOptions) : TDivisionSearchResponse;
  747. end;
  748. { --------------------------------------------------------------------
  749. TElectionsResource
  750. --------------------------------------------------------------------}
  751. //Optional query Options for TElectionsResource, method VoterInfoQuery
  752. TElectionsVoterInfoQueryOptions = Record
  753. address : String;
  754. electionId : int64;
  755. officialOnly : boolean;
  756. end;
  757. TElectionsResource = Class(TGoogleResource)
  758. Public
  759. Class Function ResourceName : String; override;
  760. Class Function DefaultAPI : TGoogleAPIClass; override;
  761. Function ElectionQuery : TElectionsQueryResponse;
  762. Function VoterInfoQuery(AQuery : string = '') : TVoterInfoResponse;
  763. Function VoterInfoQuery(AQuery : TElectionsvoterInfoQueryOptions) : TVoterInfoResponse;
  764. end;
  765. { --------------------------------------------------------------------
  766. TRepresentativesResource
  767. --------------------------------------------------------------------}
  768. //Optional query Options for TRepresentativesResource, method RepresentativeInfoByAddress
  769. TRepresentativesRepresentativeInfoByAddressOptions = Record
  770. address : String;
  771. includeOffices : boolean;
  772. levels : String;
  773. roles : String;
  774. end;
  775. //Optional query Options for TRepresentativesResource, method RepresentativeInfoByDivision
  776. TRepresentativesRepresentativeInfoByDivisionOptions = Record
  777. levels : String;
  778. recursive : boolean;
  779. roles : String;
  780. end;
  781. TRepresentativesResource = Class(TGoogleResource)
  782. Public
  783. Class Function ResourceName : String; override;
  784. Class Function DefaultAPI : TGoogleAPIClass; override;
  785. Function RepresentativeInfoByAddress(AQuery : string = '') : TRepresentativeInfoResponse;
  786. Function RepresentativeInfoByAddress(AQuery : TRepresentativesrepresentativeInfoByAddressOptions) : TRepresentativeInfoResponse;
  787. Function RepresentativeInfoByDivision(ocdId: string; AQuery : string = '') : TRepresentativeInfoData;
  788. Function RepresentativeInfoByDivision(ocdId: string; AQuery : TRepresentativesrepresentativeInfoByDivisionOptions) : TRepresentativeInfoData;
  789. end;
  790. { --------------------------------------------------------------------
  791. TCivicinfoAPI
  792. --------------------------------------------------------------------}
  793. TCivicinfoAPI = Class(TGoogleAPI)
  794. Private
  795. FDivisionsInstance : TDivisionsResource;
  796. FElectionsInstance : TElectionsResource;
  797. FRepresentativesInstance : TRepresentativesResource;
  798. Function GetDivisionsInstance : TDivisionsResource;virtual;
  799. Function GetElectionsInstance : TElectionsResource;virtual;
  800. Function GetRepresentativesInstance : TRepresentativesResource;virtual;
  801. Public
  802. //Override class functions with API info
  803. Class Function APIName : String; override;
  804. Class Function APIVersion : String; override;
  805. Class Function APIRevision : String; override;
  806. Class Function APIID : String; override;
  807. Class Function APITitle : String; override;
  808. Class Function APIDescription : String; override;
  809. Class Function APIOwnerDomain : String; override;
  810. Class Function APIOwnerName : String; override;
  811. Class Function APIIcon16 : String; override;
  812. Class Function APIIcon32 : String; override;
  813. Class Function APIdocumentationLink : String; override;
  814. Class Function APIrootUrl : string; override;
  815. Class Function APIbasePath : string;override;
  816. Class Function APIbaseURL : String;override;
  817. Class Function APIProtocol : string;override;
  818. Class Function APIservicePath : string;override;
  819. Class Function APIbatchPath : String;override;
  820. Class Function APIAuthScopes : TScopeInfoArray;override;
  821. Class Function APINeedsAuth : Boolean;override;
  822. Class Procedure RegisterAPIResources; override;
  823. //Add create function for resources
  824. Function CreateDivisionsResource(AOwner : TComponent) : TDivisionsResource;virtual;overload;
  825. Function CreateDivisionsResource : TDivisionsResource;virtual;overload;
  826. Function CreateElectionsResource(AOwner : TComponent) : TElectionsResource;virtual;overload;
  827. Function CreateElectionsResource : TElectionsResource;virtual;overload;
  828. Function CreateRepresentativesResource(AOwner : TComponent) : TRepresentativesResource;virtual;overload;
  829. Function CreateRepresentativesResource : TRepresentativesResource;virtual;overload;
  830. //Add default on-demand instances for resources
  831. Property DivisionsResource : TDivisionsResource Read GetDivisionsInstance;
  832. Property ElectionsResource : TElectionsResource Read GetElectionsInstance;
  833. Property RepresentativesResource : TRepresentativesResource Read GetRepresentativesInstance;
  834. end;
  835. implementation
  836. { --------------------------------------------------------------------
  837. TAdministrationRegion
  838. --------------------------------------------------------------------}
  839. Procedure TAdministrationRegion.SetelectionAdministrationBody(AIndex : Integer; AValue : TAdministrativeBody);
  840. begin
  841. If (FelectionAdministrationBody=AValue) then exit;
  842. FelectionAdministrationBody:=AValue;
  843. MarkPropertyChanged(AIndex);
  844. end;
  845. Procedure TAdministrationRegion.Setid(AIndex : Integer; const AValue : String);
  846. begin
  847. If (Fid=AValue) then exit;
  848. Fid:=AValue;
  849. MarkPropertyChanged(AIndex);
  850. end;
  851. Procedure TAdministrationRegion.Setlocal_jurisdiction(AIndex : Integer; AValue : TAdministrationRegion);
  852. begin
  853. If (Flocal_jurisdiction=AValue) then exit;
  854. Flocal_jurisdiction:=AValue;
  855. MarkPropertyChanged(AIndex);
  856. end;
  857. Procedure TAdministrationRegion.Setname(AIndex : Integer; const AValue : String);
  858. begin
  859. If (Fname=AValue) then exit;
  860. Fname:=AValue;
  861. MarkPropertyChanged(AIndex);
  862. end;
  863. Procedure TAdministrationRegion.Setsources(AIndex : Integer; AValue : TAdministrationRegionTypesourcesArray);
  864. begin
  865. If (Fsources=AValue) then exit;
  866. Fsources:=AValue;
  867. MarkPropertyChanged(AIndex);
  868. end;
  869. //2.6.4. bug workaround
  870. {$IFDEF VER2_6}
  871. Procedure TAdministrationRegion.SetArrayLength(Const AName : String; ALength : Longint);
  872. begin
  873. Case AName of
  874. 'sources' : SetLength(Fsources,ALength);
  875. else
  876. Inherited SetArrayLength(AName,ALength);
  877. end;
  878. end;
  879. {$ENDIF VER2_6}
  880. { --------------------------------------------------------------------
  881. TAdministrativeBody
  882. --------------------------------------------------------------------}
  883. Procedure TAdministrativeBody.SetabsenteeVotingInfoUrl(AIndex : Integer; const AValue : String);
  884. begin
  885. If (FabsenteeVotingInfoUrl=AValue) then exit;
  886. FabsenteeVotingInfoUrl:=AValue;
  887. MarkPropertyChanged(AIndex);
  888. end;
  889. Procedure TAdministrativeBody.SetballotInfoUrl(AIndex : Integer; const AValue : String);
  890. begin
  891. If (FballotInfoUrl=AValue) then exit;
  892. FballotInfoUrl:=AValue;
  893. MarkPropertyChanged(AIndex);
  894. end;
  895. Procedure TAdministrativeBody.SetcorrespondenceAddress(AIndex : Integer; AValue : TSimpleAddressType);
  896. begin
  897. If (FcorrespondenceAddress=AValue) then exit;
  898. FcorrespondenceAddress:=AValue;
  899. MarkPropertyChanged(AIndex);
  900. end;
  901. Procedure TAdministrativeBody.SetelectionInfoUrl(AIndex : Integer; const AValue : String);
  902. begin
  903. If (FelectionInfoUrl=AValue) then exit;
  904. FelectionInfoUrl:=AValue;
  905. MarkPropertyChanged(AIndex);
  906. end;
  907. Procedure TAdministrativeBody.SetelectionOfficials(AIndex : Integer; AValue : TAdministrativeBodyTypeelectionOfficialsArray);
  908. begin
  909. If (FelectionOfficials=AValue) then exit;
  910. FelectionOfficials:=AValue;
  911. MarkPropertyChanged(AIndex);
  912. end;
  913. Procedure TAdministrativeBody.SetelectionRegistrationConfirmationUrl(AIndex : Integer; const AValue : String);
  914. begin
  915. If (FelectionRegistrationConfirmationUrl=AValue) then exit;
  916. FelectionRegistrationConfirmationUrl:=AValue;
  917. MarkPropertyChanged(AIndex);
  918. end;
  919. Procedure TAdministrativeBody.SetelectionRegistrationUrl(AIndex : Integer; const AValue : String);
  920. begin
  921. If (FelectionRegistrationUrl=AValue) then exit;
  922. FelectionRegistrationUrl:=AValue;
  923. MarkPropertyChanged(AIndex);
  924. end;
  925. Procedure TAdministrativeBody.SetelectionRulesUrl(AIndex : Integer; const AValue : String);
  926. begin
  927. If (FelectionRulesUrl=AValue) then exit;
  928. FelectionRulesUrl:=AValue;
  929. MarkPropertyChanged(AIndex);
  930. end;
  931. Procedure TAdministrativeBody.SethoursOfOperation(AIndex : Integer; const AValue : String);
  932. begin
  933. If (FhoursOfOperation=AValue) then exit;
  934. FhoursOfOperation:=AValue;
  935. MarkPropertyChanged(AIndex);
  936. end;
  937. Procedure TAdministrativeBody.Setname(AIndex : Integer; const AValue : String);
  938. begin
  939. If (Fname=AValue) then exit;
  940. Fname:=AValue;
  941. MarkPropertyChanged(AIndex);
  942. end;
  943. Procedure TAdministrativeBody.SetphysicalAddress(AIndex : Integer; AValue : TSimpleAddressType);
  944. begin
  945. If (FphysicalAddress=AValue) then exit;
  946. FphysicalAddress:=AValue;
  947. MarkPropertyChanged(AIndex);
  948. end;
  949. Procedure TAdministrativeBody.Setvoter_services(AIndex : Integer; AValue : TStringArray);
  950. begin
  951. If (Fvoter_services=AValue) then exit;
  952. Fvoter_services:=AValue;
  953. MarkPropertyChanged(AIndex);
  954. end;
  955. Procedure TAdministrativeBody.SetvotingLocationFinderUrl(AIndex : Integer; const AValue : String);
  956. begin
  957. If (FvotingLocationFinderUrl=AValue) then exit;
  958. FvotingLocationFinderUrl:=AValue;
  959. MarkPropertyChanged(AIndex);
  960. end;
  961. //2.6.4. bug workaround
  962. {$IFDEF VER2_6}
  963. Procedure TAdministrativeBody.SetArrayLength(Const AName : String; ALength : Longint);
  964. begin
  965. Case AName of
  966. 'electionofficials' : SetLength(FelectionOfficials,ALength);
  967. 'voter_services' : SetLength(Fvoter_services,ALength);
  968. else
  969. Inherited SetArrayLength(AName,ALength);
  970. end;
  971. end;
  972. {$ENDIF VER2_6}
  973. { --------------------------------------------------------------------
  974. TCandidate
  975. --------------------------------------------------------------------}
  976. Procedure TCandidate.SetcandidateUrl(AIndex : Integer; const AValue : String);
  977. begin
  978. If (FcandidateUrl=AValue) then exit;
  979. FcandidateUrl:=AValue;
  980. MarkPropertyChanged(AIndex);
  981. end;
  982. Procedure TCandidate.Setchannels(AIndex : Integer; AValue : TCandidateTypechannelsArray);
  983. begin
  984. If (Fchannels=AValue) then exit;
  985. Fchannels:=AValue;
  986. MarkPropertyChanged(AIndex);
  987. end;
  988. Procedure TCandidate.Setemail(AIndex : Integer; const AValue : String);
  989. begin
  990. If (Femail=AValue) then exit;
  991. Femail:=AValue;
  992. MarkPropertyChanged(AIndex);
  993. end;
  994. Procedure TCandidate.Setname(AIndex : Integer; const AValue : String);
  995. begin
  996. If (Fname=AValue) then exit;
  997. Fname:=AValue;
  998. MarkPropertyChanged(AIndex);
  999. end;
  1000. Procedure TCandidate.SetorderOnBallot(AIndex : Integer; const AValue : String);
  1001. begin
  1002. If (ForderOnBallot=AValue) then exit;
  1003. ForderOnBallot:=AValue;
  1004. MarkPropertyChanged(AIndex);
  1005. end;
  1006. Procedure TCandidate.Setparty(AIndex : Integer; const AValue : String);
  1007. begin
  1008. If (Fparty=AValue) then exit;
  1009. Fparty:=AValue;
  1010. MarkPropertyChanged(AIndex);
  1011. end;
  1012. Procedure TCandidate.Setphone(AIndex : Integer; const AValue : String);
  1013. begin
  1014. If (Fphone=AValue) then exit;
  1015. Fphone:=AValue;
  1016. MarkPropertyChanged(AIndex);
  1017. end;
  1018. Procedure TCandidate.SetphotoUrl(AIndex : Integer; const AValue : String);
  1019. begin
  1020. If (FphotoUrl=AValue) then exit;
  1021. FphotoUrl:=AValue;
  1022. MarkPropertyChanged(AIndex);
  1023. end;
  1024. //2.6.4. bug workaround
  1025. {$IFDEF VER2_6}
  1026. Procedure TCandidate.SetArrayLength(Const AName : String; ALength : Longint);
  1027. begin
  1028. Case AName of
  1029. 'channels' : SetLength(Fchannels,ALength);
  1030. else
  1031. Inherited SetArrayLength(AName,ALength);
  1032. end;
  1033. end;
  1034. {$ENDIF VER2_6}
  1035. { --------------------------------------------------------------------
  1036. TChannel
  1037. --------------------------------------------------------------------}
  1038. Procedure TChannel.Setid(AIndex : Integer; const AValue : String);
  1039. begin
  1040. If (Fid=AValue) then exit;
  1041. Fid:=AValue;
  1042. MarkPropertyChanged(AIndex);
  1043. end;
  1044. Procedure TChannel.Set_type(AIndex : Integer; const AValue : String);
  1045. begin
  1046. If (F_type=AValue) then exit;
  1047. F_type:=AValue;
  1048. MarkPropertyChanged(AIndex);
  1049. end;
  1050. Class Function TChannel.ExportPropertyName(Const AName : String) :String;
  1051. begin
  1052. Case AName of
  1053. '_type' : Result:='type';
  1054. else
  1055. Result:=Inherited ExportPropertyName(AName);
  1056. end;
  1057. end;
  1058. { --------------------------------------------------------------------
  1059. TContest
  1060. --------------------------------------------------------------------}
  1061. Procedure TContest.SetballotPlacement(AIndex : Integer; const AValue : String);
  1062. begin
  1063. If (FballotPlacement=AValue) then exit;
  1064. FballotPlacement:=AValue;
  1065. MarkPropertyChanged(AIndex);
  1066. end;
  1067. Procedure TContest.Setcandidates(AIndex : Integer; AValue : TContestTypecandidatesArray);
  1068. begin
  1069. If (Fcandidates=AValue) then exit;
  1070. Fcandidates:=AValue;
  1071. MarkPropertyChanged(AIndex);
  1072. end;
  1073. Procedure TContest.Setdistrict(AIndex : Integer; AValue : TElectoralDistrict);
  1074. begin
  1075. If (Fdistrict=AValue) then exit;
  1076. Fdistrict:=AValue;
  1077. MarkPropertyChanged(AIndex);
  1078. end;
  1079. Procedure TContest.SetelectorateSpecifications(AIndex : Integer; const AValue : String);
  1080. begin
  1081. If (FelectorateSpecifications=AValue) then exit;
  1082. FelectorateSpecifications:=AValue;
  1083. MarkPropertyChanged(AIndex);
  1084. end;
  1085. Procedure TContest.Setid(AIndex : Integer; const AValue : String);
  1086. begin
  1087. If (Fid=AValue) then exit;
  1088. Fid:=AValue;
  1089. MarkPropertyChanged(AIndex);
  1090. end;
  1091. Procedure TContest.Setlevel(AIndex : Integer; AValue : TStringArray);
  1092. begin
  1093. If (Flevel=AValue) then exit;
  1094. Flevel:=AValue;
  1095. MarkPropertyChanged(AIndex);
  1096. end;
  1097. Procedure TContest.SetnumberElected(AIndex : Integer; const AValue : String);
  1098. begin
  1099. If (FnumberElected=AValue) then exit;
  1100. FnumberElected:=AValue;
  1101. MarkPropertyChanged(AIndex);
  1102. end;
  1103. Procedure TContest.SetnumberVotingFor(AIndex : Integer; const AValue : String);
  1104. begin
  1105. If (FnumberVotingFor=AValue) then exit;
  1106. FnumberVotingFor:=AValue;
  1107. MarkPropertyChanged(AIndex);
  1108. end;
  1109. Procedure TContest.Setoffice(AIndex : Integer; const AValue : String);
  1110. begin
  1111. If (Foffice=AValue) then exit;
  1112. Foffice:=AValue;
  1113. MarkPropertyChanged(AIndex);
  1114. end;
  1115. Procedure TContest.SetprimaryParty(AIndex : Integer; const AValue : String);
  1116. begin
  1117. If (FprimaryParty=AValue) then exit;
  1118. FprimaryParty:=AValue;
  1119. MarkPropertyChanged(AIndex);
  1120. end;
  1121. Procedure TContest.SetreferendumSubtitle(AIndex : Integer; const AValue : String);
  1122. begin
  1123. If (FreferendumSubtitle=AValue) then exit;
  1124. FreferendumSubtitle:=AValue;
  1125. MarkPropertyChanged(AIndex);
  1126. end;
  1127. Procedure TContest.SetreferendumTitle(AIndex : Integer; const AValue : String);
  1128. begin
  1129. If (FreferendumTitle=AValue) then exit;
  1130. FreferendumTitle:=AValue;
  1131. MarkPropertyChanged(AIndex);
  1132. end;
  1133. Procedure TContest.SetreferendumUrl(AIndex : Integer; const AValue : String);
  1134. begin
  1135. If (FreferendumUrl=AValue) then exit;
  1136. FreferendumUrl:=AValue;
  1137. MarkPropertyChanged(AIndex);
  1138. end;
  1139. Procedure TContest.Setroles(AIndex : Integer; AValue : TStringArray);
  1140. begin
  1141. If (Froles=AValue) then exit;
  1142. Froles:=AValue;
  1143. MarkPropertyChanged(AIndex);
  1144. end;
  1145. Procedure TContest.Setsources(AIndex : Integer; AValue : TContestTypesourcesArray);
  1146. begin
  1147. If (Fsources=AValue) then exit;
  1148. Fsources:=AValue;
  1149. MarkPropertyChanged(AIndex);
  1150. end;
  1151. Procedure TContest.Setspecial(AIndex : Integer; const AValue : String);
  1152. begin
  1153. If (Fspecial=AValue) then exit;
  1154. Fspecial:=AValue;
  1155. MarkPropertyChanged(AIndex);
  1156. end;
  1157. Procedure TContest.Set_type(AIndex : Integer; const AValue : String);
  1158. begin
  1159. If (F_type=AValue) then exit;
  1160. F_type:=AValue;
  1161. MarkPropertyChanged(AIndex);
  1162. end;
  1163. Class Function TContest.ExportPropertyName(Const AName : String) :String;
  1164. begin
  1165. Case AName of
  1166. '_type' : Result:='type';
  1167. else
  1168. Result:=Inherited ExportPropertyName(AName);
  1169. end;
  1170. end;
  1171. //2.6.4. bug workaround
  1172. {$IFDEF VER2_6}
  1173. Procedure TContest.SetArrayLength(Const AName : String; ALength : Longint);
  1174. begin
  1175. Case AName of
  1176. 'candidates' : SetLength(Fcandidates,ALength);
  1177. 'level' : SetLength(Flevel,ALength);
  1178. 'roles' : SetLength(Froles,ALength);
  1179. 'sources' : SetLength(Fsources,ALength);
  1180. else
  1181. Inherited SetArrayLength(AName,ALength);
  1182. end;
  1183. end;
  1184. {$ENDIF VER2_6}
  1185. { --------------------------------------------------------------------
  1186. TDivisionSearchResponse
  1187. --------------------------------------------------------------------}
  1188. Procedure TDivisionSearchResponse.Setkind(AIndex : Integer; const AValue : String);
  1189. begin
  1190. If (Fkind=AValue) then exit;
  1191. Fkind:=AValue;
  1192. MarkPropertyChanged(AIndex);
  1193. end;
  1194. Procedure TDivisionSearchResponse.Setresults(AIndex : Integer; AValue : TDivisionSearchResponseTyperesultsArray);
  1195. begin
  1196. If (Fresults=AValue) then exit;
  1197. Fresults:=AValue;
  1198. MarkPropertyChanged(AIndex);
  1199. end;
  1200. //2.6.4. bug workaround
  1201. {$IFDEF VER2_6}
  1202. Procedure TDivisionSearchResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1203. begin
  1204. Case AName of
  1205. 'results' : SetLength(Fresults,ALength);
  1206. else
  1207. Inherited SetArrayLength(AName,ALength);
  1208. end;
  1209. end;
  1210. {$ENDIF VER2_6}
  1211. { --------------------------------------------------------------------
  1212. TDivisionSearchResult
  1213. --------------------------------------------------------------------}
  1214. Procedure TDivisionSearchResult.Setaliases(AIndex : Integer; AValue : TStringArray);
  1215. begin
  1216. If (Faliases=AValue) then exit;
  1217. Faliases:=AValue;
  1218. MarkPropertyChanged(AIndex);
  1219. end;
  1220. Procedure TDivisionSearchResult.Setname(AIndex : Integer; const AValue : String);
  1221. begin
  1222. If (Fname=AValue) then exit;
  1223. Fname:=AValue;
  1224. MarkPropertyChanged(AIndex);
  1225. end;
  1226. Procedure TDivisionSearchResult.SetocdId(AIndex : Integer; const AValue : String);
  1227. begin
  1228. If (FocdId=AValue) then exit;
  1229. FocdId:=AValue;
  1230. MarkPropertyChanged(AIndex);
  1231. end;
  1232. //2.6.4. bug workaround
  1233. {$IFDEF VER2_6}
  1234. Procedure TDivisionSearchResult.SetArrayLength(Const AName : String; ALength : Longint);
  1235. begin
  1236. Case AName of
  1237. 'aliases' : SetLength(Faliases,ALength);
  1238. else
  1239. Inherited SetArrayLength(AName,ALength);
  1240. end;
  1241. end;
  1242. {$ENDIF VER2_6}
  1243. { --------------------------------------------------------------------
  1244. TElection
  1245. --------------------------------------------------------------------}
  1246. Procedure TElection.SetelectionDay(AIndex : Integer; const AValue : String);
  1247. begin
  1248. If (FelectionDay=AValue) then exit;
  1249. FelectionDay:=AValue;
  1250. MarkPropertyChanged(AIndex);
  1251. end;
  1252. Procedure TElection.Setid(AIndex : Integer; const AValue : String);
  1253. begin
  1254. If (Fid=AValue) then exit;
  1255. Fid:=AValue;
  1256. MarkPropertyChanged(AIndex);
  1257. end;
  1258. Procedure TElection.Setname(AIndex : Integer; const AValue : String);
  1259. begin
  1260. If (Fname=AValue) then exit;
  1261. Fname:=AValue;
  1262. MarkPropertyChanged(AIndex);
  1263. end;
  1264. { --------------------------------------------------------------------
  1265. TElectionOfficial
  1266. --------------------------------------------------------------------}
  1267. Procedure TElectionOfficial.SetemailAddress(AIndex : Integer; const AValue : String);
  1268. begin
  1269. If (FemailAddress=AValue) then exit;
  1270. FemailAddress:=AValue;
  1271. MarkPropertyChanged(AIndex);
  1272. end;
  1273. Procedure TElectionOfficial.SetfaxNumber(AIndex : Integer; const AValue : String);
  1274. begin
  1275. If (FfaxNumber=AValue) then exit;
  1276. FfaxNumber:=AValue;
  1277. MarkPropertyChanged(AIndex);
  1278. end;
  1279. Procedure TElectionOfficial.Setname(AIndex : Integer; const AValue : String);
  1280. begin
  1281. If (Fname=AValue) then exit;
  1282. Fname:=AValue;
  1283. MarkPropertyChanged(AIndex);
  1284. end;
  1285. Procedure TElectionOfficial.SetofficePhoneNumber(AIndex : Integer; const AValue : String);
  1286. begin
  1287. If (FofficePhoneNumber=AValue) then exit;
  1288. FofficePhoneNumber:=AValue;
  1289. MarkPropertyChanged(AIndex);
  1290. end;
  1291. Procedure TElectionOfficial.Settitle(AIndex : Integer; const AValue : String);
  1292. begin
  1293. If (Ftitle=AValue) then exit;
  1294. Ftitle:=AValue;
  1295. MarkPropertyChanged(AIndex);
  1296. end;
  1297. { --------------------------------------------------------------------
  1298. TElectionsQueryResponse
  1299. --------------------------------------------------------------------}
  1300. Procedure TElectionsQueryResponse.Setelections(AIndex : Integer; AValue : TElectionsQueryResponseTypeelectionsArray);
  1301. begin
  1302. If (Felections=AValue) then exit;
  1303. Felections:=AValue;
  1304. MarkPropertyChanged(AIndex);
  1305. end;
  1306. Procedure TElectionsQueryResponse.Setkind(AIndex : Integer; const AValue : String);
  1307. begin
  1308. If (Fkind=AValue) then exit;
  1309. Fkind:=AValue;
  1310. MarkPropertyChanged(AIndex);
  1311. end;
  1312. //2.6.4. bug workaround
  1313. {$IFDEF VER2_6}
  1314. Procedure TElectionsQueryResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1315. begin
  1316. Case AName of
  1317. 'elections' : SetLength(Felections,ALength);
  1318. else
  1319. Inherited SetArrayLength(AName,ALength);
  1320. end;
  1321. end;
  1322. {$ENDIF VER2_6}
  1323. { --------------------------------------------------------------------
  1324. TElectoralDistrict
  1325. --------------------------------------------------------------------}
  1326. Procedure TElectoralDistrict.Setid(AIndex : Integer; const AValue : String);
  1327. begin
  1328. If (Fid=AValue) then exit;
  1329. Fid:=AValue;
  1330. MarkPropertyChanged(AIndex);
  1331. end;
  1332. Procedure TElectoralDistrict.Setname(AIndex : Integer; const AValue : String);
  1333. begin
  1334. If (Fname=AValue) then exit;
  1335. Fname:=AValue;
  1336. MarkPropertyChanged(AIndex);
  1337. end;
  1338. Procedure TElectoralDistrict.Setscope(AIndex : Integer; const AValue : String);
  1339. begin
  1340. If (Fscope=AValue) then exit;
  1341. Fscope:=AValue;
  1342. MarkPropertyChanged(AIndex);
  1343. end;
  1344. { --------------------------------------------------------------------
  1345. TGeographicDivision
  1346. --------------------------------------------------------------------}
  1347. Procedure TGeographicDivision.SetalsoKnownAs(AIndex : Integer; AValue : TStringArray);
  1348. begin
  1349. If (FalsoKnownAs=AValue) then exit;
  1350. FalsoKnownAs:=AValue;
  1351. MarkPropertyChanged(AIndex);
  1352. end;
  1353. Procedure TGeographicDivision.Setname(AIndex : Integer; const AValue : String);
  1354. begin
  1355. If (Fname=AValue) then exit;
  1356. Fname:=AValue;
  1357. MarkPropertyChanged(AIndex);
  1358. end;
  1359. Procedure TGeographicDivision.SetofficeIndices(AIndex : Integer; AValue : TintegerArray);
  1360. begin
  1361. If (FofficeIndices=AValue) then exit;
  1362. FofficeIndices:=AValue;
  1363. MarkPropertyChanged(AIndex);
  1364. end;
  1365. //2.6.4. bug workaround
  1366. {$IFDEF VER2_6}
  1367. Procedure TGeographicDivision.SetArrayLength(Const AName : String; ALength : Longint);
  1368. begin
  1369. Case AName of
  1370. 'alsoknownas' : SetLength(FalsoKnownAs,ALength);
  1371. 'officeindices' : SetLength(FofficeIndices,ALength);
  1372. else
  1373. Inherited SetArrayLength(AName,ALength);
  1374. end;
  1375. end;
  1376. {$ENDIF VER2_6}
  1377. { --------------------------------------------------------------------
  1378. TOffice
  1379. --------------------------------------------------------------------}
  1380. Procedure TOffice.SetdivisionId(AIndex : Integer; const AValue : String);
  1381. begin
  1382. If (FdivisionId=AValue) then exit;
  1383. FdivisionId:=AValue;
  1384. MarkPropertyChanged(AIndex);
  1385. end;
  1386. Procedure TOffice.Setlevels(AIndex : Integer; AValue : TStringArray);
  1387. begin
  1388. If (Flevels=AValue) then exit;
  1389. Flevels:=AValue;
  1390. MarkPropertyChanged(AIndex);
  1391. end;
  1392. Procedure TOffice.Setname(AIndex : Integer; const AValue : String);
  1393. begin
  1394. If (Fname=AValue) then exit;
  1395. Fname:=AValue;
  1396. MarkPropertyChanged(AIndex);
  1397. end;
  1398. Procedure TOffice.SetofficialIndices(AIndex : Integer; AValue : TintegerArray);
  1399. begin
  1400. If (FofficialIndices=AValue) then exit;
  1401. FofficialIndices:=AValue;
  1402. MarkPropertyChanged(AIndex);
  1403. end;
  1404. Procedure TOffice.Setroles(AIndex : Integer; AValue : TStringArray);
  1405. begin
  1406. If (Froles=AValue) then exit;
  1407. Froles:=AValue;
  1408. MarkPropertyChanged(AIndex);
  1409. end;
  1410. Procedure TOffice.Setsources(AIndex : Integer; AValue : TOfficeTypesourcesArray);
  1411. begin
  1412. If (Fsources=AValue) then exit;
  1413. Fsources:=AValue;
  1414. MarkPropertyChanged(AIndex);
  1415. end;
  1416. //2.6.4. bug workaround
  1417. {$IFDEF VER2_6}
  1418. Procedure TOffice.SetArrayLength(Const AName : String; ALength : Longint);
  1419. begin
  1420. Case AName of
  1421. 'levels' : SetLength(Flevels,ALength);
  1422. 'officialindices' : SetLength(FofficialIndices,ALength);
  1423. 'roles' : SetLength(Froles,ALength);
  1424. 'sources' : SetLength(Fsources,ALength);
  1425. else
  1426. Inherited SetArrayLength(AName,ALength);
  1427. end;
  1428. end;
  1429. {$ENDIF VER2_6}
  1430. { --------------------------------------------------------------------
  1431. TOfficial
  1432. --------------------------------------------------------------------}
  1433. Procedure TOfficial.Setaddress(AIndex : Integer; AValue : TOfficialTypeaddressArray);
  1434. begin
  1435. If (Faddress=AValue) then exit;
  1436. Faddress:=AValue;
  1437. MarkPropertyChanged(AIndex);
  1438. end;
  1439. Procedure TOfficial.Setchannels(AIndex : Integer; AValue : TOfficialTypechannelsArray);
  1440. begin
  1441. If (Fchannels=AValue) then exit;
  1442. Fchannels:=AValue;
  1443. MarkPropertyChanged(AIndex);
  1444. end;
  1445. Procedure TOfficial.Setemails(AIndex : Integer; AValue : TStringArray);
  1446. begin
  1447. If (Femails=AValue) then exit;
  1448. Femails:=AValue;
  1449. MarkPropertyChanged(AIndex);
  1450. end;
  1451. Procedure TOfficial.Setname(AIndex : Integer; const AValue : String);
  1452. begin
  1453. If (Fname=AValue) then exit;
  1454. Fname:=AValue;
  1455. MarkPropertyChanged(AIndex);
  1456. end;
  1457. Procedure TOfficial.Setparty(AIndex : Integer; const AValue : String);
  1458. begin
  1459. If (Fparty=AValue) then exit;
  1460. Fparty:=AValue;
  1461. MarkPropertyChanged(AIndex);
  1462. end;
  1463. Procedure TOfficial.Setphones(AIndex : Integer; AValue : TStringArray);
  1464. begin
  1465. If (Fphones=AValue) then exit;
  1466. Fphones:=AValue;
  1467. MarkPropertyChanged(AIndex);
  1468. end;
  1469. Procedure TOfficial.SetphotoUrl(AIndex : Integer; const AValue : String);
  1470. begin
  1471. If (FphotoUrl=AValue) then exit;
  1472. FphotoUrl:=AValue;
  1473. MarkPropertyChanged(AIndex);
  1474. end;
  1475. Procedure TOfficial.Seturls(AIndex : Integer; AValue : TStringArray);
  1476. begin
  1477. If (Furls=AValue) then exit;
  1478. Furls:=AValue;
  1479. MarkPropertyChanged(AIndex);
  1480. end;
  1481. //2.6.4. bug workaround
  1482. {$IFDEF VER2_6}
  1483. Procedure TOfficial.SetArrayLength(Const AName : String; ALength : Longint);
  1484. begin
  1485. Case AName of
  1486. 'address' : SetLength(Faddress,ALength);
  1487. 'channels' : SetLength(Fchannels,ALength);
  1488. 'emails' : SetLength(Femails,ALength);
  1489. 'phones' : SetLength(Fphones,ALength);
  1490. 'urls' : SetLength(Furls,ALength);
  1491. else
  1492. Inherited SetArrayLength(AName,ALength);
  1493. end;
  1494. end;
  1495. {$ENDIF VER2_6}
  1496. { --------------------------------------------------------------------
  1497. TPollingLocation
  1498. --------------------------------------------------------------------}
  1499. Procedure TPollingLocation.Setaddress(AIndex : Integer; AValue : TSimpleAddressType);
  1500. begin
  1501. If (Faddress=AValue) then exit;
  1502. Faddress:=AValue;
  1503. MarkPropertyChanged(AIndex);
  1504. end;
  1505. Procedure TPollingLocation.SetendDate(AIndex : Integer; const AValue : String);
  1506. begin
  1507. If (FendDate=AValue) then exit;
  1508. FendDate:=AValue;
  1509. MarkPropertyChanged(AIndex);
  1510. end;
  1511. Procedure TPollingLocation.Setid(AIndex : Integer; const AValue : String);
  1512. begin
  1513. If (Fid=AValue) then exit;
  1514. Fid:=AValue;
  1515. MarkPropertyChanged(AIndex);
  1516. end;
  1517. Procedure TPollingLocation.Setname(AIndex : Integer; const AValue : String);
  1518. begin
  1519. If (Fname=AValue) then exit;
  1520. Fname:=AValue;
  1521. MarkPropertyChanged(AIndex);
  1522. end;
  1523. Procedure TPollingLocation.Setnotes(AIndex : Integer; const AValue : String);
  1524. begin
  1525. If (Fnotes=AValue) then exit;
  1526. Fnotes:=AValue;
  1527. MarkPropertyChanged(AIndex);
  1528. end;
  1529. Procedure TPollingLocation.SetpollingHours(AIndex : Integer; const AValue : String);
  1530. begin
  1531. If (FpollingHours=AValue) then exit;
  1532. FpollingHours:=AValue;
  1533. MarkPropertyChanged(AIndex);
  1534. end;
  1535. Procedure TPollingLocation.Setsources(AIndex : Integer; AValue : TPollingLocationTypesourcesArray);
  1536. begin
  1537. If (Fsources=AValue) then exit;
  1538. Fsources:=AValue;
  1539. MarkPropertyChanged(AIndex);
  1540. end;
  1541. Procedure TPollingLocation.SetstartDate(AIndex : Integer; const AValue : String);
  1542. begin
  1543. If (FstartDate=AValue) then exit;
  1544. FstartDate:=AValue;
  1545. MarkPropertyChanged(AIndex);
  1546. end;
  1547. Procedure TPollingLocation.SetvoterServices(AIndex : Integer; const AValue : String);
  1548. begin
  1549. If (FvoterServices=AValue) then exit;
  1550. FvoterServices:=AValue;
  1551. MarkPropertyChanged(AIndex);
  1552. end;
  1553. //2.6.4. bug workaround
  1554. {$IFDEF VER2_6}
  1555. Procedure TPollingLocation.SetArrayLength(Const AName : String; ALength : Longint);
  1556. begin
  1557. Case AName of
  1558. 'sources' : SetLength(Fsources,ALength);
  1559. else
  1560. Inherited SetArrayLength(AName,ALength);
  1561. end;
  1562. end;
  1563. {$ENDIF VER2_6}
  1564. { --------------------------------------------------------------------
  1565. TRepresentativeInfoDataTypedivisions
  1566. --------------------------------------------------------------------}
  1567. Class Function TRepresentativeInfoDataTypedivisions.AllowAdditionalProperties : Boolean;
  1568. begin
  1569. Result:=True;
  1570. end;
  1571. { --------------------------------------------------------------------
  1572. TRepresentativeInfoData
  1573. --------------------------------------------------------------------}
  1574. Procedure TRepresentativeInfoData.Setdivisions(AIndex : Integer; AValue : TRepresentativeInfoDataTypedivisions);
  1575. begin
  1576. If (Fdivisions=AValue) then exit;
  1577. Fdivisions:=AValue;
  1578. MarkPropertyChanged(AIndex);
  1579. end;
  1580. Procedure TRepresentativeInfoData.Setoffices(AIndex : Integer; AValue : TRepresentativeInfoDataTypeofficesArray);
  1581. begin
  1582. If (Foffices=AValue) then exit;
  1583. Foffices:=AValue;
  1584. MarkPropertyChanged(AIndex);
  1585. end;
  1586. Procedure TRepresentativeInfoData.Setofficials(AIndex : Integer; AValue : TRepresentativeInfoDataTypeofficialsArray);
  1587. begin
  1588. If (Fofficials=AValue) then exit;
  1589. Fofficials:=AValue;
  1590. MarkPropertyChanged(AIndex);
  1591. end;
  1592. //2.6.4. bug workaround
  1593. {$IFDEF VER2_6}
  1594. Procedure TRepresentativeInfoData.SetArrayLength(Const AName : String; ALength : Longint);
  1595. begin
  1596. Case AName of
  1597. 'offices' : SetLength(Foffices,ALength);
  1598. 'officials' : SetLength(Fofficials,ALength);
  1599. else
  1600. Inherited SetArrayLength(AName,ALength);
  1601. end;
  1602. end;
  1603. {$ENDIF VER2_6}
  1604. { --------------------------------------------------------------------
  1605. TRepresentativeInfoResponseTypedivisions
  1606. --------------------------------------------------------------------}
  1607. Class Function TRepresentativeInfoResponseTypedivisions.AllowAdditionalProperties : Boolean;
  1608. begin
  1609. Result:=True;
  1610. end;
  1611. { --------------------------------------------------------------------
  1612. TRepresentativeInfoResponse
  1613. --------------------------------------------------------------------}
  1614. Procedure TRepresentativeInfoResponse.Setdivisions(AIndex : Integer; AValue : TRepresentativeInfoResponseTypedivisions);
  1615. begin
  1616. If (Fdivisions=AValue) then exit;
  1617. Fdivisions:=AValue;
  1618. MarkPropertyChanged(AIndex);
  1619. end;
  1620. Procedure TRepresentativeInfoResponse.Setkind(AIndex : Integer; const AValue : String);
  1621. begin
  1622. If (Fkind=AValue) then exit;
  1623. Fkind:=AValue;
  1624. MarkPropertyChanged(AIndex);
  1625. end;
  1626. Procedure TRepresentativeInfoResponse.SetnormalizedInput(AIndex : Integer; AValue : TSimpleAddressType);
  1627. begin
  1628. If (FnormalizedInput=AValue) then exit;
  1629. FnormalizedInput:=AValue;
  1630. MarkPropertyChanged(AIndex);
  1631. end;
  1632. Procedure TRepresentativeInfoResponse.Setoffices(AIndex : Integer; AValue : TRepresentativeInfoResponseTypeofficesArray);
  1633. begin
  1634. If (Foffices=AValue) then exit;
  1635. Foffices:=AValue;
  1636. MarkPropertyChanged(AIndex);
  1637. end;
  1638. Procedure TRepresentativeInfoResponse.Setofficials(AIndex : Integer; AValue : TRepresentativeInfoResponseTypeofficialsArray);
  1639. begin
  1640. If (Fofficials=AValue) then exit;
  1641. Fofficials:=AValue;
  1642. MarkPropertyChanged(AIndex);
  1643. end;
  1644. //2.6.4. bug workaround
  1645. {$IFDEF VER2_6}
  1646. Procedure TRepresentativeInfoResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1647. begin
  1648. Case AName of
  1649. 'offices' : SetLength(Foffices,ALength);
  1650. 'officials' : SetLength(Fofficials,ALength);
  1651. else
  1652. Inherited SetArrayLength(AName,ALength);
  1653. end;
  1654. end;
  1655. {$ENDIF VER2_6}
  1656. { --------------------------------------------------------------------
  1657. TSimpleAddressType
  1658. --------------------------------------------------------------------}
  1659. Procedure TSimpleAddressType.Setcity(AIndex : Integer; const AValue : String);
  1660. begin
  1661. If (Fcity=AValue) then exit;
  1662. Fcity:=AValue;
  1663. MarkPropertyChanged(AIndex);
  1664. end;
  1665. Procedure TSimpleAddressType.Setline1(AIndex : Integer; const AValue : String);
  1666. begin
  1667. If (Fline1=AValue) then exit;
  1668. Fline1:=AValue;
  1669. MarkPropertyChanged(AIndex);
  1670. end;
  1671. Procedure TSimpleAddressType.Setline2(AIndex : Integer; const AValue : String);
  1672. begin
  1673. If (Fline2=AValue) then exit;
  1674. Fline2:=AValue;
  1675. MarkPropertyChanged(AIndex);
  1676. end;
  1677. Procedure TSimpleAddressType.Setline3(AIndex : Integer; const AValue : String);
  1678. begin
  1679. If (Fline3=AValue) then exit;
  1680. Fline3:=AValue;
  1681. MarkPropertyChanged(AIndex);
  1682. end;
  1683. Procedure TSimpleAddressType.SetlocationName(AIndex : Integer; const AValue : String);
  1684. begin
  1685. If (FlocationName=AValue) then exit;
  1686. FlocationName:=AValue;
  1687. MarkPropertyChanged(AIndex);
  1688. end;
  1689. Procedure TSimpleAddressType.Setstate(AIndex : Integer; const AValue : String);
  1690. begin
  1691. If (Fstate=AValue) then exit;
  1692. Fstate:=AValue;
  1693. MarkPropertyChanged(AIndex);
  1694. end;
  1695. Procedure TSimpleAddressType.Setzip(AIndex : Integer; const AValue : String);
  1696. begin
  1697. If (Fzip=AValue) then exit;
  1698. Fzip:=AValue;
  1699. MarkPropertyChanged(AIndex);
  1700. end;
  1701. { --------------------------------------------------------------------
  1702. TSource
  1703. --------------------------------------------------------------------}
  1704. Procedure TSource.Setname(AIndex : Integer; const AValue : String);
  1705. begin
  1706. If (Fname=AValue) then exit;
  1707. Fname:=AValue;
  1708. MarkPropertyChanged(AIndex);
  1709. end;
  1710. Procedure TSource.Setofficial(AIndex : Integer; AValue : boolean);
  1711. begin
  1712. If (Fofficial=AValue) then exit;
  1713. Fofficial:=AValue;
  1714. MarkPropertyChanged(AIndex);
  1715. end;
  1716. { --------------------------------------------------------------------
  1717. TVoterInfoResponse
  1718. --------------------------------------------------------------------}
  1719. Procedure TVoterInfoResponse.Setcontests(AIndex : Integer; AValue : TVoterInfoResponseTypecontestsArray);
  1720. begin
  1721. If (Fcontests=AValue) then exit;
  1722. Fcontests:=AValue;
  1723. MarkPropertyChanged(AIndex);
  1724. end;
  1725. Procedure TVoterInfoResponse.SetdropOffLocations(AIndex : Integer; AValue : TVoterInfoResponseTypedropOffLocationsArray);
  1726. begin
  1727. If (FdropOffLocations=AValue) then exit;
  1728. FdropOffLocations:=AValue;
  1729. MarkPropertyChanged(AIndex);
  1730. end;
  1731. Procedure TVoterInfoResponse.SetearlyVoteSites(AIndex : Integer; AValue : TVoterInfoResponseTypeearlyVoteSitesArray);
  1732. begin
  1733. If (FearlyVoteSites=AValue) then exit;
  1734. FearlyVoteSites:=AValue;
  1735. MarkPropertyChanged(AIndex);
  1736. end;
  1737. Procedure TVoterInfoResponse.Setelection(AIndex : Integer; AValue : TElection);
  1738. begin
  1739. If (Felection=AValue) then exit;
  1740. Felection:=AValue;
  1741. MarkPropertyChanged(AIndex);
  1742. end;
  1743. Procedure TVoterInfoResponse.Setkind(AIndex : Integer; const AValue : String);
  1744. begin
  1745. If (Fkind=AValue) then exit;
  1746. Fkind:=AValue;
  1747. MarkPropertyChanged(AIndex);
  1748. end;
  1749. Procedure TVoterInfoResponse.SetnormalizedInput(AIndex : Integer; AValue : TSimpleAddressType);
  1750. begin
  1751. If (FnormalizedInput=AValue) then exit;
  1752. FnormalizedInput:=AValue;
  1753. MarkPropertyChanged(AIndex);
  1754. end;
  1755. Procedure TVoterInfoResponse.SetotherElections(AIndex : Integer; AValue : TVoterInfoResponseTypeotherElectionsArray);
  1756. begin
  1757. If (FotherElections=AValue) then exit;
  1758. FotherElections:=AValue;
  1759. MarkPropertyChanged(AIndex);
  1760. end;
  1761. Procedure TVoterInfoResponse.SetpollingLocations(AIndex : Integer; AValue : TVoterInfoResponseTypepollingLocationsArray);
  1762. begin
  1763. If (FpollingLocations=AValue) then exit;
  1764. FpollingLocations:=AValue;
  1765. MarkPropertyChanged(AIndex);
  1766. end;
  1767. Procedure TVoterInfoResponse.SetprecinctId(AIndex : Integer; const AValue : String);
  1768. begin
  1769. If (FprecinctId=AValue) then exit;
  1770. FprecinctId:=AValue;
  1771. MarkPropertyChanged(AIndex);
  1772. end;
  1773. Procedure TVoterInfoResponse.Setstate(AIndex : Integer; AValue : TVoterInfoResponseTypestateArray);
  1774. begin
  1775. If (Fstate=AValue) then exit;
  1776. Fstate:=AValue;
  1777. MarkPropertyChanged(AIndex);
  1778. end;
  1779. //2.6.4. bug workaround
  1780. {$IFDEF VER2_6}
  1781. Procedure TVoterInfoResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1782. begin
  1783. Case AName of
  1784. 'contests' : SetLength(Fcontests,ALength);
  1785. 'dropofflocations' : SetLength(FdropOffLocations,ALength);
  1786. 'earlyvotesites' : SetLength(FearlyVoteSites,ALength);
  1787. 'otherelections' : SetLength(FotherElections,ALength);
  1788. 'pollinglocations' : SetLength(FpollingLocations,ALength);
  1789. 'state' : SetLength(Fstate,ALength);
  1790. else
  1791. Inherited SetArrayLength(AName,ALength);
  1792. end;
  1793. end;
  1794. {$ENDIF VER2_6}
  1795. { --------------------------------------------------------------------
  1796. TDivisionsResource
  1797. --------------------------------------------------------------------}
  1798. Class Function TDivisionsResource.ResourceName : String;
  1799. begin
  1800. Result:='divisions';
  1801. end;
  1802. Class Function TDivisionsResource.DefaultAPI : TGoogleAPIClass;
  1803. begin
  1804. Result:=TcivicinfoAPI;
  1805. end;
  1806. Function TDivisionsResource.Search(AQuery : string = '') : TDivisionSearchResponse;
  1807. Const
  1808. _HTTPMethod = 'GET';
  1809. _Path = 'divisions';
  1810. _Methodid = 'civicinfo.divisions.search';
  1811. begin
  1812. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TDivisionSearchResponse) as TDivisionSearchResponse;
  1813. end;
  1814. Function TDivisionsResource.Search(AQuery : TDivisionssearchOptions) : TDivisionSearchResponse;
  1815. Var
  1816. _Q : String;
  1817. begin
  1818. _Q:='';
  1819. AddToQuery(_Q,'query',AQuery.query);
  1820. Result:=Search(_Q);
  1821. end;
  1822. { --------------------------------------------------------------------
  1823. TElectionsResource
  1824. --------------------------------------------------------------------}
  1825. Class Function TElectionsResource.ResourceName : String;
  1826. begin
  1827. Result:='elections';
  1828. end;
  1829. Class Function TElectionsResource.DefaultAPI : TGoogleAPIClass;
  1830. begin
  1831. Result:=TcivicinfoAPI;
  1832. end;
  1833. Function TElectionsResource.ElectionQuery : TElectionsQueryResponse;
  1834. Const
  1835. _HTTPMethod = 'GET';
  1836. _Path = 'elections';
  1837. _Methodid = 'civicinfo.elections.electionQuery';
  1838. begin
  1839. Result:=ServiceCall(_HTTPMethod,_Path,'',Nil,TElectionsQueryResponse) as TElectionsQueryResponse;
  1840. end;
  1841. Function TElectionsResource.VoterInfoQuery(AQuery : string = '') : TVoterInfoResponse;
  1842. Const
  1843. _HTTPMethod = 'GET';
  1844. _Path = 'voterinfo';
  1845. _Methodid = 'civicinfo.elections.voterInfoQuery';
  1846. begin
  1847. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TVoterInfoResponse) as TVoterInfoResponse;
  1848. end;
  1849. Function TElectionsResource.VoterInfoQuery(AQuery : TElectionsvoterInfoQueryOptions) : TVoterInfoResponse;
  1850. Var
  1851. _Q : String;
  1852. begin
  1853. _Q:='';
  1854. AddToQuery(_Q,'address',AQuery.address);
  1855. AddToQuery(_Q,'electionId',AQuery.electionId);
  1856. AddToQuery(_Q,'officialOnly',AQuery.officialOnly);
  1857. Result:=VoterInfoQuery(_Q);
  1858. end;
  1859. { --------------------------------------------------------------------
  1860. TRepresentativesResource
  1861. --------------------------------------------------------------------}
  1862. Class Function TRepresentativesResource.ResourceName : String;
  1863. begin
  1864. Result:='representatives';
  1865. end;
  1866. Class Function TRepresentativesResource.DefaultAPI : TGoogleAPIClass;
  1867. begin
  1868. Result:=TcivicinfoAPI;
  1869. end;
  1870. Function TRepresentativesResource.RepresentativeInfoByAddress(AQuery : string = '') : TRepresentativeInfoResponse;
  1871. Const
  1872. _HTTPMethod = 'GET';
  1873. _Path = 'representatives';
  1874. _Methodid = 'civicinfo.representatives.representativeInfoByAddress';
  1875. begin
  1876. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TRepresentativeInfoResponse) as TRepresentativeInfoResponse;
  1877. end;
  1878. Function TRepresentativesResource.RepresentativeInfoByAddress(AQuery : TRepresentativesrepresentativeInfoByAddressOptions) : TRepresentativeInfoResponse;
  1879. Var
  1880. _Q : String;
  1881. begin
  1882. _Q:='';
  1883. AddToQuery(_Q,'address',AQuery.address);
  1884. AddToQuery(_Q,'includeOffices',AQuery.includeOffices);
  1885. AddToQuery(_Q,'levels',AQuery.levels);
  1886. AddToQuery(_Q,'roles',AQuery.roles);
  1887. Result:=RepresentativeInfoByAddress(_Q);
  1888. end;
  1889. Function TRepresentativesResource.RepresentativeInfoByDivision(ocdId: string; AQuery : string = '') : TRepresentativeInfoData;
  1890. Const
  1891. _HTTPMethod = 'GET';
  1892. _Path = 'representatives/{ocdId}';
  1893. _Methodid = 'civicinfo.representatives.representativeInfoByDivision';
  1894. Var
  1895. _P : String;
  1896. begin
  1897. _P:=SubstitutePath(_Path,['ocdId',ocdId]);
  1898. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TRepresentativeInfoData) as TRepresentativeInfoData;
  1899. end;
  1900. Function TRepresentativesResource.RepresentativeInfoByDivision(ocdId: string; AQuery : TRepresentativesrepresentativeInfoByDivisionOptions) : TRepresentativeInfoData;
  1901. Var
  1902. _Q : String;
  1903. begin
  1904. _Q:='';
  1905. AddToQuery(_Q,'levels',AQuery.levels);
  1906. AddToQuery(_Q,'recursive',AQuery.recursive);
  1907. AddToQuery(_Q,'roles',AQuery.roles);
  1908. Result:=RepresentativeInfoByDivision(ocdId,_Q);
  1909. end;
  1910. { --------------------------------------------------------------------
  1911. TCivicinfoAPI
  1912. --------------------------------------------------------------------}
  1913. Class Function TCivicinfoAPI.APIName : String;
  1914. begin
  1915. Result:='civicinfo';
  1916. end;
  1917. Class Function TCivicinfoAPI.APIVersion : String;
  1918. begin
  1919. Result:='v2';
  1920. end;
  1921. Class Function TCivicinfoAPI.APIRevision : String;
  1922. begin
  1923. Result:='20150302';
  1924. end;
  1925. Class Function TCivicinfoAPI.APIID : String;
  1926. begin
  1927. Result:='civicinfo:v2';
  1928. end;
  1929. Class Function TCivicinfoAPI.APITitle : String;
  1930. begin
  1931. Result:='Google Civic Information API';
  1932. end;
  1933. Class Function TCivicinfoAPI.APIDescription : String;
  1934. begin
  1935. Result:='An API for accessing civic information.';
  1936. end;
  1937. Class Function TCivicinfoAPI.APIOwnerDomain : String;
  1938. begin
  1939. Result:='google.com';
  1940. end;
  1941. Class Function TCivicinfoAPI.APIOwnerName : String;
  1942. begin
  1943. Result:='Google';
  1944. end;
  1945. Class Function TCivicinfoAPI.APIIcon16 : String;
  1946. begin
  1947. Result:='http://www.google.com/images/icons/product/search-16.gif';
  1948. end;
  1949. Class Function TCivicinfoAPI.APIIcon32 : String;
  1950. begin
  1951. Result:='http://www.google.com/images/icons/product/search-32.gif';
  1952. end;
  1953. Class Function TCivicinfoAPI.APIdocumentationLink : String;
  1954. begin
  1955. Result:='https://developers.google.com/civic-information';
  1956. end;
  1957. Class Function TCivicinfoAPI.APIrootUrl : string;
  1958. begin
  1959. Result:='https://www.googleapis.com:443/';
  1960. end;
  1961. Class Function TCivicinfoAPI.APIbasePath : string;
  1962. begin
  1963. Result:='/civicinfo/v2/';
  1964. end;
  1965. Class Function TCivicinfoAPI.APIbaseURL : String;
  1966. begin
  1967. Result:='https://www.googleapis.com:443/civicinfo/v2/';
  1968. end;
  1969. Class Function TCivicinfoAPI.APIProtocol : string;
  1970. begin
  1971. Result:='rest';
  1972. end;
  1973. Class Function TCivicinfoAPI.APIservicePath : string;
  1974. begin
  1975. Result:='civicinfo/v2/';
  1976. end;
  1977. Class Function TCivicinfoAPI.APIbatchPath : String;
  1978. begin
  1979. Result:='batch';
  1980. end;
  1981. Class Function TCivicinfoAPI.APIAuthScopes : TScopeInfoArray;
  1982. begin
  1983. SetLength(Result,0);
  1984. end;
  1985. Class Function TCivicinfoAPI.APINeedsAuth : Boolean;
  1986. begin
  1987. Result:=False;
  1988. end;
  1989. Class Procedure TCivicinfoAPI.RegisterAPIResources;
  1990. begin
  1991. TAdministrationRegion.RegisterObject;
  1992. TAdministrativeBody.RegisterObject;
  1993. TCandidate.RegisterObject;
  1994. TChannel.RegisterObject;
  1995. TContest.RegisterObject;
  1996. TDivisionSearchResponse.RegisterObject;
  1997. TDivisionSearchResult.RegisterObject;
  1998. TElection.RegisterObject;
  1999. TElectionOfficial.RegisterObject;
  2000. TElectionsQueryResponse.RegisterObject;
  2001. TElectoralDistrict.RegisterObject;
  2002. TGeographicDivision.RegisterObject;
  2003. TOffice.RegisterObject;
  2004. TOfficial.RegisterObject;
  2005. TPollingLocation.RegisterObject;
  2006. TRepresentativeInfoDataTypedivisions.RegisterObject;
  2007. TRepresentativeInfoData.RegisterObject;
  2008. TRepresentativeInfoResponseTypedivisions.RegisterObject;
  2009. TRepresentativeInfoResponse.RegisterObject;
  2010. TSimpleAddressType.RegisterObject;
  2011. TSource.RegisterObject;
  2012. TVoterInfoResponse.RegisterObject;
  2013. end;
  2014. Function TCivicinfoAPI.GetDivisionsInstance : TDivisionsResource;
  2015. begin
  2016. if (FDivisionsInstance=Nil) then
  2017. FDivisionsInstance:=CreateDivisionsResource;
  2018. Result:=FDivisionsInstance;
  2019. end;
  2020. Function TCivicinfoAPI.CreateDivisionsResource : TDivisionsResource;
  2021. begin
  2022. Result:=CreateDivisionsResource(Self);
  2023. end;
  2024. Function TCivicinfoAPI.CreateDivisionsResource(AOwner : TComponent) : TDivisionsResource;
  2025. begin
  2026. Result:=TDivisionsResource.Create(AOwner);
  2027. Result.API:=Self.API;
  2028. end;
  2029. Function TCivicinfoAPI.GetElectionsInstance : TElectionsResource;
  2030. begin
  2031. if (FElectionsInstance=Nil) then
  2032. FElectionsInstance:=CreateElectionsResource;
  2033. Result:=FElectionsInstance;
  2034. end;
  2035. Function TCivicinfoAPI.CreateElectionsResource : TElectionsResource;
  2036. begin
  2037. Result:=CreateElectionsResource(Self);
  2038. end;
  2039. Function TCivicinfoAPI.CreateElectionsResource(AOwner : TComponent) : TElectionsResource;
  2040. begin
  2041. Result:=TElectionsResource.Create(AOwner);
  2042. Result.API:=Self.API;
  2043. end;
  2044. Function TCivicinfoAPI.GetRepresentativesInstance : TRepresentativesResource;
  2045. begin
  2046. if (FRepresentativesInstance=Nil) then
  2047. FRepresentativesInstance:=CreateRepresentativesResource;
  2048. Result:=FRepresentativesInstance;
  2049. end;
  2050. Function TCivicinfoAPI.CreateRepresentativesResource : TRepresentativesResource;
  2051. begin
  2052. Result:=CreateRepresentativesResource(Self);
  2053. end;
  2054. Function TCivicinfoAPI.CreateRepresentativesResource(AOwner : TComponent) : TRepresentativesResource;
  2055. begin
  2056. Result:=TRepresentativesResource.Create(AOwner);
  2057. Result.API:=Self.API;
  2058. end;
  2059. initialization
  2060. TCivicinfoAPI.RegisterAPI;
  2061. end.