From 650c29190fff3e1053328cf38a9a61920dafbc49 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 14:29:31 -0500 Subject: [PATCH 1/2] docs: Add documentation for enums (#244) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: Add documentation for enums fix: Add context manager return types chore: Update gapic-generator-python to v1.8.1 PiperOrigin-RevId: 503210727 Source-Link: https://github.com/googleapis/googleapis/commit/a391fd1dac18dfdfa00c18c8404f2c3a6ff8e98e Source-Link: https://github.com/googleapis/googleapis-gen/commit/0080f830dec37c3384157082bce279e37079ea58 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9 * 🦉 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 --- .../redis_v1/services/cloud_redis/client.py | 2 +- google/cloud/redis_v1/types/cloud_redis.py | 116 +++++++++++++- .../services/cloud_redis/client.py | 2 +- .../cloud/redis_v1beta1/types/cloud_redis.py | 143 +++++++++++++++++- ...nippet_metadata_google.cloud.redis.v1.json | 2 +- ...t_metadata_google.cloud.redis.v1beta1.json | 2 +- 6 files changed, 249 insertions(+), 18 deletions(-) diff --git a/google/cloud/redis_v1/services/cloud_redis/client.py b/google/cloud/redis_v1/services/cloud_redis/client.py index 4079fed..6c7f897 100644 --- a/google/cloud/redis_v1/services/cloud_redis/client.py +++ b/google/cloud/redis_v1/services/cloud_redis/client.py @@ -1916,7 +1916,7 @@ def sample_reschedule_maintenance(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "CloudRedisClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/redis_v1/types/cloud_redis.py b/google/cloud/redis_v1/types/cloud_redis.py index fda727b..416fe6f 100644 --- a/google/cloud/redis_v1/types/cloud_redis.py +++ b/google/cloud/redis_v1/types/cloud_redis.py @@ -247,7 +247,36 @@ class Instance(proto.Message): """ class State(proto.Enum): - r"""Represents the different states of a Redis instance.""" + r"""Represents the different states of a Redis instance. + + Values: + STATE_UNSPECIFIED (0): + Not set. + CREATING (1): + Redis instance is being created. + READY (2): + Redis instance has been created and is fully + usable. + UPDATING (3): + Redis instance configuration is being + updated. Certain kinds of updates may cause the + instance to become unusable while the update is + in progress. + DELETING (4): + Redis instance is being deleted. + REPAIRING (5): + Redis instance is being repaired and may be + unusable. + MAINTENANCE (6): + Maintenance is being performed on this Redis + instance. + IMPORTING (8): + Redis instance is importing data + (availability may be affected). + FAILING_OVER (9): + Redis instance is failing over (availability + may be affected). + """ STATE_UNSPECIFIED = 0 CREATING = 1 READY = 2 @@ -259,25 +288,71 @@ class State(proto.Enum): FAILING_OVER = 9 class Tier(proto.Enum): - r"""Available service tiers to choose from""" + r"""Available service tiers to choose from + + Values: + TIER_UNSPECIFIED (0): + Not set. + BASIC (1): + BASIC tier: standalone instance + STANDARD_HA (3): + STANDARD_HA tier: highly available primary/replica instances + """ TIER_UNSPECIFIED = 0 BASIC = 1 STANDARD_HA = 3 class ConnectMode(proto.Enum): - r"""Available connection modes.""" + r"""Available connection modes. + + Values: + CONNECT_MODE_UNSPECIFIED (0): + Not set. + DIRECT_PEERING (1): + Connect via direct peering to the Memorystore + for Redis hosted service. + PRIVATE_SERVICE_ACCESS (2): + Connect your Memorystore for Redis instance + using Private Service Access. Private services + access provides an IP address range for multiple + Google Cloud services, including Memorystore. + """ CONNECT_MODE_UNSPECIFIED = 0 DIRECT_PEERING = 1 PRIVATE_SERVICE_ACCESS = 2 class TransitEncryptionMode(proto.Enum): - r"""Available TLS modes.""" + r"""Available TLS modes. + + Values: + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED (0): + Not set. + SERVER_AUTHENTICATION (1): + Client to Server traffic encryption enabled + with server authentication. + DISABLED (2): + TLS is disabled for the instance. + """ TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0 SERVER_AUTHENTICATION = 1 DISABLED = 2 class ReadReplicasMode(proto.Enum): - r"""Read replicas mode.""" + r"""Read replicas mode. + + Values: + READ_REPLICAS_MODE_UNSPECIFIED (0): + If not set, Memorystore Redis backend will default to + READ_REPLICAS_DISABLED. + READ_REPLICAS_DISABLED (1): + If disabled, read endpoint will not be + provided and the instance cannot scale up or + down the number of replicas. + READ_REPLICAS_ENABLED (2): + If enabled, read endpoint will be provided + and the instance can scale up and down the + number of replicas. Not valid for basic tier. + """ READ_REPLICAS_MODE_UNSPECIFIED = 0 READ_REPLICAS_DISABLED = 1 READ_REPLICAS_ENABLED = 2 @@ -435,7 +510,22 @@ class RescheduleMaintenanceRequest(proto.Message): """ class RescheduleType(proto.Enum): - r"""Reschedule options.""" + r"""Reschedule options. + + Values: + RESCHEDULE_TYPE_UNSPECIFIED (0): + Not set. + IMMEDIATE (1): + If the user wants to schedule the maintenance + to happen now. + NEXT_AVAILABLE_WINDOW (2): + If the user wants to use the existing + maintenance policy to find the next available + window. + SPECIFIC_TIME (3): + If the user wants to reschedule the + maintenance to a specific time. + """ RESCHEDULE_TYPE_UNSPECIFIED = 0 IMMEDIATE = 1 NEXT_AVAILABLE_WINDOW = 2 @@ -956,6 +1046,20 @@ class FailoverInstanceRequest(proto.Message): class DataProtectionMode(proto.Enum): r"""Specifies different modes of operation in relation to the data retention. + + Values: + DATA_PROTECTION_MODE_UNSPECIFIED (0): + Defaults to LIMITED_DATA_LOSS if a data protection mode is + not specified. + LIMITED_DATA_LOSS (1): + Instance failover will be protected with data + loss control. More specifically, the failover + will only be performed if the current + replication offset diff between primary and + replica is under a certain threshold. + FORCE_DATA_LOSS (2): + Instance failover will be performed without + data loss control. """ DATA_PROTECTION_MODE_UNSPECIFIED = 0 LIMITED_DATA_LOSS = 1 diff --git a/google/cloud/redis_v1beta1/services/cloud_redis/client.py b/google/cloud/redis_v1beta1/services/cloud_redis/client.py index 5e71cb5..fd099a1 100644 --- a/google/cloud/redis_v1beta1/services/cloud_redis/client.py +++ b/google/cloud/redis_v1beta1/services/cloud_redis/client.py @@ -1917,7 +1917,7 @@ def sample_reschedule_maintenance(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "CloudRedisClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/redis_v1beta1/types/cloud_redis.py b/google/cloud/redis_v1beta1/types/cloud_redis.py index b5cb409..baef2d7 100644 --- a/google/cloud/redis_v1beta1/types/cloud_redis.py +++ b/google/cloud/redis_v1beta1/types/cloud_redis.py @@ -250,7 +250,36 @@ class Instance(proto.Message): """ class State(proto.Enum): - r"""Represents the different states of a Redis instance.""" + r"""Represents the different states of a Redis instance. + + Values: + STATE_UNSPECIFIED (0): + Not set. + CREATING (1): + Redis instance is being created. + READY (2): + Redis instance has been created and is fully + usable. + UPDATING (3): + Redis instance configuration is being + updated. Certain kinds of updates may cause the + instance to become unusable while the update is + in progress. + DELETING (4): + Redis instance is being deleted. + REPAIRING (5): + Redis instance is being repaired and may be + unusable. + MAINTENANCE (6): + Maintenance is being performed on this Redis + instance. + IMPORTING (8): + Redis instance is importing data + (availability may be affected). + FAILING_OVER (10): + Redis instance is failing over (availability + may be affected). + """ STATE_UNSPECIFIED = 0 CREATING = 1 READY = 2 @@ -262,25 +291,71 @@ class State(proto.Enum): FAILING_OVER = 10 class Tier(proto.Enum): - r"""Available service tiers to choose from""" + r"""Available service tiers to choose from + + Values: + TIER_UNSPECIFIED (0): + Not set. + BASIC (1): + BASIC tier: standalone instance + STANDARD_HA (3): + STANDARD_HA tier: highly available primary/replica instances + """ TIER_UNSPECIFIED = 0 BASIC = 1 STANDARD_HA = 3 class ConnectMode(proto.Enum): - r"""Available connection modes.""" + r"""Available connection modes. + + Values: + CONNECT_MODE_UNSPECIFIED (0): + Not set. + DIRECT_PEERING (1): + Connect via direct peering to the Memorystore + for Redis hosted service. + PRIVATE_SERVICE_ACCESS (2): + Connect your Memorystore for Redis instance + using Private Service Access. Private services + access provides an IP address range for multiple + Google Cloud services, including Memorystore. + """ CONNECT_MODE_UNSPECIFIED = 0 DIRECT_PEERING = 1 PRIVATE_SERVICE_ACCESS = 2 class TransitEncryptionMode(proto.Enum): - r"""Available TLS modes.""" + r"""Available TLS modes. + + Values: + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED (0): + Not set. + SERVER_AUTHENTICATION (1): + Client to Server traffic encryption enabled + with server authentication. + DISABLED (2): + TLS is disabled for the instance. + """ TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0 SERVER_AUTHENTICATION = 1 DISABLED = 2 class ReadReplicasMode(proto.Enum): - r"""Read replicas mode.""" + r"""Read replicas mode. + + Values: + READ_REPLICAS_MODE_UNSPECIFIED (0): + If not set, Memorystore Redis backend will default to + READ_REPLICAS_DISABLED. + READ_REPLICAS_DISABLED (1): + If disabled, read endpoint will not be + provided and the instance cannot scale up or + down the number of replicas. + READ_REPLICAS_ENABLED (2): + If enabled, read endpoint will be provided + and the instance can scale up and down the + number of replicas. Not valid for basic tier. + """ READ_REPLICAS_MODE_UNSPECIFIED = 0 READ_REPLICAS_DISABLED = 1 READ_REPLICAS_ENABLED = 2 @@ -451,13 +526,36 @@ class PersistenceConfig(proto.Message): """ class PersistenceMode(proto.Enum): - r"""Available Persistence modes.""" + r"""Available Persistence modes. + + Values: + PERSISTENCE_MODE_UNSPECIFIED (0): + Not set. + DISABLED (1): + Persistence is disabled for the instance, + and any existing snapshots are deleted. + RDB (2): + RDB based Persistence is enabled. + """ PERSISTENCE_MODE_UNSPECIFIED = 0 DISABLED = 1 RDB = 2 class SnapshotPeriod(proto.Enum): - r"""Available snapshot periods for scheduling.""" + r"""Available snapshot periods for scheduling. + + Values: + SNAPSHOT_PERIOD_UNSPECIFIED (0): + Not set. + ONE_HOUR (3): + Snapshot every 1 hour. + SIX_HOURS (4): + Snapshot every 6 hours. + TWELVE_HOURS (5): + Snapshot every 12 hours. + TWENTY_FOUR_HOURS (6): + Snapshot every 24 hours. + """ SNAPSHOT_PERIOD_UNSPECIFIED = 0 ONE_HOUR = 3 SIX_HOURS = 4 @@ -505,7 +603,22 @@ class RescheduleMaintenanceRequest(proto.Message): """ class RescheduleType(proto.Enum): - r"""Reschedule options.""" + r"""Reschedule options. + + Values: + RESCHEDULE_TYPE_UNSPECIFIED (0): + Not set. + IMMEDIATE (1): + If the user wants to schedule the maintenance + to happen now. + NEXT_AVAILABLE_WINDOW (2): + If the user wants to use the existing + maintenance policy to find the next available + window. + SPECIFIC_TIME (3): + If the user wants to reschedule the + maintenance to a specific time. + """ RESCHEDULE_TYPE_UNSPECIFIED = 0 IMMEDIATE = 1 NEXT_AVAILABLE_WINDOW = 2 @@ -1026,6 +1139,20 @@ class FailoverInstanceRequest(proto.Message): class DataProtectionMode(proto.Enum): r"""Specifies different modes of operation in relation to the data retention. + + Values: + DATA_PROTECTION_MODE_UNSPECIFIED (0): + Defaults to LIMITED_DATA_LOSS if a data protection mode is + not specified. + LIMITED_DATA_LOSS (1): + Instance failover will be protected with data + loss control. More specifically, the failover + will only be performed if the current + replication offset diff between primary and + replica is under a certain threshold. + FORCE_DATA_LOSS (2): + Instance failover will be performed without + data loss control. """ DATA_PROTECTION_MODE_UNSPECIFIED = 0 LIMITED_DATA_LOSS = 1 diff --git a/samples/generated_samples/snippet_metadata_google.cloud.redis.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.redis.v1.json index 2d76f9f..174d9df 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.redis.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.redis.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-redis", - "version": "2.11.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.redis.v1beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.redis.v1beta1.json index 6d84d7a..443ce93 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.redis.v1beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.redis.v1beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-redis", - "version": "2.11.0" + "version": "0.1.0" }, "snippets": [ { From 9bb4baf4c2a72b5ee8b84098dfdf01ea8359a63a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 10:58:55 -0500 Subject: [PATCH 2/2] chore(main): release 2.11.1 (#245) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 12 ++++++++++++ google/cloud/redis/gapic_version.py | 2 +- google/cloud/redis_v1/gapic_version.py | 2 +- google/cloud/redis_v1beta1/gapic_version.py | 2 +- .../snippet_metadata_google.cloud.redis.v1.json | 2 +- .../snippet_metadata_google.cloud.redis.v1beta1.json | 2 +- 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a9b8e02..f58b956 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.11.0" + ".": "2.11.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index c50dcce..5c3e246 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://pypi.org/project/google-cloud-redis/#history +## [2.11.1](https://github.com/googleapis/python-redis/compare/v2.11.0...v2.11.1) (2023-01-20) + + +### Bug Fixes + +* Add context manager return types ([650c291](https://github.com/googleapis/python-redis/commit/650c29190fff3e1053328cf38a9a61920dafbc49)) + + +### Documentation + +* Add documentation for enums ([650c291](https://github.com/googleapis/python-redis/commit/650c29190fff3e1053328cf38a9a61920dafbc49)) + ## [2.11.0](https://github.com/googleapis/python-redis/compare/v2.10.0...v2.11.0) (2023-01-10) diff --git a/google/cloud/redis/gapic_version.py b/google/cloud/redis/gapic_version.py index bb74f81..9ac1d4a 100644 --- a/google/cloud/redis/gapic_version.py +++ b/google/cloud/redis/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.11.0" # {x-release-please-version} +__version__ = "2.11.1" # {x-release-please-version} diff --git a/google/cloud/redis_v1/gapic_version.py b/google/cloud/redis_v1/gapic_version.py index bb74f81..9ac1d4a 100644 --- a/google/cloud/redis_v1/gapic_version.py +++ b/google/cloud/redis_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.11.0" # {x-release-please-version} +__version__ = "2.11.1" # {x-release-please-version} diff --git a/google/cloud/redis_v1beta1/gapic_version.py b/google/cloud/redis_v1beta1/gapic_version.py index bb74f81..9ac1d4a 100644 --- a/google/cloud/redis_v1beta1/gapic_version.py +++ b/google/cloud/redis_v1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.11.0" # {x-release-please-version} +__version__ = "2.11.1" # {x-release-please-version} diff --git a/samples/generated_samples/snippet_metadata_google.cloud.redis.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.redis.v1.json index 174d9df..bfbda0e 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.redis.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.redis.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-redis", - "version": "0.1.0" + "version": "2.11.1" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.redis.v1beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.redis.v1beta1.json index 443ce93..e95ada5 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.redis.v1beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.redis.v1beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-redis", - "version": "0.1.0" + "version": "2.11.1" }, "snippets": [ {