diff --git a/src/google/events/cloud/datastore/__init__.py b/src/google/events/cloud/datastore/__init__.py new file mode 100644 index 0000000..89030d9 --- /dev/null +++ b/src/google/events/cloud/datastore/__init__.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +from google.events.cloud.datastore import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from google.events.cloud.datastore_v1.types.data import ArrayValue +from google.events.cloud.datastore_v1.types.data import Entity +from google.events.cloud.datastore_v1.types.data import EntityEventData +from google.events.cloud.datastore_v1.types.data import EntityResult +from google.events.cloud.datastore_v1.types.data import Key +from google.events.cloud.datastore_v1.types.data import PartitionId +from google.events.cloud.datastore_v1.types.data import PropertyMask +from google.events.cloud.datastore_v1.types.data import Value + +__all__ = ('ArrayValue', + 'Entity', + 'EntityEventData', + 'EntityResult', + 'Key', + 'PartitionId', + 'PropertyMask', + 'Value', +) diff --git a/src/google/events/cloud/datastore/gapic_version.py b/src/google/events/cloud/datastore/gapic_version.py new file mode 100644 index 0000000..405b1ce --- /dev/null +++ b/src/google/events/cloud/datastore/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +__version__ = "0.1.0" # {x-release-please-version} diff --git a/src/google/events/cloud/datastore/py.typed b/src/google/events/cloud/datastore/py.typed new file mode 100644 index 0000000..a899442 --- /dev/null +++ b/src/google/events/cloud/datastore/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-events-cloud-datastore package uses inline types. diff --git a/src/google/events/cloud/datastore_v1/__init__.py b/src/google/events/cloud/datastore_v1/__init__.py new file mode 100644 index 0000000..8ceb7ec --- /dev/null +++ b/src/google/events/cloud/datastore_v1/__init__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +from google.events.cloud.datastore_v1 import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.data import ArrayValue +from .types.data import Entity +from .types.data import EntityEventData +from .types.data import EntityResult +from .types.data import Key +from .types.data import PartitionId +from .types.data import PropertyMask +from .types.data import Value + +__all__ = ( +'ArrayValue', +'Entity', +'EntityEventData', +'EntityResult', +'Key', +'PartitionId', +'PropertyMask', +'Value', +) diff --git a/src/google/events/cloud/datastore_v1/gapic_version.py b/src/google/events/cloud/datastore_v1/gapic_version.py new file mode 100644 index 0000000..405b1ce --- /dev/null +++ b/src/google/events/cloud/datastore_v1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +__version__ = "0.1.0" # {x-release-please-version} diff --git a/src/google/events/cloud/datastore_v1/py.typed b/src/google/events/cloud/datastore_v1/py.typed new file mode 100644 index 0000000..a899442 --- /dev/null +++ b/src/google/events/cloud/datastore_v1/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-events-cloud-datastore package uses inline types. diff --git a/src/google/events/cloud/datastore_v1/services/__init__.py b/src/google/events/cloud/datastore_v1/services/__init__.py new file mode 100644 index 0000000..e8e1c38 --- /dev/null +++ b/src/google/events/cloud/datastore_v1/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# diff --git a/src/google/events/cloud/datastore_v1/types/__init__.py b/src/google/events/cloud/datastore_v1/types/__init__.py new file mode 100644 index 0000000..10934d4 --- /dev/null +++ b/src/google/events/cloud/datastore_v1/types/__init__.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +from .data import ( + ArrayValue, + Entity, + EntityEventData, + EntityResult, + Key, + PartitionId, + PropertyMask, + Value, +) + +__all__ = ( + 'ArrayValue', + 'Entity', + 'EntityEventData', + 'EntityResult', + 'Key', + 'PartitionId', + 'PropertyMask', + 'Value', +) diff --git a/src/google/events/cloud/datastore_v1/types/data.py b/src/google/events/cloud/datastore_v1/types/data.py new file mode 100644 index 0000000..4132357 --- /dev/null +++ b/src/google/events/cloud/datastore_v1/types/data.py @@ -0,0 +1,528 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.protobuf import struct_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore +from google.type import latlng_pb2 # type: ignore + + +__protobuf__ = proto.module( + package='google.events.cloud.datastore.v1', + manifest={ + 'EntityEventData', + 'PropertyMask', + 'EntityResult', + 'PartitionId', + 'Key', + 'ArrayValue', + 'Value', + 'Entity', + }, +) + + +class EntityEventData(proto.Message): + r"""The data within all Firestore in Datastore Mode entity + events. + + Attributes: + value (google.events.cloud.datastore_v1.types.EntityResult): + An EntityResult object containing a + post-operation entity snapshot. This is not + populated for delete events. + old_value (google.events.cloud.datastore_v1.types.EntityResult): + An EntityResult object containing a + pre-operation entity snapshot. This is only + populated for update and delete events. + update_mask (google.events.cloud.datastore_v1.types.PropertyMask): + A PropertyMask object that lists changed + properties. This is only populated for update + events.. + """ + + value: 'EntityResult' = proto.Field( + proto.MESSAGE, + number=1, + message='EntityResult', + ) + old_value: 'EntityResult' = proto.Field( + proto.MESSAGE, + number=2, + message='EntityResult', + ) + update_mask: 'PropertyMask' = proto.Field( + proto.MESSAGE, + number=3, + message='PropertyMask', + ) + + +class PropertyMask(proto.Message): + r"""A set of property paths on an entity. + + Attributes: + property_paths (MutableSequence[str]): + The list of property paths in the mask. + This is not populated for delete events. + """ + + property_paths: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=1, + ) + + +class EntityResult(proto.Message): + r"""The result of fetching an entity from Datastore. + + Attributes: + entity (google.events.cloud.datastore_v1.types.Entity): + The resulting entity. + version (int): + The version of the entity, a strictly positive number that + monotonically increases with changes to the entity. + + This field is set for + [``FULL``][google.datastore.v1.EntityResult.ResultType.FULL] + entity results. + + For [missing][google.datastore.v1.LookupResponse.missing] + entities in ``LookupResponse``, this is the version of the + snapshot that was used to look up the entity, and it is + always set except for eventually consistent reads. + create_time (google.protobuf.timestamp_pb2.Timestamp): + The time at which the entity was created. This field is set + for + [``FULL``][google.datastore.v1.EntityResult.ResultType.FULL] + entity results. If this entity is missing, this field will + not be set. + update_time (google.protobuf.timestamp_pb2.Timestamp): + The time at which the entity was last changed. This field is + set for + [``FULL``][google.datastore.v1.EntityResult.ResultType.FULL] + entity results. If this entity is missing, this field will + not be set. + cursor (bytes): + A cursor that points to the position after the result + entity. Set only when the ``EntityResult`` is part of a + ``QueryResultBatch`` message. + """ + class ResultType(proto.Enum): + r"""Specifies what data the 'entity' field contains. A ``ResultType`` is + either implied (for example, in ``LookupResponse.missing`` from + ``datastore.proto``, it is always ``KEY_ONLY``) or specified by + context (for example, in message ``QueryResultBatch``, field + ``entity_result_type`` specifies a ``ResultType`` for all the values + in field ``entity_results``). + + Values: + RESULT_TYPE_UNSPECIFIED (0): + Unspecified. This value is never used. + FULL (1): + The key and properties. + PROJECTION (2): + A projected subset of properties. The entity + may have no key. + KEY_ONLY (3): + Only the key. + """ + RESULT_TYPE_UNSPECIFIED = 0 + FULL = 1 + PROJECTION = 2 + KEY_ONLY = 3 + + entity: 'Entity' = proto.Field( + proto.MESSAGE, + number=1, + message='Entity', + ) + version: int = proto.Field( + proto.INT64, + number=4, + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=6, + message=timestamp_pb2.Timestamp, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=5, + message=timestamp_pb2.Timestamp, + ) + cursor: bytes = proto.Field( + proto.BYTES, + number=3, + ) + + +class PartitionId(proto.Message): + r"""A partition ID identifies a grouping of entities. The grouping is + always by project and namespace, however the namespace ID may be + empty. + + A partition ID contains several dimensions: project ID and namespace + ID. + + Partition dimensions: + + - May be ``""``. + - Must be valid UTF-8 bytes. + - Must have values that match regex ``[A-Za-z\d\.\-_]{1,100}`` If + the value of any dimension matches regex ``__.*__``, the + partition is reserved/read-only. A reserved/read-only partition + ID is forbidden in certain documented contexts. + + Foreign partition IDs (in which the project ID does not match the + context project ID ) are discouraged. Reads and writes of foreign + partition IDs may fail if the project is not in an active state. + + Attributes: + project_id (str): + The ID of the project to which the entities + belong. + database_id (str): + If not empty, the ID of the database to which + the entities belong. + namespace_id (str): + If not empty, the ID of the namespace to + which the entities belong. + """ + + project_id: str = proto.Field( + proto.STRING, + number=2, + ) + database_id: str = proto.Field( + proto.STRING, + number=3, + ) + namespace_id: str = proto.Field( + proto.STRING, + number=4, + ) + + +class Key(proto.Message): + r"""A unique identifier for an entity. + If a key's partition ID or any of its path kinds or names are + reserved/read-only, the key is reserved/read-only. + A reserved/read-only key is forbidden in certain documented + contexts. + + Attributes: + partition_id (google.events.cloud.datastore_v1.types.PartitionId): + Entities are partitioned into subsets, + currently identified by a project ID and + namespace ID. Queries are scoped to a single + partition. + path (MutableSequence[google.events.cloud.datastore_v1.types.Key.PathElement]): + The entity path. An entity path consists of one or more + elements composed of a kind and a string or numerical + identifier, which identify entities. The first element + identifies a *root entity*, the second element identifies a + *child* of the root entity, the third element identifies a + child of the second entity, and so forth. The entities + identified by all prefixes of the path are called the + element's *ancestors*. + + An entity path is always fully complete: *all* of the + entity's ancestors are required to be in the path along with + the entity identifier itself. The only exception is that in + some documented cases, the identifier in the last path + element (for the entity) itself may be omitted. For example, + the last path element of the key of ``Mutation.insert`` may + have no identifier. + + A path can never be empty, and a path can have at most 100 + elements. + """ + + class PathElement(proto.Message): + r"""A (kind, ID/name) pair used to construct a key path. + If either name or ID is set, the element is complete. If neither + is set, the element is incomplete. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + kind (str): + The kind of the entity. + + A kind matching regex ``__.*__`` is reserved/read-only. A + kind must not contain more than 1500 bytes when UTF-8 + encoded. Cannot be ``""``. + + Must be valid UTF-8 bytes. Legacy values that are not valid + UTF-8 are encoded as ``__bytes__`` where ```` is the + base-64 encoding of the bytes. + id (int): + The auto-allocated ID of the entity. + Never equal to zero. Values less than zero are + discouraged and may not be supported in the + future. + + This field is a member of `oneof`_ ``id_type``. + name (str): + The name of the entity. + + A name matching regex ``__.*__`` is reserved/read-only. A + name must not be more than 1500 bytes when UTF-8 encoded. + Cannot be ``""``. + + Must be valid UTF-8 bytes. Legacy values that are not valid + UTF-8 are encoded as ``__bytes__`` where ```` is the + base-64 encoding of the bytes. + + This field is a member of `oneof`_ ``id_type``. + """ + + kind: str = proto.Field( + proto.STRING, + number=1, + ) + id: int = proto.Field( + proto.INT64, + number=2, + oneof='id_type', + ) + name: str = proto.Field( + proto.STRING, + number=3, + oneof='id_type', + ) + + partition_id: 'PartitionId' = proto.Field( + proto.MESSAGE, + number=1, + message='PartitionId', + ) + path: MutableSequence[PathElement] = proto.RepeatedField( + proto.MESSAGE, + number=2, + message=PathElement, + ) + + +class ArrayValue(proto.Message): + r"""An array value. + + Attributes: + values (MutableSequence[google.events.cloud.datastore_v1.types.Value]): + Values in the array. The order of values in an array is + preserved as long as all values have identical settings for + 'exclude_from_indexes'. + """ + + values: MutableSequence['Value'] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message='Value', + ) + + +class Value(proto.Message): + r"""A message that can hold any of the supported value types and + associated metadata. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + null_value (google.protobuf.struct_pb2.NullValue): + A null value. + + This field is a member of `oneof`_ ``value_type``. + boolean_value (bool): + A boolean value. + + This field is a member of `oneof`_ ``value_type``. + integer_value (int): + An integer value. + + This field is a member of `oneof`_ ``value_type``. + double_value (float): + A double value. + + This field is a member of `oneof`_ ``value_type``. + timestamp_value (google.protobuf.timestamp_pb2.Timestamp): + A timestamp value. + When stored in the Datastore, precise only to + microseconds; any additional precision is + rounded down. + + This field is a member of `oneof`_ ``value_type``. + key_value (google.events.cloud.datastore_v1.types.Key): + A key value. + + This field is a member of `oneof`_ ``value_type``. + string_value (str): + A UTF-8 encoded string value. When ``exclude_from_indexes`` + is false (it is indexed) , may have at most 1500 bytes. + Otherwise, may be set to at most 1,000,000 bytes. + + This field is a member of `oneof`_ ``value_type``. + blob_value (bytes): + A blob value. May have at most 1,000,000 bytes. When + ``exclude_from_indexes`` is false, may have at most 1500 + bytes. In JSON requests, must be base64-encoded. + + This field is a member of `oneof`_ ``value_type``. + geo_point_value (google.type.latlng_pb2.LatLng): + A geo point value representing a point on the + surface of Earth. + + This field is a member of `oneof`_ ``value_type``. + entity_value (google.events.cloud.datastore_v1.types.Entity): + An entity value. + - May have no key. + - May have a key with an incomplete key path. - + May have a reserved/read-only key. + + This field is a member of `oneof`_ ``value_type``. + array_value (google.events.cloud.datastore_v1.types.ArrayValue): + An array value. Cannot contain another array value. A + ``Value`` instance that sets field ``array_value`` must not + set fields ``meaning`` or ``exclude_from_indexes``. + + This field is a member of `oneof`_ ``value_type``. + meaning (int): + The ``meaning`` field should only be populated for backwards + compatibility. + exclude_from_indexes (bool): + If the value should be excluded from all + indexes including those defined explicitly. + """ + + null_value: struct_pb2.NullValue = proto.Field( + proto.ENUM, + number=11, + oneof='value_type', + enum=struct_pb2.NullValue, + ) + boolean_value: bool = proto.Field( + proto.BOOL, + number=1, + oneof='value_type', + ) + integer_value: int = proto.Field( + proto.INT64, + number=2, + oneof='value_type', + ) + double_value: float = proto.Field( + proto.DOUBLE, + number=3, + oneof='value_type', + ) + timestamp_value: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=10, + oneof='value_type', + message=timestamp_pb2.Timestamp, + ) + key_value: 'Key' = proto.Field( + proto.MESSAGE, + number=5, + oneof='value_type', + message='Key', + ) + string_value: str = proto.Field( + proto.STRING, + number=17, + oneof='value_type', + ) + blob_value: bytes = proto.Field( + proto.BYTES, + number=18, + oneof='value_type', + ) + geo_point_value: latlng_pb2.LatLng = proto.Field( + proto.MESSAGE, + number=8, + oneof='value_type', + message=latlng_pb2.LatLng, + ) + entity_value: 'Entity' = proto.Field( + proto.MESSAGE, + number=6, + oneof='value_type', + message='Entity', + ) + array_value: 'ArrayValue' = proto.Field( + proto.MESSAGE, + number=9, + oneof='value_type', + message='ArrayValue', + ) + meaning: int = proto.Field( + proto.INT32, + number=14, + ) + exclude_from_indexes: bool = proto.Field( + proto.BOOL, + number=19, + ) + + +class Entity(proto.Message): + r"""A Datastore data object. + Must not exceed 1 MiB - 4 bytes. + + Attributes: + key (google.events.cloud.datastore_v1.types.Key): + The entity's key. + + An entity must have a key, unless otherwise documented (for + example, an entity in ``Value.entity_value`` may have no + key). An entity's kind is its key path's last element's + kind, or null if it has no key. + properties (MutableMapping[str, google.events.cloud.datastore_v1.types.Value]): + The entity's properties. The map's keys are property names. + A property name matching regex ``__.*__`` is reserved. A + reserved property name is forbidden in certain documented + contexts. The map keys, represented as UTF-8, must not + exceed 1,500 bytes and cannot be empty. + """ + + key: 'Key' = proto.Field( + proto.MESSAGE, + number=1, + message='Key', + ) + properties: MutableMapping[str, 'Value'] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=3, + message='Value', + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/src/google/events/cloud/gkehub/__init__.py b/src/google/events/cloud/gkehub/__init__.py new file mode 100644 index 0000000..2fcd33c --- /dev/null +++ b/src/google/events/cloud/gkehub/__init__.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +from google.events.cloud.gkehub import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from google.events.cloud.gkehub_v1.types.data import ApplianceCluster +from google.events.cloud.gkehub_v1.types.data import Authority +from google.events.cloud.gkehub_v1.types.data import CommonFeatureState +from google.events.cloud.gkehub_v1.types.data import EdgeCluster +from google.events.cloud.gkehub_v1.types.data import Feature +from google.events.cloud.gkehub_v1.types.data import FeatureEventData +from google.events.cloud.gkehub_v1.types.data import FeatureResourceState +from google.events.cloud.gkehub_v1.types.data import FeatureState +from google.events.cloud.gkehub_v1.types.data import GkeCluster +from google.events.cloud.gkehub_v1.types.data import KubernetesMetadata +from google.events.cloud.gkehub_v1.types.data import KubernetesResource +from google.events.cloud.gkehub_v1.types.data import Membership +from google.events.cloud.gkehub_v1.types.data import MembershipBinding +from google.events.cloud.gkehub_v1.types.data import MembershipBindingEventData +from google.events.cloud.gkehub_v1.types.data import MembershipBindingLifecycleState +from google.events.cloud.gkehub_v1.types.data import MembershipEndpoint +from google.events.cloud.gkehub_v1.types.data import MembershipEventData +from google.events.cloud.gkehub_v1.types.data import MembershipFeatureSpec +from google.events.cloud.gkehub_v1.types.data import MembershipFeatureState +from google.events.cloud.gkehub_v1.types.data import MembershipState +from google.events.cloud.gkehub_v1.types.data import MultiCloudCluster +from google.events.cloud.gkehub_v1.types.data import OnPremCluster +from google.events.cloud.gkehub_v1.types.data import ResourceManifest +from google.events.cloud.gkehub_v1.types.data import ResourceOptions +from google.events.cloud.gkehub_v1.types.data import Scope +from google.events.cloud.gkehub_v1.types.data import ScopeEventData +from google.events.cloud.gkehub_v1.types.data import ScopeFeatureState +from google.events.cloud.gkehub_v1.types.data import ScopeLifecycleState + +__all__ = ('ApplianceCluster', + 'Authority', + 'CommonFeatureState', + 'EdgeCluster', + 'Feature', + 'FeatureEventData', + 'FeatureResourceState', + 'FeatureState', + 'GkeCluster', + 'KubernetesMetadata', + 'KubernetesResource', + 'Membership', + 'MembershipBinding', + 'MembershipBindingEventData', + 'MembershipBindingLifecycleState', + 'MembershipEndpoint', + 'MembershipEventData', + 'MembershipFeatureSpec', + 'MembershipFeatureState', + 'MembershipState', + 'MultiCloudCluster', + 'OnPremCluster', + 'ResourceManifest', + 'ResourceOptions', + 'Scope', + 'ScopeEventData', + 'ScopeFeatureState', + 'ScopeLifecycleState', +) diff --git a/src/google/events/cloud/gkehub/gapic_version.py b/src/google/events/cloud/gkehub/gapic_version.py new file mode 100644 index 0000000..405b1ce --- /dev/null +++ b/src/google/events/cloud/gkehub/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +__version__ = "0.1.0" # {x-release-please-version} diff --git a/src/google/events/cloud/gkehub/py.typed b/src/google/events/cloud/gkehub/py.typed new file mode 100644 index 0000000..732a316 --- /dev/null +++ b/src/google/events/cloud/gkehub/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-events-cloud-gkehub package uses inline types. diff --git a/src/google/events/cloud/gkehub_v1/__init__.py b/src/google/events/cloud/gkehub_v1/__init__.py new file mode 100644 index 0000000..afb7070 --- /dev/null +++ b/src/google/events/cloud/gkehub_v1/__init__.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +from google.events.cloud.gkehub_v1 import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.data import ApplianceCluster +from .types.data import Authority +from .types.data import CommonFeatureState +from .types.data import EdgeCluster +from .types.data import Feature +from .types.data import FeatureEventData +from .types.data import FeatureResourceState +from .types.data import FeatureState +from .types.data import GkeCluster +from .types.data import KubernetesMetadata +from .types.data import KubernetesResource +from .types.data import Membership +from .types.data import MembershipBinding +from .types.data import MembershipBindingEventData +from .types.data import MembershipBindingLifecycleState +from .types.data import MembershipEndpoint +from .types.data import MembershipEventData +from .types.data import MembershipFeatureSpec +from .types.data import MembershipFeatureState +from .types.data import MembershipState +from .types.data import MultiCloudCluster +from .types.data import OnPremCluster +from .types.data import ResourceManifest +from .types.data import ResourceOptions +from .types.data import Scope +from .types.data import ScopeEventData +from .types.data import ScopeFeatureState +from .types.data import ScopeLifecycleState + +__all__ = ( +'ApplianceCluster', +'Authority', +'CommonFeatureState', +'EdgeCluster', +'Feature', +'FeatureEventData', +'FeatureResourceState', +'FeatureState', +'GkeCluster', +'KubernetesMetadata', +'KubernetesResource', +'Membership', +'MembershipBinding', +'MembershipBindingEventData', +'MembershipBindingLifecycleState', +'MembershipEndpoint', +'MembershipEventData', +'MembershipFeatureSpec', +'MembershipFeatureState', +'MembershipState', +'MultiCloudCluster', +'OnPremCluster', +'ResourceManifest', +'ResourceOptions', +'Scope', +'ScopeEventData', +'ScopeFeatureState', +'ScopeLifecycleState', +) diff --git a/src/google/events/cloud/gkehub_v1/gapic_version.py b/src/google/events/cloud/gkehub_v1/gapic_version.py new file mode 100644 index 0000000..405b1ce --- /dev/null +++ b/src/google/events/cloud/gkehub_v1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +__version__ = "0.1.0" # {x-release-please-version} diff --git a/src/google/events/cloud/gkehub_v1/py.typed b/src/google/events/cloud/gkehub_v1/py.typed new file mode 100644 index 0000000..732a316 --- /dev/null +++ b/src/google/events/cloud/gkehub_v1/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-events-cloud-gkehub package uses inline types. diff --git a/src/google/events/cloud/gkehub_v1/services/__init__.py b/src/google/events/cloud/gkehub_v1/services/__init__.py new file mode 100644 index 0000000..e8e1c38 --- /dev/null +++ b/src/google/events/cloud/gkehub_v1/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# diff --git a/src/google/events/cloud/gkehub_v1/types/__init__.py b/src/google/events/cloud/gkehub_v1/types/__init__.py new file mode 100644 index 0000000..027c2ab --- /dev/null +++ b/src/google/events/cloud/gkehub_v1/types/__init__.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +from .data import ( + ApplianceCluster, + Authority, + CommonFeatureState, + EdgeCluster, + Feature, + FeatureEventData, + FeatureResourceState, + FeatureState, + GkeCluster, + KubernetesMetadata, + KubernetesResource, + Membership, + MembershipBinding, + MembershipBindingEventData, + MembershipBindingLifecycleState, + MembershipEndpoint, + MembershipEventData, + MembershipFeatureSpec, + MembershipFeatureState, + MembershipState, + MultiCloudCluster, + OnPremCluster, + ResourceManifest, + ResourceOptions, + Scope, + ScopeEventData, + ScopeFeatureState, + ScopeLifecycleState, +) + +__all__ = ( + 'ApplianceCluster', + 'Authority', + 'CommonFeatureState', + 'EdgeCluster', + 'Feature', + 'FeatureEventData', + 'FeatureResourceState', + 'FeatureState', + 'GkeCluster', + 'KubernetesMetadata', + 'KubernetesResource', + 'Membership', + 'MembershipBinding', + 'MembershipBindingEventData', + 'MembershipBindingLifecycleState', + 'MembershipEndpoint', + 'MembershipEventData', + 'MembershipFeatureSpec', + 'MembershipFeatureState', + 'MembershipState', + 'MultiCloudCluster', + 'OnPremCluster', + 'ResourceManifest', + 'ResourceOptions', + 'Scope', + 'ScopeEventData', + 'ScopeFeatureState', + 'ScopeLifecycleState', +) diff --git a/src/google/events/cloud/gkehub_v1/types/data.py b/src/google/events/cloud/gkehub_v1/types/data.py new file mode 100644 index 0000000..703480b --- /dev/null +++ b/src/google/events/cloud/gkehub_v1/types/data.py @@ -0,0 +1,1318 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.protobuf import timestamp_pb2 # type: ignore + + +__protobuf__ = proto.module( + package='google.events.cloud.gkehub.v1', + manifest={ + 'Feature', + 'FeatureResourceState', + 'FeatureState', + 'CommonFeatureState', + 'ScopeFeatureState', + 'MembershipFeatureSpec', + 'MembershipFeatureState', + 'Scope', + 'ScopeLifecycleState', + 'MembershipBinding', + 'MembershipBindingLifecycleState', + 'Membership', + 'MembershipEndpoint', + 'KubernetesResource', + 'ResourceOptions', + 'ResourceManifest', + 'GkeCluster', + 'OnPremCluster', + 'MultiCloudCluster', + 'EdgeCluster', + 'ApplianceCluster', + 'KubernetesMetadata', + 'MembershipState', + 'Authority', + 'ScopeEventData', + 'MembershipEventData', + 'FeatureEventData', + 'MembershipBindingEventData', + }, +) + + +class Feature(proto.Message): + r"""Feature represents the settings and status of any Hub + Feature. + + Attributes: + name (str): + Output only. The full, unique name of this Feature resource + in the format ``projects/*/locations/*/features/*``. + labels (MutableMapping[str, str]): + GCP labels for this Feature. + resource_state (google.events.cloud.gkehub_v1.types.FeatureResourceState): + Output only. State of the Feature resource + itself. + membership_specs (MutableMapping[str, google.events.cloud.gkehub_v1.types.MembershipFeatureSpec]): + Optional. Membership-specific configuration for this + Feature. If this Feature does not support any per-Membership + configuration, this field may be unused. + + The keys indicate which Membership the configuration is for, + in the form: + + ``projects/{p}/locations/{l}/memberships/{m}`` + + Where {p} is the project, {l} is a valid location and {m} is + a valid Membership in this project at that location. {p} + WILL match the Feature's project. + + {p} will always be returned as the project number, but the + project ID is also accepted during input. If the same + Membership is specified in the map twice (using the project + ID form, and the project number form), exactly ONE of the + entries will be saved, with no guarantees as to which. For + this reason, it is recommended the same format be used for + all entries when mutating a Feature. + state (google.events.cloud.gkehub_v1.types.CommonFeatureState): + Output only. The Hub-wide Feature state. + membership_states (MutableMapping[str, google.events.cloud.gkehub_v1.types.MembershipFeatureState]): + Output only. Membership-specific Feature status. If this + Feature does report any per-Membership status, this field + may be unused. + + The keys indicate which Membership the state is for, in the + form: + + ``projects/{p}/locations/{l}/memberships/{m}`` + + Where {p} is the project number, {l} is a valid location and + {m} is a valid Membership in this project at that location. + {p} MUST match the Feature's project number. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the Feature resource was + created. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the Feature resource was + last updated. + delete_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the Feature resource was + deleted. + scope_states (MutableMapping[str, google.events.cloud.gkehub_v1.types.ScopeFeatureState]): + Output only. Scope-specific Feature status. If this Feature + does report any per-Scope status, this field may be unused. + + The keys indicate which Scope the state is for, in the form: + + ``projects/{p}/locations/global/scopes/{s}`` + + Where {p} is the project, {s} is a valid Scope in this + project. {p} WILL match the Feature's project. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + labels: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=2, + ) + resource_state: 'FeatureResourceState' = proto.Field( + proto.MESSAGE, + number=3, + message='FeatureResourceState', + ) + membership_specs: MutableMapping[str, 'MembershipFeatureSpec'] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=5, + message='MembershipFeatureSpec', + ) + state: 'CommonFeatureState' = proto.Field( + proto.MESSAGE, + number=6, + message='CommonFeatureState', + ) + membership_states: MutableMapping[str, 'MembershipFeatureState'] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=7, + message='MembershipFeatureState', + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=8, + message=timestamp_pb2.Timestamp, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=9, + message=timestamp_pb2.Timestamp, + ) + delete_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=10, + message=timestamp_pb2.Timestamp, + ) + scope_states: MutableMapping[str, 'ScopeFeatureState'] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=13, + message='ScopeFeatureState', + ) + + +class FeatureResourceState(proto.Message): + r"""FeatureResourceState describes the state of a Feature *resource* in + the GkeHub API. See ``FeatureState`` for the "running state" of the + Feature in the Hub and across Memberships. + + Attributes: + state (google.events.cloud.gkehub_v1.types.FeatureResourceState.State): + The current state of the Feature resource in + the Hub API. + """ + class State(proto.Enum): + r"""State describes the lifecycle status of a Feature. + + Values: + STATE_UNSPECIFIED (0): + State is unknown or not set. + ENABLING (1): + The Feature is being enabled, and the Feature + resource is being created. Once complete, the + corresponding Feature will be enabled in this + Hub. + ACTIVE (2): + The Feature is enabled in this Hub, and the + Feature resource is fully available. + DISABLING (3): + The Feature is being disabled in this Hub, + and the Feature resource is being deleted. + UPDATING (4): + The Feature resource is being updated. + SERVICE_UPDATING (5): + The Feature resource is being updated by the + Hub Service. + """ + STATE_UNSPECIFIED = 0 + ENABLING = 1 + ACTIVE = 2 + DISABLING = 3 + UPDATING = 4 + SERVICE_UPDATING = 5 + + state: State = proto.Field( + proto.ENUM, + number=1, + enum=State, + ) + + +class FeatureState(proto.Message): + r"""FeatureState describes the high-level state of a Feature. It + may be used to describe a Feature's state at the environ-level, + or per-membershop, depending on the context. + + Attributes: + code (google.events.cloud.gkehub_v1.types.FeatureState.Code): + The high-level, machine-readable status of + this Feature. + description (str): + A human-readable description of the current + status. + update_time (google.protobuf.timestamp_pb2.Timestamp): + The time this status and any related + Feature-specific details were updated. + """ + class Code(proto.Enum): + r"""Code represents a machine-readable, high-level status of the + Feature. + + Values: + CODE_UNSPECIFIED (0): + Unknown or not set. + OK (1): + The Feature is operating normally. + WARNING (2): + The Feature has encountered an issue, and is + operating in a degraded state. The Feature may + need intervention to return to normal operation. + See the description and any associated + Feature-specific details for more information. + ERROR (3): + The Feature is not operating or is in a + severely degraded state. The Feature may need + intervention to return to normal operation. See + the description and any associated + Feature-specific details for more information. + """ + CODE_UNSPECIFIED = 0 + OK = 1 + WARNING = 2 + ERROR = 3 + + code: Code = proto.Field( + proto.ENUM, + number=1, + enum=Code, + ) + description: str = proto.Field( + proto.STRING, + number=2, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + + +class CommonFeatureState(proto.Message): + r"""CommonFeatureState contains Hub-wide Feature status + information. + + Attributes: + state (google.events.cloud.gkehub_v1.types.FeatureState): + Output only. The "running state" of the + Feature in this Hub. + """ + + state: 'FeatureState' = proto.Field( + proto.MESSAGE, + number=1, + message='FeatureState', + ) + + +class ScopeFeatureState(proto.Message): + r"""ScopeFeatureState contains Scope-wide Feature status + information. + + Attributes: + state (google.events.cloud.gkehub_v1.types.FeatureState): + Output only. The "running state" of the + Feature in this Scope. + """ + + state: 'FeatureState' = proto.Field( + proto.MESSAGE, + number=1, + message='FeatureState', + ) + + +class MembershipFeatureSpec(proto.Message): + r"""MembershipFeatureSpec contains configuration information for + a single Membership. + + Attributes: + fleet_inherited (bool): + True if value of ``feature_spec`` was inherited from a + fleet-level default. + """ + + fleet_inherited: bool = proto.Field( + proto.BOOL, + number=1, + ) + + +class MembershipFeatureState(proto.Message): + r"""MembershipFeatureState contains Feature status information + for a single Membership. + + Attributes: + state (google.events.cloud.gkehub_v1.types.FeatureState): + The high-level state of this Feature for a + single membership. + """ + + state: 'FeatureState' = proto.Field( + proto.MESSAGE, + number=1, + message='FeatureState', + ) + + +class Scope(proto.Message): + r"""Scope represents a Scope in a Fleet. + + Attributes: + name (str): + The resource name for the scope + ``projects/{project}/locations/{location}/scopes/{scope}`` + uid (str): + Output only. Google-generated UUID for this + resource. This is unique across all scope + resources. If a scope resource is deleted and + another resource with the same name is created, + it gets a different uid. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the scope was created. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the scope was last updated. + delete_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the scope was deleted. + state (google.events.cloud.gkehub_v1.types.ScopeLifecycleState): + Output only. State of the scope resource. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + uid: str = proto.Field( + proto.STRING, + number=2, + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=4, + message=timestamp_pb2.Timestamp, + ) + delete_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=5, + message=timestamp_pb2.Timestamp, + ) + state: 'ScopeLifecycleState' = proto.Field( + proto.MESSAGE, + number=6, + message='ScopeLifecycleState', + ) + + +class ScopeLifecycleState(proto.Message): + r"""ScopeLifecycleState describes the state of a Scope resource. + + Attributes: + code (google.events.cloud.gkehub_v1.types.ScopeLifecycleState.Code): + Output only. The current state of the scope + resource. + """ + class Code(proto.Enum): + r"""Code describes the state of a Scope resource. + + Values: + CODE_UNSPECIFIED (0): + The code is not set. + CREATING (1): + The scope is being created. + READY (2): + The scope active. + DELETING (3): + The scope is being deleted. + UPDATING (4): + The scope is being updated. + """ + CODE_UNSPECIFIED = 0 + CREATING = 1 + READY = 2 + DELETING = 3 + UPDATING = 4 + + code: Code = proto.Field( + proto.ENUM, + number=1, + enum=Code, + ) + + +class MembershipBinding(proto.Message): + r"""MembershipBinding is a subresource of a Membership, + representing what Fleet Scopes (or other, future Fleet + resources) a Membership is bound to. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + scope (str): + A Workspace resource name in the format + ``projects/*/locations/*/scopes/*``. + + This field is a member of `oneof`_ ``target``. + fleet (bool): + Whether the membershipbinding is Fleet-wide; + true means that this Membership should be bound + to all Namespaces in this entire Fleet. + + This field is a member of `oneof`_ ``target``. + name (str): + The resource name for the membershipbinding itself + ``projects/{project}/locations/{location}/memberships/{membership}/bindings/{membershipbinding}`` + uid (str): + Output only. Google-generated UUID for this + resource. This is unique across all + membershipbinding resources. If a + membershipbinding resource is deleted and + another resource with the same name is created, + it gets a different uid. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the membership binding was + created. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the membership binding was + last updated. + delete_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the membership binding was + deleted. + state (google.events.cloud.gkehub_v1.types.MembershipBindingLifecycleState): + Output only. State of the membership binding + resource. + """ + + scope: str = proto.Field( + proto.STRING, + number=3, + oneof='target', + ) + fleet: bool = proto.Field( + proto.BOOL, + number=4, + oneof='target', + ) + name: str = proto.Field( + proto.STRING, + number=1, + ) + uid: str = proto.Field( + proto.STRING, + number=2, + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=5, + message=timestamp_pb2.Timestamp, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=6, + message=timestamp_pb2.Timestamp, + ) + delete_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=7, + message=timestamp_pb2.Timestamp, + ) + state: 'MembershipBindingLifecycleState' = proto.Field( + proto.MESSAGE, + number=8, + message='MembershipBindingLifecycleState', + ) + + +class MembershipBindingLifecycleState(proto.Message): + r"""MembershipBindingLifecycleState describes the state of a + Binding resource. + + Attributes: + code (google.events.cloud.gkehub_v1.types.MembershipBindingLifecycleState.Code): + Output only. The current state of the + MembershipBinding resource. + """ + class Code(proto.Enum): + r"""Code describes the state of a MembershipBinding resource. + + Values: + CODE_UNSPECIFIED (0): + The code is not set. + CREATING (1): + The membershipbinding is being created. + READY (2): + The membershipbinding active. + DELETING (3): + The membershipbinding is being deleted. + UPDATING (4): + The membershipbinding is being updated. + """ + CODE_UNSPECIFIED = 0 + CREATING = 1 + READY = 2 + DELETING = 3 + UPDATING = 4 + + code: Code = proto.Field( + proto.ENUM, + number=1, + enum=Code, + ) + + +class Membership(proto.Message): + r"""Membership contains information about a member cluster. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + endpoint (google.events.cloud.gkehub_v1.types.MembershipEndpoint): + Optional. Endpoint information to reach this + member. + + This field is a member of `oneof`_ ``type``. + name (str): + Output only. The full, unique name of this Membership + resource in the format + ``projects/*/locations/*/memberships/{membership_id}``, set + during creation. + + ``membership_id`` must be a valid RFC 1123 compliant DNS + label: + + 1. At most 63 characters in length + 2. It must consist of lower case alphanumeric characters or + ``-`` + 3. It must start and end with an alphanumeric character + + Which can be expressed as the regex: + ``[a-z0-9]([-a-z0-9]*[a-z0-9])?``, with a maximum length of + 63 characters. + labels (MutableMapping[str, str]): + Optional. GCP labels for this membership. + description (str): + Output only. Description of this membership, limited to 63 + characters. Must match the regex: + ``[a-zA-Z0-9][a-zA-Z0-9_\-\.\ ]*`` + + This field is present for legacy purposes. + state (google.events.cloud.gkehub_v1.types.MembershipState): + Output only. State of the Membership + resource. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the Membership was created. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the Membership was last + updated. + delete_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the Membership was deleted. + external_id (str): + Optional. An externally-generated and managed ID for this + Membership. This ID may be modified after creation, but this + is not recommended. + + The ID must match the regex: + ``[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`` + + If this Membership represents a Kubernetes cluster, this + value should be set to the UID of the ``kube-system`` + namespace object. + last_connection_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. For clusters using Connect, the + timestamp of the most recent connection + established with Google Cloud. This time is + updated every several minutes, not continuously. + For clusters that do not use GKE Connect, or + that have never connected successfully, this + field will be unset. + unique_id (str): + Output only. Google-generated UUID for this resource. This + is unique across all Membership resources. If a Membership + resource is deleted and another resource with the same name + is created, it gets a different unique_id. + authority (google.events.cloud.gkehub_v1.types.Authority): + Optional. How to identify workloads from this + Membership. See the documentation on Workload + Identity for more details: + https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity + """ + + endpoint: 'MembershipEndpoint' = proto.Field( + proto.MESSAGE, + number=4, + oneof='type', + message='MembershipEndpoint', + ) + name: str = proto.Field( + proto.STRING, + number=1, + ) + labels: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=2, + ) + description: str = proto.Field( + proto.STRING, + number=3, + ) + state: 'MembershipState' = proto.Field( + proto.MESSAGE, + number=5, + message='MembershipState', + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=6, + message=timestamp_pb2.Timestamp, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=7, + message=timestamp_pb2.Timestamp, + ) + delete_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=8, + message=timestamp_pb2.Timestamp, + ) + external_id: str = proto.Field( + proto.STRING, + number=9, + ) + last_connection_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=10, + message=timestamp_pb2.Timestamp, + ) + unique_id: str = proto.Field( + proto.STRING, + number=11, + ) + authority: 'Authority' = proto.Field( + proto.MESSAGE, + number=12, + message='Authority', + ) + + +class MembershipEndpoint(proto.Message): + r"""MembershipEndpoint contains information needed to contact a + Kubernetes API, endpoint and any additional Kubernetes metadata. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + gke_cluster (google.events.cloud.gkehub_v1.types.GkeCluster): + Optional. Specific information for a + GKE-on-GCP cluster. + + This field is a member of `oneof`_ ``type``. + on_prem_cluster (google.events.cloud.gkehub_v1.types.OnPremCluster): + Optional. Specific information for a GKE + On-Prem cluster. An onprem user-cluster who has + no resourceLink is not allowed to use this + field, it should have a nil "type" instead. + + This field is a member of `oneof`_ ``type``. + multi_cloud_cluster (google.events.cloud.gkehub_v1.types.MultiCloudCluster): + Optional. Specific information for a GKE + Multi-Cloud cluster. + + This field is a member of `oneof`_ ``type``. + edge_cluster (google.events.cloud.gkehub_v1.types.EdgeCluster): + Optional. Specific information for a Google + Edge cluster. + + This field is a member of `oneof`_ ``type``. + appliance_cluster (google.events.cloud.gkehub_v1.types.ApplianceCluster): + Optional. Specific information for a GDC Edge + Appliance cluster. + + This field is a member of `oneof`_ ``type``. + kubernetes_metadata (google.events.cloud.gkehub_v1.types.KubernetesMetadata): + Output only. Useful Kubernetes-specific + metadata. + kubernetes_resource (google.events.cloud.gkehub_v1.types.KubernetesResource): + Optional. The in-cluster Kubernetes Resources that should be + applied for a correctly registered cluster, in the steady + state. These resources: + + - Ensure that the cluster is exclusively registered to one + and only one Hub Membership. + - Propagate Workload Pool Information available in the + Membership Authority field. + - Ensure proper initial configuration of default Hub + Features. + google_managed (bool): + Output only. Whether the lifecycle of this + membership is managed by a google cluster + platform service. + """ + + gke_cluster: 'GkeCluster' = proto.Field( + proto.MESSAGE, + number=1, + oneof='type', + message='GkeCluster', + ) + on_prem_cluster: 'OnPremCluster' = proto.Field( + proto.MESSAGE, + number=4, + oneof='type', + message='OnPremCluster', + ) + multi_cloud_cluster: 'MultiCloudCluster' = proto.Field( + proto.MESSAGE, + number=5, + oneof='type', + message='MultiCloudCluster', + ) + edge_cluster: 'EdgeCluster' = proto.Field( + proto.MESSAGE, + number=6, + oneof='type', + message='EdgeCluster', + ) + appliance_cluster: 'ApplianceCluster' = proto.Field( + proto.MESSAGE, + number=7, + oneof='type', + message='ApplianceCluster', + ) + kubernetes_metadata: 'KubernetesMetadata' = proto.Field( + proto.MESSAGE, + number=2, + message='KubernetesMetadata', + ) + kubernetes_resource: 'KubernetesResource' = proto.Field( + proto.MESSAGE, + number=3, + message='KubernetesResource', + ) + google_managed: bool = proto.Field( + proto.BOOL, + number=8, + ) + + +class KubernetesResource(proto.Message): + r"""KubernetesResource contains the YAML manifests and + configuration for Membership Kubernetes resources in the + cluster. After CreateMembership or UpdateMembership, these + resources should be re-applied in the cluster. + + Attributes: + membership_resources (MutableSequence[google.events.cloud.gkehub_v1.types.ResourceManifest]): + Output only. Additional Kubernetes resources + that need to be applied to the cluster after + Membership creation, and after every update. + This field is only populated in the Membership + returned from a successful long-running + operation from CreateMembership or + UpdateMembership. It is not populated during + normal GetMembership or ListMemberships + requests. To get the resource manifest after the + initial registration, the caller should make a + UpdateMembership call with an empty field mask. + connect_resources (MutableSequence[google.events.cloud.gkehub_v1.types.ResourceManifest]): + Output only. The Kubernetes resources for + installing the GKE Connect agent + This field is only populated in the Membership + returned from a successful long-running + operation from CreateMembership or + UpdateMembership. It is not populated during + normal GetMembership or ListMemberships + requests. To get the resource manifest after the + initial registration, the caller should make a + UpdateMembership call with an empty field mask. + resource_options (google.events.cloud.gkehub_v1.types.ResourceOptions): + Optional. Options for Kubernetes resource + generation. + """ + + membership_resources: MutableSequence['ResourceManifest'] = proto.RepeatedField( + proto.MESSAGE, + number=2, + message='ResourceManifest', + ) + connect_resources: MutableSequence['ResourceManifest'] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message='ResourceManifest', + ) + resource_options: 'ResourceOptions' = proto.Field( + proto.MESSAGE, + number=4, + message='ResourceOptions', + ) + + +class ResourceOptions(proto.Message): + r"""ResourceOptions represent options for Kubernetes resource + generation. + + Attributes: + connect_version (str): + Optional. The Connect agent version to use for + connect_resources. Defaults to the latest GKE Connect + version. The version must be a currently supported version, + obsolete versions will be rejected. + v1beta1_crd (bool): + Optional. Use ``apiextensions/v1beta1`` instead of + ``apiextensions/v1`` for CustomResourceDefinition resources. + This option should be set for clusters with Kubernetes + apiserver versions <1.16. + k8s_version (str): + Optional. Major version of the Kubernetes cluster. This is + only used to determine which version to use for the + CustomResourceDefinition resources, + ``apiextensions/v1beta1`` or\ ``apiextensions/v1``. + """ + + connect_version: str = proto.Field( + proto.STRING, + number=1, + ) + v1beta1_crd: bool = proto.Field( + proto.BOOL, + number=2, + ) + k8s_version: str = proto.Field( + proto.STRING, + number=3, + ) + + +class ResourceManifest(proto.Message): + r"""ResourceManifest represents a single Kubernetes resource to + be applied to the cluster. + + Attributes: + manifest (str): + YAML manifest of the resource. + cluster_scoped (bool): + Whether the resource provided in the manifest is + ``cluster_scoped``. If unset, the manifest is assumed to be + namespace scoped. + + This field is used for REST mapping when applying the + resource in a cluster. + """ + + manifest: str = proto.Field( + proto.STRING, + number=1, + ) + cluster_scoped: bool = proto.Field( + proto.BOOL, + number=2, + ) + + +class GkeCluster(proto.Message): + r"""GkeCluster contains information specific to GKE clusters. + + Attributes: + resource_link (str): + Immutable. Self-link of the GCP resource for + the GKE cluster. For example: + //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster + Zonal clusters are also supported. + cluster_missing (bool): + Output only. If cluster_missing is set then it denotes that + the GKE cluster no longer exists in the GKE Control Plane. + """ + + resource_link: str = proto.Field( + proto.STRING, + number=1, + ) + cluster_missing: bool = proto.Field( + proto.BOOL, + number=2, + ) + + +class OnPremCluster(proto.Message): + r"""OnPremCluster contains information specific to GKE On-Prem + clusters. + + Attributes: + resource_link (str): + Immutable. Self-link of the GCP resource for + the GKE On-Prem cluster. For example: + + //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/vmwareClusters/my-cluster + //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/bareMetalClusters/my-cluster + cluster_missing (bool): + Output only. If cluster_missing is set then it denotes that + API(gkeonprem.googleapis.com) resource for this GKE On-Prem + cluster no longer exists. + admin_cluster (bool): + Immutable. Whether the cluster is an admin + cluster. + cluster_type (google.events.cloud.gkehub_v1.types.OnPremCluster.ClusterType): + Immutable. The on prem cluster's type. + """ + class ClusterType(proto.Enum): + r"""ClusterType describes on prem cluster's type. + + Values: + CLUSTERTYPE_UNSPECIFIED (0): + The ClusterType is not set. + BOOTSTRAP (1): + The ClusterType is bootstrap cluster. + HYBRID (2): + The ClusterType is baremetal hybrid cluster. + STANDALONE (3): + The ClusterType is baremetal standalone + cluster. + USER (4): + The ClusterType is user cluster. + """ + CLUSTERTYPE_UNSPECIFIED = 0 + BOOTSTRAP = 1 + HYBRID = 2 + STANDALONE = 3 + USER = 4 + + resource_link: str = proto.Field( + proto.STRING, + number=1, + ) + cluster_missing: bool = proto.Field( + proto.BOOL, + number=2, + ) + admin_cluster: bool = proto.Field( + proto.BOOL, + number=3, + ) + cluster_type: ClusterType = proto.Field( + proto.ENUM, + number=4, + enum=ClusterType, + ) + + +class MultiCloudCluster(proto.Message): + r"""MultiCloudCluster contains information specific to GKE + Multi-Cloud clusters. + + Attributes: + resource_link (str): + Immutable. Self-link of the GCP resource for + the GKE Multi-Cloud cluster. For example: + + //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/awsClusters/my-cluster + //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/azureClusters/my-cluster + //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/attachedClusters/my-cluster + cluster_missing (bool): + Output only. If cluster_missing is set then it denotes that + API(gkemulticloud.googleapis.com) resource for this GKE + Multi-Cloud cluster no longer exists. + """ + + resource_link: str = proto.Field( + proto.STRING, + number=1, + ) + cluster_missing: bool = proto.Field( + proto.BOOL, + number=2, + ) + + +class EdgeCluster(proto.Message): + r"""EdgeCluster contains information specific to Google Edge + Clusters. + + Attributes: + resource_link (str): + Immutable. Self-link of the GCP resource for + the Edge Cluster. For example: + + //edgecontainer.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster + """ + + resource_link: str = proto.Field( + proto.STRING, + number=1, + ) + + +class ApplianceCluster(proto.Message): + r"""ApplianceCluster contains information specific to GDC Edge + Appliance Clusters. + + Attributes: + resource_link (str): + Immutable. Self-link of the GCP resource for + the Appliance Cluster. For example: + + //transferappliance.googleapis.com/projects/my-project/locations/us-west1-a/appliances/my-appliance + """ + + resource_link: str = proto.Field( + proto.STRING, + number=1, + ) + + +class KubernetesMetadata(proto.Message): + r"""KubernetesMetadata provides informational metadata for + Memberships representing Kubernetes clusters. + + Attributes: + kubernetes_api_server_version (str): + Output only. Kubernetes API server version string as + reported by ``/version``. + node_provider_id (str): + Output only. Node providerID as reported by the first node + in the list of nodes on the Kubernetes endpoint. On + Kubernetes platforms that support zero-node clusters (like + GKE-on-GCP), the node_count will be zero and the + node_provider_id will be empty. + node_count (int): + Output only. Node count as reported by + Kubernetes nodes resources. + vcpu_count (int): + Output only. vCPU count as reported by + Kubernetes nodes resources. + memory_mb (int): + Output only. The total memory capacity as + reported by the sum of all Kubernetes nodes + resources, defined in MB. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. The time at which these details were last + updated. This update_time is different from the + Membership-level update_time since EndpointDetails are + updated internally for API consumers. + """ + + kubernetes_api_server_version: str = proto.Field( + proto.STRING, + number=1, + ) + node_provider_id: str = proto.Field( + proto.STRING, + number=2, + ) + node_count: int = proto.Field( + proto.INT32, + number=3, + ) + vcpu_count: int = proto.Field( + proto.INT32, + number=4, + ) + memory_mb: int = proto.Field( + proto.INT32, + number=5, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=100, + message=timestamp_pb2.Timestamp, + ) + + +class MembershipState(proto.Message): + r"""MembershipState describes the state of a Membership resource. + + Attributes: + code (google.events.cloud.gkehub_v1.types.MembershipState.Code): + Output only. The current state of the + Membership resource. + """ + class Code(proto.Enum): + r"""Code describes the state of a Membership resource. + + Values: + CODE_UNSPECIFIED (0): + The code is not set. + CREATING (1): + The cluster is being registered. + READY (2): + The cluster is registered. + DELETING (3): + The cluster is being unregistered. + UPDATING (4): + The Membership is being updated. + SERVICE_UPDATING (5): + The Membership is being updated by the Hub + Service. + """ + CODE_UNSPECIFIED = 0 + CREATING = 1 + READY = 2 + DELETING = 3 + UPDATING = 4 + SERVICE_UPDATING = 5 + + code: Code = proto.Field( + proto.ENUM, + number=1, + enum=Code, + ) + + +class Authority(proto.Message): + r"""Authority encodes how Google will recognize identities from + this Membership. See the workload identity documentation for + more details: + https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity + + Attributes: + issuer (str): + Optional. A JSON Web Token (JWT) issuer URI. ``issuer`` must + start with ``https://`` and be a valid URL with length <2000 + characters. + + If set, then Google will allow valid OIDC tokens from this + issuer to authenticate within the workload_identity_pool. + OIDC discovery will be performed on this URI to validate + tokens from the issuer. + + Clearing ``issuer`` disables Workload Identity. ``issuer`` + cannot be directly modified; it must be cleared (and + Workload Identity disabled) before using a new issuer (and + re-enabling Workload Identity). + workload_identity_pool (str): + Output only. The name of the workload identity pool in which + ``issuer`` will be recognized. + + There is a single Workload Identity Pool per Hub that is + shared between all Memberships that belong to that Hub. For + a Hub hosted in {PROJECT_ID}, the workload pool format is + ``{PROJECT_ID}.hub.id.goog``, although this is subject to + change in newer versions of this API. + identity_provider (str): + Output only. An identity provider that reflects the + ``issuer`` in the workload identity pool. + oidc_jwks (bytes): + Optional. OIDC verification keys for this Membership in JWKS + format (RFC 7517). + + When this field is set, OIDC discovery will NOT be performed + on ``issuer``, and instead OIDC tokens will be validated + using this field. + """ + + issuer: str = proto.Field( + proto.STRING, + number=1, + ) + workload_identity_pool: str = proto.Field( + proto.STRING, + number=2, + ) + identity_provider: str = proto.Field( + proto.STRING, + number=3, + ) + oidc_jwks: bytes = proto.Field( + proto.BYTES, + number=4, + ) + + +class ScopeEventData(proto.Message): + r"""The data within all Scope events. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + payload (google.events.cloud.gkehub_v1.types.Scope): + Optional. The Scope event payload. Unset for + deletion events. + + This field is a member of `oneof`_ ``_payload``. + """ + + payload: 'Scope' = proto.Field( + proto.MESSAGE, + number=1, + optional=True, + message='Scope', + ) + + +class MembershipEventData(proto.Message): + r"""The data within all Membership events. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + payload (google.events.cloud.gkehub_v1.types.Membership): + Optional. The Membership event payload. Unset + for deletion events. + + This field is a member of `oneof`_ ``_payload``. + """ + + payload: 'Membership' = proto.Field( + proto.MESSAGE, + number=1, + optional=True, + message='Membership', + ) + + +class FeatureEventData(proto.Message): + r"""The data within all Feature events. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + payload (google.events.cloud.gkehub_v1.types.Feature): + Optional. The Feature event payload. Unset + for deletion events. + + This field is a member of `oneof`_ ``_payload``. + """ + + payload: 'Feature' = proto.Field( + proto.MESSAGE, + number=1, + optional=True, + message='Feature', + ) + + +class MembershipBindingEventData(proto.Message): + r"""The data within all MembershipBinding events. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + payload (google.events.cloud.gkehub_v1.types.MembershipBinding): + Optional. The MembershipBinding event + payload. Unset for deletion events. + + This field is a member of `oneof`_ ``_payload``. + """ + + payload: 'MembershipBinding' = proto.Field( + proto.MESSAGE, + number=1, + optional=True, + message='MembershipBinding', + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/src/google/events/cloud/networkconnectivity_v1/types/data.py b/src/google/events/cloud/networkconnectivity_v1/types/data.py index 1e84bbd..a68d0d5 100644 --- a/src/google/events/cloud/networkconnectivity_v1/types/data.py +++ b/src/google/events/cloud/networkconnectivity_v1/types/data.py @@ -190,7 +190,29 @@ class ConsumerPscConfig(proto.Message): This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + state (google.events.cloud.networkconnectivity_v1.types.ServiceConnectionMap.ConsumerPscConfig.State): + Output only. Overall state of PSC Connections + management for this consumer psc config. """ + class State(proto.Enum): + r"""PSC Consumer Config State. + + Values: + STATE_UNSPECIFIED (0): + Default state, when Connection Map is created + initially. + VALID (1): + Set when policy and map configuration is + valid, and their matching can lead to allowing + creation of PSC Connections subject to other + constraints like connections limit. + CONNECTION_POLICY_MISSING (2): + No Service Connection Policy found for this + network and Service Class + """ + STATE_UNSPECIFIED = 0 + VALID = 1 + CONNECTION_POLICY_MISSING = 2 project: str = proto.Field( proto.STRING, @@ -204,6 +226,11 @@ class ConsumerPscConfig(proto.Message): proto.BOOL, number=3, ) + state: 'ServiceConnectionMap.ConsumerPscConfig.State' = proto.Field( + proto.ENUM, + number=4, + enum='ServiceConnectionMap.ConsumerPscConfig.State', + ) class ConsumerPscConnection(proto.Message): r"""PSC connection details on consumer side. @@ -440,14 +467,19 @@ class PscConfig(proto.Message): r"""Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: subnetworks (MutableSequence[str]): The resource paths of subnetworks to use for IP address management. Example: projects/{projectNumOrId}/regions/{region}/subnetworks/{resourceId}. limit (int): - Max number of PSC connections for this - policy. + Optional. Max number of PSC connections for + this policy. + + This field is a member of `oneof`_ ``_limit``. """ subnetworks: MutableSequence[str] = proto.RepeatedField( @@ -457,6 +489,7 @@ class PscConfig(proto.Message): limit: int = proto.Field( proto.INT64, number=2, + optional=True, ) class PscConnection(proto.Message):