Content-Length: 1073406 | pFad | https://github.com/googleapis/google-cloud-python/commit/68d329e886be89629c1961ee87e0b1123f3feda4

29 feat: add additional resource path with collections (#10864) · googleapis/google-cloud-python@68d329e · GitHub
Skip to content

Commit 68d329e

Browse files
feat: add additional resource path with collections (#10864)
* feat: add additional resource path with collections feat: document schema id is no longer required docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 518297793 Source-Link: googleapis/googleapis@95410d7 Source-Link: googleapis/googleapis-gen@b5100c8 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpc2NvdmVyeWVuZ2luZS8uT3dsQm90LnlhbWwiLCJoIjoiYjUxMDBjOGM4NTlhZTM3MmU1NzM0ZTQ5Yzk1N2U5NzM3ZDAwZjAxNyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent ce6dc45 commit 68d329e

23 files changed

+316
-159
lines changed

packages/google-cloud-discoveryengine/google/cloud/discoveryengine_v1beta/services/document_service/async_client.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ async def sample_get_document():
272272
Required. Full resource name of
273273
[Document][google.cloud.discoveryengine.v1beta.Document],
274274
such as
275-
``projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}``.
275+
``projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}``.
276276
277277
If the caller does not have permission to access the
278278
[Document][google.cloud.discoveryengine.v1beta.Document],
@@ -387,7 +387,7 @@ async def sample_list_documents():
387387
method.
388388
parent (:class:`str`):
389389
Required. The parent branch resource name, such as
390-
``projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}``.
390+
``projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}``.
391391
Use ``default_branch`` as the branch ID, to list
392392
documents under the default branch.
393393
@@ -496,12 +496,8 @@ async def sample_create_document():
496496
client = discoveryengine_v1beta.DocumentServiceAsyncClient()
497497
498498
# Initialize request argument(s)
499-
document = discoveryengine_v1beta.Document()
500-
document.schema_id = "schema_id_value"
501-
502499
request = discoveryengine_v1beta.CreateDocumentRequest(
503500
parent="parent_value",
504-
document=document,
505501
document_id="document_id_value",
506502
)
507503
@@ -518,7 +514,7 @@ async def sample_create_document():
518514
method.
519515
parent (:class:`str`):
520516
Required. The parent resource name, such as
521-
``projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}``.
517+
``projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}``.
522518
523519
This corresponds to the ``parent`` field
524520
on the ``request`` instance; if ``request`` is provided, this
@@ -642,11 +638,7 @@ async def sample_update_document():
642638
client = discoveryengine_v1beta.DocumentServiceAsyncClient()
643639
644640
# Initialize request argument(s)
645-
document = discoveryengine_v1beta.Document()
646-
document.schema_id = "schema_id_value"
647-
648641
request = discoveryengine_v1beta.UpdateDocumentRequest(
649-
document=document,
650642
)
651643
652644
# Make the request
@@ -747,7 +739,7 @@ async def sample_delete_document():
747739
Required. Full resource name of
748740
[Document][google.cloud.discoveryengine.v1beta.Document],
749741
such as
750-
``projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}``.
742+
``projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}``.
751743
752744
If the caller does not have permission to delete the
753745
[Document][google.cloud.discoveryengine.v1beta.Document],
@@ -839,11 +831,7 @@ async def sample_import_documents():
839831
client = discoveryengine_v1beta.DocumentServiceAsyncClient()
840832
841833
# Initialize request argument(s)
842-
inline_source = discoveryengine_v1beta.InlineSource()
843-
inline_source.documents.schema_id = "schema_id_value"
844-
845834
request = discoveryengine_v1beta.ImportDocumentsRequest(
846-
inline_source=inline_source,
847835
parent="parent_value",
848836
)
849837

