google_api_civic_info v0.13.0 GoogleApi.CivicInfo.V2.Api.Elections View Source

API calls for all endpoints tagged Elections.

Link to this section Summary

Functions

Looks up information relevant to a voter based on the voter's registered address.

Link to this section Functions

Link to this function

civicinfo_elections_election_query(connection, optional_params \\ [], opts \\ [])

View Source

Specs

civicinfo_elections_election_query(Tesla.Env.client(), keyword(), keyword()) ::
  {:ok, GoogleApi.CivicInfo.V2.Model.ElectionsQueryResponse.t()}
  | {:ok, Tesla.Env.t()}
  | {:error, any()}

List of available elections to query.

Parameters

  • connection (type: GoogleApi.CivicInfo.V2.Connection.t) - Connection to server
  • optional_params (type: keyword()) - Optional parameters
    • :"$.xgafv" (type: String.t) - V1 error format.
    • :access_token (type: String.t) - OAuth access token.
    • :alt (type: String.t) - Data format for response.
    • :callback (type: String.t) - JSONP
    • :fields (type: String.t) - Selector specifying which fields to include in a partial response.
    • :key (type: String.t) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • :oauth_token (type: String.t) - OAuth 2.0 token for the current user.
    • :prettyPrint (type: boolean()) - Returns response with indentations and line breaks.
    • :quotaUser (type: String.t) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • :uploadType (type: String.t) - Legacy upload protocol for media (e.g. "media", "multipart").
    • :upload_protocol (type: String.t) - Upload protocol for media (e.g. "raw", "multipart").
  • opts (type: keyword()) - Call options

Returns

  • {:ok, %GoogleApi.CivicInfo.V2.Model.ElectionsQueryResponse{}} on success
  • {:error, info} on failure
Link to this function

civicinfo_elections_voter_info_query(connection, address, optional_params \\ [], opts \\ [])

View Source

Specs

civicinfo_elections_voter_info_query(
  Tesla.Env.client(),
  String.t(),
  keyword(),
  keyword()
) ::
  {:ok, GoogleApi.CivicInfo.V2.Model.VoterInfoResponse.t()}
  | {:ok, Tesla.Env.t()}
  | {:error, any()}

Looks up information relevant to a voter based on the voter's registered address.

Parameters

  • connection (type: GoogleApi.CivicInfo.V2.Connection.t) - Connection to server
  • address (type: String.t) - The registered address of the voter to look up.
  • optional_params (type: keyword()) - Optional parameters
    • :"$.xgafv" (type: String.t) - V1 error format.
    • :access_token (type: String.t) - OAuth access token.
    • :alt (type: String.t) - Data format for response.
    • :callback (type: String.t) - JSONP
    • :fields (type: String.t) - Selector specifying which fields to include in a partial response.
    • :key (type: String.t) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • :oauth_token (type: String.t) - OAuth 2.0 token for the current user.
    • :prettyPrint (type: boolean()) - Returns response with indentations and line breaks.
    • :quotaUser (type: String.t) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • :uploadType (type: String.t) - Legacy upload protocol for media (e.g. "media", "multipart").
    • :upload_protocol (type: String.t) - Upload protocol for media (e.g. "raw", "multipart").
    • :electionId (type: String.t) - The unique ID of the election to look up. A list of election IDs can be obtained at https://www.googleapis.com/civicinfo/{version}/elections. If no election ID is specified in the query and there is more than one election with data for the given voter, the additional elections are provided in the otherElections response field.
    • :officialOnly (type: boolean()) - If set to true, only data from official state sources will be returned.
    • :returnAllAvailableData (type: boolean()) - If set to true, the query will return the success codeand include any partial information when it is unable to determine a matching address or unable to determine the election for electionId=0 queries.
  • opts (type: keyword()) - Call options

Returns

  • {:ok, %GoogleApi.CivicInfo.V2.Model.VoterInfoResponse{}} on success
  • {:error, info} on failure