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 | namespace Google\Service\Directory\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Directory\Schema;
|
---|
21 | use Google\Service\Directory\Schemas as SchemasModel;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "schemas" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $adminService = new Google\Service\Directory(...);
|
---|
28 | * $schemas = $adminService->schemas;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class Schemas extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Deletes a schema. (schemas.delete)
|
---|
35 | *
|
---|
36 | * @param string $customerId Immutable ID of the Google Workspace account.
|
---|
37 | * @param string $schemaKey Name or immutable ID of the schema.
|
---|
38 | * @param array $optParams Optional parameters.
|
---|
39 | * @throws \Google\Service\Exception
|
---|
40 | */
|
---|
41 | public function delete($customerId, $schemaKey, $optParams = [])
|
---|
42 | {
|
---|
43 | $params = ['customerId' => $customerId, 'schemaKey' => $schemaKey];
|
---|
44 | $params = array_merge($params, $optParams);
|
---|
45 | return $this->call('delete', [$params]);
|
---|
46 | }
|
---|
47 | /**
|
---|
48 | * Retrieves a schema. (schemas.get)
|
---|
49 | *
|
---|
50 | * @param string $customerId The unique ID for the customer's Google Workspace
|
---|
51 | * account. In case of a multi-domain account, to fetch all groups for a
|
---|
52 | * customer, use this field instead of `domain`. You can also use the
|
---|
53 | * `my_customer` alias to represent your account's `customerId`. The
|
---|
54 | * `customerId` is also returned as part of the [Users](/admin-
|
---|
55 | * sdk/directory/v1/reference/users) resource. You must provide either the
|
---|
56 | * `customer` or the `domain` parameter.
|
---|
57 | * @param string $schemaKey Name or immutable ID of the schema.
|
---|
58 | * @param array $optParams Optional parameters.
|
---|
59 | * @return Schema
|
---|
60 | * @throws \Google\Service\Exception
|
---|
61 | */
|
---|
62 | public function get($customerId, $schemaKey, $optParams = [])
|
---|
63 | {
|
---|
64 | $params = ['customerId' => $customerId, 'schemaKey' => $schemaKey];
|
---|
65 | $params = array_merge($params, $optParams);
|
---|
66 | return $this->call('get', [$params], Schema::class);
|
---|
67 | }
|
---|
68 | /**
|
---|
69 | * Creates a schema. (schemas.insert)
|
---|
70 | *
|
---|
71 | * @param string $customerId Immutable ID of the Google Workspace account.
|
---|
72 | * @param Schema $postBody
|
---|
73 | * @param array $optParams Optional parameters.
|
---|
74 | * @return Schema
|
---|
75 | * @throws \Google\Service\Exception
|
---|
76 | */
|
---|
77 | public function insert($customerId, Schema $postBody, $optParams = [])
|
---|
78 | {
|
---|
79 | $params = ['customerId' => $customerId, 'postBody' => $postBody];
|
---|
80 | $params = array_merge($params, $optParams);
|
---|
81 | return $this->call('insert', [$params], Schema::class);
|
---|
82 | }
|
---|
83 | /**
|
---|
84 | * Retrieves all schemas for a customer. (schemas.listSchemas)
|
---|
85 | *
|
---|
86 | * @param string $customerId The unique ID for the customer's Google Workspace
|
---|
87 | * account. In case of a multi-domain account, to fetch all groups for a
|
---|
88 | * customer, use this field instead of `domain`. You can also use the
|
---|
89 | * `my_customer` alias to represent your account's `customerId`. The
|
---|
90 | * `customerId` is also returned as part of the [Users](/admin-
|
---|
91 | * sdk/directory/v1/reference/users) resource. You must provide either the
|
---|
92 | * `customer` or the `domain` parameter.
|
---|
93 | * @param array $optParams Optional parameters.
|
---|
94 | * @return SchemasModel
|
---|
95 | * @throws \Google\Service\Exception
|
---|
96 | */
|
---|
97 | public function listSchemas($customerId, $optParams = [])
|
---|
98 | {
|
---|
99 | $params = ['customerId' => $customerId];
|
---|
100 | $params = array_merge($params, $optParams);
|
---|
101 | return $this->call('list', [$params], SchemasModel::class);
|
---|
102 | }
|
---|
103 | /**
|
---|
104 | * Patches a schema. (schemas.patch)
|
---|
105 | *
|
---|
106 | * @param string $customerId Immutable ID of the Google Workspace account.
|
---|
107 | * @param string $schemaKey Name or immutable ID of the schema.
|
---|
108 | * @param Schema $postBody
|
---|
109 | * @param array $optParams Optional parameters.
|
---|
110 | * @return Schema
|
---|
111 | * @throws \Google\Service\Exception
|
---|
112 | */
|
---|
113 | public function patch($customerId, $schemaKey, Schema $postBody, $optParams = [])
|
---|
114 | {
|
---|
115 | $params = ['customerId' => $customerId, 'schemaKey' => $schemaKey, 'postBody' => $postBody];
|
---|
116 | $params = array_merge($params, $optParams);
|
---|
117 | return $this->call('patch', [$params], Schema::class);
|
---|
118 | }
|
---|
119 | /**
|
---|
120 | * Updates a schema. (schemas.update)
|
---|
121 | *
|
---|
122 | * @param string $customerId Immutable ID of the Google Workspace account.
|
---|
123 | * @param string $schemaKey Name or immutable ID of the schema.
|
---|
124 | * @param Schema $postBody
|
---|
125 | * @param array $optParams Optional parameters.
|
---|
126 | * @return Schema
|
---|
127 | * @throws \Google\Service\Exception
|
---|
128 | */
|
---|
129 | public function update($customerId, $schemaKey, Schema $postBody, $optParams = [])
|
---|
130 | {
|
---|
131 | $params = ['customerId' => $customerId, 'schemaKey' => $schemaKey, 'postBody' => $postBody];
|
---|
132 | $params = array_merge($params, $optParams);
|
---|
133 | return $this->call('update', [$params], Schema::class);
|
---|
134 | }
|
---|
135 | }
|
---|
136 |
|
---|
137 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
138 | class_alias(Schemas::class, 'Google_Service_Directory_Resource_Schemas');
|
---|