ChromePolicy.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. namespace Google\Service;
  18. use Google\Client;
  19. /**
  20. * Service definition for ChromePolicy (v1).
  21. *
  22. * <p>
  23. * The Chrome Policy API is a suite of services that allows Chrome
  24. * administrators to control the policies applied to their managed Chrome OS
  25. * devices and Chrome browsers.</p>
  26. *
  27. * <p>
  28. * For more information about this service, see the API
  29. * <a href="http://developers.google.com/chrome/policy" target="_blank">Documentation</a>
  30. * </p>
  31. *
  32. * @author Google, Inc.
  33. */
  34. class ChromePolicy extends \Google\Service
  35. {
  36. /** See, edit, create or delete policies applied to Chrome OS and Chrome Browsers managed within your organization. */
  37. const CHROME_MANAGEMENT_POLICY =
  38. "https://www.googleapis.com/auth/chrome.management.policy";
  39. /** See policies applied to Chrome OS and Chrome Browsers managed within your organization. */
  40. const CHROME_MANAGEMENT_POLICY_READONLY =
  41. "https://www.googleapis.com/auth/chrome.management.policy.readonly";
  42. public $customers_policies;
  43. public $customers_policies_orgunits;
  44. public $customers_policySchemas;
  45. public $media;
  46. /**
  47. * Constructs the internal representation of the ChromePolicy service.
  48. *
  49. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  50. * config array to pass to a new Client instance.
  51. * @param string $rootUrl The root URL used for requests to the service.
  52. */
  53. public function __construct($clientOrConfig = [], $rootUrl = null)
  54. {
  55. parent::__construct($clientOrConfig);
  56. $this->rootUrl = $rootUrl ?: 'https://chromepolicy.googleapis.com/';
  57. $this->servicePath = '';
  58. $this->batchPath = 'batch';
  59. $this->version = 'v1';
  60. $this->serviceName = 'chromepolicy';
  61. $this->customers_policies = new ChromePolicy\Resource\CustomersPolicies(
  62. $this,
  63. $this->serviceName,
  64. 'policies',
  65. [
  66. 'methods' => [
  67. 'resolve' => [
  68. 'path' => 'v1/{+customer}/policies:resolve',
  69. 'httpMethod' => 'POST',
  70. 'parameters' => [
  71. 'customer' => [
  72. 'location' => 'path',
  73. 'type' => 'string',
  74. 'required' => true,
  75. ],
  76. ],
  77. ],
  78. ]
  79. ]
  80. );
  81. $this->customers_policies_orgunits = new ChromePolicy\Resource\CustomersPoliciesOrgunits(
  82. $this,
  83. $this->serviceName,
  84. 'orgunits',
  85. [
  86. 'methods' => [
  87. 'batchInherit' => [
  88. 'path' => 'v1/{+customer}/policies/orgunits:batchInherit',
  89. 'httpMethod' => 'POST',
  90. 'parameters' => [
  91. 'customer' => [
  92. 'location' => 'path',
  93. 'type' => 'string',
  94. 'required' => true,
  95. ],
  96. ],
  97. ],'batchModify' => [
  98. 'path' => 'v1/{+customer}/policies/orgunits:batchModify',
  99. 'httpMethod' => 'POST',
  100. 'parameters' => [
  101. 'customer' => [
  102. 'location' => 'path',
  103. 'type' => 'string',
  104. 'required' => true,
  105. ],
  106. ],
  107. ],
  108. ]
  109. ]
  110. );
  111. $this->customers_policySchemas = new ChromePolicy\Resource\CustomersPolicySchemas(
  112. $this,
  113. $this->serviceName,
  114. 'policySchemas',
  115. [
  116. 'methods' => [
  117. 'get' => [
  118. 'path' => 'v1/{+name}',
  119. 'httpMethod' => 'GET',
  120. 'parameters' => [
  121. 'name' => [
  122. 'location' => 'path',
  123. 'type' => 'string',
  124. 'required' => true,
  125. ],
  126. ],
  127. ],'list' => [
  128. 'path' => 'v1/{+parent}/policySchemas',
  129. 'httpMethod' => 'GET',
  130. 'parameters' => [
  131. 'parent' => [
  132. 'location' => 'path',
  133. 'type' => 'string',
  134. 'required' => true,
  135. ],
  136. 'filter' => [
  137. 'location' => 'query',
  138. 'type' => 'string',
  139. ],
  140. 'pageSize' => [
  141. 'location' => 'query',
  142. 'type' => 'integer',
  143. ],
  144. 'pageToken' => [
  145. 'location' => 'query',
  146. 'type' => 'string',
  147. ],
  148. ],
  149. ],
  150. ]
  151. ]
  152. );
  153. $this->media = new ChromePolicy\Resource\Media(
  154. $this,
  155. $this->serviceName,
  156. 'media',
  157. [
  158. 'methods' => [
  159. 'upload' => [
  160. 'path' => 'v1/{+customer}/policies/files:uploadPolicyFile',
  161. 'httpMethod' => 'POST',
  162. 'parameters' => [
  163. 'customer' => [
  164. 'location' => 'path',
  165. 'type' => 'string',
  166. 'required' => true,
  167. ],
  168. ],
  169. ],
  170. ]
  171. ]
  172. );
  173. }
  174. }
  175. // Adding a class alias for backwards compatibility with the previous class name.
  176. class_alias(ChromePolicy::class, 'Google_Service_ChromePolicy');