Skip to content

Commit d0432c7

Browse files
feat: add disposition_time, legal_hold, document_is_retention_folder, document_is_legal_hold_folder, question_answer, document_name_filter field to Document Warehouse API v1 (#11565)
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent 5e61847 commit d0432c7

File tree

12 files changed

+90
-19
lines changed

12 files changed

+90
-19
lines changed

packages/google-cloud-contentwarehouse/.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2020 Google LLC
3+
# Copyright 2023 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

packages/google-cloud-contentwarehouse/CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ We support:
236236

237237
Supported versions can be found in our ``noxfile.py`` `config`_.
238238

239-
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/noxfile.py
239+
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/google-cloud-contentwarehouse/noxfile.py
240240

241241

242242
**********

packages/google-cloud-contentwarehouse/MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2020 Google LLC
3+
# Copyright 2023 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

packages/google-cloud-contentwarehouse/README.rst

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,24 @@ In order to use this library, you first need to go through the following steps:
3636
Installation
3737
~~~~~~~~~~~~
3838

39-
Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to
40-
create isolated Python environments. The basic problem it addresses is one of
41-
dependencies and versions, and indirectly permissions.
39+
Install this library in a virtual environment using `venv`_. `venv`_ is a tool that
40+
creates isolated Python environments. These isolated environments can have separate
41+
versions of Python packages, which allows you to isolate one project's dependencies
42+
from the dependencies of other projects.
4243

43-
With `virtualenv`_, it's possible to install this library without needing system
44+
With `venv`_, it's possible to install this library without needing system
4445
install permissions, and without clashing with the installed system
4546
dependencies.
4647

47-
.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/
48+
.. _`venv`: https://docs.python.org/3/library/venv.html
4849

4950

5051
Code samples and snippets
5152
~~~~~~~~~~~~~~~~~~~~~~~~~
5253

53-
Code samples and snippets live in the `samples/` folder.
54+
Code samples and snippets live in the `samples/`_ folder.
55+
56+
.. _samples/: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-contentwarehouse/samples
5457

5558

5659
Supported Python Versions
@@ -77,21 +80,19 @@ Mac/Linux
7780

7881
.. code-block:: console
7982
80-
pip install virtualenv
81-
virtualenv <your-env>
83+
python3 -m venv <your-env>
8284
source <your-env>/bin/activate
83-
<your-env>/bin/pip install google-cloud-contentwarehouse
85+
pip install google-cloud-contentwarehouse
8486
8587
8688
Windows
8789
^^^^^^^
8890

8991
.. code-block:: console
9092
91-
pip install virtualenv
92-
virtualenv <your-env>
93-
<your-env>\Scripts\activate
94-
<your-env>\Scripts\pip.exe install google-cloud-contentwarehouse
93+
py -m venv <your-env>
94+
.\<your-env>\Scripts\activate
95+
pip install google-cloud-contentwarehouse
9596
9697
Next Steps
9798
~~~~~~~~~~

packages/google-cloud-contentwarehouse/docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2021 Google LLC
2+
# Copyright 2023 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

packages/google-cloud-contentwarehouse/google/cloud/contentwarehouse_v1/types/document.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@ class Document(proto.Message):
180180
The user who creates the document.
181181
updater (str):
182182
The user who lastly updates the document.
183+
disposition_time (google.protobuf.timestamp_pb2.Timestamp):
184+
Output only. If linked to a Collection with
185+
RetentionPolicy, the date when the document
186+
becomes mutable.
187+
legal_hold (bool):
188+
Output only. Indicates if the document has a
189+
legal hold on it.
183190
"""
184191

185192
name: str = proto.Field(
@@ -276,6 +283,15 @@ class Document(proto.Message):
276283
proto.STRING,
277284
number=14,
278285
)
286+
disposition_time: timestamp_pb2.Timestamp = proto.Field(
287+
proto.MESSAGE,
288+
number=22,
289+
message=timestamp_pb2.Timestamp,
290+
)
291+
legal_hold: bool = proto.Field(
292+
proto.BOOL,
293+
number=23,
294+
)
279295

280296

281297
class DocumentReference(proto.Message):
@@ -304,6 +320,10 @@ class DocumentReference(proto.Message):
304320
delete_time (google.protobuf.timestamp_pb2.Timestamp):
305321
Output only. The time when the document is
306322
deleted.
323+
document_is_retention_folder (bool):
324+
Document is a folder with retention policy.
325+
document_is_legal_hold_folder (bool):
326+
Document is a folder with legal hold.
307327
"""
308328

309329
document_name: str = proto.Field(
@@ -337,6 +357,14 @@ class DocumentReference(proto.Message):
337357
number=7,
338358
message=timestamp_pb2.Timestamp,
339359
)
360+
document_is_retention_folder: bool = proto.Field(
361+
proto.BOOL,
362+
number=8,
363+
)
364+
document_is_legal_hold_folder: bool = proto.Field(
365+
proto.BOOL,
366+
number=9,
367+
)
340368

341369

342370
class Property(proto.Message):

packages/google-cloud-contentwarehouse/google/cloud/contentwarehouse_v1/types/document_service.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ class SearchDocumentsResponse(proto.Message):
189189
histogram_query_results (MutableSequence[google.cloud.contentwarehouse_v1.types.HistogramQueryResult]):
190190
The histogram results that match with the specified
191191
[SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
192+
question_answer (str):
193+
Experimental.
194+
Question answer from the query against the
195+
document.
192196
"""
193197

194198
class MatchingDocument(proto.Message):
@@ -262,6 +266,10 @@ def raw_page(self):
262266
number=6,
263267
message=histogram.HistogramQueryResult,
264268
)
269+
question_answer: str = proto.Field(
270+
proto.STRING,
271+
number=7,
272+
)
265273

266274

267275
class FetchAclResponse(proto.Message):

packages/google-cloud-contentwarehouse/google/cloud/contentwarehouse_v1/types/filters.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ class DocumentQuery(proto.Message):
150150
Search all the documents under this specified folder.
151151
Format:
152152
projects/{project_number}/locations/{location}/documents/{document_id}.
153+
document_name_filter (MutableSequence[str]):
154+
Search the documents in the list. Format:
155+
projects/{project_number}/locations/{location}/documents/{document_id}.
153156
query_context (MutableSequence[str]):
154157
For custom synonyms.
155158
Customers provide the synonyms based on context.
@@ -214,6 +217,10 @@ class DocumentQuery(proto.Message):
214217
proto.STRING,
215218
number=9,
216219
)
220+
document_name_filter: MutableSequence[str] = proto.RepeatedField(
221+
proto.STRING,
222+
number=14,
223+
)
217224
query_context: MutableSequence[str] = proto.RepeatedField(
218225
proto.STRING,
219226
number=10,
@@ -251,10 +258,13 @@ class TimeField(proto.Enum):
251258
Earliest document create time.
252259
UPDATE_TIME (2):
253260
Latest document update time.
261+
DISPOSITION_TIME (3):
262+
Time when document becomes mutable again.
254263
"""
255264
TIME_FIELD_UNSPECIFIED = 0
256265
CREATE_TIME = 1
257266
UPDATE_TIME = 2
267+
DISPOSITION_TIME = 3
258268

259269
time_range: interval_pb2.Interval = proto.Field(
260270
proto.MESSAGE,

packages/google-cloud-contentwarehouse/google/cloud/contentwarehouse_v1/types/rule_engine.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,16 @@ class TriggerType(proto.Enum):
113113
Trigger for create document action.
114114
ON_UPDATE (4):
115115
Trigger for update document action.
116+
ON_CREATE_LINK (7):
117+
Trigger for create link action.
118+
ON_DELETE_LINK (8):
119+
Trigger for delete link action.
116120
"""
117121
UNKNOWN = 0
118122
ON_CREATE = 1
119123
ON_UPDATE = 4
124+
ON_CREATE_LINK = 7
125+
ON_DELETE_LINK = 8
120126

121127
description: str = proto.Field(
122128
proto.STRING,

packages/google-cloud-contentwarehouse/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2018 Google LLC
3+
# Copyright 2023 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)