Skip to content

Commit

Permalink
feat: added ScalingConfig (v1) (#214)
Browse files Browse the repository at this point in the history
* feat: added ScalingConfig (v1)
feat: added Auxiliary Versions Config (v1)
feat: added Dataplex and BQ metastore types for federation (v1alpa, v1beta)

PiperOrigin-RevId: 524313740

Source-Link: googleapis/googleapis@63d1a0e

Source-Link: googleapis/googleapis-gen@400e991
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDAwZTk5MWNmZDM3MzBhMzYzYWRmYjM4NzQ0NGU1YTZjNjI0YTQxMSJ9

* 🦉 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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Apr 15, 2023
1 parent d0f2be5 commit da24c93
Show file tree
Hide file tree
Showing 58 changed files with 3,023 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
DataprocMetastoreFederationClient,
)
from google.cloud.metastore_v1.types.metastore import (
AuxiliaryVersionConfig,
Backup,
CreateBackupRequest,
CreateMetadataImportRequest,
Expand Down Expand Up @@ -60,6 +61,7 @@
OperationMetadata,
Restore,
RestoreServiceRequest,
ScalingConfig,
Secret,
Service,
TelemetryConfig,
Expand All @@ -82,6 +84,7 @@
"DataprocMetastoreAsyncClient",
"DataprocMetastoreFederationClient",
"DataprocMetastoreFederationAsyncClient",
"AuxiliaryVersionConfig",
"Backup",
"CreateBackupRequest",
"CreateMetadataImportRequest",
Expand Down Expand Up @@ -111,6 +114,7 @@
"OperationMetadata",
"Restore",
"RestoreServiceRequest",
"ScalingConfig",
"Secret",
"Service",
"TelemetryConfig",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
DataprocMetastoreFederationClient,
)
from .types.metastore import (
AuxiliaryVersionConfig,
Backup,
CreateBackupRequest,
CreateMetadataImportRequest,
Expand Down Expand Up @@ -56,6 +57,7 @@
OperationMetadata,
Restore,
RestoreServiceRequest,
ScalingConfig,
Secret,
Service,
TelemetryConfig,
Expand All @@ -76,6 +78,7 @@
__all__ = (
"DataprocMetastoreAsyncClient",
"DataprocMetastoreFederationAsyncClient",
"AuxiliaryVersionConfig",
"BackendMetastore",
"Backup",
"CreateBackupRequest",
Expand Down Expand Up @@ -114,6 +117,7 @@
"OperationMetadata",
"Restore",
"RestoreServiceRequest",
"ScalingConfig",
"Secret",
"Service",
"TelemetryConfig",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ async def sample_list_services():
Returns:
google.cloud.metastore_v1.services.dataproc_metastore.pagers.ListServicesAsyncPager:
Response message for
[DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices].
[DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices].
Iterating over this object will yield results and
resolve additional pages automatically.
Expand Down Expand Up @@ -949,7 +949,7 @@ async def sample_list_metadata_imports():
Returns:
google.cloud.metastore_v1.services.dataproc_metastore.pagers.ListMetadataImportsAsyncPager:
Response message for
[DataprocMetastore.ListMetadataImports][google.cloud.metastore.v1.DataprocMetastore.ListMetadataImports].
[DataprocMetastore.ListMetadataImports][google.cloud.metastore.v1.DataprocMetastore.ListMetadataImports].
Iterating over this object will yield results and
resolve additional pages automatically.
Expand Down Expand Up @@ -1684,7 +1684,7 @@ async def sample_list_backups():
Returns:
google.cloud.metastore_v1.services.dataproc_metastore.pagers.ListBackupsAsyncPager:
Response message for
[DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups].
[DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups].
Iterating over this object will yield results and
resolve additional pages automatically.
Expand Down Expand Up @@ -2279,6 +2279,60 @@ async def delete_operation(
metadata=metadata,
)

async def cancel_operation(
self,
request: Optional[operations_pb2.CancelOperationRequest] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Starts asynchronous cancellation on a long-running operation.
The server makes a best effort to cancel the operation, but success
is not guaranteed. If the server doesn't support this method, it returns
`google.rpc.Code.UNIMPLEMENTED`.
Args:
request (:class:`~.operations_pb2.CancelOperationRequest`):
The request object. Request message for
`CancelOperation` method.
retry (google.api_core.retry.Retry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
None
"""
# Create or coerce a protobuf request object.
# The request isn't a proto-plus wrapped type,
# so it must be constructed via keyword expansion.
if isinstance(request, dict):
request = operations_pb2.CancelOperationRequest(**request)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
self._client._transport.cancel_operation,
default_timeout=None,
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((("name", request.name),)),
)

# Send the request.
await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

async def set_iam_policy(
self,
request: Optional[iam_policy_pb2.SetIamPolicyRequest] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ def sample_list_services():
Returns:
google.cloud.metastore_v1.services.dataproc_metastore.pagers.ListServicesPager:
Response message for
[DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices].
[DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices].
Iterating over this object will yield results and
resolve additional pages automatically.
Expand Down Expand Up @@ -1257,7 +1257,7 @@ def sample_list_metadata_imports():
Returns:
google.cloud.metastore_v1.services.dataproc_metastore.pagers.ListMetadataImportsPager:
Response message for
[DataprocMetastore.ListMetadataImports][google.cloud.metastore.v1.DataprocMetastore.ListMetadataImports].
[DataprocMetastore.ListMetadataImports][google.cloud.metastore.v1.DataprocMetastore.ListMetadataImports].
Iterating over this object will yield results and
resolve additional pages automatically.
Expand Down Expand Up @@ -1993,7 +1993,7 @@ def sample_list_backups():
Returns:
google.cloud.metastore_v1.services.dataproc_metastore.pagers.ListBackupsPager:
Response message for
[DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups].
[DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups].
Iterating over this object will yield results and
resolve additional pages automatically.
Expand Down Expand Up @@ -2601,6 +2601,60 @@ def delete_operation(
metadata=metadata,
)

def cancel_operation(
self,
request: Optional[operations_pb2.CancelOperationRequest] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Starts asynchronous cancellation on a long-running operation.
The server makes a best effort to cancel the operation, but success
is not guaranteed. If the server doesn't support this method, it returns
`google.rpc.Code.UNIMPLEMENTED`.
Args:
request (:class:`~.operations_pb2.CancelOperationRequest`):
The request object. Request message for
`CancelOperation` method.
retry (google.api_core.retry.Retry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
None
"""
# Create or coerce a protobuf request object.
# The request isn't a proto-plus wrapped type,
# so it must be constructed via keyword expansion.
if isinstance(request, dict):
request = operations_pb2.CancelOperationRequest(**request)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
self._transport.cancel_operation,
default_timeout=None,
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((("name", request.name),)),
)

# Send the request.
rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

def set_iam_policy(
self,
request: Optional[iam_policy_pb2.SetIamPolicyRequest] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,12 @@ def get_operation(
]:
raise NotImplementedError()

@property
def cancel_operation(
self,
) -> Callable[[operations_pb2.CancelOperationRequest], None,]:
raise NotImplementedError()

@property
def delete_operation(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,23 @@ def delete_operation(
)
return self._stubs["delete_operation"]

@property
def cancel_operation(
self,
) -> Callable[[operations_pb2.CancelOperationRequest], None]:
r"""Return a callable for the cancel_operation method over gRPC."""
# Generate a "stub function" on-the-fly which will actually make
# the request.
# gRPC handles serialization and deserialization, so we just need
# to pass in the functions for each.
if "cancel_operation" not in self._stubs:
self._stubs["cancel_operation"] = self.grpc_channel.unary_unary(
"/google.longrunning.Operations/CancelOperation",
request_serializer=operations_pb2.CancelOperationRequest.SerializeToString,
response_deserializer=None,
)
return self._stubs["cancel_operation"]

@property
def get_operation(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,23 @@ def delete_operation(
)
return self._stubs["delete_operation"]

@property
def cancel_operation(
self,
) -> Callable[[operations_pb2.CancelOperationRequest], None]:
r"""Return a callable for the cancel_operation method over gRPC."""
# Generate a "stub function" on-the-fly which will actually make
# the request.
# gRPC handles serialization and deserialization, so we just need
# to pass in the functions for each.
if "cancel_operation" not in self._stubs:
self._stubs["cancel_operation"] = self.grpc_channel.unary_unary(
"/google.longrunning.Operations/CancelOperation",
request_serializer=operations_pb2.CancelOperationRequest.SerializeToString,
response_deserializer=None,
)
return self._stubs["cancel_operation"]

@property
def get_operation(
self,
Expand Down
Loading

0 comments on commit da24c93

Please sign in to comment.