Skip to content

Commit

Permalink
feat: add datastore aggregation query APIs (#306)
Browse files Browse the repository at this point in the history
* chore: use gapic-generator-python 0.65.2

PiperOrigin-RevId: 444333013

Source-Link: googleapis/googleapis@f91b6cf

Source-Link: googleapis/googleapis-gen@16eb360
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZlYjM2MDk1YzI5NGU3MTJjNzRhMWJmMjM1NTA4MTdiNDIxNzRlNSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* docs: Document encoding of non-UTF-8 key strings in the Cloud Datastore API

PiperOrigin-RevId: 450535507

Source-Link: googleapis/googleapis@2f003c0

Source-Link: googleapis/googleapis-gen@7d78e9e
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2Q3OGU5ZWQ5NmRiZWE2YmY1ZTAxNzljMGVlMTY1NjEwMDc2MTZhYyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: use gapic-generator-python 1.0.0

PiperOrigin-RevId: 451250442

Source-Link: googleapis/googleapis@cca5e81

Source-Link: googleapis/googleapis-gen@0b219da
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGIyMTlkYTE2MWE4YmRjYzNjNmY3YjJlZmNkODIxMDUxODJhMzBjYSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* docs: clarifications for `DatastoreFirestoreMigraitonMetadata`
feat: new enum value `OPTIMISTIC_WITH_ENTITY_GROUPS` for `ConcurrencyMode`

PiperOrigin-RevId: 452220654

Source-Link: googleapis/googleapis@454ad5e

Source-Link: googleapis/googleapis-gen@45e7231
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDVlNzIzMThjNzI4YjQwYzIxMzFkZjFiNTY1MDk2NWI2OGViM2JlZCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: add audience parameter

PiperOrigin-RevId: 456827138

Source-Link: googleapis/googleapis@23f1a15

Source-Link: googleapis/googleapis-gen@4075a85
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDA3NWE4NTE0ZjY3NjY5MWVjMTU2Njg4YTViYmYxODNhYTk4OTNjZSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: use gapic-generator-python 1.1.1

PiperOrigin-RevId: 459095142

Source-Link: googleapis/googleapis@4f1be99

Source-Link: googleapis/googleapis-gen@ae686d9
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWU2ODZkOWNkZTRmYzNlMzZkMGFjMDJlZmI4NjQzYjE1ODkwYzFlZCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix(deps): require google-api-core 2.8.0

* fix(deps): require google-api-core>=1.32.0,>=2.8.0

* feat: Add "or" query support (only in the preview API surface)
docs: Clarify wording around default database_id usage

PiperOrigin-RevId: 462444231

Source-Link: googleapis/googleapis@b9cbfce

Source-Link: googleapis/googleapis-gen@934e426
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTM0ZTQyNmFiNDIxMDA2ZjIwNDU0NTY4ODIxYjYxYmIzMDk3OWIxMCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore(bazel): update protobuf to v3.21.3

chore(bazel): update gax-java to 2.18.4

PiperOrigin-RevId: 463115700

Source-Link: googleapis/googleapis@52130a9

Source-Link: googleapis/googleapis-gen@6a4d9d9
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmE0ZDlkOWJiM2FmYjIwYjBmNWZhNGY1ZDlmNjc0MGIxZDBlYjE5YSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: use gapic-generator-python 1.2.0

PiperOrigin-RevId: 467286830

Source-Link: googleapis/googleapis@e6e875a

Source-Link: googleapis/googleapis-gen@0295ea1
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDI5NWVhMTRkOWNkNGQ0N2RkYjIzYjllYmQzOWEzMWUyMDM1ZTI4ZiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: update count up_to field type in aggregation queries

PiperOrigin-RevId: 469555077

Source-Link: googleapis/googleapis@7c3a38d

Source-Link: googleapis/googleapis-gen@cb40e6e
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2I0MGU2ZTg5MmE5YzMzZGEwYjJlNmE2MzM1ZDVmMWU0NWE4NzBkYSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: Bump gapic-generator-python version to 1.3.0

PiperOrigin-RevId: 472561635

Source-Link: googleapis/googleapis@332ecf5

Source-Link: googleapis/googleapis-gen@4313d68
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDMxM2Q2ODI4ODBmZDlkNzI0NzI5MTE2NGQ0ZTlkM2Q1YmQ5ZjE3NyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: use gapic-generator-python 1.3.1

PiperOrigin-RevId: 472772457

Source-Link: googleapis/googleapis@855b74d

Source-Link: googleapis/googleapis-gen@b64b1e7
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjY0YjFlN2RhM2UxMzhmMTVjYTM2MTU1MmVmMDU0NWU1NDg5MWI0ZiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix: integrate  gapic-generator-python-1.4.1 and enable more py_test targets

PiperOrigin-RevId: 473833416

Source-Link: googleapis/googleapis@565a550

Source-Link: googleapis/googleapis-gen@1ee1a06
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWVlMWEwNmM2ZGUzY2E4Yjg0MzU3MmMxZmRlMDU0OGY4NDIzNjk4OSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: add datastore aggregation query APIs

PiperOrigin-RevId: 477890345

Source-Link: googleapis/googleapis@82bf674

Source-Link: googleapis/googleapis-gen@5fb8115
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWZiODExNTE2MWVhMTRhNWM1NTE4ODVjNjgxYzM2MjdjMmY2NjYzMCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Remove the tests directory from noxfile mypy session

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Update owlbot for mypy session.

* 🦉 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>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com>
Co-authored-by: Mariatta Wijaya <mariattaw@google.com>
  • Loading branch information
5 people committed Oct 4, 2022
1 parent 7e76f54 commit 96d98e5
Show file tree
Hide file tree
Showing 26 changed files with 3,477 additions and 105 deletions.
135 changes: 114 additions & 21 deletions google/cloud/datastore_admin_v1/services/datastore_admin/async_client.py
Expand Up @@ -287,11 +287,18 @@ async def export_entities(
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import datastore_admin_v1
def sample_export_entities():
async def sample_export_entities():
# Create a client
client = datastore_admin_v1.DatastoreAdminClient()
client = datastore_admin_v1.DatastoreAdminAsyncClient()
# Initialize request argument(s)
request = datastore_admin_v1.ExportEntitiesRequest(
Expand All @@ -304,7 +311,7 @@ def sample_export_entities():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down Expand Up @@ -409,6 +416,14 @@ def sample_export_entities():
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("project_id", request.project_id),)
),
)

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -450,11 +465,18 @@ async def import_entities(
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import datastore_admin_v1
def sample_import_entities():
async def sample_import_entities():
# Create a client
client = datastore_admin_v1.DatastoreAdminClient()
client = datastore_admin_v1.DatastoreAdminAsyncClient()
# Initialize request argument(s)
request = datastore_admin_v1.ImportEntitiesRequest(
Expand All @@ -467,7 +489,7 @@ def sample_import_entities():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down Expand Up @@ -540,9 +562,6 @@ def sample_import_entities():
}
The JSON representation for Empty is empty JSON
object {}.
"""
# Create or coerce a protobuf request object.
# Quick check: If we got a request object, we should *not* have
Expand Down Expand Up @@ -576,6 +595,14 @@ def sample_import_entities():
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("project_id", request.project_id),)
),
)

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -621,11 +648,18 @@ async def create_index(
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import datastore_admin_v1
def sample_create_index():
async def sample_create_index():
# Create a client
client = datastore_admin_v1.DatastoreAdminClient()
client = datastore_admin_v1.DatastoreAdminAsyncClient()
# Initialize request argument(s)
request = datastore_admin_v1.CreateIndexRequest(
Expand All @@ -636,7 +670,7 @@ def sample_create_index():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down Expand Up @@ -671,6 +705,14 @@ def sample_create_index():
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("project_id", request.project_id),)
),
)

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -715,11 +757,18 @@ async def delete_index(
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import datastore_admin_v1
def sample_delete_index():
async def sample_delete_index():
# Create a client
client = datastore_admin_v1.DatastoreAdminClient()
client = datastore_admin_v1.DatastoreAdminAsyncClient()
# Initialize request argument(s)
request = datastore_admin_v1.DeleteIndexRequest(
Expand All @@ -730,7 +779,7 @@ def sample_delete_index():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down Expand Up @@ -765,6 +814,17 @@ def sample_delete_index():
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(
("project_id", request.project_id),
("index_id", request.index_id),
)
),
)

# Send the request.
response = await rpc(
request,
Expand Down Expand Up @@ -796,18 +856,25 @@ async def get_index(
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import datastore_admin_v1
def sample_get_index():
async def sample_get_index():
# Create a client
client = datastore_admin_v1.DatastoreAdminClient()
client = datastore_admin_v1.DatastoreAdminAsyncClient()
# Initialize request argument(s)
request = datastore_admin_v1.GetIndexRequest(
)
# Make the request
response = client.get_index(request=request)
response = await client.get_index(request=request)
# Handle the response
print(response)
Expand Down Expand Up @@ -847,6 +914,17 @@ def sample_get_index():
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(
("project_id", request.project_id),
("index_id", request.index_id),
)
),
)

# Send the request.
response = await rpc(
request,
Expand All @@ -873,11 +951,18 @@ async def list_indexes(
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import datastore_admin_v1
def sample_list_indexes():
async def sample_list_indexes():
# Create a client
client = datastore_admin_v1.DatastoreAdminClient()
client = datastore_admin_v1.DatastoreAdminAsyncClient()
# Initialize request argument(s)
request = datastore_admin_v1.ListIndexesRequest(
Expand All @@ -887,7 +972,7 @@ def sample_list_indexes():
page_result = client.list_indexes(request=request)
# Handle the response
for response in page_result:
async for response in page_result:
print(response)
Args:
Expand Down Expand Up @@ -930,6 +1015,14 @@ def sample_list_indexes():
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("project_id", request.project_id),)
),
)

# Send the request.
response = await rpc(
request,
Expand Down

0 comments on commit 96d98e5

Please sign in to comment.