/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.civicinfo.v2.model;

/**
 * The result of a voter info lookup query.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Google Civic Information API. For a detailed
 * explanation see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class VoterInfoResponse extends com.google.api.client.json.GenericJson {

  /**
   * Contests that will appear on the voter's ballot.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<Contest> contests;

  static {
    // hack to force ProGuard to consider Contest used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(Contest.class);
  }

  /**
   * 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.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<PollingLocation> dropOffLocations;

  static {
    // hack to force ProGuard to consider PollingLocation used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(PollingLocation.class);
  }

  /**
   * Locations where the voter is eligible to vote early, prior to election day.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<PollingLocation> earlyVoteSites;

  static {
    // hack to force ProGuard to consider PollingLocation used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(PollingLocation.class);
  }

  /**
   * The election that was queried.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Election election;

  /**
   * Identifies what kind of resource this is. Value: the fixed string
   * "civicinfo#voterInfoResponse".
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String kind;

  /**
   * Specifies whether voters in the precinct vote only by mailing their ballots (with the possible
   * option of dropping off their ballots as well).
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean mailOnly;

  /**
   * The normalized version of the requested address
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private SimpleAddressType normalizedInput;

  /**
   * 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.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<Election> otherElections;

  static {
    // hack to force ProGuard to consider Election used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(Election.class);
  }

  /**
   * Locations where the voter is eligible to vote on election day.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<PollingLocation> pollingLocations;

  static {
    // hack to force ProGuard to consider PollingLocation used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(PollingLocation.class);
  }

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String precinctId;

  /**
   * The precincts that match this voter's address. Will only be returned for project IDs which have
   * been allowlisted as "partner projects".
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<Precinct> precincts;

  static {
    // hack to force ProGuard to consider Precinct used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(Precinct.class);
  }

  /**
   * Local Election Information for the state that the voter votes in. For the US, there will only
   * be one element in this array.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<AdministrationRegion> state;

  static {
    // hack to force ProGuard to consider AdministrationRegion used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(AdministrationRegion.class);
  }

  /**
   * Contests that will appear on the voter's ballot.
   * @return value or {@code null} for none
   */
  public java.util.List<Contest> getContests() {
    return contests;
  }

  /**
   * Contests that will appear on the voter's ballot.
   * @param contests contests or {@code null} for none
   */
  public VoterInfoResponse setContests(java.util.List<Contest> contests) {
    this.contests = contests;
    return this;
  }

  /**
   * 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.
   * @return value or {@code null} for none
   */
  public java.util.List<PollingLocation> getDropOffLocations() {
    return dropOffLocations;
  }

  /**
   * 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.
   * @param dropOffLocations dropOffLocations or {@code null} for none
   */
  public VoterInfoResponse setDropOffLocations(java.util.List<PollingLocation> dropOffLocations) {
    this.dropOffLocations = dropOffLocations;
    return this;
  }

  /**
   * Locations where the voter is eligible to vote early, prior to election day.
   * @return value or {@code null} for none
   */
  public java.util.List<PollingLocation> getEarlyVoteSites() {
    return earlyVoteSites;
  }

  /**
   * Locations where the voter is eligible to vote early, prior to election day.
   * @param earlyVoteSites earlyVoteSites or {@code null} for none
   */
  public VoterInfoResponse setEarlyVoteSites(java.util.List<PollingLocation> earlyVoteSites) {
    this.earlyVoteSites = earlyVoteSites;
    return this;
  }

  /**
   * The election that was queried.
   * @return value or {@code null} for none
   */
  public Election getElection() {
    return election;
  }

  /**
   * The election that was queried.
   * @param election election or {@code null} for none
   */
  public VoterInfoResponse setElection(Election election) {
    this.election = election;
    return this;
  }

  /**
   * Identifies what kind of resource this is. Value: the fixed string
   * "civicinfo#voterInfoResponse".
   * @return value or {@code null} for none
   */
  public java.lang.String getKind() {
    return kind;
  }

  /**
   * Identifies what kind of resource this is. Value: the fixed string
   * "civicinfo#voterInfoResponse".
   * @param kind kind or {@code null} for none
   */
  public VoterInfoResponse setKind(java.lang.String kind) {
    this.kind = kind;
    return this;
  }

  /**
   * Specifies whether voters in the precinct vote only by mailing their ballots (with the possible
   * option of dropping off their ballots as well).
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getMailOnly() {
    return mailOnly;
  }

  /**
   * Specifies whether voters in the precinct vote only by mailing their ballots (with the possible
   * option of dropping off their ballots as well).
   * @param mailOnly mailOnly or {@code null} for none
   */
  public VoterInfoResponse setMailOnly(java.lang.Boolean mailOnly) {
    this.mailOnly = mailOnly;
    return this;
  }

  /**
   * The normalized version of the requested address
   * @return value or {@code null} for none
   */
  public SimpleAddressType getNormalizedInput() {
    return normalizedInput;
  }

  /**
   * The normalized version of the requested address
   * @param normalizedInput normalizedInput or {@code null} for none
   */
  public VoterInfoResponse setNormalizedInput(SimpleAddressType normalizedInput) {
    this.normalizedInput = normalizedInput;
    return this;
  }

  /**
   * 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.
   * @return value or {@code null} for none
   */
  public java.util.List<Election> getOtherElections() {
    return otherElections;
  }

  /**
   * 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.
   * @param otherElections otherElections or {@code null} for none
   */
  public VoterInfoResponse setOtherElections(java.util.List<Election> otherElections) {
    this.otherElections = otherElections;
    return this;
  }

  /**
   * Locations where the voter is eligible to vote on election day.
   * @return value or {@code null} for none
   */
  public java.util.List<PollingLocation> getPollingLocations() {
    return pollingLocations;
  }

  /**
   * Locations where the voter is eligible to vote on election day.
   * @param pollingLocations pollingLocations or {@code null} for none
   */
  public VoterInfoResponse setPollingLocations(java.util.List<PollingLocation> pollingLocations) {
    this.pollingLocations = pollingLocations;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.lang.String getPrecinctId() {
    return precinctId;
  }

  /**
   * @param precinctId precinctId or {@code null} for none
   */
  public VoterInfoResponse setPrecinctId(java.lang.String precinctId) {
    this.precinctId = precinctId;
    return this;
  }

  /**
   * The precincts that match this voter's address. Will only be returned for project IDs which have
   * been allowlisted as "partner projects".
   * @return value or {@code null} for none
   */
  public java.util.List<Precinct> getPrecincts() {
    return precincts;
  }

  /**
   * The precincts that match this voter's address. Will only be returned for project IDs which have
   * been allowlisted as "partner projects".
   * @param precincts precincts or {@code null} for none
   */
  public VoterInfoResponse setPrecincts(java.util.List<Precinct> precincts) {
    this.precincts = precincts;
    return this;
  }

  /**
   * Local Election Information for the state that the voter votes in. For the US, there will only
   * be one element in this array.
   * @return value or {@code null} for none
   */
  public java.util.List<AdministrationRegion> getState() {
    return state;
  }

  /**
   * Local Election Information for the state that the voter votes in. For the US, there will only
   * be one element in this array.
   * @param state state or {@code null} for none
   */
  public VoterInfoResponse setState(java.util.List<AdministrationRegion> state) {
    this.state = state;
    return this;
  }

  @Override
  public VoterInfoResponse set(String fieldName, Object value) {
    return (VoterInfoResponse) super.set(fieldName, value);
  }

  @Override
  public VoterInfoResponse clone() {
    return (VoterInfoResponse) super.clone();
  }

}
