Class: Google::Apis::CivicinfoV2::VoterInfoResponse

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
generated/google/apis/civicinfo_v2/classes.rb,
generated/google/apis/civicinfo_v2/representations.rb,
generated/google/apis/civicinfo_v2/representations.rb

Overview

The result of a voter info lookup query.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ VoterInfoResponse

Returns a new instance of VoterInfoResponse



2028
2029
2030
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 2028

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#contestsArray<Google::Apis::CivicinfoV2::Contest>

Contests that will appear on the voter's ballot. Corresponds to the JSON property contests



1955
1956
1957
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1955

def contests
  @contests
end

#drop_off_locationsArray<Google::Apis::CivicinfoV2::PollingLocation>

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



1963
1964
1965
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1963

def drop_off_locations
  @drop_off_locations
end

#early_vote_sitesArray<Google::Apis::CivicinfoV2::PollingLocation>

Locations where the voter is eligible to vote early, prior to election day. Corresponds to the JSON property earlyVoteSites



1968
1969
1970
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1968

def early_vote_sites
  @early_vote_sites
end

#electionGoogle::Apis::CivicinfoV2::Election

Information about the election that was queried. Corresponds to the JSON property election



1973
1974
1975
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1973

def election
  @election
end

#kindString

Identifies what kind of resource this is. Value: the fixed string "civicinfo# voterInfoResponse". Corresponds to the JSON property kind

Returns:

  • (String)


1979
1980
1981
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1979

def kind
  @kind
end

#mail_onlyBoolean 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

Returns:

  • (Boolean)


1985
1986
1987
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1985

def mail_only
  @mail_only
end

#normalized_inputGoogle::Apis::CivicinfoV2::SimpleAddressType

A simple representation of an address. Corresponds to the JSON property normalizedInput



1991
1992
1993
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1991

def normalized_input
  @normalized_input
end

#other_electionsArray<Google::Apis::CivicinfoV2::Election>

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



2005
2006
2007
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 2005

def other_elections
  @other_elections
end

#polling_locationsArray<Google::Apis::CivicinfoV2::PollingLocation>

Locations where the voter is eligible to vote on election day. Corresponds to the JSON property pollingLocations



2010
2011
2012
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 2010

def polling_locations
  @polling_locations
end

#precinct_idString

Corresponds to the JSON property precinctId

Returns:

  • (String)


2015
2016
2017
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 2015

def precinct_id
  @precinct_id
end

#segmentsArray<Google::Apis::CivicinfoV2::StreetSegment>

Corresponds to the JSON property segments



2020
2021
2022
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 2020

def segments
  @segments
end

#stateArray<Google::Apis::CivicinfoV2::AdministrationRegion>

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



2026
2027
2028
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 2026

def state
  @state
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 2033

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)
  @segments = args[:segments] if args.key?(:segments)
  @state = args[:state] if args.key?(:state)
end