v2.d.ts
47.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
/**
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { OAuth2Client, JWT, Compute, UserRefreshClient } from 'google-auth-library';
import { GoogleConfigurable, MethodOptions, GlobalOptions, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
import { GaxiosPromise } from 'gaxios';
export declare namespace civicinfo_v2 {
export interface Options extends GlobalOptions {
version: 'v2';
}
interface StandardParameters {
/**
* Data format for the response.
*/
alt?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
*/
quotaUser?: string;
/**
* Deprecated. Please use quotaUser instead.
*/
userIp?: string;
}
/**
* Google Civic Information API
*
* Provides polling places, early vote locations, contest data, election officials, and government representatives for U.S. residential addresses.
*
* @example
* const {google} = require('googleapis');
* const civicinfo = google.civicinfo('v2');
*
* @namespace civicinfo
* @type {Function}
* @version v2
* @variation v2
* @param {object=} options Options for Civicinfo
*/
export class Civicinfo {
context: APIRequestContext;
divisions: Resource$Divisions;
elections: Resource$Elections;
representatives: Resource$Representatives;
constructor(options: GlobalOptions, google?: GoogleConfigurable);
}
/**
* Describes information about a regional election administrative area.
*/
export interface Schema$AdministrationRegion {
/**
* The election administration body for this area.
*/
electionAdministrationBody?: Schema$AdministrativeBody;
/**
* An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested from the Request more link on the Quotas page.
*/
id?: string | null;
/**
* The city or county that provides election information for this voter. This object can have the same elements as state.
*/
local_jurisdiction?: Schema$AdministrationRegion;
/**
* The name of the jurisdiction.
*/
name?: string | null;
/**
* A list of sources for this area. If multiple sources are listed the data has been aggregated from those sources.
*/
sources?: Schema$Source[];
}
/**
* Information about an election administrative body (e.g. County Board of Elections).
*/
export interface Schema$AdministrativeBody {
/**
* A URL provided by this administrative body for information on absentee voting.
*/
absenteeVotingInfoUrl?: string | null;
addressLines?: string[] | null;
/**
* A URL provided by this administrative body to give contest information to the voter.
*/
ballotInfoUrl?: string | null;
/**
* The mailing address of this administrative body.
*/
correspondenceAddress?: Schema$SimpleAddressType;
/**
* A URL provided by this administrative body for looking up general election information.
*/
electionInfoUrl?: string | null;
/**
* The election officials for this election administrative body.
*/
electionOfficials?: Schema$ElectionOfficial[];
/**
* A URL provided by this administrative body for confirming that the voter is registered to vote.
*/
electionRegistrationConfirmationUrl?: string | null;
/**
* A URL provided by this administrative body for looking up how to register to vote.
*/
electionRegistrationUrl?: string | null;
/**
* A URL provided by this administrative body describing election rules to the voter.
*/
electionRulesUrl?: string | null;
/**
* A description of the hours of operation for this administrative body.
*/
hoursOfOperation?: string | null;
/**
* The name of this election administrative body.
*/
name?: string | null;
/**
* The physical address of this administrative body.
*/
physicalAddress?: Schema$SimpleAddressType;
/**
* A description of the services this administrative body may provide.
*/
voter_services?: string[] | null;
/**
* A URL provided by this administrative body for looking up where to vote.
*/
votingLocationFinderUrl?: string | null;
}
/**
* Information about a candidate running for elected office.
*/
export interface Schema$Candidate {
/**
* The URL for the candidate's campaign web site.
*/
candidateUrl?: string | null;
/**
* A list of known (social) media channels for this candidate.
*/
channels?: Schema$Channel[];
/**
* The email address for the candidate's campaign.
*/
email?: string | null;
/**
* The candidate's name. If this is a joint ticket it will indicate the name of the candidate at the top of a ticket followed by a / and that name of candidate at the bottom of the ticket. e.g. "Mitt Romney / Paul Ryan"
*/
name?: string | null;
/**
* The order the candidate appears on the ballot for this contest.
*/
orderOnBallot?: string | null;
/**
* The full name of the party the candidate is a member of.
*/
party?: string | null;
/**
* The voice phone number for the candidate's campaign office.
*/
phone?: string | null;
/**
* A URL for a photo of the candidate.
*/
photoUrl?: string | null;
}
/**
* A social media or web channel for a candidate.
*/
export interface Schema$Channel {
/**
* The unique public identifier for the candidate's channel.
*/
id?: string | null;
/**
* The type of channel. The following is a list of types of channels, but is not exhaustive. More channel types may be added at a later time. One of: GooglePlus, YouTube, Facebook, Twitter
*/
type?: string | null;
}
/**
* Information about a contest that appears on a voter's ballot.
*/
export interface Schema$Contest {
/**
* A number specifying the position of this contest on the voter's ballot.
*/
ballotPlacement?: string | null;
/**
* The official title on the ballot for this contest, only where available.
*/
ballotTitle?: string | null;
/**
* The candidate choices for this contest.
*/
candidates?: Schema$Candidate[];
/**
* Information about the electoral district that this contest is in.
*/
district?: Schema$ElectoralDistrict;
/**
* A description of any additional eligibility requirements for voting in this contest.
*/
electorateSpecifications?: string | null;
/**
* An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested from the Request more link on the Quotas page.
*/
id?: string | null;
/**
* The levels of government of the office for this contest. There may be more than one in cases where a jurisdiction effectively acts at two different levels of government; for example, the mayor of the District of Columbia acts at "locality" level, but also effectively at both "administrative-area-2" and "administrative-area-1".
*/
level?: string[] | null;
/**
* The number of candidates that will be elected to office in this contest.
*/
numberElected?: string | null;
/**
* The number of candidates that a voter may vote for in this contest.
*/
numberVotingFor?: string | null;
/**
* The name of the office for this contest.
*/
office?: string | null;
/**
* If this is a partisan election, the name of the party it is for.
*/
primaryParty?: string | null;
/**
* The set of ballot responses for the referendum. A ballot response represents a line on the ballot. Common examples might include "yes" or "no" for referenda. This field is only populated for contests of type 'Referendum'.
*/
referendumBallotResponses?: string[] | null;
/**
* Specifies a short summary of the referendum that is typically on the ballot below the title but above the text. This field is only populated for contests of type 'Referendum'.
*/
referendumBrief?: string | null;
/**
* A statement in opposition to the referendum. It does not necessarily appear on the ballot. This field is only populated for contests of type 'Referendum'.
*/
referendumConStatement?: string | null;
/**
* Specifies what effect abstaining (not voting) on the proposition will have (i.e. whether abstaining is considered a vote against it). This field is only populated for contests of type 'Referendum'.
*/
referendumEffectOfAbstain?: string | null;
/**
* The threshold of votes that the referendum needs in order to pass, e.g. "two-thirds". This field is only populated for contests of type 'Referendum'.
*/
referendumPassageThreshold?: string | null;
/**
* A statement in favor of the referendum. It does not necessarily appear on the ballot. This field is only populated for contests of type 'Referendum'.
*/
referendumProStatement?: string | null;
/**
* A brief description of the referendum. This field is only populated for contests of type 'Referendum'.
*/
referendumSubtitle?: string | null;
/**
* The full text of the referendum. This field is only populated for contests of type 'Referendum'.
*/
referendumText?: string | null;
/**
* The title of the referendum (e.g. 'Proposition 42'). This field is only populated for contests of type 'Referendum'.
*/
referendumTitle?: string | null;
/**
* A link to the referendum. This field is only populated for contests of type 'Referendum'.
*/
referendumUrl?: string | null;
/**
* The roles which this office fulfills.
*/
roles?: string[] | null;
/**
* A list of sources for this contest. If multiple sources are listed, the data has been aggregated from those sources.
*/
sources?: Schema$Source[];
/**
* "Yes" or "No" depending on whether this a contest being held outside the normal election cycle.
*/
special?: string | null;
/**
* The type of contest. Usually this will be 'General', 'Primary', or 'Run-off' for contests with candidates. For referenda this will be 'Referendum'. For Retention contests this will typically be 'Retention'.
*/
type?: string | null;
}
export interface Schema$ContextParams {
clientProfile?: string | null;
}
/**
* A request to look up representative information for a single division.
*/
export interface Schema$DivisionRepresentativeInfoRequest {
contextParams?: Schema$ContextParams;
}
/**
* A search request for political geographies.
*/
export interface Schema$DivisionSearchRequest {
contextParams?: Schema$ContextParams;
}
/**
* The result of a division search query.
*/
export interface Schema$DivisionSearchResponse {
/**
* Identifies what kind of resource this is. Value: the fixed string "civicinfo#divisionSearchResponse".
*/
kind?: string | null;
results?: Schema$DivisionSearchResult[];
}
/**
* Represents a political geographic division that matches the requested query.
*/
export interface Schema$DivisionSearchResult {
/**
* Other Open Civic Data identifiers that refer to the same division -- for example, those that refer to other political divisions whose boundaries are defined to be coterminous with this one. For example, ocd-division/country:us/state:wy will include an alias of ocd-division/country:us/state:wy/cd:1, since Wyoming has only one Congressional district.
*/
aliases?: string[] | null;
/**
* The name of the division.
*/
name?: string | null;
/**
* The unique Open Civic Data identifier for this division.
*/
ocdId?: string | null;
}
/**
* Information about the election that was queried.
*/
export interface Schema$Election {
/**
* Day of the election in YYYY-MM-DD format.
*/
electionDay?: string | null;
/**
* The unique ID of this election.
*/
id?: string | null;
/**
* A displayable name for the election.
*/
name?: string | null;
/**
* The political division of the election. Represented as an OCD Division ID. Voters within these political jurisdictions are covered by this election. This is typically a state such as ocd-division/country:us/state:ca or for the midterms or general election the entire US (i.e. ocd-division/country:us).
*/
ocdDivisionId?: string | null;
}
/**
* Information about individual election officials.
*/
export interface Schema$ElectionOfficial {
/**
* The email address of the election official.
*/
emailAddress?: string | null;
/**
* The fax number of the election official.
*/
faxNumber?: string | null;
/**
* The full name of the election official.
*/
name?: string | null;
/**
* The office phone number of the election official.
*/
officePhoneNumber?: string | null;
/**
* The title of the election official.
*/
title?: string | null;
}
export interface Schema$ElectionsQueryRequest {
contextParams?: Schema$ContextParams;
}
/**
* The list of elections available for this version of the API.
*/
export interface Schema$ElectionsQueryResponse {
/**
* A list of available elections
*/
elections?: Schema$Election[];
/**
* Identifies what kind of resource this is. Value: the fixed string "civicinfo#electionsQueryResponse".
*/
kind?: string | null;
}
/**
* Describes the geographic scope of a contest.
*/
export interface Schema$ElectoralDistrict {
/**
* An identifier for this district, relative to its scope. For example, the 34th State Senate district would have id "34" and a scope of stateUpper.
*/
id?: string | null;
kgForeignKey?: string | null;
/**
* The name of the district.
*/
name?: string | null;
/**
* The geographic scope of this district. If unspecified the district's geography is not known. One of: national, statewide, congressional, stateUpper, stateLower, countywide, judicial, schoolBoard, cityWide, township, countyCouncil, cityCouncil, ward, special
*/
scope?: string | null;
}
export interface Schema$FieldMetadataProto {
internal?: Schema$InternalFieldMetadataProto;
}
/**
* Describes a political geography.
*/
export interface Schema$GeographicDivision {
/**
* Any other valid OCD IDs that refer to the same division. Because OCD IDs are meant to be human-readable and at least somewhat predictable, there are occasionally several identifiers for a single division. These identifiers are defined to be equivalent to one another, and one is always indicated as the primary identifier. The primary identifier will be returned in ocd_id above, and any other equivalent valid identifiers will be returned in this list. For example, if this division's OCD ID is ocd-division/country:us/district:dc, this will contain ocd-division/country:us/state:dc.
*/
alsoKnownAs?: string[] | null;
/**
* The name of the division.
*/
name?: string | null;
/**
* List of indices in the offices array, one for each office elected from this division. Will only be present if includeOffices was true (or absent) in the request.
*/
officeIndices?: number[] | null;
}
export interface Schema$InternalFieldMetadataProto {
isAuto?: boolean | null;
sourceSummary?: Schema$InternalSourceSummaryProto;
}
export interface Schema$InternalSourceSummaryProto {
dataset?: string | null;
provider?: string | null;
}
export interface Schema$LivegraphBacktraceRecordInfo {
dataSourcePublishMsec?: string | null;
expId?: string | null;
expInfo?: Schema$LivegraphBacktraceRecordInfoExpInfo;
isRecon?: boolean | null;
isWlmThrottled?: boolean | null;
numberOfTriples?: string | null;
priority?: string | null;
process?: string | null;
proxyReceiveMsec?: string | null;
proxySentMsec?: string | null;
recordId?: string | null;
shouldMonitorLatency?: boolean | null;
subscriberReceiveMsec?: string | null;
topicBuildFinishMsec?: string | null;
topicBuildStartMsec?: string | null;
version?: string | null;
}
export interface Schema$LivegraphBacktraceRecordInfoExpInfo {
deletedIns?: string[] | null;
}
export interface Schema$MessageSet {
recordMessageSetExt?: Schema$LivegraphBacktraceRecordInfo;
}
/**
* Information about an Office held by one or more Officials.
*/
export interface Schema$Office {
/**
* The OCD ID of the division with which this office is associated.
*/
divisionId?: string | null;
/**
* The levels of government of which this office is part. There may be more than one in cases where a jurisdiction effectively acts at two different levels of government; for example, the mayor of the District of Columbia acts at "locality" level, but also effectively at both "administrative-area-2" and "administrative-area-1".
*/
levels?: string[] | null;
/**
* The human-readable name of the office.
*/
name?: string | null;
/**
* List of indices in the officials array of people who presently hold this office.
*/
officialIndices?: number[] | null;
/**
* The roles which this office fulfills. Roles are not meant to be exhaustive, or to exactly specify the entire set of responsibilities of a given office, but are meant to be rough categories that are useful for general selection from or sorting of a list of offices.
*/
roles?: string[] | null;
/**
* A list of sources for this office. If multiple sources are listed, the data has been aggregated from those sources.
*/
sources?: Schema$Source[];
}
/**
* Information about a person holding an elected office.
*/
export interface Schema$Official {
/**
* Addresses at which to contact the official.
*/
address?: Schema$SimpleAddressType[];
/**
* A list of known (social) media channels for this official.
*/
channels?: Schema$Channel[];
/**
* The direct email addresses for the official.
*/
emails?: string[] | null;
/**
* The official's name.
*/
name?: string | null;
/**
* The full name of the party the official belongs to.
*/
party?: string | null;
/**
* The official's public contact phone numbers.
*/
phones?: string[] | null;
/**
* A URL for a photo of the official.
*/
photoUrl?: string | null;
/**
* The official's public website URLs.
*/
urls?: string[] | null;
}
export interface Schema$PointProto {
latE7?: number | null;
lngE7?: number | null;
metadata?: Schema$FieldMetadataProto;
temporaryData?: Schema$MessageSet;
}
/**
* A location where a voter can vote. This may be an early vote site, an election day voting location, or a drop off location for a completed ballot.
*/
export interface Schema$PollingLocation {
/**
* The address of the location.
*/
address?: Schema$SimpleAddressType;
/**
* The last date that this early vote site or drop off location may be used. This field is not populated for polling locations.
*/
endDate?: string | null;
/**
* An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested from the Request more link on the Quotas page.
*/
id?: string | null;
/**
* Latitude of the location, in degrees north of the equator. Only some locations -- generally, ballot drop boxes for vote-by-mail elections -- will have this set; for others, use a geocoding service like the Google Maps API to resolve the address to a geographic point.
*/
latitude?: number | null;
/**
* Longitude of the location, in degrees east of the Prime Meridian. Only some locations -- generally, ballot drop boxes for vote-by-mail elections -- will have this set; for others, use a geocoding service like the Google Maps API to resolve the address to a geographic point.
*/
longitude?: number | null;
/**
* The name of the early vote site or drop off location. This field is not populated for polling locations.
*/
name?: string | null;
/**
* Notes about this location (e.g. accessibility ramp or entrance to use).
*/
notes?: string | null;
/**
* A description of when this location is open.
*/
pollingHours?: string | null;
/**
* A list of sources for this location. If multiple sources are listed the data has been aggregated from those sources.
*/
sources?: Schema$Source[];
/**
* The first date that this early vote site or drop off location may be used. This field is not populated for polling locations.
*/
startDate?: string | null;
/**
* The services provided by this early vote site or drop off location. This field is not populated for polling locations.
*/
voterServices?: string | null;
}
export interface Schema$PostalAddress {
addressLines?: string[] | null;
administrativeAreaName?: string | null;
countryName?: string | null;
countryNameCode?: string | null;
dependentLocalityName?: string | null;
dependentThoroughfareName?: string | null;
firmName?: string | null;
isDisputed?: boolean | null;
languageCode?: string | null;
localityName?: string | null;
postalCodeNumber?: string | null;
postalCodeNumberExtension?: string | null;
postBoxNumber?: string | null;
premiseName?: string | null;
recipientName?: string | null;
sortingCode?: string | null;
subAdministrativeAreaName?: string | null;
subPremiseName?: string | null;
thoroughfareName?: string | null;
thoroughfareNumber?: string | null;
}
export interface Schema$Provenance {
collidedSegmentSource?: Schema$StreetSegmentList;
ctclContestUuid?: string | null;
ctclOfficeUuid?: string | null;
datasetId?: string | null;
precinctId?: string | null;
precinctSplitId?: string | null;
tsStreetSegmentId?: string | null;
vip5PrecinctId?: string | null;
vip5StreetSegmentId?: string | null;
vipStreetSegmentId?: string | null;
}
export interface Schema$RepresentativeInfoData {
/**
* Political geographic divisions that contain the requested address.
*/
divisions?: {
[key: string]: Schema$GeographicDivision;
} | null;
/**
* Elected offices referenced by the divisions listed above. Will only be present if includeOffices was true in the request.
*/
offices?: Schema$Office[];
/**
* Officials holding the offices listed above. Will only be present if includeOffices was true in the request.
*/
officials?: Schema$Official[];
}
/**
* A request for political geography and representative information for an address.
*/
export interface Schema$RepresentativeInfoRequest {
contextParams?: Schema$ContextParams;
}
/**
* The result of a representative info lookup query.
*/
export interface Schema$RepresentativeInfoResponse {
/**
* Political geographic divisions that contain the requested address.
*/
divisions?: {
[key: string]: Schema$GeographicDivision;
} | null;
/**
* Identifies what kind of resource this is. Value: the fixed string "civicinfo#representativeInfoResponse".
*/
kind?: string | null;
/**
* The normalized version of the requested address
*/
normalizedInput?: Schema$SimpleAddressType;
/**
* Elected offices referenced by the divisions listed above. Will only be present if includeOffices was true in the request.
*/
offices?: Schema$Office[];
/**
* Officials holding the offices listed above. Will only be present if includeOffices was true in the request.
*/
officials?: Schema$Official[];
}
/**
* A simple representation of an address.
*/
export interface Schema$SimpleAddressType {
/**
* The city or town for the address.
*/
city?: string | null;
/**
* The street name and number of this address.
*/
line1?: string | null;
/**
* The second line the address, if needed.
*/
line2?: string | null;
/**
* The third line of the address, if needed.
*/
line3?: string | null;
/**
* The name of the location.
*/
locationName?: string | null;
/**
* The US two letter state abbreviation of the address.
*/
state?: string | null;
/**
* The US Postal Zip Code of the address.
*/
zip?: string | null;
}
/**
* Contains information about the data source for the element containing it.
*/
export interface Schema$Source {
/**
* The name of the data source.
*/
name?: string | null;
/**
* Whether this data comes from an official government source.
*/
official?: boolean | null;
}
export interface Schema$StreetSegment {
administrationRegionIds?: string[] | null;
beforeGeocodeId?: string | null;
catalistUniquePrecinctCode?: string | null;
city?: string | null;
cityCouncilDistrict?: string | null;
congressionalDistrict?: string | null;
contestIds?: string[] | null;
countyCouncilDistrict?: string | null;
countyFips?: string | null;
datasetId?: string | null;
earlyVoteSiteByIds?: string[] | null;
endHouseNumber?: string | null;
geocodedPoint?: Schema$PointProto;
geographicDivisionOcdIds?: string[] | null;
id?: string | null;
judicialDistrict?: string | null;
mailOnly?: boolean | null;
municipalDistrict?: string | null;
ncoaAddress?: string | null;
oddOrEvens?: string[] | null;
originalId?: string | null;
pollinglocationByIds?: string[] | null;
precinctName?: string | null;
precinctOcdId?: string | null;
provenances?: Schema$Provenance[];
published?: boolean | null;
schoolDistrict?: string | null;
startHouseNumber?: string | null;
startLatE7?: number | null;
startLngE7?: number | null;
state?: string | null;
stateHouseDistrict?: string | null;
stateSenateDistrict?: string | null;
streetName?: string | null;
subAdministrativeAreaName?: string | null;
surrogateId?: string | null;
targetsmartUniquePrecinctCode?: string | null;
townshipDistrict?: string | null;
unitNumber?: string | null;
unitType?: string | null;
vanPrecinctCode?: string | null;
voterGeographicDivisionOcdIds?: string[] | null;
wardDistrict?: string | null;
wildcard?: boolean | null;
zip?: string | null;
}
export interface Schema$StreetSegmentList {
segments?: Schema$StreetSegment[];
}
/**
* A request for information about a voter.
*/
export interface Schema$VoterInfoRequest {
contextParams?: Schema$ContextParams;
voterInfoSegmentResult?: Schema$VoterInfoSegmentResult;
}
/**
* The result of a voter info lookup query.
*/
export interface Schema$VoterInfoResponse {
/**
* Contests that will appear on the voter's ballot.
*/
contests?: Schema$Contest[];
/**
* Locations where a voter is eligible to drop off a completed ballot. The voter must have received and completed a ballot prior to arriving at the location. The location may not have ballots available on the premises. These locations could be open on or before election day as indicated in the pollingHours field.
*/
dropOffLocations?: Schema$PollingLocation[];
/**
* Locations where the voter is eligible to vote early, prior to election day.
*/
earlyVoteSites?: Schema$PollingLocation[];
/**
* The election that was queried.
*/
election?: Schema$Election;
/**
* Identifies what kind of resource this is. Value: the fixed string "civicinfo#voterInfoResponse".
*/
kind?: string | null;
/**
* Specifies whether voters in the precinct vote only by mailing their ballots (with the possible option of dropping off their ballots as well).
*/
mailOnly?: boolean | null;
/**
* The normalized version of the requested address
*/
normalizedInput?: Schema$SimpleAddressType;
/**
* When there are multiple elections for a voter address, the otherElections field is populated in the API response and there are two possibilities: 1. If the earliest election is not the intended election, specify the election ID of the desired election in a second API request using the electionId field. 2. If these elections occur on the same day, the API doesn?t return any polling location, contest, or election official information to ensure that an additional query is made. For user-facing applications, we recommend displaying these elections to the user to disambiguate. A second API request using the electionId field should be made for the election that is relevant to the user.
*/
otherElections?: Schema$Election[];
/**
* Locations where the voter is eligible to vote on election day.
*/
pollingLocations?: Schema$PollingLocation[];
precinctId?: string | null;
segments?: Schema$StreetSegment[];
/**
* Local Election Information for the state that the voter votes in. For the US, there will only be one element in this array.
*/
state?: Schema$AdministrationRegion[];
}
export interface Schema$VoterInfoSegmentResult {
generatedMillis?: string | null;
postalAddress?: Schema$PostalAddress;
request?: Schema$VoterInfoRequest;
response?: Schema$VoterInfoResponse;
}
export class Resource$Divisions {
context: APIRequestContext;
constructor(context: APIRequestContext);
/**
* civicinfo.divisions.search
* @desc Searches for political divisions by their natural name or OCD ID.
* @alias civicinfo.divisions.search
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string=} params.query The search query. Queries can cover any parts of a OCD ID or a human readable division name. All words given in the query are treated as required patterns. In addition to that, most query operators of the Apache Lucene library are supported. See http://lucene.apache.org/core/2_9_4/queryparsersyntax.html
* @param {().DivisionSearchRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
search(params?: Params$Resource$Divisions$Search, options?: MethodOptions): GaxiosPromise<Schema$DivisionSearchResponse>;
search(params: Params$Resource$Divisions$Search, options: MethodOptions | BodyResponseCallback<Schema$DivisionSearchResponse>, callback: BodyResponseCallback<Schema$DivisionSearchResponse>): void;
search(params: Params$Resource$Divisions$Search, callback: BodyResponseCallback<Schema$DivisionSearchResponse>): void;
search(callback: BodyResponseCallback<Schema$DivisionSearchResponse>): void;
}
export interface Params$Resource$Divisions$Search extends StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient;
/**
* The search query. Queries can cover any parts of a OCD ID or a human readable division name. All words given in the query are treated as required patterns. In addition to that, most query operators of the Apache Lucene library are supported. See http://lucene.apache.org/core/2_9_4/queryparsersyntax.html
*/
query?: string;
/**
* Request body metadata
*/
requestBody?: Schema$DivisionSearchRequest;
}
export class Resource$Elections {
context: APIRequestContext;
constructor(context: APIRequestContext);
/**
* civicinfo.elections.electionQuery
* @desc List of available elections to query.
* @alias civicinfo.elections.electionQuery
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {().ElectionsQueryRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
electionQuery(params?: Params$Resource$Elections$Electionquery, options?: MethodOptions): GaxiosPromise<Schema$ElectionsQueryResponse>;
electionQuery(params: Params$Resource$Elections$Electionquery, options: MethodOptions | BodyResponseCallback<Schema$ElectionsQueryResponse>, callback: BodyResponseCallback<Schema$ElectionsQueryResponse>): void;
electionQuery(params: Params$Resource$Elections$Electionquery, callback: BodyResponseCallback<Schema$ElectionsQueryResponse>): void;
electionQuery(callback: BodyResponseCallback<Schema$ElectionsQueryResponse>): void;
/**
* civicinfo.elections.voterInfoQuery
* @desc Looks up information relevant to a voter based on the voter's registered address.
* @alias civicinfo.elections.voterInfoQuery
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string} params.address The registered address of the voter to look up.
* @param {string=} params.electionId The unique ID of the election to look up. A list of election IDs can be obtained at https://www.googleapis.com/civicinfo/{version}/electionsIf no election ID is specified in the query and there is more than one election with data for the given voter, the additional elections are provided in the otherElections response field.
* @param {boolean=} params.officialOnly If set to true, only data from official state sources will be returned.
* @param {boolean=} params.returnAllAvailableData If set to true, the query will return the success codeand include any partial information when it is unable to determine a matching address or unable to determine the election for electionId=0 queries.
* @param {().VoterInfoRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
voterInfoQuery(params?: Params$Resource$Elections$Voterinfoquery, options?: MethodOptions): GaxiosPromise<Schema$VoterInfoResponse>;
voterInfoQuery(params: Params$Resource$Elections$Voterinfoquery, options: MethodOptions | BodyResponseCallback<Schema$VoterInfoResponse>, callback: BodyResponseCallback<Schema$VoterInfoResponse>): void;
voterInfoQuery(params: Params$Resource$Elections$Voterinfoquery, callback: BodyResponseCallback<Schema$VoterInfoResponse>): void;
voterInfoQuery(callback: BodyResponseCallback<Schema$VoterInfoResponse>): void;
}
export interface Params$Resource$Elections$Electionquery extends StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient;
/**
* Request body metadata
*/
requestBody?: Schema$ElectionsQueryRequest;
}
export interface Params$Resource$Elections$Voterinfoquery extends StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient;
/**
* The registered address of the voter to look up.
*/
address?: string;
/**
* The unique ID of the election to look up. A list of election IDs can be obtained at https://www.googleapis.com/civicinfo/{version}/electionsIf no election ID is specified in the query and there is more than one election with data for the given voter, the additional elections are provided in the otherElections response field.
*/
electionId?: string;
/**
* If set to true, only data from official state sources will be returned.
*/
officialOnly?: boolean;
/**
* If set to true, the query will return the success codeand include any partial information when it is unable to determine a matching address or unable to determine the election for electionId=0 queries.
*/
returnAllAvailableData?: boolean;
/**
* Request body metadata
*/
requestBody?: Schema$VoterInfoRequest;
}
export class Resource$Representatives {
context: APIRequestContext;
constructor(context: APIRequestContext);
/**
* civicinfo.representatives.representativeInfoByAddress
* @desc Looks up political geography and representative information for a single address.
* @alias civicinfo.representatives.representativeInfoByAddress
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string=} params.address The address to look up. May only be specified if the field ocdId is not given in the URL.
* @param {boolean=} params.includeOffices Whether to return information about offices and officials. If false, only the top-level district information will be returned.
* @param {string=} params.levels A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching office will not be returned.
* @param {string=} params.roles A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned.
* @param {().RepresentativeInfoRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
representativeInfoByAddress(params?: Params$Resource$Representatives$Representativeinfobyaddress, options?: MethodOptions): GaxiosPromise<Schema$RepresentativeInfoResponse>;
representativeInfoByAddress(params: Params$Resource$Representatives$Representativeinfobyaddress, options: MethodOptions | BodyResponseCallback<Schema$RepresentativeInfoResponse>, callback: BodyResponseCallback<Schema$RepresentativeInfoResponse>): void;
representativeInfoByAddress(params: Params$Resource$Representatives$Representativeinfobyaddress, callback: BodyResponseCallback<Schema$RepresentativeInfoResponse>): void;
representativeInfoByAddress(callback: BodyResponseCallback<Schema$RepresentativeInfoResponse>): void;
/**
* civicinfo.representatives.representativeInfoByDivision
* @desc Looks up representative information for a single geographic division.
* @alias civicinfo.representatives.representativeInfoByDivision
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string=} params.levels A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching office will not be returned.
* @param {string} params.ocdId The Open Civic Data division identifier of the division to look up.
* @param {boolean=} params.recursive If true, information about all divisions contained in the division requested will be included as well. For example, if querying ocd-division/country:us/district:dc, this would also return all DC's wards and ANCs.
* @param {string=} params.roles A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned.
* @param {().DivisionRepresentativeInfoRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
representativeInfoByDivision(params?: Params$Resource$Representatives$Representativeinfobydivision, options?: MethodOptions): GaxiosPromise<Schema$RepresentativeInfoData>;
representativeInfoByDivision(params: Params$Resource$Representatives$Representativeinfobydivision, options: MethodOptions | BodyResponseCallback<Schema$RepresentativeInfoData>, callback: BodyResponseCallback<Schema$RepresentativeInfoData>): void;
representativeInfoByDivision(params: Params$Resource$Representatives$Representativeinfobydivision, callback: BodyResponseCallback<Schema$RepresentativeInfoData>): void;
representativeInfoByDivision(callback: BodyResponseCallback<Schema$RepresentativeInfoData>): void;
}
export interface Params$Resource$Representatives$Representativeinfobyaddress extends StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient;
/**
* The address to look up. May only be specified if the field ocdId is not given in the URL.
*/
address?: string;
/**
* Whether to return information about offices and officials. If false, only the top-level district information will be returned.
*/
includeOffices?: boolean;
/**
* A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching office will not be returned.
*/
levels?: string[];
/**
* A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned.
*/
roles?: string[];
/**
* Request body metadata
*/
requestBody?: Schema$RepresentativeInfoRequest;
}
export interface Params$Resource$Representatives$Representativeinfobydivision extends StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient;
/**
* A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching office will not be returned.
*/
levels?: string[];
/**
* The Open Civic Data division identifier of the division to look up.
*/
ocdId?: string;
/**
* If true, information about all divisions contained in the division requested will be included as well. For example, if querying ocd-division/country:us/district:dc, this would also return all DC's wards and ANCs.
*/
recursive?: boolean;
/**
* A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned.
*/
roles?: string[];
/**
* Request body metadata
*/
requestBody?: Schema$DivisionRepresentativeInfoRequest;
}
export {};
}