Skip to content

Commit 47e1116

Browse files
feat: update definitions for cloud/datafusion/v1 and cloud/datafusion/v1beta1 (#58)
fix(v1): multiple fields now have field_behavior REQUIRED fix(v1beta1): multiple fields now have field_behavior REQUIRED - [ ] Regenerate this pull request now. Committer: @viacheslav-rostovtsev PiperOrigin-RevId: 421416031 Source-Link: googleapis/googleapis@5438a17 Source-Link: googleapis/googleapis-gen@cc7213f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2M3MjEzZjBjMmFjNjYyM2M0ZThkNGJhNTcyMzM3YzgzNzk5MGJmNSJ9
1 parent f8ebddd commit 47e1116

File tree

4 files changed

+152
-56
lines changed

4 files changed

+152
-56
lines changed

packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/services/data_fusion/async_client.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ class DataFusionAsyncClient:
5454
DEFAULT_ENDPOINT = DataFusionClient.DEFAULT_ENDPOINT
5555
DEFAULT_MTLS_ENDPOINT = DataFusionClient.DEFAULT_MTLS_ENDPOINT
5656

57+
crypto_key_path = staticmethod(DataFusionClient.crypto_key_path)
58+
parse_crypto_key_path = staticmethod(DataFusionClient.parse_crypto_key_path)
5759
instance_path = staticmethod(DataFusionClient.instance_path)
5860
parse_instance_path = staticmethod(DataFusionClient.parse_instance_path)
5961
common_billing_account_path = staticmethod(
@@ -376,8 +378,8 @@ async def create_instance(
376378
The request object. Request message for creating a Data
377379
Fusion instance.
378380
parent (:class:`str`):
379-
The instance's project and location
380-
in the format
381+
Required. The instance's project and
382+
location in the format
381383
projects/{project}/locations/{location}.
382384
383385
This corresponds to the ``parent`` field
@@ -389,7 +391,9 @@ async def create_instance(
389391
on the ``request`` instance; if ``request`` is provided, this
390392
should not be set.
391393
instance_id (:class:`str`):
392-
The name of the instance to create.
394+
Required. The name of the instance to
395+
create.
396+
393397
This corresponds to the ``instance_id`` field
394398
on the ``request`` instance; if ``request`` is provided, this
395399
should not be set.
@@ -473,8 +477,8 @@ async def delete_instance(
473477
The request object. Request message for deleting a Data
474478
Fusion instance.
475479
name (:class:`str`):
476-
The instance resource name in the
477-
format
480+
Required. The instance resource name
481+
in the format
478482
projects/{project}/locations/{location}/instances/{instance}
479483
480484
This corresponds to the ``name`` field
@@ -564,14 +568,17 @@ async def update_instance(
564568
565569
Args:
566570
request (Union[google.cloud.data_fusion_v1.types.UpdateInstanceRequest, dict]):
567-
The request object.
571+
The request object. Request message for updating a Data
572+
Fusion instance. Data Fusion allows updating the labels,
573+
options, and stack driver settings. This is also used
574+
for CDF version upgrade.
568575
instance (:class:`google.cloud.data_fusion_v1.types.Instance`):
569-
The instance resource that replaces
570-
the resource on the server. Currently,
571-
Data Fusion only allows replacing
572-
labels, options, and stack driver
573-
settings. All other fields will be
574-
ignored.
576+
Required. The instance resource that
577+
replaces the resource on the server.
578+
Currently, Data Fusion only allows
579+
replacing labels, options, and stack
580+
driver settings. All other fields will
581+
be ignored.
575582
576583
This corresponds to the ``instance`` field
577584
on the ``request`` instance; if ``request`` is provided, this

packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/services/data_fusion/client.py

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,27 @@ def transport(self) -> DataFusionTransport:
165165
"""
166166
return self._transport
167167

168+
@staticmethod
169+
def crypto_key_path(
170+
project: str, location: str, key_ring: str, crypto_key: str,
171+
) -> str:
172+
"""Returns a fully-qualified crypto_key string."""
173+
return "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}".format(
174+
project=project,
175+
location=location,
176+
key_ring=key_ring,
177+
crypto_key=crypto_key,
178+
)
179+
180+
@staticmethod
181+
def parse_crypto_key_path(path: str) -> Dict[str, str]:
182+
"""Parses a crypto_key path into its component segments."""
183+
m = re.match(
184+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/keyRings/(?P<key_ring>.+?)/cryptoKeys/(?P<crypto_key>.+?)$",
185+
path,
186+
)
187+
return m.groupdict() if m else {}
188+
168189
@staticmethod
169190
def instance_path(project: str, location: str, instance: str,) -> str:
170191
"""Returns a fully-qualified instance string."""
@@ -574,8 +595,8 @@ def create_instance(
574595
The request object. Request message for creating a Data
575596
Fusion instance.
576597
parent (str):
577-
The instance's project and location
578-
in the format
598+
Required. The instance's project and
599+
location in the format
579600
projects/{project}/locations/{location}.
580601
581602
This corresponds to the ``parent`` field
@@ -587,7 +608,9 @@ def create_instance(
587608
on the ``request`` instance; if ``request`` is provided, this
588609
should not be set.
589610
instance_id (str):
590-
The name of the instance to create.
611+
Required. The name of the instance to
612+
create.
613+
591614
This corresponds to the ``instance_id`` field
592615
on the ``request`` instance; if ``request`` is provided, this
593616
should not be set.
@@ -671,8 +694,8 @@ def delete_instance(
671694
The request object. Request message for deleting a Data
672695
Fusion instance.
673696
name (str):
674-
The instance resource name in the
675-
format
697+
Required. The instance resource name
698+
in the format
676699
projects/{project}/locations/{location}/instances/{instance}
677700
678701
This corresponds to the ``name`` field
@@ -762,14 +785,17 @@ def update_instance(
762785
763786
Args:
764787
request (Union[google.cloud.data_fusion_v1.types.UpdateInstanceRequest, dict]):
765-
The request object.
788+
The request object. Request message for updating a Data
789+
Fusion instance. Data Fusion allows updating the labels,
790+
options, and stack driver settings. This is also used
791+
for CDF version upgrade.
766792
instance (google.cloud.data_fusion_v1.types.Instance):
767-
The instance resource that replaces
768-
the resource on the server. Currently,
769-
Data Fusion only allows replacing
770-
labels, options, and stack driver
771-
settings. All other fields will be
772-
ignored.
793+
Required. The instance resource that
794+
replaces the resource on the server.
795+
Currently, Data Fusion only allows
796+
replacing labels, options, and stack
797+
driver settings. All other fields will
798+
be ignored.
773799
774800
This corresponds to the ``instance`` field
775801
on the ``request`` instance; if ``request`` is provided, this

packages/google-cloud-data-fusion/google/cloud/data_fusion_v1/types/datafusion.py

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,23 @@ class Version(proto.Message):
8686
available_features (Sequence[str]):
8787
Represents a list of available feature names
8888
for a given version.
89+
type_ (google.cloud.data_fusion_v1.types.Version.Type):
90+
Type represents the release availability of
91+
the version
8992
"""
9093

94+
class Type(proto.Enum):
95+
r"""Each type represents the release availability of a CDF
96+
version
97+
"""
98+
TYPE_UNSPECIFIED = 0
99+
TYPE_PREVIEW = 1
100+
TYPE_GENERAL_AVAILABILITY = 2
101+
91102
version_number = proto.Field(proto.STRING, number=1,)
92103
default_version = proto.Field(proto.BOOL, number=2,)
93104
available_features = proto.RepeatedField(proto.STRING, number=3,)
105+
type_ = proto.Field(proto.ENUM, number=4, enum=Type,)
94106

95107

96108
class Accelerator(proto.Message):
@@ -230,6 +242,9 @@ class Instance(proto.Message):
230242
The crypto key configuration. This field is
231243
used by the Customer-Managed Encryption Keys
232244
(CMEK) feature.
245+
disabled_reason (Sequence[google.cloud.data_fusion_v1.types.Instance.DisabledReason]):
246+
Output only. If the instance state is
247+
DISABLED, the reason for disabling the instance.
233248
"""
234249

235250
class Type(proto.Enum):
@@ -253,6 +268,14 @@ class State(proto.Enum):
253268
UPDATING = 7
254269
AUTO_UPDATING = 8
255270
AUTO_UPGRADING = 9
271+
DISABLED = 10
272+
273+
class DisabledReason(proto.Enum):
274+
r"""The reason for disabling the instance if the state is
275+
DISABLED.
276+
"""
277+
DISABLED_REASON_UNSPECIFIED = 0
278+
KMS_KEY_ISSUE = 1
256279

257280
name = proto.Field(proto.STRING, number=1,)
258281
description = proto.Field(proto.STRING, number=2,)
@@ -289,15 +312,16 @@ class State(proto.Enum):
289312
crypto_key_config = proto.Field(
290313
proto.MESSAGE, number=28, message="CryptoKeyConfig",
291314
)
315+
disabled_reason = proto.RepeatedField(proto.ENUM, number=29, enum=DisabledReason,)
292316

293317

294318
class ListInstancesRequest(proto.Message):
295319
r"""Request message for listing Data Fusion instances.
296320
297321
Attributes:
298322
parent (str):
299-
The project and location for which to
300-
retrieve instance information in the format
323+
Required. The project and location for which
324+
to retrieve instance information in the format
301325
projects/{project}/locations/{location}. If the
302326
location is specified as '-' (wildcard), then
303327
all regions available to the project are
@@ -397,7 +421,8 @@ class GetInstanceRequest(proto.Message):
397421
398422
Attributes:
399423
name (str):
400-
The instance resource name in the format
424+
Required. The instance resource name in the
425+
format
401426
projects/{project}/locations/{location}/instances/{instance}.
402427
"""
403428

@@ -409,10 +434,11 @@ class CreateInstanceRequest(proto.Message):
409434
410435
Attributes:
411436
parent (str):
412-
The instance's project and location in the
413-
format projects/{project}/locations/{location}.
437+
Required. The instance's project and location
438+
in the format
439+
projects/{project}/locations/{location}.
414440
instance_id (str):
415-
The name of the instance to create.
441+
Required. The name of the instance to create.
416442
instance (google.cloud.data_fusion_v1.types.Instance):
417443
An instance resource.
418444
"""
@@ -427,23 +453,26 @@ class DeleteInstanceRequest(proto.Message):
427453
428454
Attributes:
429455
name (str):
430-
The instance resource name in the format
456+
Required. The instance resource name in the
457+
format
431458
projects/{project}/locations/{location}/instances/{instance}
432459
"""
433460

434461
name = proto.Field(proto.STRING, number=1,)
435462

436463

437464
class UpdateInstanceRequest(proto.Message):
438-
r"""
465+
r"""Request message for updating a Data Fusion instance.
466+
Data Fusion allows updating the labels, options, and stack
467+
driver settings. This is also used for CDF version upgrade.
439468
440469
Attributes:
441470
instance (google.cloud.data_fusion_v1.types.Instance):
442-
The instance resource that replaces the
443-
resource on the server. Currently, Data Fusion
444-
only allows replacing labels, options, and stack
445-
driver settings. All other fields will be
446-
ignored.
471+
Required. The instance resource that replaces
472+
the resource on the server. Currently, Data
473+
Fusion only allows replacing labels, options,
474+
and stack driver settings. All other fields will
475+
be ignored.
447476
update_mask (google.protobuf.field_mask_pb2.FieldMask):
448477
Field mask is used to specify the fields that the update
449478
will overwrite in an instance resource. The fields specified
@@ -465,8 +494,8 @@ class RestartInstanceRequest(proto.Message):
465494
466495
Attributes:
467496
name (str):
468-
Name of the Data Fusion instance which need
469-
to be restarted in the form of
497+
Required. Name of the Data Fusion instance
498+
which need to be restarted in the form of
470499
projects/{project}/locations/{location}/instances/{instance}
471500
"""
472501

0 commit comments

Comments
 (0)