Няма описание

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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. /**
  18. * Service definition for CivicInfo (v2).
  19. *
  20. * <p>
  21. * Provides polling places, early vote locations, contest data, election
  22. * officials, and government representatives for U.S. residential addresses.</p>
  23. *
  24. * <p>
  25. * For more information about this service, see the API
  26. * <a href="https://developers.google.com/civic-information" target="_blank">Documentation</a>
  27. * </p>
  28. *
  29. * @author Google, Inc.
  30. */
  31. class Google_Service_CivicInfo extends Google_Service
  32. {
  33. public $divisions;
  34. public $elections;
  35. public $representatives;
  36. /**
  37. * Constructs the internal representation of the CivicInfo service.
  38. *
  39. * @param Google_Client $client
  40. */
  41. public function __construct(Google_Client $client)
  42. {
  43. parent::__construct($client);
  44. $this->rootUrl = 'https://www.googleapis.com/';
  45. $this->servicePath = 'civicinfo/v2/';
  46. $this->version = 'v2';
  47. $this->serviceName = 'civicinfo';
  48. $this->divisions = new Google_Service_CivicInfo_Resource_Divisions(
  49. $this,
  50. $this->serviceName,
  51. 'divisions',
  52. array(
  53. 'methods' => array(
  54. 'search' => array(
  55. 'path' => 'divisions',
  56. 'httpMethod' => 'GET',
  57. 'parameters' => array(
  58. 'query' => array(
  59. 'location' => 'query',
  60. 'type' => 'string',
  61. ),
  62. ),
  63. ),
  64. )
  65. )
  66. );
  67. $this->elections = new Google_Service_CivicInfo_Resource_Elections(
  68. $this,
  69. $this->serviceName,
  70. 'elections',
  71. array(
  72. 'methods' => array(
  73. 'electionQuery' => array(
  74. 'path' => 'elections',
  75. 'httpMethod' => 'GET',
  76. 'parameters' => array(),
  77. ),'voterInfoQuery' => array(
  78. 'path' => 'voterinfo',
  79. 'httpMethod' => 'GET',
  80. 'parameters' => array(
  81. 'address' => array(
  82. 'location' => 'query',
  83. 'type' => 'string',
  84. 'required' => true,
  85. ),
  86. 'electionId' => array(
  87. 'location' => 'query',
  88. 'type' => 'string',
  89. ),
  90. 'officialOnly' => array(
  91. 'location' => 'query',
  92. 'type' => 'boolean',
  93. ),
  94. 'returnAllAvailableData' => array(
  95. 'location' => 'query',
  96. 'type' => 'boolean',
  97. ),
  98. ),
  99. ),
  100. )
  101. )
  102. );
  103. $this->representatives = new Google_Service_CivicInfo_Resource_Representatives(
  104. $this,
  105. $this->serviceName,
  106. 'representatives',
  107. array(
  108. 'methods' => array(
  109. 'representativeInfoByAddress' => array(
  110. 'path' => 'representatives',
  111. 'httpMethod' => 'GET',
  112. 'parameters' => array(
  113. 'address' => array(
  114. 'location' => 'query',
  115. 'type' => 'string',
  116. ),
  117. 'includeOffices' => array(
  118. 'location' => 'query',
  119. 'type' => 'boolean',
  120. ),
  121. 'levels' => array(
  122. 'location' => 'query',
  123. 'type' => 'string',
  124. 'repeated' => true,
  125. ),
  126. 'roles' => array(
  127. 'location' => 'query',
  128. 'type' => 'string',
  129. 'repeated' => true,
  130. ),
  131. ),
  132. ),'representativeInfoByDivision' => array(
  133. 'path' => 'representatives/{ocdId}',
  134. 'httpMethod' => 'GET',
  135. 'parameters' => array(
  136. 'ocdId' => array(
  137. 'location' => 'path',
  138. 'type' => 'string',
  139. 'required' => true,
  140. ),
  141. 'levels' => array(
  142. 'location' => 'query',
  143. 'type' => 'string',
  144. 'repeated' => true,
  145. ),
  146. 'recursive' => array(
  147. 'location' => 'query',
  148. 'type' => 'boolean',
  149. ),
  150. 'roles' => array(
  151. 'location' => 'query',
  152. 'type' => 'string',
  153. 'repeated' => true,
  154. ),
  155. ),
  156. ),
  157. )
  158. )
  159. );
  160. }
  161. }