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