packages/google-cloud-discoveryengine/google/cloud/discoveryengine_v1beta/services/document_service/client.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ def sample_get_document():
527527
Required. Full resource name of
528528
[Document][google.cloud.discoveryengine.v1beta.Document],
529529
such as
530-
``projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}``.
530+
``projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}``.
531531
532532
If the caller does not have permission to access the
533533
[Document][google.cloud.discoveryengine.v1beta.Document],
@@ -642,7 +642,7 @@ def sample_list_documents():
642642
method.
643643
parent (str):
644644
Required. The parent branch resource name, such as
645-
``projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}``.
645+
``projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}``.
646646
Use ``default_branch`` as the branch ID, to list
647647
documents under the default branch.
648648
@@ -751,12 +751,8 @@ def sample_create_document():
751751
client = discoveryengine_v1beta.DocumentServiceClient()
752752
753753
# Initialize request argument(s)
754-
document = discoveryengine_v1beta.Document()
755-
document.schema_id = "schema_id_value"
756-
757754
request = discoveryengine_v1beta.CreateDocumentRequest(
758755
parent="parent_value",
759-
document=document,
760756
document_id="document_id_value",
761757
)
762758
@@ -773,7 +769,7 @@ def sample_create_document():
773769
method.
774770
parent (str):
775771
Required. The parent resource name, such as
776-
``projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}``.
772+
``projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}``.
777773
778774
This corresponds to the ``parent`` field
779775
on the ``request`` instance; if ``request`` is provided, this
@@ -897,11 +893,7 @@ def sample_update_document():
897893
client = discoveryengine_v1beta.DocumentServiceClient()
898894
899895
# Initialize request argument(s)
900-
document = discoveryengine_v1beta.Document()
901-
document.schema_id = "schema_id_value"
902-
903896
request = discoveryengine_v1beta.UpdateDocumentRequest(
904-
document=document,
905897
)
906898
907899
# Make the request
@@ -1003,7 +995,7 @@ def sample_delete_document():
1003995
Required. Full resource name of
1004996
[Document][google.cloud.discoveryengine.v1beta.Document],
1005997
such as
1006-
``projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}``.
998+
``projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}``.
1007999
10081000
If the caller does not have permission to delete the
10091001
[Document][google.cloud.discoveryengine.v1beta.Document],
@@ -1095,11 +1087,7 @@ def sample_import_documents():
10951087
client = discoveryengine_v1beta.DocumentServiceClient()
10961088
10971089
# Initialize request argument(s)
1098-
inline_source = discoveryengine_v1beta.InlineSource()
1099-
inline_source.documents.schema_id = "schema_id_value"
1100-
11011090
request = discoveryengine_v1beta.ImportDocumentsRequest(
1102-
inline_source=inline_source,
11031091
parent="parent_value",
11041092
)
11051093

