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.



1118
1119
1120
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1118

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



1057
1058
1059
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1057

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



1065
1066
1067
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1065

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



1070
1071
1072
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1070

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



1075
1076
1077
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1075

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)


1081
1082
1083
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1081

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)


1087
1088
1089
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1087

def mail_only
  @mail_only
end

#normalized_inputGoogle::Apis::CivicinfoV2::SimpleAddressType

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



1093
1094
1095
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1093

def normalized_input
  @normalized_input
end

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

If no election ID was specified in the query, and there was more than one election with data for the given voter, this will contain information about the other elections that could apply. Corresponds to the JSON property otherElections



1100
1101
1102
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1100

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



1105
1106
1107
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1105

def polling_locations
  @polling_locations
end

#precinct_idString

Corresponds to the JSON property precinctId

Returns:

  • (String)


1110
1111
1112
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1110

def precinct_id
  @precinct_id
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



1116
1117
1118
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1116

def state
  @state
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
# File 'generated/google/apis/civicinfo_v2/classes.rb', line 1123

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