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\AndroidManagement\Resource;
19
20use Google\Service\AndroidManagement\AndroidmanagementEmpty;
21use Google\Service\AndroidManagement\Enterprise;
22use Google\Service\AndroidManagement\ListEnterprisesResponse;
23
24/**
25 * The "enterprises" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $androidmanagementService = new Google\Service\AndroidManagement(...);
29 *   $enterprises = $androidmanagementService->enterprises;
30 *  </code>
31 */
32class Enterprises extends \Google\Service\Resource
33{
34  /**
35   * Creates an enterprise. This is the last step in the enterprise signup flow.
36   * (enterprises.create)
37   *
38   * @param Enterprise $postBody
39   * @param array $optParams Optional parameters.
40   *
41   * @opt_param bool agreementAccepted Whether the enterprise admin has seen and
42   * agreed to the managed Google Play Agreement
43   * (https://www.android.com/enterprise/terms/). Do not set this field for any
44   * customer-managed enterprise (https://developers.google.com/android/management
45   * /create-enterprise#customer-managed_enterprises). Set this to field to true
46   * for all EMM-managed enterprises
47   * (https://developers.google.com/android/management/create-enterprise#emm-
48   * managed_enterprises).
49   * @opt_param string enterpriseToken The enterprise token appended to the
50   * callback URL. Set this when creating a customer-managed enterprise
51   * (https://developers.google.com/android/management/create-enterprise#customer-
52   * managed_enterprises) and not when creating a deprecated EMM-managed
53   * enterprise (https://developers.google.com/android/management/create-
54   * enterprise#emm-managed_enterprises).
55   * @opt_param string projectId The ID of the Google Cloud Platform project which
56   * will own the enterprise.
57   * @opt_param string signupUrlName The name of the SignupUrl used to sign up for
58   * the enterprise. Set this when creating a customer-managed enterprise
59   * (https://developers.google.com/android/management/create-enterprise#customer-
60   * managed_enterprises) and not when creating a deprecated EMM-managed
61   * enterprise (https://developers.google.com/android/management/create-
62   * enterprise#emm-managed_enterprises).
63   * @return Enterprise
64   */
65  public function create(Enterprise $postBody, $optParams = [])
66  {
67    $params = ['postBody' => $postBody];
68    $params = array_merge($params, $optParams);
69    return $this->call('create', [$params], Enterprise::class);
70  }
71  /**
72   * Deletes an enterprise. Only available for EMM-managed enterprises.
73   * (enterprises.delete)
74   *
75   * @param string $name The name of the enterprise in the form
76   * enterprises/{enterpriseId}.
77   * @param array $optParams Optional parameters.
78   * @return AndroidmanagementEmpty
79   */
80  public function delete($name, $optParams = [])
81  {
82    $params = ['name' => $name];
83    $params = array_merge($params, $optParams);
84    return $this->call('delete', [$params], AndroidmanagementEmpty::class);
85  }
86  /**
87   * Gets an enterprise. (enterprises.get)
88   *
89   * @param string $name The name of the enterprise in the form
90   * enterprises/{enterpriseId}.
91   * @param array $optParams Optional parameters.
92   * @return Enterprise
93   */
94  public function get($name, $optParams = [])
95  {
96    $params = ['name' => $name];
97    $params = array_merge($params, $optParams);
98    return $this->call('get', [$params], Enterprise::class);
99  }
100  /**
101   * Lists EMM-managed enterprises. Only BASIC fields are returned.
102   * (enterprises.listEnterprises)
103   *
104   * @param array $optParams Optional parameters.
105   *
106   * @opt_param int pageSize The requested page size. The actual page size may be
107   * fixed to a min or max value.
108   * @opt_param string pageToken A token identifying a page of results returned by
109   * the server.
110   * @opt_param string projectId Required. The Cloud project ID of the EMM
111   * managing the enterprises.
112   * @opt_param string view Specifies which Enterprise fields to return. This
113   * method only supports BASIC.
114   * @return ListEnterprisesResponse
115   */
116  public function listEnterprises($optParams = [])
117  {
118    $params = [];
119    $params = array_merge($params, $optParams);
120    return $this->call('list', [$params], ListEnterprisesResponse::class);
121  }
122  /**
123   * Updates an enterprise. (enterprises.patch)
124   *
125   * @param string $name The name of the enterprise in the form
126   * enterprises/{enterpriseId}.
127   * @param Enterprise $postBody
128   * @param array $optParams Optional parameters.
129   *
130   * @opt_param string updateMask The field mask indicating the fields to update.
131   * If not set, all modifiable fields will be modified.
132   * @return Enterprise
133   */
134  public function patch($name, Enterprise $postBody, $optParams = [])
135  {
136    $params = ['name' => $name, 'postBody' => $postBody];
137    $params = array_merge($params, $optParams);
138    return $this->call('patch', [$params], Enterprise::class);
139  }
140}
141
142// Adding a class alias for backwards compatibility with the previous class name.
143class_alias(Enterprises::class, 'Google_Service_AndroidManagement_Resource_Enterprises');
144