packages/google-cloud-discoveryengine/google/cloud/discoveryengine_v1beta/services/document_service/transports/rest.py

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,22 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient:
405405
if self._operations_client is None:
406406
http_options: Dict[str, List[Dict[str, str]]] = {
407407
"google.longrunning.Operations.GetOperation": [
408+
{
409+
"method": "get",
410+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}",
411+
},
412+
{
413+
"method": "get",
414+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}",
415+
},
416+
{
417+
"method": "get",
418+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}",
419+
},
420+
{
421+
"method": "get",
422+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/operations/*}",
423+
},
408424
{
409425
"method": "get",
410426
"uri": "/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}",
@@ -427,6 +443,22 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient:
427443
},
428444
],
429445
"google.longrunning.Operations.ListOperations": [
446+
{
447+
"method": "get",
448+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations",
449+
},
450+
{
451+
"method": "get",
452+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations",
453+
},
454+
{
455+
"method": "get",
456+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations",
457+
},
458+
{
459+
"method": "get",
460+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*}/operations",
461+
},
430462
{
431463
"method": "get",
432464
"uri": "/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations",
@@ -518,6 +550,11 @@ def __call__(
518550
"uri": "/v1beta/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents",
519551
"body": "document",
520552
},
553+
{
554+
"method": "post",
555+
"uri": "/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents",
556+
"body": "document",
557+
},
521558
]
522559
request, metadata = self._interceptor.pre_create_document(request, metadata)
523560
pb_request = document_service.CreateDocumentRequest.pb(request)
@@ -611,6 +648,10 @@ def __call__(
611648
"method": "delete",
612649
"uri": "/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}",
613650
},
651+
{
652+
"method": "delete",
653+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}",
654+
},
614655
]
615656
request, metadata = self._interceptor.pre_delete_document(request, metadata)
616657
pb_request = document_service.DeleteDocumentRequest.pb(request)
@@ -695,6 +736,10 @@ def __call__(
695736
"method": "get",
696737
"uri": "/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}",
697738
},
739+
{
740+
"method": "get",
741+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}",
742+
},
698743
]
699744
request, metadata = self._interceptor.pre_get_document(request, metadata)
700745
pb_request = document_service.GetDocumentRequest.pb(request)
@@ -785,6 +830,11 @@ def __call__(
785830
"uri": "/v1beta/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:import",
786831
"body": "*",
787832
},
833+
{
834+
"method": "post",
835+
"uri": "/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:import",
836+
"body": "*",
837+
},
788838
]
789839
request, metadata = self._interceptor.pre_import_documents(
790840
request, metadata
@@ -885,6 +935,10 @@ def __call__(
885935
"method": "get",
886936
"uri": "/v1beta/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents",
887937
},
938+
{
939+
"method": "get",
940+
"uri": "/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents",
941+
},
888942
]
889943
request, metadata = self._interceptor.pre_list_documents(request, metadata)
890944
pb_request = document_service.ListDocumentsRequest.pb(request)
@@ -978,6 +1032,11 @@ def __call__(
9781032
"uri": "/v1beta/{document.name=projects/*/locations/*/dataStores/*/branches/*/documents/*}",
9791033
"body": "document",
9801034
},
1035+
{
1036+
"method": "patch",
1037+
"uri": "/v1beta/{document.name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}",
1038+
"body": "document",
1039+
},
9811040
]
9821041
request, metadata = self._interceptor.pre_update_document(request, metadata)
9831042
pb_request = document_service.UpdateDocumentRequest.pb(request)
@@ -1109,6 +1168,22 @@ def __call__(
11091168
"""
11101169

11111170
http_options: List[Dict[str, str]] = [
1171+
{
1172+
"method": "get",
1173+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}",
1174+
},
1175+
{
1176+
"method": "get",
1177+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}",
1178+
},
1179+
{
1180+
"method": "get",
1181+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}",
1182+
},
1183+
{
1184+
"method": "get",
1185+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/operations/*}",
1186+
},
11121187
{
11131188
"method": "get",
11141189
"uri": "/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}",
@@ -1192,6 +1267,22 @@ def __call__(
11921267
"""
11931268

11941269
http_options: List[Dict[str, str]] = [
1270+
{
1271+
"method": "get",
1272+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations",
1273+
},
1274+
{
1275+
"method": "get",
1276+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations",
1277+
},
1278+
{
1279+
"method": "get",
1280+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations",
1281+
},
1282+
{
1283+
"method": "get",
1284+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*}/operations",
1285+
},
11951286
{
11961287
"method": "get",
11971288
"uri": "/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations",

packages/google-cloud-discoveryengine/google/cloud/discoveryengine_v1beta/services/recommendation_service/transports/rest.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,11 @@ def __call__(
290290
"uri": "/v1beta/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:recommend",
291291
"body": "*",
292292
},
293+
{
294+
"method": "post",
295+
"uri": "/v1beta/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:recommend",
296+
"body": "*",
297+
},
293298
]
294299
request, metadata = self._interceptor.pre_recommend(request, metadata)
295300
pb_request = recommendation_service.RecommendRequest.pb(request)
@@ -382,6 +387,22 @@ def __call__(
382387
"""
383388

384389
http_options: List[Dict[str, str]] = [
390+
{
391+
"method": "get",
392+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}",
393+
},
394+
{
395+
"method": "get",
396+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}",
397+
},
398+
{
399+
"method": "get",
400+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}",
401+
},
402+
{
403+
"method": "get",
404+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/operations/*}",
405+
},
385406
{
386407
"method": "get",
387408
"uri": "/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}",
@@ -465,6 +486,22 @@ def __call__(
465486
"""
466487

467488
http_options: List[Dict[str, str]] = [
489+
{
490+
"method": "get",
491+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations",
492+
},
493+
{
494+
"method": "get",
495+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations",
496+
},
497+
{
498+
"method": "get",
499+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations",
500+
},
501+
{
502+
"method": "get",
503+
"uri": "/v1beta/{name=projects/*/locations/*/collections/*}/operations",
504+
},
468505
{
469506
"method": "get",
470507
"uri": "/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations",

packages/google-cloud-discoveryengine/google/cloud/discoveryengine_v1beta/services/user_event_service/async_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,9 @@ async def sample_write_user_event():
278278
Returns:
279279
google.cloud.discoveryengine_v1beta.types.UserEvent:
280280
UserEvent captures all metadata
281-
information DiscoveryEngine API needs to
282-
know about how end users interact with
283-
customers' website.
281+
information Discovery Engine API needs
282+
to know about how end users interact
283+
with customers' website.
284284
285285
"""
286286
# Create or coerce a protobuf request object.

packages/google-cloud-discoveryengine/google/cloud/discoveryengine_v1beta/services/user_event_service/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,9 @@ def sample_write_user_event():
531531
Returns:
532532
google.cloud.discoveryengine_v1beta.types.UserEvent:
533533
UserEvent captures all metadata
534-
information DiscoveryEngine API needs to
535-
know about how end users interact with
536-
customers' website.
534+
information Discovery Engine API needs
535+
to know about how end users interact
536+
with customers' website.
537537
538538
"""
539539
# Create or coerce a protobuf request object.

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/google-cloud-python/commit/68d329e886be89629c1961ee87e0b1123f3feda4

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy