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\DiscoveryEngine\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\DiscoveryEngine\GoogleCloudDiscoveryengineV1ListSchemasResponse;
|
---|
21 | use Google\Service\DiscoveryEngine\GoogleCloudDiscoveryengineV1Schema;
|
---|
22 | use Google\Service\DiscoveryEngine\GoogleLongrunningOperation;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "schemas" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $discoveryengineService = new Google\Service\DiscoveryEngine(...);
|
---|
29 | * $schemas = $discoveryengineService->projects_locations_collections_dataStores_schemas;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsLocationsCollectionsDataStoresSchemas extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Creates a Schema. (schemas.create)
|
---|
36 | *
|
---|
37 | * @param string $parent Required. The parent data store resource name, in the
|
---|
38 | * format of `projects/{project}/locations/{location}/collections/{collection}/d
|
---|
39 | * ataStores/{data_store}`.
|
---|
40 | * @param GoogleCloudDiscoveryengineV1Schema $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | *
|
---|
43 | * @opt_param string schemaId Required. The ID to use for the Schema, which
|
---|
44 | * becomes the final component of the Schema.name. This field should conform to
|
---|
45 | * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit
|
---|
46 | * of 63 characters.
|
---|
47 | * @return GoogleLongrunningOperation
|
---|
48 | * @throws \Google\Service\Exception
|
---|
49 | */
|
---|
50 | public function create($parent, GoogleCloudDiscoveryengineV1Schema $postBody, $optParams = [])
|
---|
51 | {
|
---|
52 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
53 | $params = array_merge($params, $optParams);
|
---|
54 | return $this->call('create', [$params], GoogleLongrunningOperation::class);
|
---|
55 | }
|
---|
56 | /**
|
---|
57 | * Deletes a Schema. (schemas.delete)
|
---|
58 | *
|
---|
59 | * @param string $name Required. The full resource name of the schema, in the
|
---|
60 | * format of `projects/{project}/locations/{location}/collections/{collection}/d
|
---|
61 | * ataStores/{data_store}/schemas/{schema}`.
|
---|
62 | * @param array $optParams Optional parameters.
|
---|
63 | * @return GoogleLongrunningOperation
|
---|
64 | * @throws \Google\Service\Exception
|
---|
65 | */
|
---|
66 | public function delete($name, $optParams = [])
|
---|
67 | {
|
---|
68 | $params = ['name' => $name];
|
---|
69 | $params = array_merge($params, $optParams);
|
---|
70 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
71 | }
|
---|
72 | /**
|
---|
73 | * Gets a Schema. (schemas.get)
|
---|
74 | *
|
---|
75 | * @param string $name Required. The full resource name of the schema, in the
|
---|
76 | * format of `projects/{project}/locations/{location}/collections/{collection}/d
|
---|
77 | * ataStores/{data_store}/schemas/{schema}`.
|
---|
78 | * @param array $optParams Optional parameters.
|
---|
79 | * @return GoogleCloudDiscoveryengineV1Schema
|
---|
80 | * @throws \Google\Service\Exception
|
---|
81 | */
|
---|
82 | public function get($name, $optParams = [])
|
---|
83 | {
|
---|
84 | $params = ['name' => $name];
|
---|
85 | $params = array_merge($params, $optParams);
|
---|
86 | return $this->call('get', [$params], GoogleCloudDiscoveryengineV1Schema::class);
|
---|
87 | }
|
---|
88 | /**
|
---|
89 | * Gets a list of Schemas.
|
---|
90 | * (schemas.listProjectsLocationsCollectionsDataStoresSchemas)
|
---|
91 | *
|
---|
92 | * @param string $parent Required. The parent data store resource name, in the
|
---|
93 | * format of `projects/{project}/locations/{location}/collections/{collection}/d
|
---|
94 | * ataStores/{data_store}`.
|
---|
95 | * @param array $optParams Optional parameters.
|
---|
96 | *
|
---|
97 | * @opt_param int pageSize The maximum number of Schemas to return. The service
|
---|
98 | * may return fewer than this value. If unspecified, at most 100 Schemas are
|
---|
99 | * returned. The maximum value is 1000; values above 1000 are set to 1000.
|
---|
100 | * @opt_param string pageToken A page token, received from a previous
|
---|
101 | * SchemaService.ListSchemas call. Provide this to retrieve the subsequent page.
|
---|
102 | * When paginating, all other parameters provided to SchemaService.ListSchemas
|
---|
103 | * must match the call that provided the page token.
|
---|
104 | * @return GoogleCloudDiscoveryengineV1ListSchemasResponse
|
---|
105 | * @throws \Google\Service\Exception
|
---|
106 | */
|
---|
107 | public function listProjectsLocationsCollectionsDataStoresSchemas($parent, $optParams = [])
|
---|
108 | {
|
---|
109 | $params = ['parent' => $parent];
|
---|
110 | $params = array_merge($params, $optParams);
|
---|
111 | return $this->call('list', [$params], GoogleCloudDiscoveryengineV1ListSchemasResponse::class);
|
---|
112 | }
|
---|
113 | /**
|
---|
114 | * Updates a Schema. (schemas.patch)
|
---|
115 | *
|
---|
116 | * @param string $name Immutable. The full resource name of the schema, in the
|
---|
117 | * format of `projects/{project}/locations/{location}/collections/{collection}/d
|
---|
118 | * ataStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 encoded
|
---|
119 | * string with a length limit of 1024 characters.
|
---|
120 | * @param GoogleCloudDiscoveryengineV1Schema $postBody
|
---|
121 | * @param array $optParams Optional parameters.
|
---|
122 | *
|
---|
123 | * @opt_param bool allowMissing If set to true, and the Schema is not found, a
|
---|
124 | * new Schema is created. In this situation, `update_mask` is ignored.
|
---|
125 | * @return GoogleLongrunningOperation
|
---|
126 | * @throws \Google\Service\Exception
|
---|
127 | */
|
---|
128 | public function patch($name, GoogleCloudDiscoveryengineV1Schema $postBody, $optParams = [])
|
---|
129 | {
|
---|
130 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
131 | $params = array_merge($params, $optParams);
|
---|
132 | return $this->call('patch', [$params], GoogleLongrunningOperation::class);
|
---|
133 | }
|
---|
134 | }
|
---|
135 |
|
---|
136 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
137 | class_alias(ProjectsLocationsCollectionsDataStoresSchemas::class, 'Google_Service_DiscoveryEngine_Resource_ProjectsLocationsCollectionsDataStoresSchemas');
|
---|