View Source GoogleApi.CivicInfo.V2.Api.Representatives (google_api_civic_info v0.23.0)

API calls for all endpoints tagged Representatives.

Summary

Functions

Looks up political geography and representative information for a single address.

Functions

Link to this function

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

View Source
@spec civicinfo_representatives_representative_info_by_address(
  Tesla.Env.client(),
  keyword(),
  keyword()
) ::
  {:ok, GoogleApi.CivicInfo.V2.Model.RepresentativeInfoResponse.t()}
  | {:ok, Tesla.Env.t()}
  | {:ok, list()}
  | {:error, any()}

Looks up political geography and representative information for a single address.

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").
    • :address (type: String.t) - The address to look up. May only be specified if the field ocdId is not given in the URL
    • :includeOffices (type: boolean()) - Whether to return information about offices and officials. If false, only the top-level district information will be returned.
    • :levels (type: list(String.t)) - A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching office will not be returned.
    • :roles (type: list(String.t)) - A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned.
  • opts (type: keyword()) - Call options

Returns

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

civicinfo_representatives_representative_info_by_division(connection, ocd_id, optional_params \\ [], opts \\ [])

View Source
@spec civicinfo_representatives_representative_info_by_division(
  Tesla.Env.client(),
  String.t(),
  keyword(),
  keyword()
) ::
  {:ok, GoogleApi.CivicInfo.V2.Model.RepresentativeInfoData.t()}
  | {:ok, Tesla.Env.t()}
  | {:ok, list()}
  | {:error, any()}

Looks up representative information for a single geographic division.

Parameters

  • connection (type: GoogleApi.CivicInfo.V2.Connection.t) - Connection to server
  • ocd_id (type: String.t) - The Open Civic Data division identifier of the division 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").
    • :levels (type: list(String.t)) - A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching office will not be returned.
    • :recursive (type: boolean()) - If true, information about all divisions contained in the division requested will be included as well. For example, if querying ocd-division/country:us/district:dc, this would also return all DC's wards and ANCs.
    • :roles (type: list(String.t)) - A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned.
  • opts (type: keyword()) - Call options

Returns

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