[e3d4e0a] | 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\GoogleCloudContentwarehouseV1DeleteDocumentRequest;
|
---|
| 21 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1Document;
|
---|
| 22 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1GetDocumentRequest;
|
---|
| 23 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1UpdateDocumentRequest;
|
---|
| 24 | use Google\Service\Contentwarehouse\GoogleCloudContentwarehouseV1UpdateDocumentResponse;
|
---|
| 25 | use Google\Service\Contentwarehouse\GoogleProtobufEmpty;
|
---|
| 26 |
|
---|
| 27 | /**
|
---|
| 28 | * The "referenceId" collection of methods.
|
---|
| 29 | * Typical usage is:
|
---|
| 30 | * <code>
|
---|
| 31 | * $contentwarehouseService = new Google\Service\Contentwarehouse(...);
|
---|
| 32 | * $referenceId = $contentwarehouseService->projects_locations_documents_referenceId;
|
---|
| 33 | * </code>
|
---|
| 34 | */
|
---|
| 35 | class ProjectsLocationsDocumentsReferenceId extends \Google\Service\Resource
|
---|
| 36 | {
|
---|
| 37 | /**
|
---|
| 38 | * Deletes a document. Returns NOT_FOUND if the document does not exist.
|
---|
| 39 | * (referenceId.delete)
|
---|
| 40 | *
|
---|
| 41 | * @param string $name Required. The name of the document to delete. Format:
|
---|
| 42 | * projects/{project_number}/locations/{location}/documents/{document_id} or pro
|
---|
| 43 | * jects/{project_number}/locations/{location}/documents/referenceId/{reference_
|
---|
| 44 | * id}.
|
---|
| 45 | * @param GoogleCloudContentwarehouseV1DeleteDocumentRequest $postBody
|
---|
| 46 | * @param array $optParams Optional parameters.
|
---|
| 47 | * @return GoogleProtobufEmpty
|
---|
| 48 | * @throws \Google\Service\Exception
|
---|
| 49 | */
|
---|
| 50 | public function delete($name, GoogleCloudContentwarehouseV1DeleteDocumentRequest $postBody, $optParams = [])
|
---|
| 51 | {
|
---|
| 52 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 53 | $params = array_merge($params, $optParams);
|
---|
| 54 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
| 55 | }
|
---|
| 56 | /**
|
---|
| 57 | * Gets a document. Returns NOT_FOUND if the document does not exist.
|
---|
| 58 | * (referenceId.get)
|
---|
| 59 | *
|
---|
| 60 | * @param string $name Required. The name of the document to retrieve. Format:
|
---|
| 61 | * projects/{project_number}/locations/{location}/documents/{document_id} or pro
|
---|
| 62 | * jects/{project_number}/locations/{location}/documents/referenceId/{reference_
|
---|
| 63 | * id}.
|
---|
| 64 | * @param GoogleCloudContentwarehouseV1GetDocumentRequest $postBody
|
---|
| 65 | * @param array $optParams Optional parameters.
|
---|
| 66 | * @return GoogleCloudContentwarehouseV1Document
|
---|
| 67 | * @throws \Google\Service\Exception
|
---|
| 68 | */
|
---|
| 69 | public function get($name, GoogleCloudContentwarehouseV1GetDocumentRequest $postBody, $optParams = [])
|
---|
| 70 | {
|
---|
| 71 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 72 | $params = array_merge($params, $optParams);
|
---|
| 73 | return $this->call('get', [$params], GoogleCloudContentwarehouseV1Document::class);
|
---|
| 74 | }
|
---|
| 75 | /**
|
---|
| 76 | * Updates a document. Returns INVALID_ARGUMENT if the name of the document is
|
---|
| 77 | * non-empty and does not equal the existing name. (referenceId.patch)
|
---|
| 78 | *
|
---|
| 79 | * @param string $name Required. The name of the document to update. Format:
|
---|
| 80 | * projects/{project_number}/locations/{location}/documents/{document_id} or pro
|
---|
| 81 | * jects/{project_number}/locations/{location}/documents/referenceId/{reference_
|
---|
| 82 | * id}.
|
---|
| 83 | * @param GoogleCloudContentwarehouseV1UpdateDocumentRequest $postBody
|
---|
| 84 | * @param array $optParams Optional parameters.
|
---|
| 85 | * @return GoogleCloudContentwarehouseV1UpdateDocumentResponse
|
---|
| 86 | * @throws \Google\Service\Exception
|
---|
| 87 | */
|
---|
| 88 | public function patch($name, GoogleCloudContentwarehouseV1UpdateDocumentRequest $postBody, $optParams = [])
|
---|
| 89 | {
|
---|
| 90 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 91 | $params = array_merge($params, $optParams);
|
---|
| 92 | return $this->call('patch', [$params], GoogleCloudContentwarehouseV1UpdateDocumentResponse::class);
|
---|
| 93 | }
|
---|
| 94 | }
|
---|
| 95 |
|
---|
| 96 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 97 | class_alias(ProjectsLocationsDocumentsReferenceId::class, 'Google_Service_Contentwarehouse_Resource_ProjectsLocationsDocumentsReferenceId');
|
---|