Initial commit

This commit is contained in:
Local Administrator
2025-04-18 10:32:42 +02:00
commit b83134aca3
29643 changed files with 3045897 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* 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.
*/
namespace Google\Service\CivicInfo\Resource;
use Google\Service\CivicInfo\DivisionByAddressResponse;
use Google\Service\CivicInfo\DivisionSearchResponse;
/**
* The "divisions" collection of methods.
* Typical usage is:
* <code>
* $civicinfoService = new Google\Service\CivicInfo(...);
* $divisions = $civicinfoService->divisions;
* </code>
*/
class Divisions extends \Google\Service\Resource
{
/**
* Lookup OCDIDs and names for divisions related to an address.
* (divisions.queryDivisionByAddress)
*
* @param array $optParams Optional parameters.
*
* @opt_param string address
* @return DivisionByAddressResponse
* @throws \Google\Service\Exception
*/
public function queryDivisionByAddress($optParams = [])
{
$params = [];
$params = array_merge($params, $optParams);
return $this->call('queryDivisionByAddress', [$params], DivisionByAddressResponse::class);
}
/**
* Searches for political divisions by their natural name or OCD ID.
* (divisions.search)
*
* @param array $optParams Optional parameters.
*
* @opt_param string query The search query. Queries can cover any parts of a
* OCD ID or a human readable division name. All words given in the query are
* treated as required patterns. In addition to that, most query operators of
* the Apache Lucene library are supported. See
* http://lucene.apache.org/core/2_9_4/queryparsersyntax.html
* @return DivisionSearchResponse
* @throws \Google\Service\Exception
*/
public function search($optParams = [])
{
$params = [];
$params = array_merge($params, $optParams);
return $this->call('search', [$params], DivisionSearchResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Divisions::class, 'Google_Service_CivicInfo_Resource_Divisions');

View File

@@ -0,0 +1,84 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* 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.
*/
namespace Google\Service\CivicInfo\Resource;
use Google\Service\CivicInfo\ElectionsQueryResponse;
use Google\Service\CivicInfo\VoterInfoResponse;
/**
* The "elections" collection of methods.
* Typical usage is:
* <code>
* $civicinfoService = new Google\Service\CivicInfo(...);
* $elections = $civicinfoService->elections;
* </code>
*/
class Elections extends \Google\Service\Resource
{
/**
* List of available elections to query. (elections.electionQuery)
*
* @param array $optParams Optional parameters.
*
* @opt_param bool productionDataOnly Whether to include data that has not been
* allowlisted yet
* @return ElectionsQueryResponse
* @throws \Google\Service\Exception
*/
public function electionQuery($optParams = [])
{
$params = [];
$params = array_merge($params, $optParams);
return $this->call('electionQuery', [$params], ElectionsQueryResponse::class);
}
/**
* Looks up information relevant to a voter based on the voter's registered
* address. (elections.voterInfoQuery)
*
* @param array $optParams Optional parameters.
*
* @opt_param string address The registered address of the voter to look up.
* @opt_param string electionId 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.
* @opt_param bool officialOnly If set to true, only data from official state
* sources will be returned.
* @opt_param bool productionDataOnly Whether to include data that has not been
* vetted yet. Should only be made available to internal IPs or trusted
* partners. This is a non-discoverable parameter in the One Platform API
* config.
* @opt_param bool returnAllAvailableData If set to true, the query will return
* the success code and include any partial information when it is unable to
* determine a matching address or unable to determine the election for
* electionId=0 queries.
* @return VoterInfoResponse
* @throws \Google\Service\Exception
*/
public function voterInfoQuery($optParams = [])
{
$params = [];
$params = array_merge($params, $optParams);
return $this->call('voterInfoQuery', [$params], VoterInfoResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Elections::class, 'Google_Service_CivicInfo_Resource_Elections');

View File

@@ -0,0 +1,89 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* 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.
*/
namespace Google\Service\CivicInfo\Resource;
use Google\Service\CivicInfo\RepresentativeInfoData;
use Google\Service\CivicInfo\RepresentativeInfoResponse;
/**
* The "representatives" collection of methods.
* Typical usage is:
* <code>
* $civicinfoService = new Google\Service\CivicInfo(...);
* $representatives = $civicinfoService->representatives;
* </code>
*/
class Representatives extends \Google\Service\Resource
{
/**
* Looks up political geography and representative information for a single
* address. (representatives.representativeInfoByAddress)
*
* @param array $optParams Optional parameters.
*
* @opt_param string address The address to look up. May only be specified if
* the field ocdId is not given in the URL
* @opt_param bool includeOffices Whether to return information about offices
* and officials. If false, only the top-level district information will be
* returned.
* @opt_param string levels 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.
* @opt_param string roles 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.
* @return RepresentativeInfoResponse
* @throws \Google\Service\Exception
*/
public function representativeInfoByAddress($optParams = [])
{
$params = [];
$params = array_merge($params, $optParams);
return $this->call('representativeInfoByAddress', [$params], RepresentativeInfoResponse::class);
}
/**
* Looks up representative information for a single geographic division.
* (representatives.representativeInfoByDivision)
*
* @param string $ocdId The Open Civic Data division identifier of the division
* to look up.
* @param array $optParams Optional parameters.
*
* @opt_param string levels 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.
* @opt_param bool recursive 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.
* @opt_param string roles 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.
* @return RepresentativeInfoData
* @throws \Google\Service\Exception
*/
public function representativeInfoByDivision($ocdId, $optParams = [])
{
$params = ['ocdId' => $ocdId];
$params = array_merge($params, $optParams);
return $this->call('representativeInfoByDivision', [$params], RepresentativeInfoData::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Representatives::class, 'Google_Service_CivicInfo_Resource_Representatives');