Class: Google::Apis::CivicinfoV2::CivicinfoApiprotosV2VoterInfoResponse
- Inherits:
-
Object
- Object
- Google::Apis::CivicinfoV2::CivicinfoApiprotosV2VoterInfoResponse
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/civicinfo_v2/classes.rb,
lib/google/apis/civicinfo_v2/representations.rb,
lib/google/apis/civicinfo_v2/representations.rb
Overview
The result of a voter info lookup query.
Instance Attribute Summary collapse
-
#contests ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2Contest>
Contests that will appear on the voter's ballot.
-
#drop_off_locations ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2PollingLocation>
Locations where a voter is eligible to drop off a completed ballot.
-
#early_vote_sites ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2PollingLocation>
Locations where the voter is eligible to vote early, prior to election day.
-
#election ⇒ Google::Apis::CivicinfoV2::CivicinfoSchemaV2Election
Information about the election that was queried.
-
#kind ⇒ String
Identifies what kind of resource this is.
-
#mail_only ⇒ Boolean
(also: #mail_only?)
Specifies whether voters in the precinct vote only by mailing their ballots ( with the possible option of dropping off their ballots as well).
-
#normalized_input ⇒ Google::Apis::CivicinfoV2::CivicinfoSchemaV2SimpleAddressType
A simple representation of an address.
-
#other_elections ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2Election>
When there are multiple elections for a voter address, the otherElections field is populated in the API response and there are two possibilities: 1.
-
#polling_locations ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2PollingLocation>
Locations where the voter is eligible to vote on election day.
-
#precinct_id ⇒ String
Corresponds to the JSON property
precinctId. -
#precincts ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2Precinct>
The precincts that match this voter's address.
-
#state ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2AdministrationRegion>
Local Election Information for the state that the voter votes in.
Instance Method Summary collapse
-
#initialize(**args) ⇒ CivicinfoApiprotosV2VoterInfoResponse
constructor
A new instance of CivicinfoApiprotosV2VoterInfoResponse.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ CivicinfoApiprotosV2VoterInfoResponse
Returns a new instance of CivicinfoApiprotosV2VoterInfoResponse.
218 219 220 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 218 def initialize(**args) update!(**args) end |
Instance Attribute Details
#contests ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2Contest>
Contests that will appear on the voter's ballot.
Corresponds to the JSON property contests
144 145 146 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 144 def contests @contests end |
#drop_off_locations ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2PollingLocation>
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.
Corresponds to the JSON property dropOffLocations
152 153 154 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 152 def drop_off_locations @drop_off_locations end |
#early_vote_sites ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2PollingLocation>
Locations where the voter is eligible to vote early, prior to election day.
Corresponds to the JSON property earlyVoteSites
157 158 159 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 157 def early_vote_sites @early_vote_sites end |
#election ⇒ Google::Apis::CivicinfoV2::CivicinfoSchemaV2Election
Information about the election that was queried.
Corresponds to the JSON property election
162 163 164 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 162 def election @election end |
#kind ⇒ String
Identifies what kind of resource this is. Value: the fixed string "civicinfo#
voterInfoResponse".
Corresponds to the JSON property kind
168 169 170 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 168 def kind @kind end |
#mail_only ⇒ Boolean Also known as: mail_only?
Specifies whether voters in the precinct vote only by mailing their ballots (
with the possible option of dropping off their ballots as well).
Corresponds to the JSON property mailOnly
174 175 176 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 174 def mail_only @mail_only end |
#normalized_input ⇒ Google::Apis::CivicinfoV2::CivicinfoSchemaV2SimpleAddressType
A simple representation of an address.
Corresponds to the JSON property normalizedInput
180 181 182 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 180 def normalized_input @normalized_input end |
#other_elections ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2Election>
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.
Corresponds to the JSON property otherElections
194 195 196 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 194 def other_elections @other_elections end |
#polling_locations ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2PollingLocation>
Locations where the voter is eligible to vote on election day.
Corresponds to the JSON property pollingLocations
199 200 201 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 199 def polling_locations @polling_locations end |
#precinct_id ⇒ String
Corresponds to the JSON property precinctId
204 205 206 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 204 def precinct_id @precinct_id end |
#precincts ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2Precinct>
The precincts that match this voter's address. Will only be returned for
project IDs which have been allowlisted as "partner projects".
Corresponds to the JSON property precincts
210 211 212 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 210 def precincts @precincts end |
#state ⇒ Array<Google::Apis::CivicinfoV2::CivicinfoSchemaV2AdministrationRegion>
Local Election Information for the state that the voter votes in. For the US,
there will only be one element in this array.
Corresponds to the JSON property state
216 217 218 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 216 def state @state end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/google/apis/civicinfo_v2/classes.rb', line 223 def update!(**args) @contests = args[:contests] if args.key?(:contests) @drop_off_locations = args[:drop_off_locations] if args.key?(:drop_off_locations) @early_vote_sites = args[:early_vote_sites] if args.key?(:early_vote_sites) @election = args[:election] if args.key?(:election) @kind = args[:kind] if args.key?(:kind) @mail_only = args[:mail_only] if args.key?(:mail_only) @normalized_input = args[:normalized_input] if args.key?(:normalized_input) @other_elections = args[:other_elections] if args.key?(:other_elections) @polling_locations = args[:polling_locations] if args.key?(:polling_locations) @precinct_id = args[:precinct_id] if args.key?(:precinct_id) @precincts = args[:precincts] if args.key?(:precincts) @state = args[:state] if args.key?(:state) end |