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\FirebaseDataConnect\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\FirebaseDataConnect\ListSchemasResponse;
|
---|
21 | use Google\Service\FirebaseDataConnect\Operation;
|
---|
22 | use Google\Service\FirebaseDataConnect\Schema;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "schemas" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $firebasedataconnectService = new Google\Service\FirebaseDataConnect(...);
|
---|
29 | * $schemas = $firebasedataconnectService->projects_locations_services_schemas;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsLocationsServicesSchemas extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Creates a new Schema in a given project and location. Only creation of
|
---|
36 | * `schemas/main` is supported and calling create with any other schema ID will
|
---|
37 | * result in an error. (schemas.create)
|
---|
38 | *
|
---|
39 | * @param string $parent Required. Value for parent.
|
---|
40 | * @param Schema $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | *
|
---|
43 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
44 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
45 | * the server will know to ignore the request if it has already been completed.
|
---|
46 | * The server will guarantee that for at least 60 minutes since the first
|
---|
47 | * request. For example, consider a situation where you make an initial request
|
---|
48 | * and the request times out. If you make the request again with the same
|
---|
49 | * request ID, the server can check if original operation with the same request
|
---|
50 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
51 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
52 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
53 | * (00000000-0000-0000-0000-000000000000).
|
---|
54 | * @opt_param string schemaId Required. The ID to use for the schema, which will
|
---|
55 | * become the final component of the schema's resource name. Currently, only
|
---|
56 | * `main` is supported and any other schema ID will result in an error.
|
---|
57 | * @opt_param bool validateOnly Optional. If set, validate the request and
|
---|
58 | * preview the Schema, but do not actually update it.
|
---|
59 | * @return Operation
|
---|
60 | * @throws \Google\Service\Exception
|
---|
61 | */
|
---|
62 | public function create($parent, Schema $postBody, $optParams = [])
|
---|
63 | {
|
---|
64 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
65 | $params = array_merge($params, $optParams);
|
---|
66 | return $this->call('create', [$params], Operation::class);
|
---|
67 | }
|
---|
68 | /**
|
---|
69 | * Deletes a single Schema. Because the schema and connectors must be compatible
|
---|
70 | * at all times, if this is called while any connectors are active, this will
|
---|
71 | * result in an error. (schemas.delete)
|
---|
72 | *
|
---|
73 | * @param string $name Required. The name of the schema to delete, in the
|
---|
74 | * format: ```
|
---|
75 | * projects/{project}/locations/{location}/services/{service}/schemas/{schema}
|
---|
76 | * ```
|
---|
77 | * @param array $optParams Optional parameters.
|
---|
78 | *
|
---|
79 | * @opt_param bool allowMissing Optional. If true and the Schema is not found,
|
---|
80 | * the request will succeed but no action will be taken on the server.
|
---|
81 | * @opt_param string etag Optional. The etag of the Schema. If this is provided,
|
---|
82 | * it must match the server's etag.
|
---|
83 | * @opt_param bool force Optional. If set to true, any child resources (i.e.
|
---|
84 | * SchemaRevisions) will also be deleted.
|
---|
85 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
86 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
87 | * the server will know to ignore the request if it has already been completed.
|
---|
88 | * The server will guarantee that for at least 60 minutes after the first
|
---|
89 | * request. For example, consider a situation where you make an initial request
|
---|
90 | * and the request times out. If you make the request again with the same
|
---|
91 | * request ID, the server can check if original operation with the same request
|
---|
92 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
93 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
94 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
95 | * (00000000-0000-0000-0000-000000000000).
|
---|
96 | * @opt_param bool validateOnly Optional. If set, validate the request and
|
---|
97 | * preview the Schema, but do not actually delete it.
|
---|
98 | * @return Operation
|
---|
99 | * @throws \Google\Service\Exception
|
---|
100 | */
|
---|
101 | public function delete($name, $optParams = [])
|
---|
102 | {
|
---|
103 | $params = ['name' => $name];
|
---|
104 | $params = array_merge($params, $optParams);
|
---|
105 | return $this->call('delete', [$params], Operation::class);
|
---|
106 | }
|
---|
107 | /**
|
---|
108 | * Gets details of a single Schema. (schemas.get)
|
---|
109 | *
|
---|
110 | * @param string $name Required. The name of the schema to retrieve, in the
|
---|
111 | * format: ```
|
---|
112 | * projects/{project}/locations/{location}/services/{service}/schemas/{schema}
|
---|
113 | * ```
|
---|
114 | * @param array $optParams Optional parameters.
|
---|
115 | * @return Schema
|
---|
116 | * @throws \Google\Service\Exception
|
---|
117 | */
|
---|
118 | public function get($name, $optParams = [])
|
---|
119 | {
|
---|
120 | $params = ['name' => $name];
|
---|
121 | $params = array_merge($params, $optParams);
|
---|
122 | return $this->call('get', [$params], Schema::class);
|
---|
123 | }
|
---|
124 | /**
|
---|
125 | * Lists Schemas in a given project and location. Note that only `schemas/main`
|
---|
126 | * is supported, so this will always return at most one Schema.
|
---|
127 | * (schemas.listProjectsLocationsServicesSchemas)
|
---|
128 | *
|
---|
129 | * @param string $parent Required. Value of parent.
|
---|
130 | * @param array $optParams Optional parameters.
|
---|
131 | *
|
---|
132 | * @opt_param string filter Optional. Filtering results.
|
---|
133 | * @opt_param string orderBy Optional. Hint for how to order the results.
|
---|
134 | * @opt_param int pageSize Optional. Requested page size. Server may return
|
---|
135 | * fewer items than requested. If unspecified, server will pick an appropriate
|
---|
136 | * default.
|
---|
137 | * @opt_param string pageToken Optional. A page token, received from a previous
|
---|
138 | * `ListSchemas` call. Provide this to retrieve the subsequent page. When
|
---|
139 | * paginating, all other parameters provided to `ListSchemas` must match the
|
---|
140 | * call that provided the page token.
|
---|
141 | * @return ListSchemasResponse
|
---|
142 | * @throws \Google\Service\Exception
|
---|
143 | */
|
---|
144 | public function listProjectsLocationsServicesSchemas($parent, $optParams = [])
|
---|
145 | {
|
---|
146 | $params = ['parent' => $parent];
|
---|
147 | $params = array_merge($params, $optParams);
|
---|
148 | return $this->call('list', [$params], ListSchemasResponse::class);
|
---|
149 | }
|
---|
150 | /**
|
---|
151 | * Updates the parameters of a single Schema, and creates a new SchemaRevision
|
---|
152 | * with the updated Schema. (schemas.patch)
|
---|
153 | *
|
---|
154 | * @param string $name Identifier. The relative resource name of the schema, in
|
---|
155 | * the format: ```
|
---|
156 | * projects/{project}/locations/{location}/services/{service}/schemas/{schema}
|
---|
157 | * ``` Right now, the only supported schema is "main".
|
---|
158 | * @param Schema $postBody
|
---|
159 | * @param array $optParams Optional parameters.
|
---|
160 | *
|
---|
161 | * @opt_param bool allowMissing Optional. If true and the Schema is not found, a
|
---|
162 | * new Schema will be created. In this case, `update_mask` is ignored.
|
---|
163 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
164 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
165 | * the server will know to ignore the request if it has already been completed.
|
---|
166 | * The server will guarantee that for at least 60 minutes since the first
|
---|
167 | * request. For example, consider a situation where you make an initial request
|
---|
168 | * and the request times out. If you make the request again with the same
|
---|
169 | * request ID, the server can check if original operation with the same request
|
---|
170 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
171 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
172 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
173 | * (00000000-0000-0000-0000-000000000000).
|
---|
174 | * @opt_param string updateMask Optional. Field mask is used to specify the
|
---|
175 | * fields to be overwritten in the Schema resource by the update. The fields
|
---|
176 | * specified in the update_mask are relative to the resource, not the full
|
---|
177 | * request. A field will be overwritten if it is in the mask. If the user does
|
---|
178 | * not provide a mask then all fields will be overwritten.
|
---|
179 | * @opt_param bool validateOnly Optional. If set, validate the request and
|
---|
180 | * preview the Schema, but do not actually update it.
|
---|
181 | * @return Operation
|
---|
182 | * @throws \Google\Service\Exception
|
---|
183 | */
|
---|
184 | public function patch($name, Schema $postBody, $optParams = [])
|
---|
185 | {
|
---|
186 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
187 | $params = array_merge($params, $optParams);
|
---|
188 | return $this->call('patch', [$params], Operation::class);
|
---|
189 | }
|
---|
190 | }
|
---|
191 |
|
---|
192 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
193 | class_alias(ProjectsLocationsServicesSchemas::class, 'Google_Service_FirebaseDataConnect_Resource_ProjectsLocationsServicesSchemas');
|
---|