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\Contentwarehouse\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1CreateDocumentRequest;
|
---|
21 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1CreateDocumentResponse;
|
---|
22 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1DeleteDocumentRequest;
|
---|
23 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1Document;
|
---|
24 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1FetchAclRequest;
|
---|
25 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1FetchAclResponse;
|
---|
26 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1GetDocumentRequest;
|
---|
27 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1ListLinkedSourcesRequest;
|
---|
28 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1ListLinkedSourcesResponse;
|
---|
29 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1ListLinkedTargetsRequest;
|
---|
30 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1ListLinkedTargetsResponse;
|
---|
31 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1LockDocumentRequest;
|
---|
32 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1SearchDocumentsRequest;
|
---|
33 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1SearchDocumentsResponse;
|
---|
34 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1SetAclRequest;
|
---|
35 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1SetAclResponse;
|
---|
36 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1UpdateDocumentRequest;
|
---|
37 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1UpdateDocumentResponse;
|
---|
38 | use Google\Service\Contentwarehouse\GoogleProtobufEmpty;
|
---|
39 |
|
---|
40 | /**
|
---|
41 | * The "documents" collection of methods.
|
---|
42 | * Typical usage is:
|
---|
43 | * <code>
|
---|
44 | * $contentwarehouseService = new Google\Service\Contentwarehouse(...);
|
---|
45 | * $documents = $contentwarehouseService->projects_locations_documents;
|
---|
46 | * </code>
|
---|
47 | */
|
---|
48 | class ProjectsLocationsDocuments extends \Google\Service\Resource
|
---|
49 | {
|
---|
50 | /**
|
---|
51 | * Creates a document. (documents.create)
|
---|
52 | *
|
---|
53 | * @param string $parent Required. The parent name. Format:
|
---|
54 | * projects/{project_number}/locations/{location}.
|
---|
55 | * @param GoogleCloudContentwarehouseV1CreateDocumentRequest $postBody
|
---|
56 | * @param array $optParams Optional parameters.
|
---|
57 | * @return GoogleCloudContentwarehouseV1CreateDocumentResponse
|
---|
58 | * @throws \Google\Service\Exception
|
---|
59 | */
|
---|
60 | public function create($parent, GoogleCloudContentwarehouseV1CreateDocumentRequest $postBody, $optParams = [])
|
---|
61 | {
|
---|
62 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
63 | $params = array_merge($params, $optParams);
|
---|
64 | return $this->call('create', [$params], GoogleCloudContentwarehouseV1CreateDocumentResponse::class);
|
---|
65 | }
|
---|
66 | /**
|
---|
67 | * Deletes a document. Returns NOT_FOUND if the document does not exist.
|
---|
68 | * (documents.delete)
|
---|
69 | *
|
---|
70 | * @param string $name Required. The name of the document to delete. Format:
|
---|
71 | * projects/{project_number}/locations/{location}/documents/{document_id} or pro
|
---|
72 | * jects/{project_number}/locations/{location}/documents/referenceId/{reference_
|
---|
73 | * id}.
|
---|
74 | * @param GoogleCloudContentwarehouseV1DeleteDocumentRequest $postBody
|
---|
75 | * @param array $optParams Optional parameters.
|
---|
76 | * @return GoogleProtobufEmpty
|
---|
77 | * @throws \Google\Service\Exception
|
---|
78 | */
|
---|
79 | public function delete($name, GoogleCloudContentwarehouseV1DeleteDocumentRequest $postBody, $optParams = [])
|
---|
80 | {
|
---|
81 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
82 | $params = array_merge($params, $optParams);
|
---|
83 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
84 | }
|
---|
85 | /**
|
---|
86 | * Gets the access control policy for a resource. Returns NOT_FOUND error if the
|
---|
87 | * resource does not exist. Returns an empty policy if the resource exists but
|
---|
88 | * does not have a policy set. (documents.fetchAcl)
|
---|
89 | *
|
---|
90 | * @param string $resource Required. REQUIRED: The resource for which the policy
|
---|
91 | * is being requested. Format for document:
|
---|
92 | * projects/{project_number}/locations/{location}/documents/{document_id}.
|
---|
93 | * Format for collection:
|
---|
94 | * projects/{project_number}/locations/{location}/collections/{collection_id}.
|
---|
95 | * Format for project: projects/{project_number}.
|
---|
96 | * @param GoogleCloudContentwarehouseV1FetchAclRequest $postBody
|
---|
97 | * @param array $optParams Optional parameters.
|
---|
98 | * @return GoogleCloudContentwarehouseV1FetchAclResponse
|
---|
99 | * @throws \Google\Service\Exception
|
---|
100 | */
|
---|
101 | public function fetchAcl($resource, GoogleCloudContentwarehouseV1FetchAclRequest $postBody, $optParams = [])
|
---|
102 | {
|
---|
103 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
104 | $params = array_merge($params, $optParams);
|
---|
105 | return $this->call('fetchAcl', [$params], GoogleCloudContentwarehouseV1FetchAclResponse::class);
|
---|
106 | }
|
---|
107 | /**
|
---|
108 | * Gets a document. Returns NOT_FOUND if the document does not exist.
|
---|
109 | * (documents.get)
|
---|
110 | *
|
---|
111 | * @param string $name Required. The name of the document to retrieve. Format:
|
---|
112 | * projects/{project_number}/locations/{location}/documents/{document_id} or pro
|
---|
113 | * jects/{project_number}/locations/{location}/documents/referenceId/{reference_
|
---|
114 | * id}.
|
---|
115 | * @param GoogleCloudContentwarehouseV1GetDocumentRequest $postBody
|
---|
116 | * @param array $optParams Optional parameters.
|
---|
117 | * @return GoogleCloudContentwarehouseV1Document
|
---|
118 | * @throws \Google\Service\Exception
|
---|
119 | */
|
---|
120 | public function get($name, GoogleCloudContentwarehouseV1GetDocumentRequest $postBody, $optParams = [])
|
---|
121 | {
|
---|
122 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
123 | $params = array_merge($params, $optParams);
|
---|
124 | return $this->call('get', [$params], GoogleCloudContentwarehouseV1Document::class);
|
---|
125 | }
|
---|
126 | /**
|
---|
127 | * Return all source document-links from the document. (documents.linkedSources)
|
---|
128 | *
|
---|
129 | * @param string $parent Required. The name of the document, for which all
|
---|
130 | * source links are returned. Format: projects/{project_number}/locations/{locat
|
---|
131 | * ion}/documents/{source_document_id}.
|
---|
132 | * @param GoogleCloudContentwarehouseV1ListLinkedSourcesRequest $postBody
|
---|
133 | * @param array $optParams Optional parameters.
|
---|
134 | * @return GoogleCloudContentwarehouseV1ListLinkedSourcesResponse
|
---|
135 | * @throws \Google\Service\Exception
|
---|
136 | */
|
---|
137 | public function linkedSources($parent, GoogleCloudContentwarehouseV1ListLinkedSourcesRequest $postBody, $optParams = [])
|
---|
138 | {
|
---|
139 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
140 | $params = array_merge($params, $optParams);
|
---|
141 | return $this->call('linkedSources', [$params], GoogleCloudContentwarehouseV1ListLinkedSourcesResponse::class);
|
---|
142 | }
|
---|
143 | /**
|
---|
144 | * Return all target document-links from the document. (documents.linkedTargets)
|
---|
145 | *
|
---|
146 | * @param string $parent Required. The name of the document, for which all
|
---|
147 | * target links are returned. Format: projects/{project_number}/locations/{locat
|
---|
148 | * ion}/documents/{target_document_id}.
|
---|
149 | * @param GoogleCloudContentwarehouseV1ListLinkedTargetsRequest $postBody
|
---|
150 | * @param array $optParams Optional parameters.
|
---|
151 | * @return GoogleCloudContentwarehouseV1ListLinkedTargetsResponse
|
---|
152 | * @throws \Google\Service\Exception
|
---|
153 | */
|
---|
154 | public function linkedTargets($parent, GoogleCloudContentwarehouseV1ListLinkedTargetsRequest $postBody, $optParams = [])
|
---|
155 | {
|
---|
156 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
157 | $params = array_merge($params, $optParams);
|
---|
158 | return $this->call('linkedTargets', [$params], GoogleCloudContentwarehouseV1ListLinkedTargetsResponse::class);
|
---|
159 | }
|
---|
160 | /**
|
---|
161 | * Lock the document so the document cannot be updated by other users.
|
---|
162 | * (documents.lock)
|
---|
163 | *
|
---|
164 | * @param string $name Required. The name of the document to lock. Format:
|
---|
165 | * projects/{project_number}/locations/{location}/documents/{document}.
|
---|
166 | * @param GoogleCloudContentwarehouseV1LockDocumentRequest $postBody
|
---|
167 | * @param array $optParams Optional parameters.
|
---|
168 | * @return GoogleCloudContentwarehouseV1Document
|
---|
169 | * @throws \Google\Service\Exception
|
---|
170 | */
|
---|
171 | public function lock($name, GoogleCloudContentwarehouseV1LockDocumentRequest $postBody, $optParams = [])
|
---|
172 | {
|
---|
173 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
174 | $params = array_merge($params, $optParams);
|
---|
175 | return $this->call('lock', [$params], GoogleCloudContentwarehouseV1Document::class);
|
---|
176 | }
|
---|
177 | /**
|
---|
178 | * Updates a document. Returns INVALID_ARGUMENT if the name of the document is
|
---|
179 | * non-empty and does not equal the existing name. (documents.patch)
|
---|
180 | *
|
---|
181 | * @param string $name Required. The name of the document to update. Format:
|
---|
182 | * projects/{project_number}/locations/{location}/documents/{document_id} or pro
|
---|
183 | * jects/{project_number}/locations/{location}/documents/referenceId/{reference_
|
---|
184 | * id}.
|
---|
185 | * @param GoogleCloudContentwarehouseV1UpdateDocumentRequest $postBody
|
---|
186 | * @param array $optParams Optional parameters.
|
---|
187 | * @return GoogleCloudContentwarehouseV1UpdateDocumentResponse
|
---|
188 | * @throws \Google\Service\Exception
|
---|
189 | */
|
---|
190 | public function patch($name, GoogleCloudContentwarehouseV1UpdateDocumentRequest $postBody, $optParams = [])
|
---|
191 | {
|
---|
192 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
193 | $params = array_merge($params, $optParams);
|
---|
194 | return $this->call('patch', [$params], GoogleCloudContentwarehouseV1UpdateDocumentResponse::class);
|
---|
195 | }
|
---|
196 | /**
|
---|
197 | * Searches for documents using provided SearchDocumentsRequest. This call only
|
---|
198 | * returns documents that the caller has permission to search against.
|
---|
199 | * (documents.search)
|
---|
200 | *
|
---|
201 | * @param string $parent Required. The parent, which owns this collection of
|
---|
202 | * documents. Format: projects/{project_number}/locations/{location}.
|
---|
203 | * @param GoogleCloudContentwarehouseV1SearchDocumentsRequest $postBody
|
---|
204 | * @param array $optParams Optional parameters.
|
---|
205 | * @return GoogleCloudContentwarehouseV1SearchDocumentsResponse
|
---|
206 | * @throws \Google\Service\Exception
|
---|
207 | */
|
---|
208 | public function search($parent, GoogleCloudContentwarehouseV1SearchDocumentsRequest $postBody, $optParams = [])
|
---|
209 | {
|
---|
210 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
211 | $params = array_merge($params, $optParams);
|
---|
212 | return $this->call('search', [$params], GoogleCloudContentwarehouseV1SearchDocumentsResponse::class);
|
---|
213 | }
|
---|
214 | /**
|
---|
215 | * Sets the access control policy for a resource. Replaces any existing policy.
|
---|
216 | * (documents.setAcl)
|
---|
217 | *
|
---|
218 | * @param string $resource Required. REQUIRED: The resource for which the policy
|
---|
219 | * is being requested. Format for document:
|
---|
220 | * projects/{project_number}/locations/{location}/documents/{document_id}.
|
---|
221 | * Format for collection:
|
---|
222 | * projects/{project_number}/locations/{location}/collections/{collection_id}.
|
---|
223 | * Format for project: projects/{project_number}.
|
---|
224 | * @param GoogleCloudContentwarehouseV1SetAclRequest $postBody
|
---|
225 | * @param array $optParams Optional parameters.
|
---|
226 | * @return GoogleCloudContentwarehouseV1SetAclResponse
|
---|
227 | * @throws \Google\Service\Exception
|
---|
228 | */
|
---|
229 | public function setAcl($resource, GoogleCloudContentwarehouseV1SetAclRequest $postBody, $optParams = [])
|
---|
230 | {
|
---|
231 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
232 | $params = array_merge($params, $optParams);
|
---|
233 | return $this->call('setAcl', [$params], GoogleCloudContentwarehouseV1SetAclResponse::class);
|
---|
234 | }
|
---|
235 | }
|
---|
236 |
|
---|
237 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
238 | class_alias(ProjectsLocationsDocuments::class, 'Google_Service_Contentwarehouse_Resource_ProjectsLocationsDocuments');
|
---|