Skip to content

Commit

Permalink
chore: use gapic-generator-python 0.63.2 (#7)
Browse files Browse the repository at this point in the history
* chore: use gapic-generator-python 0.63.2
docs: add generated snippets

PiperOrigin-RevId: 427792504

Source-Link: googleapis/googleapis@55b9e1e

Source-Link: googleapis/googleapis-gen@bf4e86b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9

* 🦉 Updates from OwlBot

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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Feb 11, 2022
1 parent b60a9ae commit 9ef78cf
Show file tree
Hide file tree
Showing 65 changed files with 6,900 additions and 0 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,25 @@ async def get_entity(
) -> metadata_.Entity:
r"""Get a metadata entity.
.. code-block::
from google.cloud import dataplex_v1
def sample_get_entity():
# Create a client
client = dataplex_v1.MetadataServiceClient()
# Initialize request argument(s)
request = dataplex_v1.GetEntityRequest(
name="name_value",
)
# Make the request
response = client.get_entity(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.dataplex_v1.types.GetEntityRequest, dict]):
The request object. Get metadata entity request.
Expand Down Expand Up @@ -299,6 +318,27 @@ async def list_entities(
) -> pagers.ListEntitiesAsyncPager:
r"""List metadata entities in a zone.
.. code-block::
from google.cloud import dataplex_v1
def sample_list_entities():
# Create a client
client = dataplex_v1.MetadataServiceClient()
# Initialize request argument(s)
request = dataplex_v1.ListEntitiesRequest(
parent="parent_value",
view="FILESETS",
)
# Make the request
page_result = client.list_entities(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.dataplex_v1.types.ListEntitiesRequest, dict]):
The request object. List metadata entities request.
Expand Down Expand Up @@ -386,6 +426,25 @@ async def get_partition(
) -> metadata_.Partition:
r"""Get a metadata partition of an entity.
.. code-block::
from google.cloud import dataplex_v1
def sample_get_partition():
# Create a client
client = dataplex_v1.MetadataServiceClient()
# Initialize request argument(s)
request = dataplex_v1.GetPartitionRequest(
name="name_value",
)
# Make the request
response = client.get_partition(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.dataplex_v1.types.GetPartitionRequest, dict]):
The request object. Get metadata partition request.
Expand Down Expand Up @@ -465,6 +524,26 @@ async def list_partitions(
) -> pagers.ListPartitionsAsyncPager:
r"""List metadata partitions of an entity.
.. code-block::
from google.cloud import dataplex_v1
def sample_list_partitions():
# Create a client
client = dataplex_v1.MetadataServiceClient()
# Initialize request argument(s)
request = dataplex_v1.ListPartitionsRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_partitions(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.dataplex_v1.types.ListPartitionsRequest, dict]):
The request object. List metadata partitions request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,26 @@ def get_entity(
) -> metadata_.Entity:
r"""Get a metadata entity.
.. code-block::
from google.cloud import dataplex_v1
def sample_get_entity():
# Create a client
client = dataplex_v1.MetadataServiceClient()
# Initialize request argument(s)
request = dataplex_v1.GetEntityRequest(
name="name_value",
)
# Make the request
response = client.get_entity(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.dataplex_v1.types.GetEntityRequest, dict]):
The request object. Get metadata entity request.
Expand Down Expand Up @@ -524,6 +544,28 @@ def list_entities(
) -> pagers.ListEntitiesPager:
r"""List metadata entities in a zone.
.. code-block::
from google.cloud import dataplex_v1
def sample_list_entities():
# Create a client
client = dataplex_v1.MetadataServiceClient()
# Initialize request argument(s)
request = dataplex_v1.ListEntitiesRequest(
parent="parent_value",
view="FILESETS",
)
# Make the request
page_result = client.list_entities(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.dataplex_v1.types.ListEntitiesRequest, dict]):
The request object. List metadata entities request.
Expand Down Expand Up @@ -602,6 +644,26 @@ def get_partition(
) -> metadata_.Partition:
r"""Get a metadata partition of an entity.
.. code-block::
from google.cloud import dataplex_v1
def sample_get_partition():
# Create a client
client = dataplex_v1.MetadataServiceClient()
# Initialize request argument(s)
request = dataplex_v1.GetPartitionRequest(
name="name_value",
)
# Make the request
response = client.get_partition(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.dataplex_v1.types.GetPartitionRequest, dict]):
The request object. Get metadata partition request.
Expand Down Expand Up @@ -672,6 +734,27 @@ def list_partitions(
) -> pagers.ListPartitionsPager:
r"""List metadata partitions of an entity.
.. code-block::
from google.cloud import dataplex_v1
def sample_list_partitions():
# Create a client
client = dataplex_v1.MetadataServiceClient()
# Initialize request argument(s)
request = dataplex_v1.ListPartitionsRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_partitions(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.dataplex_v1.types.ListPartitionsRequest, dict]):
The request object. List metadata partitions request.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for CancelJob
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-dataplex


# [START dataplex_generated_dataplex_v1_DataplexService_CancelJob_async]
from google.cloud import dataplex_v1


async def sample_cancel_job():
# Create a client
client = dataplex_v1.DataplexServiceAsyncClient()

# Initialize request argument(s)
request = dataplex_v1.CancelJobRequest(
name="name_value",
)

# Make the request
await client.cancel_job(request=request)


# [END dataplex_generated_dataplex_v1_DataplexService_CancelJob_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for CancelJob
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-dataplex


# [START dataplex_generated_dataplex_v1_DataplexService_CancelJob_sync]
from google.cloud import dataplex_v1


def sample_cancel_job():
# Create a client
client = dataplex_v1.DataplexServiceClient()

# Initialize request argument(s)
request = dataplex_v1.CancelJobRequest(
name="name_value",
)

# Make the request
client.cancel_job(request=request)


# [END dataplex_generated_dataplex_v1_DataplexService_CancelJob_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for CreateAsset
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-dataplex


# [START dataplex_generated_dataplex_v1_DataplexService_CreateAsset_async]
from google.cloud import dataplex_v1


async def sample_create_asset():
# Create a client
client = dataplex_v1.DataplexServiceAsyncClient()

# Initialize request argument(s)
asset = dataplex_v1.Asset()
asset.resource_spec.type_ = "BIGQUERY_DATASET"

request = dataplex_v1.CreateAssetRequest(
parent="parent_value",
asset_id="asset_id_value",
asset=asset,
)

# Make the request
operation = client.create_asset(request=request)

print("Waiting for operation to complete...")

response = await operation.result()

# Handle the response
print(response)

# [END dataplex_generated_dataplex_v1_DataplexService_CreateAsset_async]
Loading

0 comments on commit 9ef78cf

Please sign in to comment.