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\Aiplatform\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1AddContextArtifactsAndExecutionsRequest;
|
---|
21 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1AddContextArtifactsAndExecutionsResponse;
|
---|
22 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1AddContextChildrenRequest;
|
---|
23 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1AddContextChildrenResponse;
|
---|
24 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1Context;
|
---|
25 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1LineageSubgraph;
|
---|
26 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1ListContextsResponse;
|
---|
27 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1PurgeContextsRequest;
|
---|
28 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1RemoveContextChildrenRequest;
|
---|
29 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1RemoveContextChildrenResponse;
|
---|
30 | use Google\Service\Aiplatform\GoogleLongrunningOperation;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * The "contexts" collection of methods.
|
---|
34 | * Typical usage is:
|
---|
35 | * <code>
|
---|
36 | * $aiplatformService = new Google\Service\Aiplatform(...);
|
---|
37 | * $contexts = $aiplatformService->projects_locations_metadataStores_contexts;
|
---|
38 | * </code>
|
---|
39 | */
|
---|
40 | class ProjectsLocationsMetadataStoresContexts extends \Google\Service\Resource
|
---|
41 | {
|
---|
42 | /**
|
---|
43 | * Adds a set of Artifacts and Executions to a Context. If any of the Artifacts
|
---|
44 | * or Executions have already been added to a Context, they are simply skipped.
|
---|
45 | * (contexts.addContextArtifactsAndExecutions)
|
---|
46 | *
|
---|
47 | * @param string $context Required. The resource name of the Context that the
|
---|
48 | * Artifacts and Executions belong to. Format: `projects/{project}/locations/{lo
|
---|
49 | * cation}/metadataStores/{metadatastore}/contexts/{context}`
|
---|
50 | * @param GoogleCloudAiplatformV1AddContextArtifactsAndExecutionsRequest $postBody
|
---|
51 | * @param array $optParams Optional parameters.
|
---|
52 | * @return GoogleCloudAiplatformV1AddContextArtifactsAndExecutionsResponse
|
---|
53 | * @throws \Google\Service\Exception
|
---|
54 | */
|
---|
55 | public function addContextArtifactsAndExecutions($context, GoogleCloudAiplatformV1AddContextArtifactsAndExecutionsRequest $postBody, $optParams = [])
|
---|
56 | {
|
---|
57 | $params = ['context' => $context, 'postBody' => $postBody];
|
---|
58 | $params = array_merge($params, $optParams);
|
---|
59 | return $this->call('addContextArtifactsAndExecutions', [$params], GoogleCloudAiplatformV1AddContextArtifactsAndExecutionsResponse::class);
|
---|
60 | }
|
---|
61 | /**
|
---|
62 | * Adds a set of Contexts as children to a parent Context. If any of the child
|
---|
63 | * Contexts have already been added to the parent Context, they are simply
|
---|
64 | * skipped. If this call would create a cycle or cause any Context to have more
|
---|
65 | * than 10 parents, the request will fail with an INVALID_ARGUMENT error.
|
---|
66 | * (contexts.addContextChildren)
|
---|
67 | *
|
---|
68 | * @param string $context Required. The resource name of the parent Context.
|
---|
69 | * Format: `projects/{project}/locations/{location}/metadataStores/{metadatastor
|
---|
70 | * e}/contexts/{context}`
|
---|
71 | * @param GoogleCloudAiplatformV1AddContextChildrenRequest $postBody
|
---|
72 | * @param array $optParams Optional parameters.
|
---|
73 | * @return GoogleCloudAiplatformV1AddContextChildrenResponse
|
---|
74 | * @throws \Google\Service\Exception
|
---|
75 | */
|
---|
76 | public function addContextChildren($context, GoogleCloudAiplatformV1AddContextChildrenRequest $postBody, $optParams = [])
|
---|
77 | {
|
---|
78 | $params = ['context' => $context, 'postBody' => $postBody];
|
---|
79 | $params = array_merge($params, $optParams);
|
---|
80 | return $this->call('addContextChildren', [$params], GoogleCloudAiplatformV1AddContextChildrenResponse::class);
|
---|
81 | }
|
---|
82 | /**
|
---|
83 | * Creates a Context associated with a MetadataStore. (contexts.create)
|
---|
84 | *
|
---|
85 | * @param string $parent Required. The resource name of the MetadataStore where
|
---|
86 | * the Context should be created. Format:
|
---|
87 | * `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
|
---|
88 | * @param GoogleCloudAiplatformV1Context $postBody
|
---|
89 | * @param array $optParams Optional parameters.
|
---|
90 | *
|
---|
91 | * @opt_param string contextId The {context} portion of the resource name with
|
---|
92 | * the format: `projects/{project}/locations/{location}/metadataStores/{metadata
|
---|
93 | * store}/contexts/{context}`. If not provided, the Context's ID will be a UUID
|
---|
94 | * generated by the service. Must be 4-128 characters in length. Valid
|
---|
95 | * characters are `/a-z-/`. Must be unique across all Contexts in the parent
|
---|
96 | * MetadataStore. (Otherwise the request will fail with ALREADY_EXISTS, or
|
---|
97 | * PERMISSION_DENIED if the caller can't view the preexisting Context.)
|
---|
98 | * @return GoogleCloudAiplatformV1Context
|
---|
99 | * @throws \Google\Service\Exception
|
---|
100 | */
|
---|
101 | public function create($parent, GoogleCloudAiplatformV1Context $postBody, $optParams = [])
|
---|
102 | {
|
---|
103 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
104 | $params = array_merge($params, $optParams);
|
---|
105 | return $this->call('create', [$params], GoogleCloudAiplatformV1Context::class);
|
---|
106 | }
|
---|
107 | /**
|
---|
108 | * Deletes a stored Context. (contexts.delete)
|
---|
109 | *
|
---|
110 | * @param string $name Required. The resource name of the Context to delete.
|
---|
111 | * Format: `projects/{project}/locations/{location}/metadataStores/{metadatastor
|
---|
112 | * e}/contexts/{context}`
|
---|
113 | * @param array $optParams Optional parameters.
|
---|
114 | *
|
---|
115 | * @opt_param string etag Optional. The etag of the Context to delete. If this
|
---|
116 | * is provided, it must match the server's etag. Otherwise, the request will
|
---|
117 | * fail with a FAILED_PRECONDITION.
|
---|
118 | * @opt_param bool force The force deletion semantics is still undefined. Users
|
---|
119 | * should not use this field.
|
---|
120 | * @return GoogleLongrunningOperation
|
---|
121 | * @throws \Google\Service\Exception
|
---|
122 | */
|
---|
123 | public function delete($name, $optParams = [])
|
---|
124 | {
|
---|
125 | $params = ['name' => $name];
|
---|
126 | $params = array_merge($params, $optParams);
|
---|
127 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
128 | }
|
---|
129 | /**
|
---|
130 | * Retrieves a specific Context. (contexts.get)
|
---|
131 | *
|
---|
132 | * @param string $name Required. The resource name of the Context to retrieve.
|
---|
133 | * Format: `projects/{project}/locations/{location}/metadataStores/{metadatastor
|
---|
134 | * e}/contexts/{context}`
|
---|
135 | * @param array $optParams Optional parameters.
|
---|
136 | * @return GoogleCloudAiplatformV1Context
|
---|
137 | * @throws \Google\Service\Exception
|
---|
138 | */
|
---|
139 | public function get($name, $optParams = [])
|
---|
140 | {
|
---|
141 | $params = ['name' => $name];
|
---|
142 | $params = array_merge($params, $optParams);
|
---|
143 | return $this->call('get', [$params], GoogleCloudAiplatformV1Context::class);
|
---|
144 | }
|
---|
145 | /**
|
---|
146 | * Lists Contexts on the MetadataStore.
|
---|
147 | * (contexts.listProjectsLocationsMetadataStoresContexts)
|
---|
148 | *
|
---|
149 | * @param string $parent Required. The MetadataStore whose Contexts should be
|
---|
150 | * listed. Format:
|
---|
151 | * `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
|
---|
152 | * @param array $optParams Optional parameters.
|
---|
153 | *
|
---|
154 | * @opt_param string filter Filter specifying the boolean condition for the
|
---|
155 | * Contexts to satisfy in order to be part of the result set. The syntax to
|
---|
156 | * define filter query is based on https://google.aip.dev/160. Following are the
|
---|
157 | * supported set of filters: * **Attribute filtering**: For example:
|
---|
158 | * `display_name = "test"`. Supported fields include: `name`, `display_name`,
|
---|
159 | * `schema_title`, `create_time`, and `update_time`. Time fields, such as
|
---|
160 | * `create_time` and `update_time`, require values specified in RFC-3339 format.
|
---|
161 | * For example: `create_time = "2020-11-19T11:30:00-04:00"`. * **Metadata
|
---|
162 | * field**: To filter on metadata fields use traversal operation as follows:
|
---|
163 | * `metadata..`. For example: `metadata.field_1.number_value = 10.0`. In case
|
---|
164 | * the field name contains special characters (such as colon), one can embed it
|
---|
165 | * inside double quote. For example: `metadata."field:1".number_value = 10.0` *
|
---|
166 | * **Parent Child filtering**: To filter Contexts based on parent-child
|
---|
167 | * relationship use the HAS operator as follows: ``` parent_contexts:
|
---|
168 | * "projects//locations//metadataStores//contexts/" child_contexts:
|
---|
169 | * "projects//locations//metadataStores//contexts/" ``` Each of the above
|
---|
170 | * supported filters can be combined together using logical operators (`AND` &
|
---|
171 | * `OR`). Maximum nested expression depth allowed is 5. For example:
|
---|
172 | * `display_name = "test" AND metadata.field1.bool_value = true`.
|
---|
173 | * @opt_param string orderBy How the list of messages is ordered. Specify the
|
---|
174 | * values to order by and an ordering operation. The default sorting order is
|
---|
175 | * ascending. To specify descending order for a field, users append a " desc"
|
---|
176 | * suffix; for example: "foo desc, bar". Subfields are specified with a `.`
|
---|
177 | * character, such as foo.bar. see https://google.aip.dev/132#ordering for more
|
---|
178 | * details.
|
---|
179 | * @opt_param int pageSize The maximum number of Contexts to return. The service
|
---|
180 | * may return fewer. Must be in range 1-1000, inclusive. Defaults to 100.
|
---|
181 | * @opt_param string pageToken A page token, received from a previous
|
---|
182 | * MetadataService.ListContexts call. Provide this to retrieve the subsequent
|
---|
183 | * page. When paginating, all other provided parameters must match the call that
|
---|
184 | * provided the page token. (Otherwise the request will fail with
|
---|
185 | * INVALID_ARGUMENT error.)
|
---|
186 | * @return GoogleCloudAiplatformV1ListContextsResponse
|
---|
187 | * @throws \Google\Service\Exception
|
---|
188 | */
|
---|
189 | public function listProjectsLocationsMetadataStoresContexts($parent, $optParams = [])
|
---|
190 | {
|
---|
191 | $params = ['parent' => $parent];
|
---|
192 | $params = array_merge($params, $optParams);
|
---|
193 | return $this->call('list', [$params], GoogleCloudAiplatformV1ListContextsResponse::class);
|
---|
194 | }
|
---|
195 | /**
|
---|
196 | * Updates a stored Context. (contexts.patch)
|
---|
197 | *
|
---|
198 | * @param string $name Immutable. The resource name of the Context.
|
---|
199 | * @param GoogleCloudAiplatformV1Context $postBody
|
---|
200 | * @param array $optParams Optional parameters.
|
---|
201 | *
|
---|
202 | * @opt_param bool allowMissing If set to true, and the Context is not found, a
|
---|
203 | * new Context is created.
|
---|
204 | * @opt_param string updateMask Optional. A FieldMask indicating which fields
|
---|
205 | * should be updated.
|
---|
206 | * @return GoogleCloudAiplatformV1Context
|
---|
207 | * @throws \Google\Service\Exception
|
---|
208 | */
|
---|
209 | public function patch($name, GoogleCloudAiplatformV1Context $postBody, $optParams = [])
|
---|
210 | {
|
---|
211 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
212 | $params = array_merge($params, $optParams);
|
---|
213 | return $this->call('patch', [$params], GoogleCloudAiplatformV1Context::class);
|
---|
214 | }
|
---|
215 | /**
|
---|
216 | * Purges Contexts. (contexts.purge)
|
---|
217 | *
|
---|
218 | * @param string $parent Required. The metadata store to purge Contexts from.
|
---|
219 | * Format:
|
---|
220 | * `projects/{project}/locations/{location}/metadataStores/{metadatastore}`
|
---|
221 | * @param GoogleCloudAiplatformV1PurgeContextsRequest $postBody
|
---|
222 | * @param array $optParams Optional parameters.
|
---|
223 | * @return GoogleLongrunningOperation
|
---|
224 | * @throws \Google\Service\Exception
|
---|
225 | */
|
---|
226 | public function purge($parent, GoogleCloudAiplatformV1PurgeContextsRequest $postBody, $optParams = [])
|
---|
227 | {
|
---|
228 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
229 | $params = array_merge($params, $optParams);
|
---|
230 | return $this->call('purge', [$params], GoogleLongrunningOperation::class);
|
---|
231 | }
|
---|
232 | /**
|
---|
233 | * Retrieves Artifacts and Executions within the specified Context, connected by
|
---|
234 | * Event edges and returned as a LineageSubgraph.
|
---|
235 | * (contexts.queryContextLineageSubgraph)
|
---|
236 | *
|
---|
237 | * @param string $context Required. The resource name of the Context whose
|
---|
238 | * Artifacts and Executions should be retrieved as a LineageSubgraph. Format: `p
|
---|
239 | * rojects/{project}/locations/{location}/metadataStores/{metadatastore}/context
|
---|
240 | * s/{context}` The request may error with FAILED_PRECONDITION if the number of
|
---|
241 | * Artifacts, the number of Executions, or the number of Events that would be
|
---|
242 | * returned for the Context exceeds 1000.
|
---|
243 | * @param array $optParams Optional parameters.
|
---|
244 | * @return GoogleCloudAiplatformV1LineageSubgraph
|
---|
245 | * @throws \Google\Service\Exception
|
---|
246 | */
|
---|
247 | public function queryContextLineageSubgraph($context, $optParams = [])
|
---|
248 | {
|
---|
249 | $params = ['context' => $context];
|
---|
250 | $params = array_merge($params, $optParams);
|
---|
251 | return $this->call('queryContextLineageSubgraph', [$params], GoogleCloudAiplatformV1LineageSubgraph::class);
|
---|
252 | }
|
---|
253 | /**
|
---|
254 | * Remove a set of children contexts from a parent Context. If any of the child
|
---|
255 | * Contexts were NOT added to the parent Context, they are simply skipped.
|
---|
256 | * (contexts.removeContextChildren)
|
---|
257 | *
|
---|
258 | * @param string $context Required. The resource name of the parent Context.
|
---|
259 | * Format: `projects/{project}/locations/{location}/metadataStores/{metadatastor
|
---|
260 | * e}/contexts/{context}`
|
---|
261 | * @param GoogleCloudAiplatformV1RemoveContextChildrenRequest $postBody
|
---|
262 | * @param array $optParams Optional parameters.
|
---|
263 | * @return GoogleCloudAiplatformV1RemoveContextChildrenResponse
|
---|
264 | * @throws \Google\Service\Exception
|
---|
265 | */
|
---|
266 | public function removeContextChildren($context, GoogleCloudAiplatformV1RemoveContextChildrenRequest $postBody, $optParams = [])
|
---|
267 | {
|
---|
268 | $params = ['context' => $context, 'postBody' => $postBody];
|
---|
269 | $params = array_merge($params, $optParams);
|
---|
270 | return $this->call('removeContextChildren', [$params], GoogleCloudAiplatformV1RemoveContextChildrenResponse::class);
|
---|
271 | }
|
---|
272 | }
|
---|
273 |
|
---|
274 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
275 | class_alias(ProjectsLocationsMetadataStoresContexts::class, 'Google_Service_Aiplatform_Resource_ProjectsLocationsMetadataStoresContexts');
|
---|