google-apis-civicinfo_v2 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +13 -0
- data/CHANGELOG.md +7 -0
- data/LICENSE.md +202 -0
- data/OVERVIEW.md +96 -0
- data/lib/google-apis-civicinfo_v2.rb +15 -0
- data/lib/google/apis/civicinfo_v2.rb +34 -0
- data/lib/google/apis/civicinfo_v2/classes.rb +1155 -0
- data/lib/google/apis/civicinfo_v2/gem_version.rb +28 -0
- data/lib/google/apis/civicinfo_v2/representations.rb +426 -0
- data/lib/google/apis/civicinfo_v2/service.rb +259 -0
- metadata +76 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e1499758a4828a440280da2ef5c6133bde5071dc608ce10a7d4f53ff09bbeafa
|
4
|
+
data.tar.gz: 3f0bcd09525e4a2a362ce926b923707d24ff61e4b2acf780e3e0e40c178b197c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8b8009de2c32a9300a75296e36850eaa1f3941a6f4ada8493939904d44e252618cdd2e87c9ecb7550d89e6551c84897c64c4bffe23714272bbd37a94fd0c1530
|
7
|
+
data.tar.gz: c568e4d95ea66d2d4555859dd8ab6e956b183b6a52430de7589bcf1146a09690cd847afcbe49f5af9ae55c3e9fba0408311d9edfd1111f95658461a3a4fb9300
|
data/.yardopts
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
--hide-void-return
|
2
|
+
--no-private
|
3
|
+
--verbose
|
4
|
+
--title=google-apis-civicinfo_v2
|
5
|
+
--markup-provider=redcarpet
|
6
|
+
--markup=markdown
|
7
|
+
--main OVERVIEW.md
|
8
|
+
lib/google/apis/civicinfo_v2/*.rb
|
9
|
+
lib/google/apis/civicinfo_v2.rb
|
10
|
+
-
|
11
|
+
OVERVIEW.md
|
12
|
+
CHANGELOG.md
|
13
|
+
LICENSE.md
|
data/CHANGELOG.md
ADDED
data/LICENSE.md
ADDED
@@ -0,0 +1,202 @@
|
|
1
|
+
|
2
|
+
Apache License
|
3
|
+
Version 2.0, January 2004
|
4
|
+
http://www.apache.org/licenses/
|
5
|
+
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
7
|
+
|
8
|
+
1. Definitions.
|
9
|
+
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
12
|
+
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
14
|
+
the copyright owner that is granting the License.
|
15
|
+
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
17
|
+
other entities that control, are controlled by, or are under common
|
18
|
+
control with that entity. For the purposes of this definition,
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
20
|
+
direction or management of such entity, whether by contract or
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
23
|
+
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
25
|
+
exercising permissions granted by this License.
|
26
|
+
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
28
|
+
including but not limited to software source code, documentation
|
29
|
+
source, and configuration files.
|
30
|
+
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
32
|
+
transformation or translation of a Source form, including but
|
33
|
+
not limited to compiled object code, generated documentation,
|
34
|
+
and conversions to other media types.
|
35
|
+
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
37
|
+
Object form, made available under the License, as indicated by a
|
38
|
+
copyright notice that is included in or attached to the work
|
39
|
+
(an example is provided in the Appendix below).
|
40
|
+
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
47
|
+
the Work and Derivative Works thereof.
|
48
|
+
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
50
|
+
the original version of the Work and any modifications or additions
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
62
|
+
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
65
|
+
subsequently incorporated within the Work.
|
66
|
+
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
73
|
+
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
79
|
+
where such license applies only to those patent claims licensable
|
80
|
+
by such Contributor that are necessarily infringed by their
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
83
|
+
institute patent litigation against any entity (including a
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
86
|
+
or contributory patent infringement, then any patent licenses
|
87
|
+
granted to You under this License for that Work shall terminate
|
88
|
+
as of the date such litigation is filed.
|
89
|
+
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
92
|
+
modifications, and in Source or Object form, provided that You
|
93
|
+
meet the following conditions:
|
94
|
+
|
95
|
+
(a) You must give any other recipients of the Work or
|
96
|
+
Derivative Works a copy of this License; and
|
97
|
+
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
99
|
+
stating that You changed the files; and
|
100
|
+
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
103
|
+
attribution notices from the Source form of the Work,
|
104
|
+
excluding those notices that do not pertain to any part of
|
105
|
+
the Derivative Works; and
|
106
|
+
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
109
|
+
include a readable copy of the attribution notices contained
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
112
|
+
of the following places: within a NOTICE text file distributed
|
113
|
+
as part of the Derivative Works; within the Source form or
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
115
|
+
within a display generated by the Derivative Works, if and
|
116
|
+
wherever such third-party notices normally appear. The contents
|
117
|
+
of the NOTICE file are for informational purposes only and
|
118
|
+
do not modify the License. You may add Your own attribution
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
121
|
+
that such additional attribution notices cannot be construed
|
122
|
+
as modifying the License.
|
123
|
+
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
125
|
+
may provide additional or different license terms and conditions
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
129
|
+
the conditions stated in this License.
|
130
|
+
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
134
|
+
this License, without any additional terms or conditions.
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
136
|
+
the terms of any separate license agreement you may have executed
|
137
|
+
with Licensor regarding such Contributions.
|
138
|
+
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
141
|
+
except as required for reasonable and customary use in describing the
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
143
|
+
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
153
|
+
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
159
|
+
incidental, or consequential damages of any character arising as a
|
160
|
+
result of this License or out of the use or inability to use the
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
163
|
+
other commercial damages or losses), even if such Contributor
|
164
|
+
has been advised of the possibility of such damages.
|
165
|
+
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
169
|
+
or other liability obligations and/or rights consistent with this
|
170
|
+
License. However, in accepting such obligations, You may act only
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
175
|
+
of your accepting any such warranty or additional liability.
|
176
|
+
|
177
|
+
END OF TERMS AND CONDITIONS
|
178
|
+
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
180
|
+
|
181
|
+
To apply the Apache License to your work, attach the following
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
183
|
+
replaced with your own identifying information. (Don't include
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
185
|
+
comment syntax for the file format. We also recommend that a
|
186
|
+
file or class name and description of purpose be included on the
|
187
|
+
same "printed page" as the copyright notice for easier
|
188
|
+
identification within third-party archives.
|
189
|
+
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
191
|
+
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
193
|
+
you may not use this file except in compliance with the License.
|
194
|
+
You may obtain a copy of the License at
|
195
|
+
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
197
|
+
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
201
|
+
See the License for the specific language governing permissions and
|
202
|
+
limitations under the License.
|
data/OVERVIEW.md
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
# Simple REST client for version V2 of the Google Civic Information API
|
2
|
+
|
3
|
+
This is a simple client library for version V2 of the Google Civic Information API. It provides:
|
4
|
+
|
5
|
+
* A client object that connects to the HTTP/JSON REST endpoint for the service.
|
6
|
+
* Ruby objects for data structures related to the service.
|
7
|
+
* Integration with the googleauth gem for authentication using OAuth, API keys, and service accounts.
|
8
|
+
* Control of retry, pagination, and timeouts.
|
9
|
+
|
10
|
+
Note that although this client library is supported and will continue to be updated to track changes to the service, it is otherwise considered complete and not under active development. Many Google services, especially Google Cloud Platform services, may provide a more modern client that is under more active development and improvement. See the section below titled *Which client should I use?* for more information.
|
11
|
+
|
12
|
+
## Getting started
|
13
|
+
|
14
|
+
### Before you begin
|
15
|
+
|
16
|
+
There are a few setup steps you need to complete before you can use this library:
|
17
|
+
|
18
|
+
1. If you don't already have a Google account, [sign up](https://www.google.com/accounts).
|
19
|
+
2. If you have never created a Google APIs Console project, read about [Managing Projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects) and create a project in the [Google API Console](https://console.cloud.google.com/).
|
20
|
+
3. Most APIs need to be enabled for your project. [Enable it](https://console.cloud.google.com/apis/library/civicinfo.googleapis.com) in the console.
|
21
|
+
|
22
|
+
### Installation
|
23
|
+
|
24
|
+
Add this line to your application's Gemfile:
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
gem 'google-apis-civicinfo_v2', '~> 0.1'
|
28
|
+
```
|
29
|
+
|
30
|
+
And then execute:
|
31
|
+
|
32
|
+
```
|
33
|
+
$ bundle
|
34
|
+
```
|
35
|
+
|
36
|
+
Or install it yourself as:
|
37
|
+
|
38
|
+
```
|
39
|
+
$ gem install google-apis-civicinfo_v2
|
40
|
+
```
|
41
|
+
|
42
|
+
### Creating a client object
|
43
|
+
|
44
|
+
Once the gem is installed, you can load the client code and instantiate a client.
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
# Load the client
|
48
|
+
require "google/apis/civicinfo_v2"
|
49
|
+
|
50
|
+
# Create a client object
|
51
|
+
client = Google::Apis::CivicinfoV2::CivicInfoService.new
|
52
|
+
|
53
|
+
# Authenticate calls
|
54
|
+
client.authentication = # ... use the googleauth gem to create credentials
|
55
|
+
```
|
56
|
+
|
57
|
+
See the class reference docs for information on the methods you can call from a client.
|
58
|
+
|
59
|
+
## Documentation
|
60
|
+
|
61
|
+
More detailed descriptions of the Google simple REST clients are available in two documents.
|
62
|
+
|
63
|
+
* The [Usage Guide](https://github.com/googleapis/google-api-ruby-client/blob/master/docs/usage-guide.md) discusses how to make API calls, how to use the provided data structures, and how to work the various features of the client library, including media upload and download, error handling, retries, pagination, and logging.
|
64
|
+
* The [Auth Guide](https://github.com/googleapis/google-api-ruby-client/blob/master/docs/auth-guide.md) discusses authentication in the client libraries, including API keys, OAuth 2.0, service accounts, and environment variables.
|
65
|
+
|
66
|
+
(Note: the above documents are written for the simple REST clients in general, and their examples may not reflect the Civicinfo service in particular.)
|
67
|
+
|
68
|
+
For reference information on specific calls in the Google Civic Information API, see the {Google::Apis::CivicinfoV2::CivicInfoService class reference docs}.
|
69
|
+
|
70
|
+
## Which client should I use?
|
71
|
+
|
72
|
+
Google provides two types of Ruby API client libraries: **simple REST clients** and **modern clients**.
|
73
|
+
|
74
|
+
This library, `google-apis-civicinfo_v2`, is a simple REST client. You can identify these clients by their gem names, which are always in the form `google-apis-<servicename>_<serviceversion>`. The simple REST clients connect to HTTP/JSON REST endpoints and are automatically generated from service discovery documents. They support most API functionality, but their class interfaces are sometimes awkward.
|
75
|
+
|
76
|
+
Modern clients are produced by a modern code generator, sometimes combined with hand-crafted functionality. Most modern clients connect to high-performance gRPC endpoints, although a few are backed by REST services. Modern clients are available for many Google services, especially Google Cloud Platform services, but do not yet support all the services covered by the simple clients.
|
77
|
+
|
78
|
+
Gem names for modern clients are often of the form `google-cloud-<service_name>`. (For example, [google-cloud-pubsub](https://rubygems.org/gems/google-cloud-pubsub).) Note that most modern clients also have corresponding "versioned" gems with names like `google-cloud-<service_name>-<version>`. (For example, [google-cloud-pubsub-v1](https://rubygems.org/gems/google-cloud-pubsub-v1).) The "versioned" gems can be used directly, but often provide lower-level interfaces. In most cases, the main gem is recommended.
|
79
|
+
|
80
|
+
**For most users, we recommend the modern client, if one is available.** Compared with simple clients, modern clients are generally much easier to use and more Ruby-like, support more advanced features such as streaming and long-running operations, and often provide much better performance. You may consider using a simple client instead, if a modern client is not yet available for the service you want to use, or if you are not able to use gRPC on your infrastructure.
|
81
|
+
|
82
|
+
The [product documentation](https://developers.google.com/civic-information/) may provide guidance regarding the preferred client library to use.
|
83
|
+
|
84
|
+
## Supported Ruby versions
|
85
|
+
|
86
|
+
This library is supported on Ruby 2.5+.
|
87
|
+
|
88
|
+
Google provides official support for Ruby versions that are actively supported by Ruby Core -- that is, Ruby versions that are either in normal maintenance or in security maintenance, and not end of life. Currently, this means Ruby 2.5 and later. Older versions of Ruby _may_ still work, but are unsupported and not recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby support schedule.
|
89
|
+
|
90
|
+
## License
|
91
|
+
|
92
|
+
This library is licensed under Apache 2.0. Full license text is available in the {file:LICENSE.md LICENSE}.
|
93
|
+
|
94
|
+
## Support
|
95
|
+
|
96
|
+
Please [report bugs at the project on Github](https://github.com/google/google-api-ruby-client/issues). Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-api-ruby-client) about the client or APIs on [StackOverflow](http://stackoverflow.com).
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require "google/apis/civicinfo_v2"
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'google/apis/civicinfo_v2/service.rb'
|
16
|
+
require 'google/apis/civicinfo_v2/classes.rb'
|
17
|
+
require 'google/apis/civicinfo_v2/representations.rb'
|
18
|
+
require 'google/apis/civicinfo_v2/gem_version.rb'
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Apis
|
22
|
+
# Google Civic Information API
|
23
|
+
#
|
24
|
+
# Provides polling places, early vote locations, contest data, election
|
25
|
+
# officials, and government representatives for U.S. residential addresses.
|
26
|
+
#
|
27
|
+
# @see https://developers.google.com/civic-information/
|
28
|
+
module CivicinfoV2
|
29
|
+
# Version of the Google Civic Information API this client connects to.
|
30
|
+
# This is NOT the gem version.
|
31
|
+
VERSION = 'V2'
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,1155 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'date'
|
16
|
+
require 'google/apis/core/base_service'
|
17
|
+
require 'google/apis/core/json_representation'
|
18
|
+
require 'google/apis/core/hashable'
|
19
|
+
require 'google/apis/errors'
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Apis
|
23
|
+
module CivicinfoV2
|
24
|
+
|
25
|
+
# Describes information about a regional election administrative area.
|
26
|
+
class AdministrationRegion
|
27
|
+
include Google::Apis::Core::Hashable
|
28
|
+
|
29
|
+
# Information about an election administrative body (e.g. County Board of
|
30
|
+
# Elections).
|
31
|
+
# Corresponds to the JSON property `electionAdministrationBody`
|
32
|
+
# @return [Google::Apis::CivicinfoV2::AdministrativeBody]
|
33
|
+
attr_accessor :election_administration_body
|
34
|
+
|
35
|
+
# Describes information about a regional election administrative area.
|
36
|
+
# Corresponds to the JSON property `local_jurisdiction`
|
37
|
+
# @return [Google::Apis::CivicinfoV2::AdministrationRegion]
|
38
|
+
attr_accessor :local_jurisdiction
|
39
|
+
|
40
|
+
# The name of the jurisdiction.
|
41
|
+
# Corresponds to the JSON property `name`
|
42
|
+
# @return [String]
|
43
|
+
attr_accessor :name
|
44
|
+
|
45
|
+
# A list of sources for this area. If multiple sources are listed the data has
|
46
|
+
# been aggregated from those sources.
|
47
|
+
# Corresponds to the JSON property `sources`
|
48
|
+
# @return [Array<Google::Apis::CivicinfoV2::Source>]
|
49
|
+
attr_accessor :sources
|
50
|
+
|
51
|
+
def initialize(**args)
|
52
|
+
update!(**args)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Update properties of this object
|
56
|
+
def update!(**args)
|
57
|
+
@election_administration_body = args[:election_administration_body] if args.key?(:election_administration_body)
|
58
|
+
@local_jurisdiction = args[:local_jurisdiction] if args.key?(:local_jurisdiction)
|
59
|
+
@name = args[:name] if args.key?(:name)
|
60
|
+
@sources = args[:sources] if args.key?(:sources)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# Information about an election administrative body (e.g. County Board of
|
65
|
+
# Elections).
|
66
|
+
class AdministrativeBody
|
67
|
+
include Google::Apis::Core::Hashable
|
68
|
+
|
69
|
+
# A URL provided by this administrative body for information on absentee voting.
|
70
|
+
# Corresponds to the JSON property `absenteeVotingInfoUrl`
|
71
|
+
# @return [String]
|
72
|
+
attr_accessor :absentee_voting_info_url
|
73
|
+
|
74
|
+
# A URL provided by this administrative body to give contest information to the
|
75
|
+
# voter.
|
76
|
+
# Corresponds to the JSON property `ballotInfoUrl`
|
77
|
+
# @return [String]
|
78
|
+
attr_accessor :ballot_info_url
|
79
|
+
|
80
|
+
# A simple representation of an address.
|
81
|
+
# Corresponds to the JSON property `correspondenceAddress`
|
82
|
+
# @return [Google::Apis::CivicinfoV2::SimpleAddressType]
|
83
|
+
attr_accessor :correspondence_address
|
84
|
+
|
85
|
+
# A URL provided by this administrative body for looking up general election
|
86
|
+
# information.
|
87
|
+
# Corresponds to the JSON property `electionInfoUrl`
|
88
|
+
# @return [String]
|
89
|
+
attr_accessor :election_info_url
|
90
|
+
|
91
|
+
# A last minute or emergency notification text provided by this administrative
|
92
|
+
# body.
|
93
|
+
# Corresponds to the JSON property `electionNoticeText`
|
94
|
+
# @return [String]
|
95
|
+
attr_accessor :election_notice_text
|
96
|
+
|
97
|
+
# A URL provided by this administrative body for additional information related
|
98
|
+
# to the last minute or emergency notification.
|
99
|
+
# Corresponds to the JSON property `electionNoticeUrl`
|
100
|
+
# @return [String]
|
101
|
+
attr_accessor :election_notice_url
|
102
|
+
|
103
|
+
# The election officials for this election administrative body.
|
104
|
+
# Corresponds to the JSON property `electionOfficials`
|
105
|
+
# @return [Array<Google::Apis::CivicinfoV2::ElectionOfficial>]
|
106
|
+
attr_accessor :election_officials
|
107
|
+
|
108
|
+
# A URL provided by this administrative body for confirming that the voter is
|
109
|
+
# registered to vote.
|
110
|
+
# Corresponds to the JSON property `electionRegistrationConfirmationUrl`
|
111
|
+
# @return [String]
|
112
|
+
attr_accessor :election_registration_confirmation_url
|
113
|
+
|
114
|
+
# A URL provided by this administrative body for looking up how to register to
|
115
|
+
# vote.
|
116
|
+
# Corresponds to the JSON property `electionRegistrationUrl`
|
117
|
+
# @return [String]
|
118
|
+
attr_accessor :election_registration_url
|
119
|
+
|
120
|
+
# A URL provided by this administrative body describing election rules to the
|
121
|
+
# voter.
|
122
|
+
# Corresponds to the JSON property `electionRulesUrl`
|
123
|
+
# @return [String]
|
124
|
+
attr_accessor :election_rules_url
|
125
|
+
|
126
|
+
# A description of the hours of operation for this administrative body.
|
127
|
+
# Corresponds to the JSON property `hoursOfOperation`
|
128
|
+
# @return [String]
|
129
|
+
attr_accessor :hours_of_operation
|
130
|
+
|
131
|
+
# The name of this election administrative body.
|
132
|
+
# Corresponds to the JSON property `name`
|
133
|
+
# @return [String]
|
134
|
+
attr_accessor :name
|
135
|
+
|
136
|
+
# A simple representation of an address.
|
137
|
+
# Corresponds to the JSON property `physicalAddress`
|
138
|
+
# @return [Google::Apis::CivicinfoV2::SimpleAddressType]
|
139
|
+
attr_accessor :physical_address
|
140
|
+
|
141
|
+
# A description of the services this administrative body may provide.
|
142
|
+
# Corresponds to the JSON property `voter_services`
|
143
|
+
# @return [Array<String>]
|
144
|
+
attr_accessor :voter_services
|
145
|
+
|
146
|
+
# A URL provided by this administrative body for looking up where to vote.
|
147
|
+
# Corresponds to the JSON property `votingLocationFinderUrl`
|
148
|
+
# @return [String]
|
149
|
+
attr_accessor :voting_location_finder_url
|
150
|
+
|
151
|
+
def initialize(**args)
|
152
|
+
update!(**args)
|
153
|
+
end
|
154
|
+
|
155
|
+
# Update properties of this object
|
156
|
+
def update!(**args)
|
157
|
+
@absentee_voting_info_url = args[:absentee_voting_info_url] if args.key?(:absentee_voting_info_url)
|
158
|
+
@ballot_info_url = args[:ballot_info_url] if args.key?(:ballot_info_url)
|
159
|
+
@correspondence_address = args[:correspondence_address] if args.key?(:correspondence_address)
|
160
|
+
@election_info_url = args[:election_info_url] if args.key?(:election_info_url)
|
161
|
+
@election_notice_text = args[:election_notice_text] if args.key?(:election_notice_text)
|
162
|
+
@election_notice_url = args[:election_notice_url] if args.key?(:election_notice_url)
|
163
|
+
@election_officials = args[:election_officials] if args.key?(:election_officials)
|
164
|
+
@election_registration_confirmation_url = args[:election_registration_confirmation_url] if args.key?(:election_registration_confirmation_url)
|
165
|
+
@election_registration_url = args[:election_registration_url] if args.key?(:election_registration_url)
|
166
|
+
@election_rules_url = args[:election_rules_url] if args.key?(:election_rules_url)
|
167
|
+
@hours_of_operation = args[:hours_of_operation] if args.key?(:hours_of_operation)
|
168
|
+
@name = args[:name] if args.key?(:name)
|
169
|
+
@physical_address = args[:physical_address] if args.key?(:physical_address)
|
170
|
+
@voter_services = args[:voter_services] if args.key?(:voter_services)
|
171
|
+
@voting_location_finder_url = args[:voting_location_finder_url] if args.key?(:voting_location_finder_url)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Information about a candidate running for elected office.
|
176
|
+
class Candidate
|
177
|
+
include Google::Apis::Core::Hashable
|
178
|
+
|
179
|
+
# The URL for the candidate's campaign web site.
|
180
|
+
# Corresponds to the JSON property `candidateUrl`
|
181
|
+
# @return [String]
|
182
|
+
attr_accessor :candidate_url
|
183
|
+
|
184
|
+
# A list of known (social) media channels for this candidate.
|
185
|
+
# Corresponds to the JSON property `channels`
|
186
|
+
# @return [Array<Google::Apis::CivicinfoV2::Channel>]
|
187
|
+
attr_accessor :channels
|
188
|
+
|
189
|
+
# The email address for the candidate's campaign.
|
190
|
+
# Corresponds to the JSON property `email`
|
191
|
+
# @return [String]
|
192
|
+
attr_accessor :email
|
193
|
+
|
194
|
+
# The candidate's name. If this is a joint ticket it will indicate the name of
|
195
|
+
# the candidate at the top of a ticket followed by a / and that name of
|
196
|
+
# candidate at the bottom of the ticket. e.g. "Mitt Romney / Paul Ryan"
|
197
|
+
# Corresponds to the JSON property `name`
|
198
|
+
# @return [String]
|
199
|
+
attr_accessor :name
|
200
|
+
|
201
|
+
# The order the candidate appears on the ballot for this contest.
|
202
|
+
# Corresponds to the JSON property `orderOnBallot`
|
203
|
+
# @return [Fixnum]
|
204
|
+
attr_accessor :order_on_ballot
|
205
|
+
|
206
|
+
# The full name of the party the candidate is a member of.
|
207
|
+
# Corresponds to the JSON property `party`
|
208
|
+
# @return [String]
|
209
|
+
attr_accessor :party
|
210
|
+
|
211
|
+
# The voice phone number for the candidate's campaign office.
|
212
|
+
# Corresponds to the JSON property `phone`
|
213
|
+
# @return [String]
|
214
|
+
attr_accessor :phone
|
215
|
+
|
216
|
+
# A URL for a photo of the candidate.
|
217
|
+
# Corresponds to the JSON property `photoUrl`
|
218
|
+
# @return [String]
|
219
|
+
attr_accessor :photo_url
|
220
|
+
|
221
|
+
def initialize(**args)
|
222
|
+
update!(**args)
|
223
|
+
end
|
224
|
+
|
225
|
+
# Update properties of this object
|
226
|
+
def update!(**args)
|
227
|
+
@candidate_url = args[:candidate_url] if args.key?(:candidate_url)
|
228
|
+
@channels = args[:channels] if args.key?(:channels)
|
229
|
+
@email = args[:email] if args.key?(:email)
|
230
|
+
@name = args[:name] if args.key?(:name)
|
231
|
+
@order_on_ballot = args[:order_on_ballot] if args.key?(:order_on_ballot)
|
232
|
+
@party = args[:party] if args.key?(:party)
|
233
|
+
@phone = args[:phone] if args.key?(:phone)
|
234
|
+
@photo_url = args[:photo_url] if args.key?(:photo_url)
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
# A social media or web channel for a candidate.
|
239
|
+
class Channel
|
240
|
+
include Google::Apis::Core::Hashable
|
241
|
+
|
242
|
+
# The unique public identifier for the candidate's channel.
|
243
|
+
# Corresponds to the JSON property `id`
|
244
|
+
# @return [String]
|
245
|
+
attr_accessor :id
|
246
|
+
|
247
|
+
# The type of channel. The following is a list of types of channels, but is not
|
248
|
+
# exhaustive. More channel types may be added at a later time. One of:
|
249
|
+
# GooglePlus, YouTube, Facebook, Twitter
|
250
|
+
# Corresponds to the JSON property `type`
|
251
|
+
# @return [String]
|
252
|
+
attr_accessor :type
|
253
|
+
|
254
|
+
def initialize(**args)
|
255
|
+
update!(**args)
|
256
|
+
end
|
257
|
+
|
258
|
+
# Update properties of this object
|
259
|
+
def update!(**args)
|
260
|
+
@id = args[:id] if args.key?(:id)
|
261
|
+
@type = args[:type] if args.key?(:type)
|
262
|
+
end
|
263
|
+
end
|
264
|
+
|
265
|
+
# Information about a contest that appears on a voter's ballot.
|
266
|
+
class Contest
|
267
|
+
include Google::Apis::Core::Hashable
|
268
|
+
|
269
|
+
# A number specifying the position of this contest on the voter's ballot.
|
270
|
+
# Corresponds to the JSON property `ballotPlacement`
|
271
|
+
# @return [Fixnum]
|
272
|
+
attr_accessor :ballot_placement
|
273
|
+
|
274
|
+
# The official title on the ballot for this contest, only where available.
|
275
|
+
# Corresponds to the JSON property `ballotTitle`
|
276
|
+
# @return [String]
|
277
|
+
attr_accessor :ballot_title
|
278
|
+
|
279
|
+
# The candidate choices for this contest.
|
280
|
+
# Corresponds to the JSON property `candidates`
|
281
|
+
# @return [Array<Google::Apis::CivicinfoV2::Candidate>]
|
282
|
+
attr_accessor :candidates
|
283
|
+
|
284
|
+
# Describes the geographic scope of a contest.
|
285
|
+
# Corresponds to the JSON property `district`
|
286
|
+
# @return [Google::Apis::CivicinfoV2::ElectoralDistrict]
|
287
|
+
attr_accessor :district
|
288
|
+
|
289
|
+
# A description of any additional eligibility requirements for voting in this
|
290
|
+
# contest.
|
291
|
+
# Corresponds to the JSON property `electorateSpecifications`
|
292
|
+
# @return [String]
|
293
|
+
attr_accessor :electorate_specifications
|
294
|
+
|
295
|
+
# The levels of government of the office for this contest. There may be more
|
296
|
+
# than one in cases where a jurisdiction effectively acts at two different
|
297
|
+
# levels of government; for example, the mayor of the District of Columbia acts
|
298
|
+
# at "locality" level, but also effectively at both "administrative-area-2" and "
|
299
|
+
# administrative-area-1".
|
300
|
+
# Corresponds to the JSON property `level`
|
301
|
+
# @return [Array<String>]
|
302
|
+
attr_accessor :level
|
303
|
+
|
304
|
+
# The number of candidates that will be elected to office in this contest.
|
305
|
+
# Corresponds to the JSON property `numberElected`
|
306
|
+
# @return [Fixnum]
|
307
|
+
attr_accessor :number_elected
|
308
|
+
|
309
|
+
# The number of candidates that a voter may vote for in this contest.
|
310
|
+
# Corresponds to the JSON property `numberVotingFor`
|
311
|
+
# @return [Fixnum]
|
312
|
+
attr_accessor :number_voting_for
|
313
|
+
|
314
|
+
# The name of the office for this contest.
|
315
|
+
# Corresponds to the JSON property `office`
|
316
|
+
# @return [String]
|
317
|
+
attr_accessor :office
|
318
|
+
|
319
|
+
# If this is a partisan election, the name of the party/parties it is for.
|
320
|
+
# Corresponds to the JSON property `primaryParties`
|
321
|
+
# @return [Array<String>]
|
322
|
+
attr_accessor :primary_parties
|
323
|
+
|
324
|
+
# [DEPRECATED] If this is a partisan election, the name of the party it is for.
|
325
|
+
# This field as deprecated in favor of the array "primaryParties", as contests
|
326
|
+
# may contain more than one party.
|
327
|
+
# Corresponds to the JSON property `primaryParty`
|
328
|
+
# @return [String]
|
329
|
+
attr_accessor :primary_party
|
330
|
+
|
331
|
+
# The set of ballot responses for the referendum. A ballot response represents a
|
332
|
+
# line on the ballot. Common examples might include "yes" or "no" for referenda.
|
333
|
+
# This field is only populated for contests of type 'Referendum'.
|
334
|
+
# Corresponds to the JSON property `referendumBallotResponses`
|
335
|
+
# @return [Array<String>]
|
336
|
+
attr_accessor :referendum_ballot_responses
|
337
|
+
|
338
|
+
# Specifies a short summary of the referendum that is typically on the ballot
|
339
|
+
# below the title but above the text. This field is only populated for contests
|
340
|
+
# of type 'Referendum'.
|
341
|
+
# Corresponds to the JSON property `referendumBrief`
|
342
|
+
# @return [String]
|
343
|
+
attr_accessor :referendum_brief
|
344
|
+
|
345
|
+
# A statement in opposition to the referendum. It does not necessarily appear on
|
346
|
+
# the ballot. This field is only populated for contests of type 'Referendum'.
|
347
|
+
# Corresponds to the JSON property `referendumConStatement`
|
348
|
+
# @return [String]
|
349
|
+
attr_accessor :referendum_con_statement
|
350
|
+
|
351
|
+
# Specifies what effect abstaining (not voting) on the proposition will have (i.
|
352
|
+
# e. whether abstaining is considered a vote against it). This field is only
|
353
|
+
# populated for contests of type 'Referendum'.
|
354
|
+
# Corresponds to the JSON property `referendumEffectOfAbstain`
|
355
|
+
# @return [String]
|
356
|
+
attr_accessor :referendum_effect_of_abstain
|
357
|
+
|
358
|
+
# The threshold of votes that the referendum needs in order to pass, e.g. "two-
|
359
|
+
# thirds". This field is only populated for contests of type 'Referendum'.
|
360
|
+
# Corresponds to the JSON property `referendumPassageThreshold`
|
361
|
+
# @return [String]
|
362
|
+
attr_accessor :referendum_passage_threshold
|
363
|
+
|
364
|
+
# A statement in favor of the referendum. It does not necessarily appear on the
|
365
|
+
# ballot. This field is only populated for contests of type 'Referendum'.
|
366
|
+
# Corresponds to the JSON property `referendumProStatement`
|
367
|
+
# @return [String]
|
368
|
+
attr_accessor :referendum_pro_statement
|
369
|
+
|
370
|
+
# A brief description of the referendum. This field is only populated for
|
371
|
+
# contests of type 'Referendum'.
|
372
|
+
# Corresponds to the JSON property `referendumSubtitle`
|
373
|
+
# @return [String]
|
374
|
+
attr_accessor :referendum_subtitle
|
375
|
+
|
376
|
+
# The full text of the referendum. This field is only populated for contests of
|
377
|
+
# type 'Referendum'.
|
378
|
+
# Corresponds to the JSON property `referendumText`
|
379
|
+
# @return [String]
|
380
|
+
attr_accessor :referendum_text
|
381
|
+
|
382
|
+
# The title of the referendum (e.g. 'Proposition 42'). This field is only
|
383
|
+
# populated for contests of type 'Referendum'.
|
384
|
+
# Corresponds to the JSON property `referendumTitle`
|
385
|
+
# @return [String]
|
386
|
+
attr_accessor :referendum_title
|
387
|
+
|
388
|
+
# A link to the referendum. This field is only populated for contests of type '
|
389
|
+
# Referendum'.
|
390
|
+
# Corresponds to the JSON property `referendumUrl`
|
391
|
+
# @return [String]
|
392
|
+
attr_accessor :referendum_url
|
393
|
+
|
394
|
+
# The roles which this office fulfills.
|
395
|
+
# Corresponds to the JSON property `roles`
|
396
|
+
# @return [Array<String>]
|
397
|
+
attr_accessor :roles
|
398
|
+
|
399
|
+
# A list of sources for this contest. If multiple sources are listed, the data
|
400
|
+
# has been aggregated from those sources.
|
401
|
+
# Corresponds to the JSON property `sources`
|
402
|
+
# @return [Array<Google::Apis::CivicinfoV2::Source>]
|
403
|
+
attr_accessor :sources
|
404
|
+
|
405
|
+
# "Yes" or "No" depending on whether this a contest being held outside the
|
406
|
+
# normal election cycle.
|
407
|
+
# Corresponds to the JSON property `special`
|
408
|
+
# @return [String]
|
409
|
+
attr_accessor :special
|
410
|
+
|
411
|
+
# The type of contest. Usually this will be 'General', 'Primary', or 'Run-off'
|
412
|
+
# for contests with candidates. For referenda this will be 'Referendum'. For
|
413
|
+
# Retention contests this will typically be 'Retention'.
|
414
|
+
# Corresponds to the JSON property `type`
|
415
|
+
# @return [String]
|
416
|
+
attr_accessor :type
|
417
|
+
|
418
|
+
def initialize(**args)
|
419
|
+
update!(**args)
|
420
|
+
end
|
421
|
+
|
422
|
+
# Update properties of this object
|
423
|
+
def update!(**args)
|
424
|
+
@ballot_placement = args[:ballot_placement] if args.key?(:ballot_placement)
|
425
|
+
@ballot_title = args[:ballot_title] if args.key?(:ballot_title)
|
426
|
+
@candidates = args[:candidates] if args.key?(:candidates)
|
427
|
+
@district = args[:district] if args.key?(:district)
|
428
|
+
@electorate_specifications = args[:electorate_specifications] if args.key?(:electorate_specifications)
|
429
|
+
@level = args[:level] if args.key?(:level)
|
430
|
+
@number_elected = args[:number_elected] if args.key?(:number_elected)
|
431
|
+
@number_voting_for = args[:number_voting_for] if args.key?(:number_voting_for)
|
432
|
+
@office = args[:office] if args.key?(:office)
|
433
|
+
@primary_parties = args[:primary_parties] if args.key?(:primary_parties)
|
434
|
+
@primary_party = args[:primary_party] if args.key?(:primary_party)
|
435
|
+
@referendum_ballot_responses = args[:referendum_ballot_responses] if args.key?(:referendum_ballot_responses)
|
436
|
+
@referendum_brief = args[:referendum_brief] if args.key?(:referendum_brief)
|
437
|
+
@referendum_con_statement = args[:referendum_con_statement] if args.key?(:referendum_con_statement)
|
438
|
+
@referendum_effect_of_abstain = args[:referendum_effect_of_abstain] if args.key?(:referendum_effect_of_abstain)
|
439
|
+
@referendum_passage_threshold = args[:referendum_passage_threshold] if args.key?(:referendum_passage_threshold)
|
440
|
+
@referendum_pro_statement = args[:referendum_pro_statement] if args.key?(:referendum_pro_statement)
|
441
|
+
@referendum_subtitle = args[:referendum_subtitle] if args.key?(:referendum_subtitle)
|
442
|
+
@referendum_text = args[:referendum_text] if args.key?(:referendum_text)
|
443
|
+
@referendum_title = args[:referendum_title] if args.key?(:referendum_title)
|
444
|
+
@referendum_url = args[:referendum_url] if args.key?(:referendum_url)
|
445
|
+
@roles = args[:roles] if args.key?(:roles)
|
446
|
+
@sources = args[:sources] if args.key?(:sources)
|
447
|
+
@special = args[:special] if args.key?(:special)
|
448
|
+
@type = args[:type] if args.key?(:type)
|
449
|
+
end
|
450
|
+
end
|
451
|
+
|
452
|
+
# The result of a division search query.
|
453
|
+
class SearchDivisionResponse
|
454
|
+
include Google::Apis::Core::Hashable
|
455
|
+
|
456
|
+
# Identifies what kind of resource this is. Value: the fixed string "civicinfo#
|
457
|
+
# divisionSearchResponse".
|
458
|
+
# Corresponds to the JSON property `kind`
|
459
|
+
# @return [String]
|
460
|
+
attr_accessor :kind
|
461
|
+
|
462
|
+
#
|
463
|
+
# Corresponds to the JSON property `results`
|
464
|
+
# @return [Array<Google::Apis::CivicinfoV2::DivisionSearchResult>]
|
465
|
+
attr_accessor :results
|
466
|
+
|
467
|
+
def initialize(**args)
|
468
|
+
update!(**args)
|
469
|
+
end
|
470
|
+
|
471
|
+
# Update properties of this object
|
472
|
+
def update!(**args)
|
473
|
+
@kind = args[:kind] if args.key?(:kind)
|
474
|
+
@results = args[:results] if args.key?(:results)
|
475
|
+
end
|
476
|
+
end
|
477
|
+
|
478
|
+
# Represents a political geographic division that matches the requested query.
|
479
|
+
class DivisionSearchResult
|
480
|
+
include Google::Apis::Core::Hashable
|
481
|
+
|
482
|
+
# Other Open Civic Data identifiers that refer to the same division -- for
|
483
|
+
# example, those that refer to other political divisions whose boundaries are
|
484
|
+
# defined to be coterminous with this one. For example, ocd-division/country:us/
|
485
|
+
# state:wy will include an alias of ocd-division/country:us/state:wy/cd:1, since
|
486
|
+
# Wyoming has only one Congressional district.
|
487
|
+
# Corresponds to the JSON property `aliases`
|
488
|
+
# @return [Array<String>]
|
489
|
+
attr_accessor :aliases
|
490
|
+
|
491
|
+
# The name of the division.
|
492
|
+
# Corresponds to the JSON property `name`
|
493
|
+
# @return [String]
|
494
|
+
attr_accessor :name
|
495
|
+
|
496
|
+
# The unique Open Civic Data identifier for this division
|
497
|
+
# Corresponds to the JSON property `ocdId`
|
498
|
+
# @return [String]
|
499
|
+
attr_accessor :ocd_id
|
500
|
+
|
501
|
+
def initialize(**args)
|
502
|
+
update!(**args)
|
503
|
+
end
|
504
|
+
|
505
|
+
# Update properties of this object
|
506
|
+
def update!(**args)
|
507
|
+
@aliases = args[:aliases] if args.key?(:aliases)
|
508
|
+
@name = args[:name] if args.key?(:name)
|
509
|
+
@ocd_id = args[:ocd_id] if args.key?(:ocd_id)
|
510
|
+
end
|
511
|
+
end
|
512
|
+
|
513
|
+
# Information about the election that was queried.
|
514
|
+
class Election
|
515
|
+
include Google::Apis::Core::Hashable
|
516
|
+
|
517
|
+
# Day of the election in YYYY-MM-DD format.
|
518
|
+
# Corresponds to the JSON property `electionDay`
|
519
|
+
# @return [String]
|
520
|
+
attr_accessor :election_day
|
521
|
+
|
522
|
+
# The unique ID of this election.
|
523
|
+
# Corresponds to the JSON property `id`
|
524
|
+
# @return [Fixnum]
|
525
|
+
attr_accessor :id
|
526
|
+
|
527
|
+
# A displayable name for the election.
|
528
|
+
# Corresponds to the JSON property `name`
|
529
|
+
# @return [String]
|
530
|
+
attr_accessor :name
|
531
|
+
|
532
|
+
# The political division of the election. Represented as an OCD Division ID.
|
533
|
+
# Voters within these political jurisdictions are covered by this election. This
|
534
|
+
# is typically a state such as ocd-division/country:us/state:ca or for the
|
535
|
+
# midterms or general election the entire US (i.e. ocd-division/country:us).
|
536
|
+
# Corresponds to the JSON property `ocdDivisionId`
|
537
|
+
# @return [String]
|
538
|
+
attr_accessor :ocd_division_id
|
539
|
+
|
540
|
+
def initialize(**args)
|
541
|
+
update!(**args)
|
542
|
+
end
|
543
|
+
|
544
|
+
# Update properties of this object
|
545
|
+
def update!(**args)
|
546
|
+
@election_day = args[:election_day] if args.key?(:election_day)
|
547
|
+
@id = args[:id] if args.key?(:id)
|
548
|
+
@name = args[:name] if args.key?(:name)
|
549
|
+
@ocd_division_id = args[:ocd_division_id] if args.key?(:ocd_division_id)
|
550
|
+
end
|
551
|
+
end
|
552
|
+
|
553
|
+
# Information about individual election officials.
|
554
|
+
class ElectionOfficial
|
555
|
+
include Google::Apis::Core::Hashable
|
556
|
+
|
557
|
+
# The email address of the election official.
|
558
|
+
# Corresponds to the JSON property `emailAddress`
|
559
|
+
# @return [String]
|
560
|
+
attr_accessor :email_address
|
561
|
+
|
562
|
+
# The fax number of the election official.
|
563
|
+
# Corresponds to the JSON property `faxNumber`
|
564
|
+
# @return [String]
|
565
|
+
attr_accessor :fax_number
|
566
|
+
|
567
|
+
# The full name of the election official.
|
568
|
+
# Corresponds to the JSON property `name`
|
569
|
+
# @return [String]
|
570
|
+
attr_accessor :name
|
571
|
+
|
572
|
+
# The office phone number of the election official.
|
573
|
+
# Corresponds to the JSON property `officePhoneNumber`
|
574
|
+
# @return [String]
|
575
|
+
attr_accessor :office_phone_number
|
576
|
+
|
577
|
+
# The title of the election official.
|
578
|
+
# Corresponds to the JSON property `title`
|
579
|
+
# @return [String]
|
580
|
+
attr_accessor :title
|
581
|
+
|
582
|
+
def initialize(**args)
|
583
|
+
update!(**args)
|
584
|
+
end
|
585
|
+
|
586
|
+
# Update properties of this object
|
587
|
+
def update!(**args)
|
588
|
+
@email_address = args[:email_address] if args.key?(:email_address)
|
589
|
+
@fax_number = args[:fax_number] if args.key?(:fax_number)
|
590
|
+
@name = args[:name] if args.key?(:name)
|
591
|
+
@office_phone_number = args[:office_phone_number] if args.key?(:office_phone_number)
|
592
|
+
@title = args[:title] if args.key?(:title)
|
593
|
+
end
|
594
|
+
end
|
595
|
+
|
596
|
+
# The list of elections available for this version of the API.
|
597
|
+
class QueryElectionsResponse
|
598
|
+
include Google::Apis::Core::Hashable
|
599
|
+
|
600
|
+
# A list of available elections
|
601
|
+
# Corresponds to the JSON property `elections`
|
602
|
+
# @return [Array<Google::Apis::CivicinfoV2::Election>]
|
603
|
+
attr_accessor :elections
|
604
|
+
|
605
|
+
# Identifies what kind of resource this is. Value: the fixed string "civicinfo#
|
606
|
+
# electionsQueryResponse".
|
607
|
+
# Corresponds to the JSON property `kind`
|
608
|
+
# @return [String]
|
609
|
+
attr_accessor :kind
|
610
|
+
|
611
|
+
def initialize(**args)
|
612
|
+
update!(**args)
|
613
|
+
end
|
614
|
+
|
615
|
+
# Update properties of this object
|
616
|
+
def update!(**args)
|
617
|
+
@elections = args[:elections] if args.key?(:elections)
|
618
|
+
@kind = args[:kind] if args.key?(:kind)
|
619
|
+
end
|
620
|
+
end
|
621
|
+
|
622
|
+
# Describes the geographic scope of a contest.
|
623
|
+
class ElectoralDistrict
|
624
|
+
include Google::Apis::Core::Hashable
|
625
|
+
|
626
|
+
# An identifier for this district, relative to its scope. For example, the 34th
|
627
|
+
# State Senate district would have id "34" and a scope of stateUpper.
|
628
|
+
# Corresponds to the JSON property `id`
|
629
|
+
# @return [String]
|
630
|
+
attr_accessor :id
|
631
|
+
|
632
|
+
# The name of the district.
|
633
|
+
# Corresponds to the JSON property `name`
|
634
|
+
# @return [String]
|
635
|
+
attr_accessor :name
|
636
|
+
|
637
|
+
# The geographic scope of this district. If unspecified the district's geography
|
638
|
+
# is not known. One of: national, statewide, congressional, stateUpper,
|
639
|
+
# stateLower, countywide, judicial, schoolBoard, cityWide, township,
|
640
|
+
# countyCouncil, cityCouncil, ward, special
|
641
|
+
# Corresponds to the JSON property `scope`
|
642
|
+
# @return [String]
|
643
|
+
attr_accessor :scope
|
644
|
+
|
645
|
+
def initialize(**args)
|
646
|
+
update!(**args)
|
647
|
+
end
|
648
|
+
|
649
|
+
# Update properties of this object
|
650
|
+
def update!(**args)
|
651
|
+
@id = args[:id] if args.key?(:id)
|
652
|
+
@name = args[:name] if args.key?(:name)
|
653
|
+
@scope = args[:scope] if args.key?(:scope)
|
654
|
+
end
|
655
|
+
end
|
656
|
+
|
657
|
+
# Describes a political geography.
|
658
|
+
class GeographicDivision
|
659
|
+
include Google::Apis::Core::Hashable
|
660
|
+
|
661
|
+
# Any other valid OCD IDs that refer to the same division.\n\nBecause OCD IDs
|
662
|
+
# are meant to be human-readable and at least somewhat predictable, there are
|
663
|
+
# occasionally several identifiers for a single division. These identifiers are
|
664
|
+
# defined to be equivalent to one another, and one is always indicated as the
|
665
|
+
# primary identifier. The primary identifier will be returned in ocd_id above,
|
666
|
+
# and any other equivalent valid identifiers will be returned in this list.\n\
|
667
|
+
# nFor example, if this division's OCD ID is ocd-division/country:us/district:dc,
|
668
|
+
# this will contain ocd-division/country:us/state:dc.
|
669
|
+
# Corresponds to the JSON property `alsoKnownAs`
|
670
|
+
# @return [Array<String>]
|
671
|
+
attr_accessor :also_known_as
|
672
|
+
|
673
|
+
# The name of the division.
|
674
|
+
# Corresponds to the JSON property `name`
|
675
|
+
# @return [String]
|
676
|
+
attr_accessor :name
|
677
|
+
|
678
|
+
# List of indices in the offices array, one for each office elected from this
|
679
|
+
# division. Will only be present if includeOffices was true (or absent) in the
|
680
|
+
# request.
|
681
|
+
# Corresponds to the JSON property `officeIndices`
|
682
|
+
# @return [Array<Fixnum>]
|
683
|
+
attr_accessor :office_indices
|
684
|
+
|
685
|
+
def initialize(**args)
|
686
|
+
update!(**args)
|
687
|
+
end
|
688
|
+
|
689
|
+
# Update properties of this object
|
690
|
+
def update!(**args)
|
691
|
+
@also_known_as = args[:also_known_as] if args.key?(:also_known_as)
|
692
|
+
@name = args[:name] if args.key?(:name)
|
693
|
+
@office_indices = args[:office_indices] if args.key?(:office_indices)
|
694
|
+
end
|
695
|
+
end
|
696
|
+
|
697
|
+
# Information about an Office held by one or more Officials.
|
698
|
+
class Office
|
699
|
+
include Google::Apis::Core::Hashable
|
700
|
+
|
701
|
+
# The OCD ID of the division with which this office is associated.
|
702
|
+
# Corresponds to the JSON property `divisionId`
|
703
|
+
# @return [String]
|
704
|
+
attr_accessor :division_id
|
705
|
+
|
706
|
+
# The levels of government of which this office is part. There may be more than
|
707
|
+
# one in cases where a jurisdiction effectively acts at two different levels of
|
708
|
+
# government; for example, the mayor of the District of Columbia acts at "
|
709
|
+
# locality" level, but also effectively at both "administrative-area-2" and "
|
710
|
+
# administrative-area-1".
|
711
|
+
# Corresponds to the JSON property `levels`
|
712
|
+
# @return [Array<String>]
|
713
|
+
attr_accessor :levels
|
714
|
+
|
715
|
+
# The human-readable name of the office.
|
716
|
+
# Corresponds to the JSON property `name`
|
717
|
+
# @return [String]
|
718
|
+
attr_accessor :name
|
719
|
+
|
720
|
+
# List of indices in the officials array of people who presently hold this
|
721
|
+
# office.
|
722
|
+
# Corresponds to the JSON property `officialIndices`
|
723
|
+
# @return [Array<Fixnum>]
|
724
|
+
attr_accessor :official_indices
|
725
|
+
|
726
|
+
# The roles which this office fulfills. Roles are not meant to be exhaustive, or
|
727
|
+
# to exactly specify the entire set of responsibilities of a given office, but
|
728
|
+
# are meant to be rough categories that are useful for general selection from or
|
729
|
+
# sorting of a list of offices.
|
730
|
+
# Corresponds to the JSON property `roles`
|
731
|
+
# @return [Array<String>]
|
732
|
+
attr_accessor :roles
|
733
|
+
|
734
|
+
# A list of sources for this office. If multiple sources are listed, the data
|
735
|
+
# has been aggregated from those sources.
|
736
|
+
# Corresponds to the JSON property `sources`
|
737
|
+
# @return [Array<Google::Apis::CivicinfoV2::Source>]
|
738
|
+
attr_accessor :sources
|
739
|
+
|
740
|
+
def initialize(**args)
|
741
|
+
update!(**args)
|
742
|
+
end
|
743
|
+
|
744
|
+
# Update properties of this object
|
745
|
+
def update!(**args)
|
746
|
+
@division_id = args[:division_id] if args.key?(:division_id)
|
747
|
+
@levels = args[:levels] if args.key?(:levels)
|
748
|
+
@name = args[:name] if args.key?(:name)
|
749
|
+
@official_indices = args[:official_indices] if args.key?(:official_indices)
|
750
|
+
@roles = args[:roles] if args.key?(:roles)
|
751
|
+
@sources = args[:sources] if args.key?(:sources)
|
752
|
+
end
|
753
|
+
end
|
754
|
+
|
755
|
+
# Information about a person holding an elected office.
|
756
|
+
class Official
|
757
|
+
include Google::Apis::Core::Hashable
|
758
|
+
|
759
|
+
# Addresses at which to contact the official.
|
760
|
+
# Corresponds to the JSON property `address`
|
761
|
+
# @return [Array<Google::Apis::CivicinfoV2::SimpleAddressType>]
|
762
|
+
attr_accessor :address
|
763
|
+
|
764
|
+
# A list of known (social) media channels for this official.
|
765
|
+
# Corresponds to the JSON property `channels`
|
766
|
+
# @return [Array<Google::Apis::CivicinfoV2::Channel>]
|
767
|
+
attr_accessor :channels
|
768
|
+
|
769
|
+
# The direct email addresses for the official.
|
770
|
+
# Corresponds to the JSON property `emails`
|
771
|
+
# @return [Array<String>]
|
772
|
+
attr_accessor :emails
|
773
|
+
|
774
|
+
# The official's name.
|
775
|
+
# Corresponds to the JSON property `name`
|
776
|
+
# @return [String]
|
777
|
+
attr_accessor :name
|
778
|
+
|
779
|
+
# The full name of the party the official belongs to.
|
780
|
+
# Corresponds to the JSON property `party`
|
781
|
+
# @return [String]
|
782
|
+
attr_accessor :party
|
783
|
+
|
784
|
+
# The official's public contact phone numbers.
|
785
|
+
# Corresponds to the JSON property `phones`
|
786
|
+
# @return [Array<String>]
|
787
|
+
attr_accessor :phones
|
788
|
+
|
789
|
+
# A URL for a photo of the official.
|
790
|
+
# Corresponds to the JSON property `photoUrl`
|
791
|
+
# @return [String]
|
792
|
+
attr_accessor :photo_url
|
793
|
+
|
794
|
+
# The official's public website URLs.
|
795
|
+
# Corresponds to the JSON property `urls`
|
796
|
+
# @return [Array<String>]
|
797
|
+
attr_accessor :urls
|
798
|
+
|
799
|
+
def initialize(**args)
|
800
|
+
update!(**args)
|
801
|
+
end
|
802
|
+
|
803
|
+
# Update properties of this object
|
804
|
+
def update!(**args)
|
805
|
+
@address = args[:address] if args.key?(:address)
|
806
|
+
@channels = args[:channels] if args.key?(:channels)
|
807
|
+
@emails = args[:emails] if args.key?(:emails)
|
808
|
+
@name = args[:name] if args.key?(:name)
|
809
|
+
@party = args[:party] if args.key?(:party)
|
810
|
+
@phones = args[:phones] if args.key?(:phones)
|
811
|
+
@photo_url = args[:photo_url] if args.key?(:photo_url)
|
812
|
+
@urls = args[:urls] if args.key?(:urls)
|
813
|
+
end
|
814
|
+
end
|
815
|
+
|
816
|
+
# A location where a voter can vote. This may be an early vote site, an election
|
817
|
+
# day voting location, or a drop off location for a completed ballot.
|
818
|
+
class PollingLocation
|
819
|
+
include Google::Apis::Core::Hashable
|
820
|
+
|
821
|
+
# A simple representation of an address.
|
822
|
+
# Corresponds to the JSON property `address`
|
823
|
+
# @return [Google::Apis::CivicinfoV2::SimpleAddressType]
|
824
|
+
attr_accessor :address
|
825
|
+
|
826
|
+
# The last date that this early vote site or drop off location may be used. This
|
827
|
+
# field is not populated for polling locations.
|
828
|
+
# Corresponds to the JSON property `endDate`
|
829
|
+
# @return [String]
|
830
|
+
attr_accessor :end_date
|
831
|
+
|
832
|
+
# Latitude of the location, in degrees north of the equator. Note this field may
|
833
|
+
# not be available for some locations.
|
834
|
+
# Corresponds to the JSON property `latitude`
|
835
|
+
# @return [Float]
|
836
|
+
attr_accessor :latitude
|
837
|
+
|
838
|
+
# Longitude of the location, in degrees east of the Prime Meridian. Note this
|
839
|
+
# field may not be available for some locations.
|
840
|
+
# Corresponds to the JSON property `longitude`
|
841
|
+
# @return [Float]
|
842
|
+
attr_accessor :longitude
|
843
|
+
|
844
|
+
# The name of the early vote site or drop off location. This field is not
|
845
|
+
# populated for polling locations.
|
846
|
+
# Corresponds to the JSON property `name`
|
847
|
+
# @return [String]
|
848
|
+
attr_accessor :name
|
849
|
+
|
850
|
+
# Notes about this location (e.g. accessibility ramp or entrance to use).
|
851
|
+
# Corresponds to the JSON property `notes`
|
852
|
+
# @return [String]
|
853
|
+
attr_accessor :notes
|
854
|
+
|
855
|
+
# A description of when this location is open.
|
856
|
+
# Corresponds to the JSON property `pollingHours`
|
857
|
+
# @return [String]
|
858
|
+
attr_accessor :polling_hours
|
859
|
+
|
860
|
+
# A list of sources for this location. If multiple sources are listed the data
|
861
|
+
# has been aggregated from those sources.
|
862
|
+
# Corresponds to the JSON property `sources`
|
863
|
+
# @return [Array<Google::Apis::CivicinfoV2::Source>]
|
864
|
+
attr_accessor :sources
|
865
|
+
|
866
|
+
# The first date that this early vote site or drop off location may be used.
|
867
|
+
# This field is not populated for polling locations.
|
868
|
+
# Corresponds to the JSON property `startDate`
|
869
|
+
# @return [String]
|
870
|
+
attr_accessor :start_date
|
871
|
+
|
872
|
+
# The services provided by this early vote site or drop off location. This field
|
873
|
+
# is not populated for polling locations.
|
874
|
+
# Corresponds to the JSON property `voterServices`
|
875
|
+
# @return [String]
|
876
|
+
attr_accessor :voter_services
|
877
|
+
|
878
|
+
def initialize(**args)
|
879
|
+
update!(**args)
|
880
|
+
end
|
881
|
+
|
882
|
+
# Update properties of this object
|
883
|
+
def update!(**args)
|
884
|
+
@address = args[:address] if args.key?(:address)
|
885
|
+
@end_date = args[:end_date] if args.key?(:end_date)
|
886
|
+
@latitude = args[:latitude] if args.key?(:latitude)
|
887
|
+
@longitude = args[:longitude] if args.key?(:longitude)
|
888
|
+
@name = args[:name] if args.key?(:name)
|
889
|
+
@notes = args[:notes] if args.key?(:notes)
|
890
|
+
@polling_hours = args[:polling_hours] if args.key?(:polling_hours)
|
891
|
+
@sources = args[:sources] if args.key?(:sources)
|
892
|
+
@start_date = args[:start_date] if args.key?(:start_date)
|
893
|
+
@voter_services = args[:voter_services] if args.key?(:voter_services)
|
894
|
+
end
|
895
|
+
end
|
896
|
+
|
897
|
+
#
|
898
|
+
class RepresentativeInfoData
|
899
|
+
include Google::Apis::Core::Hashable
|
900
|
+
|
901
|
+
# A map of political geographic divisions that contain the requested address,
|
902
|
+
# keyed by the unique Open Civic Data identifier for this division.
|
903
|
+
# Corresponds to the JSON property `divisions`
|
904
|
+
# @return [Hash<String,Google::Apis::CivicinfoV2::GeographicDivision>]
|
905
|
+
attr_accessor :divisions
|
906
|
+
|
907
|
+
# Elected offices referenced by the divisions listed above. Will only be present
|
908
|
+
# if includeOffices was true in the request.
|
909
|
+
# Corresponds to the JSON property `offices`
|
910
|
+
# @return [Array<Google::Apis::CivicinfoV2::Office>]
|
911
|
+
attr_accessor :offices
|
912
|
+
|
913
|
+
# Officials holding the offices listed above. Will only be present if
|
914
|
+
# includeOffices was true in the request.
|
915
|
+
# Corresponds to the JSON property `officials`
|
916
|
+
# @return [Array<Google::Apis::CivicinfoV2::Official>]
|
917
|
+
attr_accessor :officials
|
918
|
+
|
919
|
+
def initialize(**args)
|
920
|
+
update!(**args)
|
921
|
+
end
|
922
|
+
|
923
|
+
# Update properties of this object
|
924
|
+
def update!(**args)
|
925
|
+
@divisions = args[:divisions] if args.key?(:divisions)
|
926
|
+
@offices = args[:offices] if args.key?(:offices)
|
927
|
+
@officials = args[:officials] if args.key?(:officials)
|
928
|
+
end
|
929
|
+
end
|
930
|
+
|
931
|
+
# The result of a representative info lookup query.
|
932
|
+
class RepresentativeInfoResponse
|
933
|
+
include Google::Apis::Core::Hashable
|
934
|
+
|
935
|
+
# A map of political geographic divisions that contain the requested address,
|
936
|
+
# keyed by the unique Open Civic Data identifier for this division.
|
937
|
+
# Corresponds to the JSON property `divisions`
|
938
|
+
# @return [Hash<String,Google::Apis::CivicinfoV2::GeographicDivision>]
|
939
|
+
attr_accessor :divisions
|
940
|
+
|
941
|
+
# Identifies what kind of resource this is. Value: the fixed string "civicinfo#
|
942
|
+
# representativeInfoResponse".
|
943
|
+
# Corresponds to the JSON property `kind`
|
944
|
+
# @return [String]
|
945
|
+
attr_accessor :kind
|
946
|
+
|
947
|
+
# A simple representation of an address.
|
948
|
+
# Corresponds to the JSON property `normalizedInput`
|
949
|
+
# @return [Google::Apis::CivicinfoV2::SimpleAddressType]
|
950
|
+
attr_accessor :normalized_input
|
951
|
+
|
952
|
+
# Elected offices referenced by the divisions listed above. Will only be present
|
953
|
+
# if includeOffices was true in the request.
|
954
|
+
# Corresponds to the JSON property `offices`
|
955
|
+
# @return [Array<Google::Apis::CivicinfoV2::Office>]
|
956
|
+
attr_accessor :offices
|
957
|
+
|
958
|
+
# Officials holding the offices listed above. Will only be present if
|
959
|
+
# includeOffices was true in the request.
|
960
|
+
# Corresponds to the JSON property `officials`
|
961
|
+
# @return [Array<Google::Apis::CivicinfoV2::Official>]
|
962
|
+
attr_accessor :officials
|
963
|
+
|
964
|
+
def initialize(**args)
|
965
|
+
update!(**args)
|
966
|
+
end
|
967
|
+
|
968
|
+
# Update properties of this object
|
969
|
+
def update!(**args)
|
970
|
+
@divisions = args[:divisions] if args.key?(:divisions)
|
971
|
+
@kind = args[:kind] if args.key?(:kind)
|
972
|
+
@normalized_input = args[:normalized_input] if args.key?(:normalized_input)
|
973
|
+
@offices = args[:offices] if args.key?(:offices)
|
974
|
+
@officials = args[:officials] if args.key?(:officials)
|
975
|
+
end
|
976
|
+
end
|
977
|
+
|
978
|
+
# A simple representation of an address.
|
979
|
+
class SimpleAddressType
|
980
|
+
include Google::Apis::Core::Hashable
|
981
|
+
|
982
|
+
# The city or town for the address.
|
983
|
+
# Corresponds to the JSON property `city`
|
984
|
+
# @return [String]
|
985
|
+
attr_accessor :city
|
986
|
+
|
987
|
+
# The street name and number of this address.
|
988
|
+
# Corresponds to the JSON property `line1`
|
989
|
+
# @return [String]
|
990
|
+
attr_accessor :line1
|
991
|
+
|
992
|
+
# The second line the address, if needed.
|
993
|
+
# Corresponds to the JSON property `line2`
|
994
|
+
# @return [String]
|
995
|
+
attr_accessor :line2
|
996
|
+
|
997
|
+
# The third line of the address, if needed.
|
998
|
+
# Corresponds to the JSON property `line3`
|
999
|
+
# @return [String]
|
1000
|
+
attr_accessor :line3
|
1001
|
+
|
1002
|
+
# The name of the location.
|
1003
|
+
# Corresponds to the JSON property `locationName`
|
1004
|
+
# @return [String]
|
1005
|
+
attr_accessor :location_name
|
1006
|
+
|
1007
|
+
# The US two letter state abbreviation of the address.
|
1008
|
+
# Corresponds to the JSON property `state`
|
1009
|
+
# @return [String]
|
1010
|
+
attr_accessor :state
|
1011
|
+
|
1012
|
+
# The US Postal Zip Code of the address.
|
1013
|
+
# Corresponds to the JSON property `zip`
|
1014
|
+
# @return [String]
|
1015
|
+
attr_accessor :zip
|
1016
|
+
|
1017
|
+
def initialize(**args)
|
1018
|
+
update!(**args)
|
1019
|
+
end
|
1020
|
+
|
1021
|
+
# Update properties of this object
|
1022
|
+
def update!(**args)
|
1023
|
+
@city = args[:city] if args.key?(:city)
|
1024
|
+
@line1 = args[:line1] if args.key?(:line1)
|
1025
|
+
@line2 = args[:line2] if args.key?(:line2)
|
1026
|
+
@line3 = args[:line3] if args.key?(:line3)
|
1027
|
+
@location_name = args[:location_name] if args.key?(:location_name)
|
1028
|
+
@state = args[:state] if args.key?(:state)
|
1029
|
+
@zip = args[:zip] if args.key?(:zip)
|
1030
|
+
end
|
1031
|
+
end
|
1032
|
+
|
1033
|
+
# Contains information about the data source for the element containing it.
|
1034
|
+
class Source
|
1035
|
+
include Google::Apis::Core::Hashable
|
1036
|
+
|
1037
|
+
# The name of the data source.
|
1038
|
+
# Corresponds to the JSON property `name`
|
1039
|
+
# @return [String]
|
1040
|
+
attr_accessor :name
|
1041
|
+
|
1042
|
+
# Whether this data comes from an official government source.
|
1043
|
+
# Corresponds to the JSON property `official`
|
1044
|
+
# @return [Boolean]
|
1045
|
+
attr_accessor :official
|
1046
|
+
alias_method :official?, :official
|
1047
|
+
|
1048
|
+
def initialize(**args)
|
1049
|
+
update!(**args)
|
1050
|
+
end
|
1051
|
+
|
1052
|
+
# Update properties of this object
|
1053
|
+
def update!(**args)
|
1054
|
+
@name = args[:name] if args.key?(:name)
|
1055
|
+
@official = args[:official] if args.key?(:official)
|
1056
|
+
end
|
1057
|
+
end
|
1058
|
+
|
1059
|
+
# The result of a voter info lookup query.
|
1060
|
+
class VoterInfoResponse
|
1061
|
+
include Google::Apis::Core::Hashable
|
1062
|
+
|
1063
|
+
# Contests that will appear on the voter's ballot.
|
1064
|
+
# Corresponds to the JSON property `contests`
|
1065
|
+
# @return [Array<Google::Apis::CivicinfoV2::Contest>]
|
1066
|
+
attr_accessor :contests
|
1067
|
+
|
1068
|
+
# Locations where a voter is eligible to drop off a completed ballot. The voter
|
1069
|
+
# must have received and completed a ballot prior to arriving at the location.
|
1070
|
+
# The location may not have ballots available on the premises. These locations
|
1071
|
+
# could be open on or before election day as indicated in the pollingHours field.
|
1072
|
+
# Corresponds to the JSON property `dropOffLocations`
|
1073
|
+
# @return [Array<Google::Apis::CivicinfoV2::PollingLocation>]
|
1074
|
+
attr_accessor :drop_off_locations
|
1075
|
+
|
1076
|
+
# Locations where the voter is eligible to vote early, prior to election day.
|
1077
|
+
# Corresponds to the JSON property `earlyVoteSites`
|
1078
|
+
# @return [Array<Google::Apis::CivicinfoV2::PollingLocation>]
|
1079
|
+
attr_accessor :early_vote_sites
|
1080
|
+
|
1081
|
+
# Information about the election that was queried.
|
1082
|
+
# Corresponds to the JSON property `election`
|
1083
|
+
# @return [Google::Apis::CivicinfoV2::Election]
|
1084
|
+
attr_accessor :election
|
1085
|
+
|
1086
|
+
# Identifies what kind of resource this is. Value: the fixed string "civicinfo#
|
1087
|
+
# voterInfoResponse".
|
1088
|
+
# Corresponds to the JSON property `kind`
|
1089
|
+
# @return [String]
|
1090
|
+
attr_accessor :kind
|
1091
|
+
|
1092
|
+
# Specifies whether voters in the precinct vote only by mailing their ballots (
|
1093
|
+
# with the possible option of dropping off their ballots as well).
|
1094
|
+
# Corresponds to the JSON property `mailOnly`
|
1095
|
+
# @return [Boolean]
|
1096
|
+
attr_accessor :mail_only
|
1097
|
+
alias_method :mail_only?, :mail_only
|
1098
|
+
|
1099
|
+
# A simple representation of an address.
|
1100
|
+
# Corresponds to the JSON property `normalizedInput`
|
1101
|
+
# @return [Google::Apis::CivicinfoV2::SimpleAddressType]
|
1102
|
+
attr_accessor :normalized_input
|
1103
|
+
|
1104
|
+
# When there are multiple elections for a voter address, the otherElections
|
1105
|
+
# field is populated in the API response and there are two possibilities: 1. If
|
1106
|
+
# the earliest election is not the intended election, specify the election ID of
|
1107
|
+
# the desired election in a second API request using the electionId field. 2. If
|
1108
|
+
# these elections occur on the same day, the API doesn?t return any polling
|
1109
|
+
# location, contest, or election official information to ensure that an
|
1110
|
+
# additional query is made. For user-facing applications, we recommend
|
1111
|
+
# displaying these elections to the user to disambiguate. A second API request
|
1112
|
+
# using the electionId field should be made for the election that is relevant to
|
1113
|
+
# the user.
|
1114
|
+
# Corresponds to the JSON property `otherElections`
|
1115
|
+
# @return [Array<Google::Apis::CivicinfoV2::Election>]
|
1116
|
+
attr_accessor :other_elections
|
1117
|
+
|
1118
|
+
# Locations where the voter is eligible to vote on election day.
|
1119
|
+
# Corresponds to the JSON property `pollingLocations`
|
1120
|
+
# @return [Array<Google::Apis::CivicinfoV2::PollingLocation>]
|
1121
|
+
attr_accessor :polling_locations
|
1122
|
+
|
1123
|
+
#
|
1124
|
+
# Corresponds to the JSON property `precinctId`
|
1125
|
+
# @return [String]
|
1126
|
+
attr_accessor :precinct_id
|
1127
|
+
|
1128
|
+
# Local Election Information for the state that the voter votes in. For the US,
|
1129
|
+
# there will only be one element in this array.
|
1130
|
+
# Corresponds to the JSON property `state`
|
1131
|
+
# @return [Array<Google::Apis::CivicinfoV2::AdministrationRegion>]
|
1132
|
+
attr_accessor :state
|
1133
|
+
|
1134
|
+
def initialize(**args)
|
1135
|
+
update!(**args)
|
1136
|
+
end
|
1137
|
+
|
1138
|
+
# Update properties of this object
|
1139
|
+
def update!(**args)
|
1140
|
+
@contests = args[:contests] if args.key?(:contests)
|
1141
|
+
@drop_off_locations = args[:drop_off_locations] if args.key?(:drop_off_locations)
|
1142
|
+
@early_vote_sites = args[:early_vote_sites] if args.key?(:early_vote_sites)
|
1143
|
+
@election = args[:election] if args.key?(:election)
|
1144
|
+
@kind = args[:kind] if args.key?(:kind)
|
1145
|
+
@mail_only = args[:mail_only] if args.key?(:mail_only)
|
1146
|
+
@normalized_input = args[:normalized_input] if args.key?(:normalized_input)
|
1147
|
+
@other_elections = args[:other_elections] if args.key?(:other_elections)
|
1148
|
+
@polling_locations = args[:polling_locations] if args.key?(:polling_locations)
|
1149
|
+
@precinct_id = args[:precinct_id] if args.key?(:precinct_id)
|
1150
|
+
@state = args[:state] if args.key?(:state)
|
1151
|
+
end
|
1152
|
+
end
|
1153
|
+
end
|
1154
|
+
end
|
1155
|
+
end
|