source: vendor/google/apiclient-services/src/CivicInfo.php@ f9c482b

Last change on this file since f9c482b was f9c482b, checked in by Vlado 222039 <vlado.popovski@…>, 7 days ago

Upload new project files

  • Property mode set to 100644
File size: 5.9 KB
Line 
1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service;
19
20use Google\Client;
21
22/**
23 * Service definition for CivicInfo (v2).
24 *
25 * <p>
26 * Provides polling places, early vote locations, contest data, election
27 * officials, and government representatives for U.S. residential addresses.</p>
28 *
29 * <p>
30 * For more information about this service, see the API
31 * <a href="https://developers.google.com/civic-information/" target="_blank">Documentation</a>
32 * </p>
33 *
34 * @author Google, Inc.
35 */
36class CivicInfo extends \Google\Service
37{
38
39
40 public $divisions;
41 public $elections;
42 public $representatives;
43 public $rootUrlTemplate;
44
45 /**
46 * Constructs the internal representation of the CivicInfo service.
47 *
48 * @param Client|array $clientOrConfig The client used to deliver requests, or a
49 * config array to pass to a new Client instance.
50 * @param string $rootUrl The root URL used for requests to the service.
51 */
52 public function __construct($clientOrConfig = [], $rootUrl = null)
53 {
54 parent::__construct($clientOrConfig);
55 $this->rootUrl = $rootUrl ?: 'https://civicinfo.googleapis.com/';
56 $this->rootUrlTemplate = $rootUrl ?: 'https://civicinfo.UNIVERSE_DOMAIN/';
57 $this->servicePath = '';
58 $this->batchPath = 'batch';
59 $this->version = 'v2';
60 $this->serviceName = 'civicinfo';
61
62 $this->divisions = new CivicInfo\Resource\Divisions(
63 $this,
64 $this->serviceName,
65 'divisions',
66 [
67 'methods' => [
68 'queryDivisionByAddress' => [
69 'path' => 'civicinfo/v2/divisionsByAddress',
70 'httpMethod' => 'GET',
71 'parameters' => [
72 'address' => [
73 'location' => 'query',
74 'type' => 'string',
75 ],
76 ],
77 ],'search' => [
78 'path' => 'civicinfo/v2/divisions',
79 'httpMethod' => 'GET',
80 'parameters' => [
81 'query' => [
82 'location' => 'query',
83 'type' => 'string',
84 ],
85 ],
86 ],
87 ]
88 ]
89 );
90 $this->elections = new CivicInfo\Resource\Elections(
91 $this,
92 $this->serviceName,
93 'elections',
94 [
95 'methods' => [
96 'electionQuery' => [
97 'path' => 'civicinfo/v2/elections',
98 'httpMethod' => 'GET',
99 'parameters' => [
100 'productionDataOnly' => [
101 'location' => 'query',
102 'type' => 'boolean',
103 ],
104 ],
105 ],'voterInfoQuery' => [
106 'path' => 'civicinfo/v2/voterinfo',
107 'httpMethod' => 'GET',
108 'parameters' => [
109 'address' => [
110 'location' => 'query',
111 'type' => 'string',
112 ],
113 'electionId' => [
114 'location' => 'query',
115 'type' => 'string',
116 ],
117 'officialOnly' => [
118 'location' => 'query',
119 'type' => 'boolean',
120 ],
121 'productionDataOnly' => [
122 'location' => 'query',
123 'type' => 'boolean',
124 ],
125 'returnAllAvailableData' => [
126 'location' => 'query',
127 'type' => 'boolean',
128 ],
129 ],
130 ],
131 ]
132 ]
133 );
134 $this->representatives = new CivicInfo\Resource\Representatives(
135 $this,
136 $this->serviceName,
137 'representatives',
138 [
139 'methods' => [
140 'representativeInfoByAddress' => [
141 'path' => 'civicinfo/v2/representatives',
142 'httpMethod' => 'GET',
143 'parameters' => [
144 'address' => [
145 'location' => 'query',
146 'type' => 'string',
147 ],
148 'includeOffices' => [
149 'location' => 'query',
150 'type' => 'boolean',
151 ],
152 'levels' => [
153 'location' => 'query',
154 'type' => 'string',
155 'repeated' => true,
156 ],
157 'roles' => [
158 'location' => 'query',
159 'type' => 'string',
160 'repeated' => true,
161 ],
162 ],
163 ],'representativeInfoByDivision' => [
164 'path' => 'civicinfo/v2/representatives/{ocdId}',
165 'httpMethod' => 'GET',
166 'parameters' => [
167 'ocdId' => [
168 'location' => 'path',
169 'type' => 'string',
170 'required' => true,
171 ],
172 'levels' => [
173 'location' => 'query',
174 'type' => 'string',
175 'repeated' => true,
176 ],
177 'recursive' => [
178 'location' => 'query',
179 'type' => 'boolean',
180 ],
181 'roles' => [
182 'location' => 'query',
183 'type' => 'string',
184 'repeated' => true,
185 ],
186 ],
187 ],
188 ]
189 ]
190 );
191 }
192}
193
194// Adding a class alias for backwards compatibility with the previous class name.
195class_alias(CivicInfo::class, 'Google_Service_CivicInfo');
Note: See TracBrowser for help on using the repository browser.