From c35bd0b7d4a5dad90b7d228952b0fbd17d97a838 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 30 Jun 2023 02:30:18 +0000 Subject: [PATCH] feat: [gke-backup] added new restore scope options (#9586) - [ ] Regenerate this pull request now. feat: added transformation rules for restore feat: added BackupPlan and RestorePlan state information These features aim to do the following: 1. Improve flexibility of restore with new options to define new kinds of scope configurations. 2. Improve flexibility of restore by supporting Transformation Rules, which enable the removal and addition of spec fields of restored resources prior to their creation. 3. Improve observability by revealing the state information of BackupPlan and RestorePlan. PiperOrigin-RevId: 543605700 Source-Link: https://togithub.com/googleapis/googleapis/commit/d39c91b3ac0abec1490ef00010107355a4dae317 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/0cf7f93d4a60fae7fbd1a9ab03f7da4c62fb1bd2 Copy-Tag: eyJwIjoiamF2YS1na2UtYmFja3VwLy5Pd2xCb3QueWFtbCIsImgiOiIwY2Y3ZjkzZDRhNjBmYWU3ZmJkMWE5YWIwM2Y3ZGE0YzYyZmIxYmQyIn0= --- java-gke-backup/README.md | 2 +- .../v1/BackupForGKEClientHttpJsonTest.java | 14 + .../gkebackup/v1/BackupForGKEClientTest.java | 10 + .../google/cloud/gkebackup/v1/BackupPlan.java | 621 +- .../gkebackup/v1/BackupPlanOrBuilder.java | 62 + .../cloud/gkebackup/v1/BackupPlanProto.java | 53 +- .../cloud/gkebackup/v1/RestoreConfig.java | 12771 ++++++++++++---- .../gkebackup/v1/RestoreConfigOrBuilder.java | 149 + .../cloud/gkebackup/v1/RestorePlan.java | 570 +- .../gkebackup/v1/RestorePlanOrBuilder.java | 60 + .../cloud/gkebackup/v1/RestorePlanProto.java | 28 +- .../cloud/gkebackup/v1/RestoreProto.java | 126 +- .../cloud/gkebackup/v1/backup_plan.proto | 36 +- .../google/cloud/gkebackup/v1/restore.proto | 137 +- .../cloud/gkebackup/v1/restore_plan.proto | 29 +- 15 files changed, 11756 insertions(+), 2912 deletions(-) diff --git a/java-gke-backup/README.md b/java-gke-backup/README.md index 2f3ec8a46339..0a343a8a2aea 100644 --- a/java-gke-backup/README.md +++ b/java-gke-backup/README.md @@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html [stability-image]: https://img.shields.io/badge/stability-preview-yellow [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-gke-backup.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-gke-backup/0.18.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-gke-backup/0.19.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/java-gke-backup/google-cloud-gke-backup/src/test/java/com/google/cloud/gkebackup/v1/BackupForGKEClientHttpJsonTest.java b/java-gke-backup/google-cloud-gke-backup/src/test/java/com/google/cloud/gkebackup/v1/BackupForGKEClientHttpJsonTest.java index c14be163a91b..6d6fdf4fbcac 100644 --- a/java-gke-backup/google-cloud-gke-backup/src/test/java/com/google/cloud/gkebackup/v1/BackupForGKEClientHttpJsonTest.java +++ b/java-gke-backup/google-cloud-gke-backup/src/test/java/com/google/cloud/gkebackup/v1/BackupForGKEClientHttpJsonTest.java @@ -119,6 +119,7 @@ public void createBackupPlanTest() throws Exception { .setDeactivated(true) .setBackupConfig(BackupPlan.BackupConfig.newBuilder().build()) .setProtectedPodCount(-1494678716) + .setStateReason("stateReason1148834357") .build(); Operation resultOperation = Operation.newBuilder() @@ -185,6 +186,7 @@ public void createBackupPlanTest2() throws Exception { .setDeactivated(true) .setBackupConfig(BackupPlan.BackupConfig.newBuilder().build()) .setProtectedPodCount(-1494678716) + .setStateReason("stateReason1148834357") .build(); Operation resultOperation = Operation.newBuilder() @@ -351,6 +353,7 @@ public void getBackupPlanTest() throws Exception { .setDeactivated(true) .setBackupConfig(BackupPlan.BackupConfig.newBuilder().build()) .setProtectedPodCount(-1494678716) + .setStateReason("stateReason1148834357") .build(); mockService.addResponse(expectedResponse); @@ -407,6 +410,7 @@ public void getBackupPlanTest2() throws Exception { .setDeactivated(true) .setBackupConfig(BackupPlan.BackupConfig.newBuilder().build()) .setProtectedPodCount(-1494678716) + .setStateReason("stateReason1148834357") .build(); mockService.addResponse(expectedResponse); @@ -463,6 +467,7 @@ public void updateBackupPlanTest() throws Exception { .setDeactivated(true) .setBackupConfig(BackupPlan.BackupConfig.newBuilder().build()) .setProtectedPodCount(-1494678716) + .setStateReason("stateReason1148834357") .build(); Operation resultOperation = Operation.newBuilder() @@ -487,6 +492,7 @@ public void updateBackupPlanTest() throws Exception { .setDeactivated(true) .setBackupConfig(BackupPlan.BackupConfig.newBuilder().build()) .setProtectedPodCount(-1494678716) + .setStateReason("stateReason1148834357") .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -531,6 +537,7 @@ public void updateBackupPlanExceptionTest() throws Exception { .setDeactivated(true) .setBackupConfig(BackupPlan.BackupConfig.newBuilder().build()) .setProtectedPodCount(-1494678716) + .setStateReason("stateReason1148834357") .build(); FieldMask updateMask = FieldMask.newBuilder().build(); client.updateBackupPlanAsync(backupPlan, updateMask).get(); @@ -1471,6 +1478,7 @@ public void createRestorePlanTest() throws Exception { .setRestoreConfig(RestoreConfig.newBuilder().build()) .putAllLabels(new HashMap()) .setEtag("etag3123477") + .setStateReason("stateReason1148834357") .build(); Operation resultOperation = Operation.newBuilder() @@ -1534,6 +1542,7 @@ public void createRestorePlanTest2() throws Exception { .setRestoreConfig(RestoreConfig.newBuilder().build()) .putAllLabels(new HashMap()) .setEtag("etag3123477") + .setStateReason("stateReason1148834357") .build(); Operation resultOperation = Operation.newBuilder() @@ -1697,6 +1706,7 @@ public void getRestorePlanTest() throws Exception { .setRestoreConfig(RestoreConfig.newBuilder().build()) .putAllLabels(new HashMap()) .setEtag("etag3123477") + .setStateReason("stateReason1148834357") .build(); mockService.addResponse(expectedResponse); @@ -1750,6 +1760,7 @@ public void getRestorePlanTest2() throws Exception { .setRestoreConfig(RestoreConfig.newBuilder().build()) .putAllLabels(new HashMap()) .setEtag("etag3123477") + .setStateReason("stateReason1148834357") .build(); mockService.addResponse(expectedResponse); @@ -1803,6 +1814,7 @@ public void updateRestorePlanTest() throws Exception { .setRestoreConfig(RestoreConfig.newBuilder().build()) .putAllLabels(new HashMap()) .setEtag("etag3123477") + .setStateReason("stateReason1148834357") .build(); Operation resultOperation = Operation.newBuilder() @@ -1824,6 +1836,7 @@ public void updateRestorePlanTest() throws Exception { .setRestoreConfig(RestoreConfig.newBuilder().build()) .putAllLabels(new HashMap()) .setEtag("etag3123477") + .setStateReason("stateReason1148834357") .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -1866,6 +1879,7 @@ public void updateRestorePlanExceptionTest() throws Exception { .setRestoreConfig(RestoreConfig.newBuilder().build()) .putAllLabels(new HashMap()) .setEtag("etag3123477") + .setStateReason("stateReason1148834357") .build(); FieldMask updateMask = FieldMask.newBuilder().build(); client.updateRestorePlanAsync(restorePlan, updateMask).get(); diff --git a/java-gke-backup/google-cloud-gke-backup/src/test/java/com/google/cloud/gkebackup/v1/BackupForGKEClientTest.java b/java-gke-backup/google-cloud-gke-backup/src/test/java/com/google/cloud/gkebackup/v1/BackupForGKEClientTest.java index d171c509f4df..5f7709dcd621 100644 --- a/java-gke-backup/google-cloud-gke-backup/src/test/java/com/google/cloud/gkebackup/v1/BackupForGKEClientTest.java +++ b/java-gke-backup/google-cloud-gke-backup/src/test/java/com/google/cloud/gkebackup/v1/BackupForGKEClientTest.java @@ -128,6 +128,7 @@ public void createBackupPlanTest() throws Exception { .setDeactivated(true) .setBackupConfig(BackupPlan.BackupConfig.newBuilder().build()) .setProtectedPodCount(-1494678716) + .setStateReason("stateReason1148834357") .build(); Operation resultOperation = Operation.newBuilder() @@ -193,6 +194,7 @@ public void createBackupPlanTest2() throws Exception { .setDeactivated(true) .setBackupConfig(BackupPlan.BackupConfig.newBuilder().build()) .setProtectedPodCount(-1494678716) + .setStateReason("stateReason1148834357") .build(); Operation resultOperation = Operation.newBuilder() @@ -346,6 +348,7 @@ public void getBackupPlanTest() throws Exception { .setDeactivated(true) .setBackupConfig(BackupPlan.BackupConfig.newBuilder().build()) .setProtectedPodCount(-1494678716) + .setStateReason("stateReason1148834357") .build(); mockBackupForGKE.addResponse(expectedResponse); @@ -396,6 +399,7 @@ public void getBackupPlanTest2() throws Exception { .setDeactivated(true) .setBackupConfig(BackupPlan.BackupConfig.newBuilder().build()) .setProtectedPodCount(-1494678716) + .setStateReason("stateReason1148834357") .build(); mockBackupForGKE.addResponse(expectedResponse); @@ -446,6 +450,7 @@ public void updateBackupPlanTest() throws Exception { .setDeactivated(true) .setBackupConfig(BackupPlan.BackupConfig.newBuilder().build()) .setProtectedPodCount(-1494678716) + .setStateReason("stateReason1148834357") .build(); Operation resultOperation = Operation.newBuilder() @@ -1298,6 +1303,7 @@ public void createRestorePlanTest() throws Exception { .setRestoreConfig(RestoreConfig.newBuilder().build()) .putAllLabels(new HashMap()) .setEtag("etag3123477") + .setStateReason("stateReason1148834357") .build(); Operation resultOperation = Operation.newBuilder() @@ -1360,6 +1366,7 @@ public void createRestorePlanTest2() throws Exception { .setRestoreConfig(RestoreConfig.newBuilder().build()) .putAllLabels(new HashMap()) .setEtag("etag3123477") + .setStateReason("stateReason1148834357") .build(); Operation resultOperation = Operation.newBuilder() @@ -1510,6 +1517,7 @@ public void getRestorePlanTest() throws Exception { .setRestoreConfig(RestoreConfig.newBuilder().build()) .putAllLabels(new HashMap()) .setEtag("etag3123477") + .setStateReason("stateReason1148834357") .build(); mockBackupForGKE.addResponse(expectedResponse); @@ -1557,6 +1565,7 @@ public void getRestorePlanTest2() throws Exception { .setRestoreConfig(RestoreConfig.newBuilder().build()) .putAllLabels(new HashMap()) .setEtag("etag3123477") + .setStateReason("stateReason1148834357") .build(); mockBackupForGKE.addResponse(expectedResponse); @@ -1604,6 +1613,7 @@ public void updateRestorePlanTest() throws Exception { .setRestoreConfig(RestoreConfig.newBuilder().build()) .putAllLabels(new HashMap()) .setEtag("etag3123477") + .setStateReason("stateReason1148834357") .build(); Operation resultOperation = Operation.newBuilder() diff --git a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/BackupPlan.java b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/BackupPlan.java index b14d43aceb3e..1fc8b67648ba 100644 --- a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/BackupPlan.java +++ b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/BackupPlan.java @@ -43,6 +43,8 @@ private BackupPlan() { description_ = ""; cluster_ = ""; etag_ = ""; + state_ = 0; + stateReason_ = ""; } @java.lang.Override @@ -77,6 +79,251 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { com.google.cloud.gkebackup.v1.BackupPlan.Builder.class); } + /** + * + * + *
+   * State
+   * 
+ * + * Protobuf enum {@code google.cloud.gkebackup.v1.BackupPlan.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default first value for Enums.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Waiting for cluster state to be RUNNING.
+     * 
+ * + * CLUSTER_PENDING = 1; + */ + CLUSTER_PENDING(1), + /** + * + * + *
+     * The BackupPlan is in the process of being created.
+     * 
+ * + * PROVISIONING = 2; + */ + PROVISIONING(2), + /** + * + * + *
+     * The BackupPlan has successfully been created and is ready for Backups.
+     * 
+ * + * READY = 3; + */ + READY(3), + /** + * + * + *
+     * BackupPlan creation has failed.
+     * 
+ * + * FAILED = 4; + */ + FAILED(4), + /** + * + * + *
+     * The BackupPlan has been deactivated.
+     * 
+ * + * DEACTIVATED = 5; + */ + DEACTIVATED(5), + /** + * + * + *
+     * The BackupPlan is in the process of being deleted.
+     * 
+ * + * DELETING = 6; + */ + DELETING(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default first value for Enums.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Waiting for cluster state to be RUNNING.
+     * 
+ * + * CLUSTER_PENDING = 1; + */ + public static final int CLUSTER_PENDING_VALUE = 1; + /** + * + * + *
+     * The BackupPlan is in the process of being created.
+     * 
+ * + * PROVISIONING = 2; + */ + public static final int PROVISIONING_VALUE = 2; + /** + * + * + *
+     * The BackupPlan has successfully been created and is ready for Backups.
+     * 
+ * + * READY = 3; + */ + public static final int READY_VALUE = 3; + /** + * + * + *
+     * BackupPlan creation has failed.
+     * 
+ * + * FAILED = 4; + */ + public static final int FAILED_VALUE = 4; + /** + * + * + *
+     * The BackupPlan has been deactivated.
+     * 
+ * + * DEACTIVATED = 5; + */ + public static final int DEACTIVATED_VALUE = 5; + /** + * + * + *
+     * The BackupPlan is in the process of being deleted.
+     * 
+ * + * DELETING = 6; + */ + public static final int DELETING_VALUE = 6; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return CLUSTER_PENDING; + case 2: + return PROVISIONING; + case 3: + return READY; + case 4: + return FAILED; + case 5: + return DEACTIVATED; + case 6: + return DELETING; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.gkebackup.v1.BackupPlan.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.gkebackup.v1.BackupPlan.State) + } + public interface RetentionPolicyOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy) @@ -1036,7 +1283,7 @@ public interface ScheduleOrBuilder * * *
-   * Schedule defines scheduling parameters for automatically creating Backups
+   * Defines scheduling parameters for automatically creating Backups
    * via this BackupPlan.
    * 
* @@ -1334,7 +1581,7 @@ protected Builder newBuilderForType( * * *
-     * Schedule defines scheduling parameters for automatically creating Backups
+     * Defines scheduling parameters for automatically creating Backups
      * via this BackupPlan.
      * 
* @@ -4438,6 +4685,104 @@ public int getProtectedPodCount() { return protectedPodCount_; } + public static final int STATE_FIELD_NUMBER = 14; + private int state_ = 0; + /** + * + * + *
+   * Output only. State of the BackupPlan. This State field reflects the
+   * various stages a BackupPlan can be in
+   * during the Create operation. It will be set to "DEACTIVATED"
+   * if the BackupPlan is deactivated on an Update
+   * 
+ * + * + * .google.cloud.gkebackup.v1.BackupPlan.State state = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. State of the BackupPlan. This State field reflects the
+   * various stages a BackupPlan can be in
+   * during the Create operation. It will be set to "DEACTIVATED"
+   * if the BackupPlan is deactivated on an Update
+   * 
+ * + * + * .google.cloud.gkebackup.v1.BackupPlan.State state = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.gkebackup.v1.BackupPlan.State getState() { + com.google.cloud.gkebackup.v1.BackupPlan.State result = + com.google.cloud.gkebackup.v1.BackupPlan.State.forNumber(state_); + return result == null ? com.google.cloud.gkebackup.v1.BackupPlan.State.UNRECOGNIZED : result; + } + + public static final int STATE_REASON_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object stateReason_ = ""; + /** + * + * + *
+   * Output only. Human-readable description of why BackupPlan is in the current
+   * `state`
+   * 
+ * + * string state_reason = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The stateReason. + */ + @java.lang.Override + public java.lang.String getStateReason() { + java.lang.Object ref = stateReason_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stateReason_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable description of why BackupPlan is in the current
+   * `state`
+   * 
+ * + * string state_reason = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for stateReason. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStateReasonBytes() { + java.lang.Object ref = stateReason_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stateReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -4490,6 +4835,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (protectedPodCount_ != 0) { output.writeInt32(13, protectedPodCount_); } + if (state_ != com.google.cloud.gkebackup.v1.BackupPlan.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(14, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stateReason_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, stateReason_); + } getUnknownFields().writeTo(output); } @@ -4545,6 +4896,12 @@ public int getSerializedSize() { if (protectedPodCount_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(13, protectedPodCount_); } + if (state_ != com.google.cloud.gkebackup.v1.BackupPlan.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(14, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stateReason_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, stateReason_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -4588,6 +4945,8 @@ public boolean equals(final java.lang.Object obj) { if (!getBackupConfig().equals(other.getBackupConfig())) return false; } if (getProtectedPodCount() != other.getProtectedPodCount()) return false; + if (state_ != other.state_) return false; + if (!getStateReason().equals(other.getStateReason())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -4637,6 +4996,10 @@ public int hashCode() { } hash = (37 * hash) + PROTECTED_POD_COUNT_FIELD_NUMBER; hash = (53 * hash) + getProtectedPodCount(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + STATE_REASON_FIELD_NUMBER; + hash = (53 * hash) + getStateReason().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -4829,6 +5192,8 @@ public Builder clear() { backupConfigBuilder_ = null; } protectedPodCount_ = 0; + state_ = 0; + stateReason_ = ""; return this; } @@ -4908,6 +5273,12 @@ private void buildPartial0(com.google.cloud.gkebackup.v1.BackupPlan result) { if (((from_bitField0_ & 0x00001000) != 0)) { result.protectedPodCount_ = protectedPodCount_; } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.stateReason_ = stateReason_; + } } @java.lang.Override @@ -5003,6 +5374,14 @@ public Builder mergeFrom(com.google.cloud.gkebackup.v1.BackupPlan other) { if (other.getProtectedPodCount() != 0) { setProtectedPodCount(other.getProtectedPodCount()); } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getStateReason().isEmpty()) { + stateReason_ = other.stateReason_; + bitField0_ |= 0x00004000; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -5113,6 +5492,18 @@ public Builder mergeFrom( bitField0_ |= 0x00001000; break; } // case 104 + case 112: + { + state_ = input.readEnum(); + bitField0_ |= 0x00002000; + break; + } // case 112 + case 122: + { + stateReason_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 122 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -6998,6 +7389,232 @@ public Builder clearProtectedPodCount() { return this; } + private int state_ = 0; + /** + * + * + *
+     * Output only. State of the BackupPlan. This State field reflects the
+     * various stages a BackupPlan can be in
+     * during the Create operation. It will be set to "DEACTIVATED"
+     * if the BackupPlan is deactivated on an Update
+     * 
+ * + * + * .google.cloud.gkebackup.v1.BackupPlan.State state = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. State of the BackupPlan. This State field reflects the
+     * various stages a BackupPlan can be in
+     * during the Create operation. It will be set to "DEACTIVATED"
+     * if the BackupPlan is deactivated on an Update
+     * 
+ * + * + * .google.cloud.gkebackup.v1.BackupPlan.State state = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the BackupPlan. This State field reflects the
+     * various stages a BackupPlan can be in
+     * during the Create operation. It will be set to "DEACTIVATED"
+     * if the BackupPlan is deactivated on an Update
+     * 
+ * + * + * .google.cloud.gkebackup.v1.BackupPlan.State state = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.gkebackup.v1.BackupPlan.State getState() { + com.google.cloud.gkebackup.v1.BackupPlan.State result = + com.google.cloud.gkebackup.v1.BackupPlan.State.forNumber(state_); + return result == null ? com.google.cloud.gkebackup.v1.BackupPlan.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. State of the BackupPlan. This State field reflects the
+     * various stages a BackupPlan can be in
+     * during the Create operation. It will be set to "DEACTIVATED"
+     * if the BackupPlan is deactivated on an Update
+     * 
+ * + * + * .google.cloud.gkebackup.v1.BackupPlan.State state = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.gkebackup.v1.BackupPlan.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00002000; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the BackupPlan. This State field reflects the
+     * various stages a BackupPlan can be in
+     * during the Create operation. It will be set to "DEACTIVATED"
+     * if the BackupPlan is deactivated on an Update
+     * 
+ * + * + * .google.cloud.gkebackup.v1.BackupPlan.State state = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00002000); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object stateReason_ = ""; + /** + * + * + *
+     * Output only. Human-readable description of why BackupPlan is in the current
+     * `state`
+     * 
+ * + * string state_reason = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The stateReason. + */ + public java.lang.String getStateReason() { + java.lang.Object ref = stateReason_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stateReason_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable description of why BackupPlan is in the current
+     * `state`
+     * 
+ * + * string state_reason = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for stateReason. + */ + public com.google.protobuf.ByteString getStateReasonBytes() { + java.lang.Object ref = stateReason_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stateReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable description of why BackupPlan is in the current
+     * `state`
+     * 
+ * + * string state_reason = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The stateReason to set. + * @return This builder for chaining. + */ + public Builder setStateReason(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + stateReason_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable description of why BackupPlan is in the current
+     * `state`
+     * 
+ * + * string state_reason = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStateReason() { + stateReason_ = getDefaultInstance().getStateReason(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable description of why BackupPlan is in the current
+     * `state`
+     * 
+ * + * string state_reason = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for stateReason to set. + * @return This builder for chaining. + */ + public Builder setStateReasonBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + stateReason_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/BackupPlanOrBuilder.java b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/BackupPlanOrBuilder.java index e7bdfc5818ac..b5a460b3cb64 100644 --- a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/BackupPlanOrBuilder.java +++ b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/BackupPlanOrBuilder.java @@ -452,4 +452,66 @@ java.lang.String getLabelsOrDefault( * @return The protectedPodCount. */ int getProtectedPodCount(); + + /** + * + * + *
+   * Output only. State of the BackupPlan. This State field reflects the
+   * various stages a BackupPlan can be in
+   * during the Create operation. It will be set to "DEACTIVATED"
+   * if the BackupPlan is deactivated on an Update
+   * 
+ * + * + * .google.cloud.gkebackup.v1.BackupPlan.State state = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. State of the BackupPlan. This State field reflects the
+   * various stages a BackupPlan can be in
+   * during the Create operation. It will be set to "DEACTIVATED"
+   * if the BackupPlan is deactivated on an Update
+   * 
+ * + * + * .google.cloud.gkebackup.v1.BackupPlan.State state = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.gkebackup.v1.BackupPlan.State getState(); + + /** + * + * + *
+   * Output only. Human-readable description of why BackupPlan is in the current
+   * `state`
+   * 
+ * + * string state_reason = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The stateReason. + */ + java.lang.String getStateReason(); + /** + * + * + *
+   * Output only. Human-readable description of why BackupPlan is in the current
+   * `state`
+   * 
+ * + * string state_reason = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for stateReason. + */ + com.google.protobuf.ByteString getStateReasonBytes(); } diff --git a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/BackupPlanProto.java b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/BackupPlanProto.java index 129630967f96..ab3209eb299b 100644 --- a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/BackupPlanProto.java +++ b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/BackupPlanProto.java @@ -61,7 +61,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "/api/field_behavior.proto\032\031google/api/re" + "source.proto\032&google/cloud/gkebackup/v1/" + "common.proto\032\037google/protobuf/timestamp." - + "proto\"\334\t\n\nBackupPlan\022\022\n\004name\030\001 \001(\tB\004\342A\001\003" + + "proto\"\267\013\n\nBackupPlan\022\022\n\004name\030\001 \001(\tB\004\342A\001\003" + "\022\021\n\003uid\030\002 \001(\tB\004\342A\001\003\0225\n\013create_time\030\003 \001(\013" + "2\032.google.protobuf.TimestampB\004\342A\001\003\0225\n\013up" + "date_time\030\004 \001(\0132\032.google.protobuf.Timest" @@ -76,28 +76,33 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\030\n \001(\tB\004\342A\001\003\022\023\n\013deactivated\030\013 \001(\010\022I\n\rbac" + "kup_config\030\014 \001(\01322.google.cloud.gkebacku" + "p.v1.BackupPlan.BackupConfig\022!\n\023protecte" - + "d_pod_count\030\r \001(\005B\004\342A\001\003\032^\n\017RetentionPoli" - + "cy\022\037\n\027backup_delete_lock_days\030\001 \001(\005\022\032\n\022b" - + "ackup_retain_days\030\002 \001(\005\022\016\n\006locked\030\003 \001(\010\032" - + "1\n\010Schedule\022\025\n\rcron_schedule\030\001 \001(\t\022\016\n\006pa" - + "used\030\002 \001(\010\032\303\002\n\014BackupConfig\022\030\n\016all_names" - + "paces\030\001 \001(\010H\000\022D\n\023selected_namespaces\030\002 \001" - + "(\0132%.google.cloud.gkebackup.v1.Namespace" - + "sH\000\022K\n\025selected_applications\030\003 \001(\0132*.goo" - + "gle.cloud.gkebackup.v1.NamespacedNamesH\000" - + "\022\033\n\023include_volume_data\030\004 \001(\010\022\027\n\017include" - + "_secrets\030\005 \001(\010\022@\n\016encryption_key\030\006 \001(\0132(" - + ".google.cloud.gkebackup.v1.EncryptionKey" - + "B\016\n\014backup_scope\032-\n\013LabelsEntry\022\013\n\003key\030\001" - + " \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:k\352Ah\n#gkebackup." - + "googleapis.com/BackupPlan\022Aprojects/{pro" - + "ject}/locations/{location}/backupPlans/{" - + "backup_plan}B\306\001\n\035com.google.cloud.gkebac" - + "kup.v1B\017BackupPlanProtoP\001Z;cloud.google." - + "com/go/gkebackup/apiv1/gkebackuppb;gkeba" - + "ckuppb\252\002\031Google.Cloud.GkeBackup.V1\312\002\031Goo" - + "gle\\Cloud\\GkeBackup\\V1\352\002\034Google::Cloud::" - + "GkeBackup::V1b\006proto3" + + "d_pod_count\030\r \001(\005B\004\342A\001\003\022@\n\005state\030\016 \001(\0162+" + + ".google.cloud.gkebackup.v1.BackupPlan.St" + + "ateB\004\342A\001\003\022\032\n\014state_reason\030\017 \001(\tB\004\342A\001\003\032^\n" + + "\017RetentionPolicy\022\037\n\027backup_delete_lock_d" + + "ays\030\001 \001(\005\022\032\n\022backup_retain_days\030\002 \001(\005\022\016\n" + + "\006locked\030\003 \001(\010\0321\n\010Schedule\022\025\n\rcron_schedu" + + "le\030\001 \001(\t\022\016\n\006paused\030\002 \001(\010\032\303\002\n\014BackupConfi" + + "g\022\030\n\016all_namespaces\030\001 \001(\010H\000\022D\n\023selected_" + + "namespaces\030\002 \001(\0132%.google.cloud.gkebacku" + + "p.v1.NamespacesH\000\022K\n\025selected_applicatio" + + "ns\030\003 \001(\0132*.google.cloud.gkebackup.v1.Nam" + + "espacedNamesH\000\022\033\n\023include_volume_data\030\004 " + + "\001(\010\022\027\n\017include_secrets\030\005 \001(\010\022@\n\016encrypti" + + "on_key\030\006 \001(\0132(.google.cloud.gkebackup.v1" + + ".EncryptionKeyB\016\n\014backup_scope\032-\n\013Labels" + + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"{\n" + + "\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\023\n\017CLUSTER" + + "_PENDING\020\001\022\020\n\014PROVISIONING\020\002\022\t\n\005READY\020\003\022" + + "\n\n\006FAILED\020\004\022\017\n\013DEACTIVATED\020\005\022\014\n\010DELETING" + + "\020\006:k\352Ah\n#gkebackup.googleapis.com/Backup" + + "Plan\022Aprojects/{project}/locations/{loca" + + "tion}/backupPlans/{backup_plan}B\306\001\n\035com." + + "google.cloud.gkebackup.v1B\017BackupPlanPro" + + "toP\001Z;cloud.google.com/go/gkebackup/apiv" + + "1/gkebackuppb;gkebackuppb\252\002\031Google.Cloud" + + ".GkeBackup.V1\312\002\031Google\\Cloud\\GkeBackup\\V" + + "1\352\002\034Google::Cloud::GkeBackup::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -127,6 +132,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Deactivated", "BackupConfig", "ProtectedPodCount", + "State", + "StateReason", }); internal_static_google_cloud_gkebackup_v1_BackupPlan_RetentionPolicy_descriptor = internal_static_google_cloud_gkebackup_v1_BackupPlan_descriptor.getNestedTypes().get(0); diff --git a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestoreConfig.java b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestoreConfig.java index 37ddfde82301..1df8e308d3da 100644 --- a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestoreConfig.java +++ b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestoreConfig.java @@ -23,7 +23,7 @@ * *
  * Configuration of a restore.
- * Next id: 9
+ * Next id: 12
  * 
* * Protobuf type {@code google.cloud.gkebackup.v1.RestoreConfig} @@ -43,6 +43,7 @@ private RestoreConfig() { clusterResourceConflictPolicy_ = 0; namespacedResourceRestoreMode_ = 0; substitutionRules_ = java.util.Collections.emptyList(); + transformationRules_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -1563,6 +1564,109 @@ public interface ClusterResourceRestoreScopeOrBuilder */ com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder getSelectedGroupKindsOrBuilder( int index); + + /** + * + * + *
+     * A list of cluster-scoped resource group kinds to NOT restore from the
+     * backup. If specified, all valid cluster-scoped resources will be
+     * restored except for those specified in the list.
+     * Mutually exclusive to any other field in the message.
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + java.util.List + getExcludedGroupKindsList(); + /** + * + * + *
+     * A list of cluster-scoped resource group kinds to NOT restore from the
+     * backup. If specified, all valid cluster-scoped resources will be
+     * restored except for those specified in the list.
+     * Mutually exclusive to any other field in the message.
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind getExcludedGroupKinds(int index); + /** + * + * + *
+     * A list of cluster-scoped resource group kinds to NOT restore from the
+     * backup. If specified, all valid cluster-scoped resources will be
+     * restored except for those specified in the list.
+     * Mutually exclusive to any other field in the message.
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + int getExcludedGroupKindsCount(); + /** + * + * + *
+     * A list of cluster-scoped resource group kinds to NOT restore from the
+     * backup. If specified, all valid cluster-scoped resources will be
+     * restored except for those specified in the list.
+     * Mutually exclusive to any other field in the message.
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + java.util.List + getExcludedGroupKindsOrBuilderList(); + /** + * + * + *
+     * A list of cluster-scoped resource group kinds to NOT restore from the
+     * backup. If specified, all valid cluster-scoped resources will be
+     * restored except for those specified in the list.
+     * Mutually exclusive to any other field in the message.
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder getExcludedGroupKindsOrBuilder( + int index); + + /** + * + * + *
+     * If True, all valid cluster-scoped resources will be restored.
+     * Mutually exclusive to any other field in the message.
+     * 
+ * + * bool all_group_kinds = 3; + * + * @return The allGroupKinds. + */ + boolean getAllGroupKinds(); + + /** + * + * + *
+     * If True, no cluster-scoped resources will be restored.
+     * This has the same restore scope as if the message is not defined.
+     * Mutually exclusive to any other field in the message.
+     * 
+ * + * bool no_group_kinds = 4; + * + * @return The noGroupKinds. + */ + boolean getNoGroupKinds(); } /** * @@ -1603,6 +1707,7 @@ private ClusterResourceRestoreScope(com.google.protobuf.GeneratedMessageV3.Build private ClusterResourceRestoreScope() { selectedGroupKinds_ = java.util.Collections.emptyList(); + excludedGroupKinds_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -1716,6 +1821,139 @@ public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind getSelectedGroupKin return selectedGroupKinds_.get(index); } + public static final int EXCLUDED_GROUP_KINDS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List + excludedGroupKinds_; + /** + * + * + *
+     * A list of cluster-scoped resource group kinds to NOT restore from the
+     * backup. If specified, all valid cluster-scoped resources will be
+     * restored except for those specified in the list.
+     * Mutually exclusive to any other field in the message.
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + @java.lang.Override + public java.util.List + getExcludedGroupKindsList() { + return excludedGroupKinds_; + } + /** + * + * + *
+     * A list of cluster-scoped resource group kinds to NOT restore from the
+     * backup. If specified, all valid cluster-scoped resources will be
+     * restored except for those specified in the list.
+     * Mutually exclusive to any other field in the message.
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + @java.lang.Override + public java.util.List + getExcludedGroupKindsOrBuilderList() { + return excludedGroupKinds_; + } + /** + * + * + *
+     * A list of cluster-scoped resource group kinds to NOT restore from the
+     * backup. If specified, all valid cluster-scoped resources will be
+     * restored except for those specified in the list.
+     * Mutually exclusive to any other field in the message.
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + @java.lang.Override + public int getExcludedGroupKindsCount() { + return excludedGroupKinds_.size(); + } + /** + * + * + *
+     * A list of cluster-scoped resource group kinds to NOT restore from the
+     * backup. If specified, all valid cluster-scoped resources will be
+     * restored except for those specified in the list.
+     * Mutually exclusive to any other field in the message.
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind getExcludedGroupKinds(int index) { + return excludedGroupKinds_.get(index); + } + /** + * + * + *
+     * A list of cluster-scoped resource group kinds to NOT restore from the
+     * backup. If specified, all valid cluster-scoped resources will be
+     * restored except for those specified in the list.
+     * Mutually exclusive to any other field in the message.
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder + getExcludedGroupKindsOrBuilder(int index) { + return excludedGroupKinds_.get(index); + } + + public static final int ALL_GROUP_KINDS_FIELD_NUMBER = 3; + private boolean allGroupKinds_ = false; + /** + * + * + *
+     * If True, all valid cluster-scoped resources will be restored.
+     * Mutually exclusive to any other field in the message.
+     * 
+ * + * bool all_group_kinds = 3; + * + * @return The allGroupKinds. + */ + @java.lang.Override + public boolean getAllGroupKinds() { + return allGroupKinds_; + } + + public static final int NO_GROUP_KINDS_FIELD_NUMBER = 4; + private boolean noGroupKinds_ = false; + /** + * + * + *
+     * If True, no cluster-scoped resources will be restored.
+     * This has the same restore scope as if the message is not defined.
+     * Mutually exclusive to any other field in the message.
+     * 
+ * + * bool no_group_kinds = 4; + * + * @return The noGroupKinds. + */ + @java.lang.Override + public boolean getNoGroupKinds() { + return noGroupKinds_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1733,6 +1971,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < selectedGroupKinds_.size(); i++) { output.writeMessage(1, selectedGroupKinds_.get(i)); } + for (int i = 0; i < excludedGroupKinds_.size(); i++) { + output.writeMessage(2, excludedGroupKinds_.get(i)); + } + if (allGroupKinds_ != false) { + output.writeBool(3, allGroupKinds_); + } + if (noGroupKinds_ != false) { + output.writeBool(4, noGroupKinds_); + } getUnknownFields().writeTo(output); } @@ -1746,6 +1993,16 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, selectedGroupKinds_.get(i)); } + for (int i = 0; i < excludedGroupKinds_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, excludedGroupKinds_.get(i)); + } + if (allGroupKinds_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, allGroupKinds_); + } + if (noGroupKinds_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, noGroupKinds_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -1764,6 +2021,9 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope) obj; if (!getSelectedGroupKindsList().equals(other.getSelectedGroupKindsList())) return false; + if (!getExcludedGroupKindsList().equals(other.getExcludedGroupKindsList())) return false; + if (getAllGroupKinds() != other.getAllGroupKinds()) return false; + if (getNoGroupKinds() != other.getNoGroupKinds()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1779,6 +2039,14 @@ public int hashCode() { hash = (37 * hash) + SELECTED_GROUP_KINDS_FIELD_NUMBER; hash = (53 * hash) + getSelectedGroupKindsList().hashCode(); } + if (getExcludedGroupKindsCount() > 0) { + hash = (37 * hash) + EXCLUDED_GROUP_KINDS_FIELD_NUMBER; + hash = (53 * hash) + getExcludedGroupKindsList().hashCode(); + } + hash = (37 * hash) + ALL_GROUP_KINDS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllGroupKinds()); + hash = (37 * hash) + NO_GROUP_KINDS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getNoGroupKinds()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1948,6 +2216,15 @@ public Builder clear() { selectedGroupKindsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); + if (excludedGroupKindsBuilder_ == null) { + excludedGroupKinds_ = java.util.Collections.emptyList(); + } else { + excludedGroupKinds_ = null; + excludedGroupKindsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + allGroupKinds_ = false; + noGroupKinds_ = false; return this; } @@ -1998,11 +2275,26 @@ private void buildPartialRepeatedFields( } else { result.selectedGroupKinds_ = selectedGroupKindsBuilder_.build(); } + if (excludedGroupKindsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + excludedGroupKinds_ = java.util.Collections.unmodifiableList(excludedGroupKinds_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.excludedGroupKinds_ = excludedGroupKinds_; + } else { + result.excludedGroupKinds_ = excludedGroupKindsBuilder_.build(); + } } private void buildPartial0( com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope result) { int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.allGroupKinds_ = allGroupKinds_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.noGroupKinds_ = noGroupKinds_; + } } @java.lang.Override @@ -2084,6 +2376,39 @@ public Builder mergeFrom( } } } + if (excludedGroupKindsBuilder_ == null) { + if (!other.excludedGroupKinds_.isEmpty()) { + if (excludedGroupKinds_.isEmpty()) { + excludedGroupKinds_ = other.excludedGroupKinds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureExcludedGroupKindsIsMutable(); + excludedGroupKinds_.addAll(other.excludedGroupKinds_); + } + onChanged(); + } + } else { + if (!other.excludedGroupKinds_.isEmpty()) { + if (excludedGroupKindsBuilder_.isEmpty()) { + excludedGroupKindsBuilder_.dispose(); + excludedGroupKindsBuilder_ = null; + excludedGroupKinds_ = other.excludedGroupKinds_; + bitField0_ = (bitField0_ & ~0x00000002); + excludedGroupKindsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getExcludedGroupKindsFieldBuilder() + : null; + } else { + excludedGroupKindsBuilder_.addAllMessages(other.excludedGroupKinds_); + } + } + } + if (other.getAllGroupKinds() != false) { + setAllGroupKinds(other.getAllGroupKinds()); + } + if (other.getNoGroupKinds() != false) { + setNoGroupKinds(other.getNoGroupKinds()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -2124,6 +2449,32 @@ public Builder mergeFrom( } break; } // case 10 + case 18: + { + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind m = + input.readMessage( + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.parser(), + extensionRegistry); + if (excludedGroupKindsBuilder_ == null) { + ensureExcludedGroupKindsIsMutable(); + excludedGroupKinds_.add(m); + } else { + excludedGroupKindsBuilder_.addMessage(m); + } + break; + } // case 18 + case 24: + { + allGroupKinds_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + noGroupKinds_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2566,51 +2917,6297 @@ public Builder removeSelectedGroupKinds(int index) { return selectedGroupKindsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } + private java.util.List + excludedGroupKinds_ = java.util.Collections.emptyList(); - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + private void ensureExcludedGroupKindsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + excludedGroupKinds_ = + new java.util.ArrayList( + excludedGroupKinds_); + bitField0_ |= 0x00000002; + } } - // @@protoc_insertion_point(builder_scope:google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope) - } - - // @@protoc_insertion_point(class_scope:google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope) - private static final com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope(); - } - - public static com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope - getDefaultInstance() { - return DEFAULT_INSTANCE; - } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder> + excludedGroupKindsBuilder_; - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ClusterResourceRestoreScope parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public java.util.List + getExcludedGroupKindsList() { + if (excludedGroupKindsBuilder_ == null) { + return java.util.Collections.unmodifiableList(excludedGroupKinds_); + } else { + return excludedGroupKindsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public int getExcludedGroupKindsCount() { + if (excludedGroupKindsBuilder_ == null) { + return excludedGroupKinds_.size(); + } else { + return excludedGroupKindsBuilder_.getCount(); + } + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind getExcludedGroupKinds( + int index) { + if (excludedGroupKindsBuilder_ == null) { + return excludedGroupKinds_.get(index); + } else { + return excludedGroupKindsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public Builder setExcludedGroupKinds( + int index, com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind value) { + if (excludedGroupKindsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExcludedGroupKindsIsMutable(); + excludedGroupKinds_.set(index, value); + onChanged(); + } else { + excludedGroupKindsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public Builder setExcludedGroupKinds( + int index, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder builderForValue) { + if (excludedGroupKindsBuilder_ == null) { + ensureExcludedGroupKindsIsMutable(); + excludedGroupKinds_.set(index, builderForValue.build()); + onChanged(); + } else { + excludedGroupKindsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public Builder addExcludedGroupKinds( + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind value) { + if (excludedGroupKindsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExcludedGroupKindsIsMutable(); + excludedGroupKinds_.add(value); + onChanged(); + } else { + excludedGroupKindsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public Builder addExcludedGroupKinds( + int index, com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind value) { + if (excludedGroupKindsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExcludedGroupKindsIsMutable(); + excludedGroupKinds_.add(index, value); + onChanged(); + } else { + excludedGroupKindsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public Builder addExcludedGroupKinds( + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder builderForValue) { + if (excludedGroupKindsBuilder_ == null) { + ensureExcludedGroupKindsIsMutable(); + excludedGroupKinds_.add(builderForValue.build()); + onChanged(); + } else { + excludedGroupKindsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public Builder addExcludedGroupKinds( + int index, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder builderForValue) { + if (excludedGroupKindsBuilder_ == null) { + ensureExcludedGroupKindsIsMutable(); + excludedGroupKinds_.add(index, builderForValue.build()); + onChanged(); + } else { + excludedGroupKindsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public Builder addAllExcludedGroupKinds( + java.lang.Iterable + values) { + if (excludedGroupKindsBuilder_ == null) { + ensureExcludedGroupKindsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, excludedGroupKinds_); + onChanged(); + } else { + excludedGroupKindsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public Builder clearExcludedGroupKinds() { + if (excludedGroupKindsBuilder_ == null) { + excludedGroupKinds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + excludedGroupKindsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public Builder removeExcludedGroupKinds(int index) { + if (excludedGroupKindsBuilder_ == null) { + ensureExcludedGroupKindsIsMutable(); + excludedGroupKinds_.remove(index); + onChanged(); + } else { + excludedGroupKindsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder + getExcludedGroupKindsBuilder(int index) { + return getExcludedGroupKindsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder + getExcludedGroupKindsOrBuilder(int index) { + if (excludedGroupKindsBuilder_ == null) { + return excludedGroupKinds_.get(index); + } else { + return excludedGroupKindsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public java.util.List< + ? extends com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder> + getExcludedGroupKindsOrBuilderList() { + if (excludedGroupKindsBuilder_ != null) { + return excludedGroupKindsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(excludedGroupKinds_); + } + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder + addExcludedGroupKindsBuilder() { + return getExcludedGroupKindsFieldBuilder() + .addBuilder(com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.getDefaultInstance()); + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder + addExcludedGroupKindsBuilder(int index) { + return getExcludedGroupKindsFieldBuilder() + .addBuilder( + index, com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.getDefaultInstance()); + } + /** + * + * + *
+       * A list of cluster-scoped resource group kinds to NOT restore from the
+       * backup. If specified, all valid cluster-scoped resources will be
+       * restored except for those specified in the list.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind excluded_group_kinds = 2; + * + */ + public java.util.List + getExcludedGroupKindsBuilderList() { + return getExcludedGroupKindsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder> + getExcludedGroupKindsFieldBuilder() { + if (excludedGroupKindsBuilder_ == null) { + excludedGroupKindsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder>( + excludedGroupKinds_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + excludedGroupKinds_ = null; + } + return excludedGroupKindsBuilder_; + } + + private boolean allGroupKinds_; + /** + * + * + *
+       * If True, all valid cluster-scoped resources will be restored.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * bool all_group_kinds = 3; + * + * @return The allGroupKinds. + */ + @java.lang.Override + public boolean getAllGroupKinds() { + return allGroupKinds_; + } + /** + * + * + *
+       * If True, all valid cluster-scoped resources will be restored.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * bool all_group_kinds = 3; + * + * @param value The allGroupKinds to set. + * @return This builder for chaining. + */ + public Builder setAllGroupKinds(boolean value) { + + allGroupKinds_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * If True, all valid cluster-scoped resources will be restored.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * bool all_group_kinds = 3; + * + * @return This builder for chaining. + */ + public Builder clearAllGroupKinds() { + bitField0_ = (bitField0_ & ~0x00000004); + allGroupKinds_ = false; + onChanged(); + return this; + } + + private boolean noGroupKinds_; + /** + * + * + *
+       * If True, no cluster-scoped resources will be restored.
+       * This has the same restore scope as if the message is not defined.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * bool no_group_kinds = 4; + * + * @return The noGroupKinds. + */ + @java.lang.Override + public boolean getNoGroupKinds() { + return noGroupKinds_; + } + /** + * + * + *
+       * If True, no cluster-scoped resources will be restored.
+       * This has the same restore scope as if the message is not defined.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * bool no_group_kinds = 4; + * + * @param value The noGroupKinds to set. + * @return This builder for chaining. + */ + public Builder setNoGroupKinds(boolean value) { + + noGroupKinds_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * If True, no cluster-scoped resources will be restored.
+       * This has the same restore scope as if the message is not defined.
+       * Mutually exclusive to any other field in the message.
+       * 
+ * + * bool no_group_kinds = 4; + * + * @return This builder for chaining. + */ + public Builder clearNoGroupKinds() { + bitField0_ = (bitField0_ & ~0x00000008); + noGroupKinds_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope) + private static final com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope(); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClusterResourceRestoreScope parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SubstitutionRuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must be
+     * contained within one of the listed Kubernetes Namespace in the Backup.
+     * If this field is not provided, no namespace filtering will be performed
+     * (all resources in all Namespaces, including all cluster-scoped resources,
+     * will be candidates for substitution).
+     * To mix cluster-scoped and namespaced resources in the same rule, use an
+     * empty string ("") as one of the target namespaces.
+     * 
+ * + * repeated string target_namespaces = 1; + * + * @return A list containing the targetNamespaces. + */ + java.util.List getTargetNamespacesList(); + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must be
+     * contained within one of the listed Kubernetes Namespace in the Backup.
+     * If this field is not provided, no namespace filtering will be performed
+     * (all resources in all Namespaces, including all cluster-scoped resources,
+     * will be candidates for substitution).
+     * To mix cluster-scoped and namespaced resources in the same rule, use an
+     * empty string ("") as one of the target namespaces.
+     * 
+ * + * repeated string target_namespaces = 1; + * + * @return The count of targetNamespaces. + */ + int getTargetNamespacesCount(); + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must be
+     * contained within one of the listed Kubernetes Namespace in the Backup.
+     * If this field is not provided, no namespace filtering will be performed
+     * (all resources in all Namespaces, including all cluster-scoped resources,
+     * will be candidates for substitution).
+     * To mix cluster-scoped and namespaced resources in the same rule, use an
+     * empty string ("") as one of the target namespaces.
+     * 
+ * + * repeated string target_namespaces = 1; + * + * @param index The index of the element to return. + * @return The targetNamespaces at the given index. + */ + java.lang.String getTargetNamespaces(int index); + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must be
+     * contained within one of the listed Kubernetes Namespace in the Backup.
+     * If this field is not provided, no namespace filtering will be performed
+     * (all resources in all Namespaces, including all cluster-scoped resources,
+     * will be candidates for substitution).
+     * To mix cluster-scoped and namespaced resources in the same rule, use an
+     * empty string ("") as one of the target namespaces.
+     * 
+ * + * repeated string target_namespaces = 1; + * + * @param index The index of the value to return. + * @return The bytes of the targetNamespaces at the given index. + */ + com.google.protobuf.ByteString getTargetNamespacesBytes(int index); + + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must belong to
+     * one of the listed "types".
+     * If this field is not provided, no type filtering will be performed (all
+     * resources of all types matching previous filtering parameters will be
+     * candidates for substitution).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + java.util.List getTargetGroupKindsList(); + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must belong to
+     * one of the listed "types".
+     * If this field is not provided, no type filtering will be performed (all
+     * resources of all types matching previous filtering parameters will be
+     * candidates for substitution).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind getTargetGroupKinds(int index); + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must belong to
+     * one of the listed "types".
+     * If this field is not provided, no type filtering will be performed (all
+     * resources of all types matching previous filtering parameters will be
+     * candidates for substitution).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + int getTargetGroupKindsCount(); + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must belong to
+     * one of the listed "types".
+     * If this field is not provided, no type filtering will be performed (all
+     * resources of all types matching previous filtering parameters will be
+     * candidates for substitution).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + java.util.List + getTargetGroupKindsOrBuilderList(); + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must belong to
+     * one of the listed "types".
+     * If this field is not provided, no type filtering will be performed (all
+     * resources of all types matching previous filtering parameters will be
+     * candidates for substitution).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder getTargetGroupKindsOrBuilder( + int index); + + /** + * + * + *
+     * Required. This is a [JSONPath]
+     * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
+     * expression that matches specific fields of candidate
+     * resources and it operates as both a filtering parameter (resources that
+     * are not matched with this expression will not be candidates for
+     * substitution) as well as a field identifier (identifies exactly which
+     * fields out of the candidate resources will be modified).
+     * 
+ * + * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The targetJsonPath. + */ + java.lang.String getTargetJsonPath(); + /** + * + * + *
+     * Required. This is a [JSONPath]
+     * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
+     * expression that matches specific fields of candidate
+     * resources and it operates as both a filtering parameter (resources that
+     * are not matched with this expression will not be candidates for
+     * substitution) as well as a field identifier (identifies exactly which
+     * fields out of the candidate resources will be modified).
+     * 
+ * + * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for targetJsonPath. + */ + com.google.protobuf.ByteString getTargetJsonPathBytes(); + + /** + * + * + *
+     * (Filtering parameter) This is a [regular expression]
+     * (https://en.wikipedia.org/wiki/Regular_expression)
+     * that is compared against the fields matched by the target_json_path
+     * expression (and must also have passed the previous filters).
+     * Substitution will not be performed against fields whose
+     * value does not match this expression. If this field is NOT specified,
+     * then ALL fields matched by the target_json_path expression will undergo
+     * substitution. Note that an empty (e.g., "", rather than unspecified)
+     * value for this field will only match empty fields.
+     * 
+ * + * string original_value_pattern = 4; + * + * @return The originalValuePattern. + */ + java.lang.String getOriginalValuePattern(); + /** + * + * + *
+     * (Filtering parameter) This is a [regular expression]
+     * (https://en.wikipedia.org/wiki/Regular_expression)
+     * that is compared against the fields matched by the target_json_path
+     * expression (and must also have passed the previous filters).
+     * Substitution will not be performed against fields whose
+     * value does not match this expression. If this field is NOT specified,
+     * then ALL fields matched by the target_json_path expression will undergo
+     * substitution. Note that an empty (e.g., "", rather than unspecified)
+     * value for this field will only match empty fields.
+     * 
+ * + * string original_value_pattern = 4; + * + * @return The bytes for originalValuePattern. + */ + com.google.protobuf.ByteString getOriginalValuePatternBytes(); + + /** + * + * + *
+     * This is the new value to set for any fields that pass the filtering and
+     * selection criteria. To remove a value from a Kubernetes resource, either
+     * leave this field unspecified, or set it to the empty string ("").
+     * 
+ * + * string new_value = 5; + * + * @return The newValue. + */ + java.lang.String getNewValue(); + /** + * + * + *
+     * This is the new value to set for any fields that pass the filtering and
+     * selection criteria. To remove a value from a Kubernetes resource, either
+     * leave this field unspecified, or set it to the empty string ("").
+     * 
+ * + * string new_value = 5; + * + * @return The bytes for newValue. + */ + com.google.protobuf.ByteString getNewValueBytes(); + } + /** + * + * + *
+   * A transformation rule to be applied against Kubernetes resources as they
+   * are selected for restoration from a Backup. A rule contains both filtering
+   * logic (which resources are subject to substitution) and substitution logic.
+   * 
+ * + * Protobuf type {@code google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule} + */ + public static final class SubstitutionRule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) + SubstitutionRuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use SubstitutionRule.newBuilder() to construct. + private SubstitutionRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SubstitutionRule() { + targetNamespaces_ = com.google.protobuf.LazyStringArrayList.emptyList(); + targetGroupKinds_ = java.util.Collections.emptyList(); + targetJsonPath_ = ""; + originalValuePattern_ = ""; + newValue_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SubstitutionRule(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_SubstitutionRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_SubstitutionRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.class, + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder.class); + } + + public static final int TARGET_NAMESPACES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList targetNamespaces_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must be
+     * contained within one of the listed Kubernetes Namespace in the Backup.
+     * If this field is not provided, no namespace filtering will be performed
+     * (all resources in all Namespaces, including all cluster-scoped resources,
+     * will be candidates for substitution).
+     * To mix cluster-scoped and namespaced resources in the same rule, use an
+     * empty string ("") as one of the target namespaces.
+     * 
+ * + * repeated string target_namespaces = 1; + * + * @return A list containing the targetNamespaces. + */ + public com.google.protobuf.ProtocolStringList getTargetNamespacesList() { + return targetNamespaces_; + } + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must be
+     * contained within one of the listed Kubernetes Namespace in the Backup.
+     * If this field is not provided, no namespace filtering will be performed
+     * (all resources in all Namespaces, including all cluster-scoped resources,
+     * will be candidates for substitution).
+     * To mix cluster-scoped and namespaced resources in the same rule, use an
+     * empty string ("") as one of the target namespaces.
+     * 
+ * + * repeated string target_namespaces = 1; + * + * @return The count of targetNamespaces. + */ + public int getTargetNamespacesCount() { + return targetNamespaces_.size(); + } + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must be
+     * contained within one of the listed Kubernetes Namespace in the Backup.
+     * If this field is not provided, no namespace filtering will be performed
+     * (all resources in all Namespaces, including all cluster-scoped resources,
+     * will be candidates for substitution).
+     * To mix cluster-scoped and namespaced resources in the same rule, use an
+     * empty string ("") as one of the target namespaces.
+     * 
+ * + * repeated string target_namespaces = 1; + * + * @param index The index of the element to return. + * @return The targetNamespaces at the given index. + */ + public java.lang.String getTargetNamespaces(int index) { + return targetNamespaces_.get(index); + } + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must be
+     * contained within one of the listed Kubernetes Namespace in the Backup.
+     * If this field is not provided, no namespace filtering will be performed
+     * (all resources in all Namespaces, including all cluster-scoped resources,
+     * will be candidates for substitution).
+     * To mix cluster-scoped and namespaced resources in the same rule, use an
+     * empty string ("") as one of the target namespaces.
+     * 
+ * + * repeated string target_namespaces = 1; + * + * @param index The index of the value to return. + * @return The bytes of the targetNamespaces at the given index. + */ + public com.google.protobuf.ByteString getTargetNamespacesBytes(int index) { + return targetNamespaces_.getByteString(index); + } + + public static final int TARGET_GROUP_KINDS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List targetGroupKinds_; + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must belong to
+     * one of the listed "types".
+     * If this field is not provided, no type filtering will be performed (all
+     * resources of all types matching previous filtering parameters will be
+     * candidates for substitution).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + @java.lang.Override + public java.util.List + getTargetGroupKindsList() { + return targetGroupKinds_; + } + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must belong to
+     * one of the listed "types".
+     * If this field is not provided, no type filtering will be performed (all
+     * resources of all types matching previous filtering parameters will be
+     * candidates for substitution).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + @java.lang.Override + public java.util.List + getTargetGroupKindsOrBuilderList() { + return targetGroupKinds_; + } + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must belong to
+     * one of the listed "types".
+     * If this field is not provided, no type filtering will be performed (all
+     * resources of all types matching previous filtering parameters will be
+     * candidates for substitution).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + @java.lang.Override + public int getTargetGroupKindsCount() { + return targetGroupKinds_.size(); + } + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must belong to
+     * one of the listed "types".
+     * If this field is not provided, no type filtering will be performed (all
+     * resources of all types matching previous filtering parameters will be
+     * candidates for substitution).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind getTargetGroupKinds(int index) { + return targetGroupKinds_.get(index); + } + /** + * + * + *
+     * (Filtering parameter) Any resource subject to substitution must belong to
+     * one of the listed "types".
+     * If this field is not provided, no type filtering will be performed (all
+     * resources of all types matching previous filtering parameters will be
+     * candidates for substitution).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder + getTargetGroupKindsOrBuilder(int index) { + return targetGroupKinds_.get(index); + } + + public static final int TARGET_JSON_PATH_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object targetJsonPath_ = ""; + /** + * + * + *
+     * Required. This is a [JSONPath]
+     * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
+     * expression that matches specific fields of candidate
+     * resources and it operates as both a filtering parameter (resources that
+     * are not matched with this expression will not be candidates for
+     * substitution) as well as a field identifier (identifies exactly which
+     * fields out of the candidate resources will be modified).
+     * 
+ * + * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The targetJsonPath. + */ + @java.lang.Override + public java.lang.String getTargetJsonPath() { + java.lang.Object ref = targetJsonPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetJsonPath_ = s; + return s; + } + } + /** + * + * + *
+     * Required. This is a [JSONPath]
+     * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
+     * expression that matches specific fields of candidate
+     * resources and it operates as both a filtering parameter (resources that
+     * are not matched with this expression will not be candidates for
+     * substitution) as well as a field identifier (identifies exactly which
+     * fields out of the candidate resources will be modified).
+     * 
+ * + * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for targetJsonPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetJsonPathBytes() { + java.lang.Object ref = targetJsonPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetJsonPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORIGINAL_VALUE_PATTERN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object originalValuePattern_ = ""; + /** + * + * + *
+     * (Filtering parameter) This is a [regular expression]
+     * (https://en.wikipedia.org/wiki/Regular_expression)
+     * that is compared against the fields matched by the target_json_path
+     * expression (and must also have passed the previous filters).
+     * Substitution will not be performed against fields whose
+     * value does not match this expression. If this field is NOT specified,
+     * then ALL fields matched by the target_json_path expression will undergo
+     * substitution. Note that an empty (e.g., "", rather than unspecified)
+     * value for this field will only match empty fields.
+     * 
+ * + * string original_value_pattern = 4; + * + * @return The originalValuePattern. + */ + @java.lang.Override + public java.lang.String getOriginalValuePattern() { + java.lang.Object ref = originalValuePattern_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + originalValuePattern_ = s; + return s; + } + } + /** + * + * + *
+     * (Filtering parameter) This is a [regular expression]
+     * (https://en.wikipedia.org/wiki/Regular_expression)
+     * that is compared against the fields matched by the target_json_path
+     * expression (and must also have passed the previous filters).
+     * Substitution will not be performed against fields whose
+     * value does not match this expression. If this field is NOT specified,
+     * then ALL fields matched by the target_json_path expression will undergo
+     * substitution. Note that an empty (e.g., "", rather than unspecified)
+     * value for this field will only match empty fields.
+     * 
+ * + * string original_value_pattern = 4; + * + * @return The bytes for originalValuePattern. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOriginalValuePatternBytes() { + java.lang.Object ref = originalValuePattern_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + originalValuePattern_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NEW_VALUE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object newValue_ = ""; + /** + * + * + *
+     * This is the new value to set for any fields that pass the filtering and
+     * selection criteria. To remove a value from a Kubernetes resource, either
+     * leave this field unspecified, or set it to the empty string ("").
+     * 
+ * + * string new_value = 5; + * + * @return The newValue. + */ + @java.lang.Override + public java.lang.String getNewValue() { + java.lang.Object ref = newValue_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + newValue_ = s; + return s; + } + } + /** + * + * + *
+     * This is the new value to set for any fields that pass the filtering and
+     * selection criteria. To remove a value from a Kubernetes resource, either
+     * leave this field unspecified, or set it to the empty string ("").
+     * 
+ * + * string new_value = 5; + * + * @return The bytes for newValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNewValueBytes() { + java.lang.Object ref = newValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + newValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < targetNamespaces_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, targetNamespaces_.getRaw(i)); + } + for (int i = 0; i < targetGroupKinds_.size(); i++) { + output.writeMessage(2, targetGroupKinds_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(targetJsonPath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, targetJsonPath_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(originalValuePattern_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, originalValuePattern_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(newValue_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, newValue_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < targetNamespaces_.size(); i++) { + dataSize += computeStringSizeNoTag(targetNamespaces_.getRaw(i)); + } + size += dataSize; + size += 1 * getTargetNamespacesList().size(); + } + for (int i = 0; i < targetGroupKinds_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, targetGroupKinds_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(targetJsonPath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, targetJsonPath_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(originalValuePattern_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, originalValuePattern_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(newValue_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, newValue_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule)) { + return super.equals(obj); + } + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule other = + (com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) obj; + + if (!getTargetNamespacesList().equals(other.getTargetNamespacesList())) return false; + if (!getTargetGroupKindsList().equals(other.getTargetGroupKindsList())) return false; + if (!getTargetJsonPath().equals(other.getTargetJsonPath())) return false; + if (!getOriginalValuePattern().equals(other.getOriginalValuePattern())) return false; + if (!getNewValue().equals(other.getNewValue())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTargetNamespacesCount() > 0) { + hash = (37 * hash) + TARGET_NAMESPACES_FIELD_NUMBER; + hash = (53 * hash) + getTargetNamespacesList().hashCode(); + } + if (getTargetGroupKindsCount() > 0) { + hash = (37 * hash) + TARGET_GROUP_KINDS_FIELD_NUMBER; + hash = (53 * hash) + getTargetGroupKindsList().hashCode(); + } + hash = (37 * hash) + TARGET_JSON_PATH_FIELD_NUMBER; + hash = (53 * hash) + getTargetJsonPath().hashCode(); + hash = (37 * hash) + ORIGINAL_VALUE_PATTERN_FIELD_NUMBER; + hash = (53 * hash) + getOriginalValuePattern().hashCode(); + hash = (37 * hash) + NEW_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getNewValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A transformation rule to be applied against Kubernetes resources as they
+     * are selected for restoration from a Backup. A rule contains both filtering
+     * logic (which resources are subject to substitution) and substitution logic.
+     * 
+ * + * Protobuf type {@code google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_SubstitutionRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_SubstitutionRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.class, + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder.class); + } + + // Construct using com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + targetNamespaces_ = com.google.protobuf.LazyStringArrayList.emptyList(); + if (targetGroupKindsBuilder_ == null) { + targetGroupKinds_ = java.util.Collections.emptyList(); + } else { + targetGroupKinds_ = null; + targetGroupKindsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + targetJsonPath_ = ""; + originalValuePattern_ = ""; + newValue_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_SubstitutionRule_descriptor; + } + + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + getDefaultInstanceForType() { + return com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule build() { + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule buildPartial() { + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule result = + new com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule result) { + if (targetGroupKindsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + targetGroupKinds_ = java.util.Collections.unmodifiableList(targetGroupKinds_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.targetGroupKinds_ = targetGroupKinds_; + } else { + result.targetGroupKinds_ = targetGroupKindsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + targetNamespaces_.makeImmutable(); + result.targetNamespaces_ = targetNamespaces_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.targetJsonPath_ = targetJsonPath_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.originalValuePattern_ = originalValuePattern_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.newValue_ = newValue_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) { + return mergeFrom((com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule other) { + if (other + == com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.getDefaultInstance()) + return this; + if (!other.targetNamespaces_.isEmpty()) { + if (targetNamespaces_.isEmpty()) { + targetNamespaces_ = other.targetNamespaces_; + bitField0_ |= 0x00000001; + } else { + ensureTargetNamespacesIsMutable(); + targetNamespaces_.addAll(other.targetNamespaces_); + } + onChanged(); + } + if (targetGroupKindsBuilder_ == null) { + if (!other.targetGroupKinds_.isEmpty()) { + if (targetGroupKinds_.isEmpty()) { + targetGroupKinds_ = other.targetGroupKinds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureTargetGroupKindsIsMutable(); + targetGroupKinds_.addAll(other.targetGroupKinds_); + } + onChanged(); + } + } else { + if (!other.targetGroupKinds_.isEmpty()) { + if (targetGroupKindsBuilder_.isEmpty()) { + targetGroupKindsBuilder_.dispose(); + targetGroupKindsBuilder_ = null; + targetGroupKinds_ = other.targetGroupKinds_; + bitField0_ = (bitField0_ & ~0x00000002); + targetGroupKindsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTargetGroupKindsFieldBuilder() + : null; + } else { + targetGroupKindsBuilder_.addAllMessages(other.targetGroupKinds_); + } + } + } + if (!other.getTargetJsonPath().isEmpty()) { + targetJsonPath_ = other.targetJsonPath_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getOriginalValuePattern().isEmpty()) { + originalValuePattern_ = other.originalValuePattern_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getNewValue().isEmpty()) { + newValue_ = other.newValue_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureTargetNamespacesIsMutable(); + targetNamespaces_.add(s); + break; + } // case 10 + case 18: + { + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind m = + input.readMessage( + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.parser(), + extensionRegistry); + if (targetGroupKindsBuilder_ == null) { + ensureTargetGroupKindsIsMutable(); + targetGroupKinds_.add(m); + } else { + targetGroupKindsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + targetJsonPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + originalValuePattern_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + newValue_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList targetNamespaces_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureTargetNamespacesIsMutable() { + if (!targetNamespaces_.isModifiable()) { + targetNamespaces_ = new com.google.protobuf.LazyStringArrayList(targetNamespaces_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for substitution).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string target_namespaces = 1; + * + * @return A list containing the targetNamespaces. + */ + public com.google.protobuf.ProtocolStringList getTargetNamespacesList() { + targetNamespaces_.makeImmutable(); + return targetNamespaces_; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for substitution).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string target_namespaces = 1; + * + * @return The count of targetNamespaces. + */ + public int getTargetNamespacesCount() { + return targetNamespaces_.size(); + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for substitution).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string target_namespaces = 1; + * + * @param index The index of the element to return. + * @return The targetNamespaces at the given index. + */ + public java.lang.String getTargetNamespaces(int index) { + return targetNamespaces_.get(index); + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for substitution).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string target_namespaces = 1; + * + * @param index The index of the value to return. + * @return The bytes of the targetNamespaces at the given index. + */ + public com.google.protobuf.ByteString getTargetNamespacesBytes(int index) { + return targetNamespaces_.getByteString(index); + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for substitution).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string target_namespaces = 1; + * + * @param index The index to set the value at. + * @param value The targetNamespaces to set. + * @return This builder for chaining. + */ + public Builder setTargetNamespaces(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTargetNamespacesIsMutable(); + targetNamespaces_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for substitution).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string target_namespaces = 1; + * + * @param value The targetNamespaces to add. + * @return This builder for chaining. + */ + public Builder addTargetNamespaces(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTargetNamespacesIsMutable(); + targetNamespaces_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for substitution).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string target_namespaces = 1; + * + * @param values The targetNamespaces to add. + * @return This builder for chaining. + */ + public Builder addAllTargetNamespaces(java.lang.Iterable values) { + ensureTargetNamespacesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, targetNamespaces_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for substitution).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string target_namespaces = 1; + * + * @return This builder for chaining. + */ + public Builder clearTargetNamespaces() { + targetNamespaces_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for substitution).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string target_namespaces = 1; + * + * @param value The bytes of the targetNamespaces to add. + * @return This builder for chaining. + */ + public Builder addTargetNamespacesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTargetNamespacesIsMutable(); + targetNamespaces_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List + targetGroupKinds_ = java.util.Collections.emptyList(); + + private void ensureTargetGroupKindsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + targetGroupKinds_ = + new java.util.ArrayList( + targetGroupKinds_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder> + targetGroupKindsBuilder_; + + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public java.util.List + getTargetGroupKindsList() { + if (targetGroupKindsBuilder_ == null) { + return java.util.Collections.unmodifiableList(targetGroupKinds_); + } else { + return targetGroupKindsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public int getTargetGroupKindsCount() { + if (targetGroupKindsBuilder_ == null) { + return targetGroupKinds_.size(); + } else { + return targetGroupKindsBuilder_.getCount(); + } + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind getTargetGroupKinds(int index) { + if (targetGroupKindsBuilder_ == null) { + return targetGroupKinds_.get(index); + } else { + return targetGroupKindsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public Builder setTargetGroupKinds( + int index, com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind value) { + if (targetGroupKindsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTargetGroupKindsIsMutable(); + targetGroupKinds_.set(index, value); + onChanged(); + } else { + targetGroupKindsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public Builder setTargetGroupKinds( + int index, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder builderForValue) { + if (targetGroupKindsBuilder_ == null) { + ensureTargetGroupKindsIsMutable(); + targetGroupKinds_.set(index, builderForValue.build()); + onChanged(); + } else { + targetGroupKindsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public Builder addTargetGroupKinds( + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind value) { + if (targetGroupKindsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTargetGroupKindsIsMutable(); + targetGroupKinds_.add(value); + onChanged(); + } else { + targetGroupKindsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public Builder addTargetGroupKinds( + int index, com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind value) { + if (targetGroupKindsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTargetGroupKindsIsMutable(); + targetGroupKinds_.add(index, value); + onChanged(); + } else { + targetGroupKindsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public Builder addTargetGroupKinds( + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder builderForValue) { + if (targetGroupKindsBuilder_ == null) { + ensureTargetGroupKindsIsMutable(); + targetGroupKinds_.add(builderForValue.build()); + onChanged(); + } else { + targetGroupKindsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public Builder addTargetGroupKinds( + int index, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder builderForValue) { + if (targetGroupKindsBuilder_ == null) { + ensureTargetGroupKindsIsMutable(); + targetGroupKinds_.add(index, builderForValue.build()); + onChanged(); + } else { + targetGroupKindsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public Builder addAllTargetGroupKinds( + java.lang.Iterable + values) { + if (targetGroupKindsBuilder_ == null) { + ensureTargetGroupKindsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, targetGroupKinds_); + onChanged(); + } else { + targetGroupKindsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public Builder clearTargetGroupKinds() { + if (targetGroupKindsBuilder_ == null) { + targetGroupKinds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + targetGroupKindsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public Builder removeTargetGroupKinds(int index) { + if (targetGroupKindsBuilder_ == null) { + ensureTargetGroupKindsIsMutable(); + targetGroupKinds_.remove(index); + onChanged(); + } else { + targetGroupKindsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder + getTargetGroupKindsBuilder(int index) { + return getTargetGroupKindsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder + getTargetGroupKindsOrBuilder(int index) { + if (targetGroupKindsBuilder_ == null) { + return targetGroupKinds_.get(index); + } else { + return targetGroupKindsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public java.util.List< + ? extends com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder> + getTargetGroupKindsOrBuilderList() { + if (targetGroupKindsBuilder_ != null) { + return targetGroupKindsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(targetGroupKinds_); + } + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder + addTargetGroupKindsBuilder() { + return getTargetGroupKindsFieldBuilder() + .addBuilder(com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.getDefaultInstance()); + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder + addTargetGroupKindsBuilder(int index) { + return getTargetGroupKindsFieldBuilder() + .addBuilder( + index, com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.getDefaultInstance()); + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to substitution must belong to
+       * one of the listed "types".
+       * If this field is not provided, no type filtering will be performed (all
+       * resources of all types matching previous filtering parameters will be
+       * candidates for substitution).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + */ + public java.util.List + getTargetGroupKindsBuilderList() { + return getTargetGroupKindsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder> + getTargetGroupKindsFieldBuilder() { + if (targetGroupKindsBuilder_ == null) { + targetGroupKindsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder>( + targetGroupKinds_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + targetGroupKinds_ = null; + } + return targetGroupKindsBuilder_; + } + + private java.lang.Object targetJsonPath_ = ""; + /** + * + * + *
+       * Required. This is a [JSONPath]
+       * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
+       * expression that matches specific fields of candidate
+       * resources and it operates as both a filtering parameter (resources that
+       * are not matched with this expression will not be candidates for
+       * substitution) as well as a field identifier (identifies exactly which
+       * fields out of the candidate resources will be modified).
+       * 
+ * + * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The targetJsonPath. + */ + public java.lang.String getTargetJsonPath() { + java.lang.Object ref = targetJsonPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetJsonPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. This is a [JSONPath]
+       * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
+       * expression that matches specific fields of candidate
+       * resources and it operates as both a filtering parameter (resources that
+       * are not matched with this expression will not be candidates for
+       * substitution) as well as a field identifier (identifies exactly which
+       * fields out of the candidate resources will be modified).
+       * 
+ * + * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for targetJsonPath. + */ + public com.google.protobuf.ByteString getTargetJsonPathBytes() { + java.lang.Object ref = targetJsonPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetJsonPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. This is a [JSONPath]
+       * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
+       * expression that matches specific fields of candidate
+       * resources and it operates as both a filtering parameter (resources that
+       * are not matched with this expression will not be candidates for
+       * substitution) as well as a field identifier (identifies exactly which
+       * fields out of the candidate resources will be modified).
+       * 
+ * + * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The targetJsonPath to set. + * @return This builder for chaining. + */ + public Builder setTargetJsonPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetJsonPath_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. This is a [JSONPath]
+       * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
+       * expression that matches specific fields of candidate
+       * resources and it operates as both a filtering parameter (resources that
+       * are not matched with this expression will not be candidates for
+       * substitution) as well as a field identifier (identifies exactly which
+       * fields out of the candidate resources will be modified).
+       * 
+ * + * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTargetJsonPath() { + targetJsonPath_ = getDefaultInstance().getTargetJsonPath(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. This is a [JSONPath]
+       * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
+       * expression that matches specific fields of candidate
+       * resources and it operates as both a filtering parameter (resources that
+       * are not matched with this expression will not be candidates for
+       * substitution) as well as a field identifier (identifies exactly which
+       * fields out of the candidate resources will be modified).
+       * 
+ * + * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for targetJsonPath to set. + * @return This builder for chaining. + */ + public Builder setTargetJsonPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetJsonPath_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object originalValuePattern_ = ""; + /** + * + * + *
+       * (Filtering parameter) This is a [regular expression]
+       * (https://en.wikipedia.org/wiki/Regular_expression)
+       * that is compared against the fields matched by the target_json_path
+       * expression (and must also have passed the previous filters).
+       * Substitution will not be performed against fields whose
+       * value does not match this expression. If this field is NOT specified,
+       * then ALL fields matched by the target_json_path expression will undergo
+       * substitution. Note that an empty (e.g., "", rather than unspecified)
+       * value for this field will only match empty fields.
+       * 
+ * + * string original_value_pattern = 4; + * + * @return The originalValuePattern. + */ + public java.lang.String getOriginalValuePattern() { + java.lang.Object ref = originalValuePattern_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + originalValuePattern_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * (Filtering parameter) This is a [regular expression]
+       * (https://en.wikipedia.org/wiki/Regular_expression)
+       * that is compared against the fields matched by the target_json_path
+       * expression (and must also have passed the previous filters).
+       * Substitution will not be performed against fields whose
+       * value does not match this expression. If this field is NOT specified,
+       * then ALL fields matched by the target_json_path expression will undergo
+       * substitution. Note that an empty (e.g., "", rather than unspecified)
+       * value for this field will only match empty fields.
+       * 
+ * + * string original_value_pattern = 4; + * + * @return The bytes for originalValuePattern. + */ + public com.google.protobuf.ByteString getOriginalValuePatternBytes() { + java.lang.Object ref = originalValuePattern_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + originalValuePattern_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * (Filtering parameter) This is a [regular expression]
+       * (https://en.wikipedia.org/wiki/Regular_expression)
+       * that is compared against the fields matched by the target_json_path
+       * expression (and must also have passed the previous filters).
+       * Substitution will not be performed against fields whose
+       * value does not match this expression. If this field is NOT specified,
+       * then ALL fields matched by the target_json_path expression will undergo
+       * substitution. Note that an empty (e.g., "", rather than unspecified)
+       * value for this field will only match empty fields.
+       * 
+ * + * string original_value_pattern = 4; + * + * @param value The originalValuePattern to set. + * @return This builder for chaining. + */ + public Builder setOriginalValuePattern(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + originalValuePattern_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * (Filtering parameter) This is a [regular expression]
+       * (https://en.wikipedia.org/wiki/Regular_expression)
+       * that is compared against the fields matched by the target_json_path
+       * expression (and must also have passed the previous filters).
+       * Substitution will not be performed against fields whose
+       * value does not match this expression. If this field is NOT specified,
+       * then ALL fields matched by the target_json_path expression will undergo
+       * substitution. Note that an empty (e.g., "", rather than unspecified)
+       * value for this field will only match empty fields.
+       * 
+ * + * string original_value_pattern = 4; + * + * @return This builder for chaining. + */ + public Builder clearOriginalValuePattern() { + originalValuePattern_ = getDefaultInstance().getOriginalValuePattern(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+       * (Filtering parameter) This is a [regular expression]
+       * (https://en.wikipedia.org/wiki/Regular_expression)
+       * that is compared against the fields matched by the target_json_path
+       * expression (and must also have passed the previous filters).
+       * Substitution will not be performed against fields whose
+       * value does not match this expression. If this field is NOT specified,
+       * then ALL fields matched by the target_json_path expression will undergo
+       * substitution. Note that an empty (e.g., "", rather than unspecified)
+       * value for this field will only match empty fields.
+       * 
+ * + * string original_value_pattern = 4; + * + * @param value The bytes for originalValuePattern to set. + * @return This builder for chaining. + */ + public Builder setOriginalValuePatternBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + originalValuePattern_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object newValue_ = ""; + /** + * + * + *
+       * This is the new value to set for any fields that pass the filtering and
+       * selection criteria. To remove a value from a Kubernetes resource, either
+       * leave this field unspecified, or set it to the empty string ("").
+       * 
+ * + * string new_value = 5; + * + * @return The newValue. + */ + public java.lang.String getNewValue() { + java.lang.Object ref = newValue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + newValue_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * This is the new value to set for any fields that pass the filtering and
+       * selection criteria. To remove a value from a Kubernetes resource, either
+       * leave this field unspecified, or set it to the empty string ("").
+       * 
+ * + * string new_value = 5; + * + * @return The bytes for newValue. + */ + public com.google.protobuf.ByteString getNewValueBytes() { + java.lang.Object ref = newValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + newValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * This is the new value to set for any fields that pass the filtering and
+       * selection criteria. To remove a value from a Kubernetes resource, either
+       * leave this field unspecified, or set it to the empty string ("").
+       * 
+ * + * string new_value = 5; + * + * @param value The newValue to set. + * @return This builder for chaining. + */ + public Builder setNewValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + newValue_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * This is the new value to set for any fields that pass the filtering and
+       * selection criteria. To remove a value from a Kubernetes resource, either
+       * leave this field unspecified, or set it to the empty string ("").
+       * 
+ * + * string new_value = 5; + * + * @return This builder for chaining. + */ + public Builder clearNewValue() { + newValue_ = getDefaultInstance().getNewValue(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+       * This is the new value to set for any fields that pass the filtering and
+       * selection criteria. To remove a value from a Kubernetes resource, either
+       * leave this field unspecified, or set it to the empty string ("").
+       * 
+ * + * string new_value = 5; + * + * @param value The bytes for newValue to set. + * @return This builder for chaining. + */ + public Builder setNewValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + newValue_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) + private static final com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule(); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SubstitutionRule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TransformationRuleActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. op specifies the operation to perform.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op op = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for op. + */ + int getOpValue(); + /** + * + * + *
+     * Required. op specifies the operation to perform.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op op = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The op. + */ + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op getOp(); + + /** + * + * + *
+     * A string containing a JSON Pointer value that references the location in
+     * the target document to move the value from.
+     * 
+ * + * string from_path = 2; + * + * @return The fromPath. + */ + java.lang.String getFromPath(); + /** + * + * + *
+     * A string containing a JSON Pointer value that references the location in
+     * the target document to move the value from.
+     * 
+ * + * string from_path = 2; + * + * @return The bytes for fromPath. + */ + com.google.protobuf.ByteString getFromPathBytes(); + + /** + * + * + *
+     * A string containing a JSON-Pointer value that references a location
+     * within the target document where the operation is performed.
+     * 
+ * + * string path = 3; + * + * @return The path. + */ + java.lang.String getPath(); + /** + * + * + *
+     * A string containing a JSON-Pointer value that references a location
+     * within the target document where the operation is performed.
+     * 
+ * + * string path = 3; + * + * @return The bytes for path. + */ + com.google.protobuf.ByteString getPathBytes(); + + /** + * + * + *
+     * A string that specifies the desired value in string format to
+     * use for transformation.
+     * 
+ * + * string value = 4; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+     * A string that specifies the desired value in string format to
+     * use for transformation.
+     * 
+ * + * string value = 4; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + } + /** + * + * + *
+   * TransformationRuleAction defines a TransformationRule action based on the
+   * JSON Patch RFC (https://www.rfc-editor.org/rfc/rfc6902)
+   * 
+ * + * Protobuf type {@code google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction} + */ + public static final class TransformationRuleAction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction) + TransformationRuleActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use TransformationRuleAction.newBuilder() to construct. + private TransformationRuleAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TransformationRuleAction() { + op_ = 0; + fromPath_ = ""; + path_ = ""; + value_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TransformationRuleAction(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRuleAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRuleAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.class, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Builder.class); + } + + /** + * + * + *
+     * Possible values for operations of a transformation rule action.
+     * 
+ * + * Protobuf enum {@code google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op} + */ + public enum Op implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified operation
+       * 
+ * + * OP_UNSPECIFIED = 0; + */ + OP_UNSPECIFIED(0), + /** + * + * + *
+       * The "remove" operation removes the value at the target location.
+       * 
+ * + * REMOVE = 1; + */ + REMOVE(1), + /** + * + * + *
+       * The "move" operation removes the value at a specified location and
+       * adds it to the target location.
+       * 
+ * + * MOVE = 2; + */ + MOVE(2), + /** + * + * + *
+       * The "copy" operation copies the value at a specified location to the
+       * target location.
+       * 
+ * + * COPY = 3; + */ + COPY(3), + /** + * + * + *
+       * The "add" operation performs one of the following functions,
+       * depending upon what the target location references:
+       * 1. If the target location specifies an array index, a new value is
+       * inserted into the array at the specified index.
+       * 2. If the target location specifies an object member that does not
+       * already exist, a new member is added to the object.
+       * 3. If the target location specifies an object member that does exist,
+       * that member's value is replaced.
+       * 
+ * + * ADD = 4; + */ + ADD(4), + /** + * + * + *
+       * The "test" operation tests that a value at the target location is
+       * equal to a specified value.
+       * 
+ * + * TEST = 5; + */ + TEST(5), + /** + * + * + *
+       * The "replace" operation replaces the value at the target location
+       * with a new value.  The operation object MUST contain a "value" member
+       * whose content specifies the replacement value.
+       * 
+ * + * REPLACE = 6; + */ + REPLACE(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified operation
+       * 
+ * + * OP_UNSPECIFIED = 0; + */ + public static final int OP_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * The "remove" operation removes the value at the target location.
+       * 
+ * + * REMOVE = 1; + */ + public static final int REMOVE_VALUE = 1; + /** + * + * + *
+       * The "move" operation removes the value at a specified location and
+       * adds it to the target location.
+       * 
+ * + * MOVE = 2; + */ + public static final int MOVE_VALUE = 2; + /** + * + * + *
+       * The "copy" operation copies the value at a specified location to the
+       * target location.
+       * 
+ * + * COPY = 3; + */ + public static final int COPY_VALUE = 3; + /** + * + * + *
+       * The "add" operation performs one of the following functions,
+       * depending upon what the target location references:
+       * 1. If the target location specifies an array index, a new value is
+       * inserted into the array at the specified index.
+       * 2. If the target location specifies an object member that does not
+       * already exist, a new member is added to the object.
+       * 3. If the target location specifies an object member that does exist,
+       * that member's value is replaced.
+       * 
+ * + * ADD = 4; + */ + public static final int ADD_VALUE = 4; + /** + * + * + *
+       * The "test" operation tests that a value at the target location is
+       * equal to a specified value.
+       * 
+ * + * TEST = 5; + */ + public static final int TEST_VALUE = 5; + /** + * + * + *
+       * The "replace" operation replaces the value at the target location
+       * with a new value.  The operation object MUST contain a "value" member
+       * whose content specifies the replacement value.
+       * 
+ * + * REPLACE = 6; + */ + public static final int REPLACE_VALUE = 6; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Op valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Op forNumber(int value) { + switch (value) { + case 0: + return OP_UNSPECIFIED; + case 1: + return REMOVE; + case 2: + return MOVE; + case 3: + return COPY; + case 4: + return ADD; + case 5: + return TEST; + case 6: + return REPLACE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Op findValueByNumber(int number) { + return Op.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Op[] VALUES = values(); + + public static Op valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Op(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op) + } + + public static final int OP_FIELD_NUMBER = 1; + private int op_ = 0; + /** + * + * + *
+     * Required. op specifies the operation to perform.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op op = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for op. + */ + @java.lang.Override + public int getOpValue() { + return op_; + } + /** + * + * + *
+     * Required. op specifies the operation to perform.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op op = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The op. + */ + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op getOp() { + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op result = + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op.forNumber(op_); + return result == null + ? com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op.UNRECOGNIZED + : result; + } + + public static final int FROM_PATH_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object fromPath_ = ""; + /** + * + * + *
+     * A string containing a JSON Pointer value that references the location in
+     * the target document to move the value from.
+     * 
+ * + * string from_path = 2; + * + * @return The fromPath. + */ + @java.lang.Override + public java.lang.String getFromPath() { + java.lang.Object ref = fromPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fromPath_ = s; + return s; + } + } + /** + * + * + *
+     * A string containing a JSON Pointer value that references the location in
+     * the target document to move the value from.
+     * 
+ * + * string from_path = 2; + * + * @return The bytes for fromPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFromPathBytes() { + java.lang.Object ref = fromPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fromPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PATH_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object path_ = ""; + /** + * + * + *
+     * A string containing a JSON-Pointer value that references a location
+     * within the target document where the operation is performed.
+     * 
+ * + * string path = 3; + * + * @return The path. + */ + @java.lang.Override + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + path_ = s; + return s; + } + } + /** + * + * + *
+     * A string containing a JSON-Pointer value that references a location
+     * within the target document where the operation is performed.
+     * 
+ * + * string path = 3; + * + * @return The bytes for path. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + /** + * + * + *
+     * A string that specifies the desired value in string format to
+     * use for transformation.
+     * 
+ * + * string value = 4; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + /** + * + * + *
+     * A string that specifies the desired value in string format to
+     * use for transformation.
+     * 
+ * + * string value = 4; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (op_ + != com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op.OP_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, op_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fromPath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, fromPath_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, path_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (op_ + != com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op.OP_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, op_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fromPath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, fromPath_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, path_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction)) { + return super.equals(obj); + } + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction other = + (com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction) obj; + + if (op_ != other.op_) return false; + if (!getFromPath().equals(other.getFromPath())) return false; + if (!getPath().equals(other.getPath())) return false; + if (!getValue().equals(other.getValue())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OP_FIELD_NUMBER; + hash = (53 * hash) + op_; + hash = (37 * hash) + FROM_PATH_FIELD_NUMBER; + hash = (53 * hash) + getFromPath().hashCode(); + hash = (37 * hash) + PATH_FIELD_NUMBER; + hash = (53 * hash) + getPath().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * TransformationRuleAction defines a TransformationRule action based on the
+     * JSON Patch RFC (https://www.rfc-editor.org/rfc/rfc6902)
+     * 
+ * + * Protobuf type {@code google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction) + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRuleAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRuleAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.class, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Builder.class); + } + + // Construct using + // com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + op_ = 0; + fromPath_ = ""; + path_ = ""; + value_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRuleAction_descriptor; + } + + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction + getDefaultInstanceForType() { + return com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction build() { + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction buildPartial() { + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction result = + new com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.op_ = op_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fromPath_ = fromPath_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.path_ = path_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.value_ = value_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction) { + return mergeFrom( + (com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction other) { + if (other + == com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction + .getDefaultInstance()) return this; + if (other.op_ != 0) { + setOpValue(other.getOpValue()); + } + if (!other.getFromPath().isEmpty()) { + fromPath_ = other.fromPath_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPath().isEmpty()) { + path_ = other.path_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + op_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + fromPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + path_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + value_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int op_ = 0; + /** + * + * + *
+       * Required. op specifies the operation to perform.
+       * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op op = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for op. + */ + @java.lang.Override + public int getOpValue() { + return op_; + } + /** + * + * + *
+       * Required. op specifies the operation to perform.
+       * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op op = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for op to set. + * @return This builder for chaining. + */ + public Builder setOpValue(int value) { + op_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. op specifies the operation to perform.
+       * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op op = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The op. + */ + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op getOp() { + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op result = + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op.forNumber(op_); + return result == null + ? com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Required. op specifies the operation to perform.
+       * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op op = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The op to set. + * @return This builder for chaining. + */ + public Builder setOp( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + op_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. op specifies the operation to perform.
+       * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Op op = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearOp() { + bitField0_ = (bitField0_ & ~0x00000001); + op_ = 0; + onChanged(); + return this; + } + + private java.lang.Object fromPath_ = ""; + /** + * + * + *
+       * A string containing a JSON Pointer value that references the location in
+       * the target document to move the value from.
+       * 
+ * + * string from_path = 2; + * + * @return The fromPath. + */ + public java.lang.String getFromPath() { + java.lang.Object ref = fromPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fromPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * A string containing a JSON Pointer value that references the location in
+       * the target document to move the value from.
+       * 
+ * + * string from_path = 2; + * + * @return The bytes for fromPath. + */ + public com.google.protobuf.ByteString getFromPathBytes() { + java.lang.Object ref = fromPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fromPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * A string containing a JSON Pointer value that references the location in
+       * the target document to move the value from.
+       * 
+ * + * string from_path = 2; + * + * @param value The fromPath to set. + * @return This builder for chaining. + */ + public Builder setFromPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fromPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * A string containing a JSON Pointer value that references the location in
+       * the target document to move the value from.
+       * 
+ * + * string from_path = 2; + * + * @return This builder for chaining. + */ + public Builder clearFromPath() { + fromPath_ = getDefaultInstance().getFromPath(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * A string containing a JSON Pointer value that references the location in
+       * the target document to move the value from.
+       * 
+ * + * string from_path = 2; + * + * @param value The bytes for fromPath to set. + * @return This builder for chaining. + */ + public Builder setFromPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fromPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object path_ = ""; + /** + * + * + *
+       * A string containing a JSON-Pointer value that references a location
+       * within the target document where the operation is performed.
+       * 
+ * + * string path = 3; + * + * @return The path. + */ + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + path_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * A string containing a JSON-Pointer value that references a location
+       * within the target document where the operation is performed.
+       * 
+ * + * string path = 3; + * + * @return The bytes for path. + */ + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * A string containing a JSON-Pointer value that references a location
+       * within the target document where the operation is performed.
+       * 
+ * + * string path = 3; + * + * @param value The path to set. + * @return This builder for chaining. + */ + public Builder setPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + path_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * A string containing a JSON-Pointer value that references a location
+       * within the target document where the operation is performed.
+       * 
+ * + * string path = 3; + * + * @return This builder for chaining. + */ + public Builder clearPath() { + path_ = getDefaultInstance().getPath(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * A string containing a JSON-Pointer value that references a location
+       * within the target document where the operation is performed.
+       * 
+ * + * string path = 3; + * + * @param value The bytes for path to set. + * @return This builder for chaining. + */ + public Builder setPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + path_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + /** + * + * + *
+       * A string that specifies the desired value in string format to
+       * use for transformation.
+       * 
+ * + * string value = 4; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * A string that specifies the desired value in string format to
+       * use for transformation.
+       * 
+ * + * string value = 4; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * A string that specifies the desired value in string format to
+       * use for transformation.
+       * 
+ * + * string value = 4; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * A string that specifies the desired value in string format to
+       * use for transformation.
+       * 
+ * + * string value = 4; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+       * A string that specifies the desired value in string format to
+       * use for transformation.
+       * 
+ * + * string value = 4; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction) + private static final com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction(); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TransformationRuleAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ResourceFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must be
+     * contained within one of the listed Kubernetes Namespace in the Backup.
+     * If this field is not provided, no namespace filtering will be performed
+     * (all resources in all Namespaces, including all cluster-scoped resources,
+     * will be candidates for transformation).
+     * To mix cluster-scoped and namespaced resources in the same rule, use an
+     * empty string ("") as one of the target namespaces.
+     * 
+ * + * repeated string namespaces = 1; + * + * @return A list containing the namespaces. + */ + java.util.List getNamespacesList(); + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must be
+     * contained within one of the listed Kubernetes Namespace in the Backup.
+     * If this field is not provided, no namespace filtering will be performed
+     * (all resources in all Namespaces, including all cluster-scoped resources,
+     * will be candidates for transformation).
+     * To mix cluster-scoped and namespaced resources in the same rule, use an
+     * empty string ("") as one of the target namespaces.
+     * 
+ * + * repeated string namespaces = 1; + * + * @return The count of namespaces. + */ + int getNamespacesCount(); + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must be
+     * contained within one of the listed Kubernetes Namespace in the Backup.
+     * If this field is not provided, no namespace filtering will be performed
+     * (all resources in all Namespaces, including all cluster-scoped resources,
+     * will be candidates for transformation).
+     * To mix cluster-scoped and namespaced resources in the same rule, use an
+     * empty string ("") as one of the target namespaces.
+     * 
+ * + * repeated string namespaces = 1; + * + * @param index The index of the element to return. + * @return The namespaces at the given index. + */ + java.lang.String getNamespaces(int index); + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must be
+     * contained within one of the listed Kubernetes Namespace in the Backup.
+     * If this field is not provided, no namespace filtering will be performed
+     * (all resources in all Namespaces, including all cluster-scoped resources,
+     * will be candidates for transformation).
+     * To mix cluster-scoped and namespaced resources in the same rule, use an
+     * empty string ("") as one of the target namespaces.
+     * 
+ * + * repeated string namespaces = 1; + * + * @param index The index of the value to return. + * @return The bytes of the namespaces at the given index. + */ + com.google.protobuf.ByteString getNamespacesBytes(int index); + + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must belong
+     * to one of the listed "types". If this field is not provided, no type
+     * filtering will be performed (all resources of all types matching previous
+     * filtering parameters will be candidates for transformation).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + java.util.List getGroupKindsList(); + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must belong
+     * to one of the listed "types". If this field is not provided, no type
+     * filtering will be performed (all resources of all types matching previous
+     * filtering parameters will be candidates for transformation).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind getGroupKinds(int index); + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must belong
+     * to one of the listed "types". If this field is not provided, no type
+     * filtering will be performed (all resources of all types matching previous
+     * filtering parameters will be candidates for transformation).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + int getGroupKindsCount(); + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must belong
+     * to one of the listed "types". If this field is not provided, no type
+     * filtering will be performed (all resources of all types matching previous
+     * filtering parameters will be candidates for transformation).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + java.util.List + getGroupKindsOrBuilderList(); + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must belong
+     * to one of the listed "types". If this field is not provided, no type
+     * filtering will be performed (all resources of all types matching previous
+     * filtering parameters will be candidates for transformation).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder getGroupKindsOrBuilder( + int index); + + /** + * + * + *
+     * This is a [JSONPath]
+     * (https://github.com/json-path/JsonPath/blob/master/README.md)
+     * expression that matches specific fields of candidate
+     * resources and it operates as a filtering parameter (resources that
+     * are not matched with this expression will not be candidates for
+     * transformation).
+     * 
+ * + * string json_path = 3; + * + * @return The jsonPath. + */ + java.lang.String getJsonPath(); + /** + * + * + *
+     * This is a [JSONPath]
+     * (https://github.com/json-path/JsonPath/blob/master/README.md)
+     * expression that matches specific fields of candidate
+     * resources and it operates as a filtering parameter (resources that
+     * are not matched with this expression will not be candidates for
+     * transformation).
+     * 
+ * + * string json_path = 3; + * + * @return The bytes for jsonPath. + */ + com.google.protobuf.ByteString getJsonPathBytes(); + } + /** + * + * + *
+   * ResourceFilter specifies matching criteria to limit the scope of a
+   * change to a specific set of kubernetes resources that are selected for
+   * restoration from a backup.
+   * 
+ * + * Protobuf type {@code google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter} + */ + public static final class ResourceFilter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter) + ResourceFilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResourceFilter.newBuilder() to construct. + private ResourceFilter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResourceFilter() { + namespaces_ = com.google.protobuf.LazyStringArrayList.emptyList(); + groupKinds_ = java.util.Collections.emptyList(); + jsonPath_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResourceFilter(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_ResourceFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_ResourceFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter.class, + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter.Builder.class); + } + + public static final int NAMESPACES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList namespaces_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must be
+     * contained within one of the listed Kubernetes Namespace in the Backup.
+     * If this field is not provided, no namespace filtering will be performed
+     * (all resources in all Namespaces, including all cluster-scoped resources,
+     * will be candidates for transformation).
+     * To mix cluster-scoped and namespaced resources in the same rule, use an
+     * empty string ("") as one of the target namespaces.
+     * 
+ * + * repeated string namespaces = 1; + * + * @return A list containing the namespaces. + */ + public com.google.protobuf.ProtocolStringList getNamespacesList() { + return namespaces_; + } + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must be
+     * contained within one of the listed Kubernetes Namespace in the Backup.
+     * If this field is not provided, no namespace filtering will be performed
+     * (all resources in all Namespaces, including all cluster-scoped resources,
+     * will be candidates for transformation).
+     * To mix cluster-scoped and namespaced resources in the same rule, use an
+     * empty string ("") as one of the target namespaces.
+     * 
+ * + * repeated string namespaces = 1; + * + * @return The count of namespaces. + */ + public int getNamespacesCount() { + return namespaces_.size(); + } + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must be
+     * contained within one of the listed Kubernetes Namespace in the Backup.
+     * If this field is not provided, no namespace filtering will be performed
+     * (all resources in all Namespaces, including all cluster-scoped resources,
+     * will be candidates for transformation).
+     * To mix cluster-scoped and namespaced resources in the same rule, use an
+     * empty string ("") as one of the target namespaces.
+     * 
+ * + * repeated string namespaces = 1; + * + * @param index The index of the element to return. + * @return The namespaces at the given index. + */ + public java.lang.String getNamespaces(int index) { + return namespaces_.get(index); + } + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must be
+     * contained within one of the listed Kubernetes Namespace in the Backup.
+     * If this field is not provided, no namespace filtering will be performed
+     * (all resources in all Namespaces, including all cluster-scoped resources,
+     * will be candidates for transformation).
+     * To mix cluster-scoped and namespaced resources in the same rule, use an
+     * empty string ("") as one of the target namespaces.
+     * 
+ * + * repeated string namespaces = 1; + * + * @param index The index of the value to return. + * @return The bytes of the namespaces at the given index. + */ + public com.google.protobuf.ByteString getNamespacesBytes(int index) { + return namespaces_.getByteString(index); + } + + public static final int GROUP_KINDS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List groupKinds_; + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must belong
+     * to one of the listed "types". If this field is not provided, no type
+     * filtering will be performed (all resources of all types matching previous
+     * filtering parameters will be candidates for transformation).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + @java.lang.Override + public java.util.List + getGroupKindsList() { + return groupKinds_; + } + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must belong
+     * to one of the listed "types". If this field is not provided, no type
+     * filtering will be performed (all resources of all types matching previous
+     * filtering parameters will be candidates for transformation).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + @java.lang.Override + public java.util.List + getGroupKindsOrBuilderList() { + return groupKinds_; + } + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must belong
+     * to one of the listed "types". If this field is not provided, no type
+     * filtering will be performed (all resources of all types matching previous
+     * filtering parameters will be candidates for transformation).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + @java.lang.Override + public int getGroupKindsCount() { + return groupKinds_.size(); + } + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must belong
+     * to one of the listed "types". If this field is not provided, no type
+     * filtering will be performed (all resources of all types matching previous
+     * filtering parameters will be candidates for transformation).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind getGroupKinds(int index) { + return groupKinds_.get(index); + } + /** + * + * + *
+     * (Filtering parameter) Any resource subject to transformation must belong
+     * to one of the listed "types". If this field is not provided, no type
+     * filtering will be performed (all resources of all types matching previous
+     * filtering parameters will be candidates for transformation).
+     * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder getGroupKindsOrBuilder( + int index) { + return groupKinds_.get(index); + } + + public static final int JSON_PATH_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object jsonPath_ = ""; + /** + * + * + *
+     * This is a [JSONPath]
+     * (https://github.com/json-path/JsonPath/blob/master/README.md)
+     * expression that matches specific fields of candidate
+     * resources and it operates as a filtering parameter (resources that
+     * are not matched with this expression will not be candidates for
+     * transformation).
+     * 
+ * + * string json_path = 3; + * + * @return The jsonPath. + */ + @java.lang.Override + public java.lang.String getJsonPath() { + java.lang.Object ref = jsonPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + jsonPath_ = s; + return s; + } + } + /** + * + * + *
+     * This is a [JSONPath]
+     * (https://github.com/json-path/JsonPath/blob/master/README.md)
+     * expression that matches specific fields of candidate
+     * resources and it operates as a filtering parameter (resources that
+     * are not matched with this expression will not be candidates for
+     * transformation).
+     * 
+ * + * string json_path = 3; + * + * @return The bytes for jsonPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getJsonPathBytes() { + java.lang.Object ref = jsonPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + jsonPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < namespaces_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, namespaces_.getRaw(i)); + } + for (int i = 0; i < groupKinds_.size(); i++) { + output.writeMessage(2, groupKinds_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(jsonPath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, jsonPath_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < namespaces_.size(); i++) { + dataSize += computeStringSizeNoTag(namespaces_.getRaw(i)); + } + size += dataSize; + size += 1 * getNamespacesList().size(); + } + for (int i = 0; i < groupKinds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, groupKinds_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(jsonPath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, jsonPath_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter)) { + return super.equals(obj); + } + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter other = + (com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter) obj; + + if (!getNamespacesList().equals(other.getNamespacesList())) return false; + if (!getGroupKindsList().equals(other.getGroupKindsList())) return false; + if (!getJsonPath().equals(other.getJsonPath())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNamespacesCount() > 0) { + hash = (37 * hash) + NAMESPACES_FIELD_NUMBER; + hash = (53 * hash) + getNamespacesList().hashCode(); + } + if (getGroupKindsCount() > 0) { + hash = (37 * hash) + GROUP_KINDS_FIELD_NUMBER; + hash = (53 * hash) + getGroupKindsList().hashCode(); + } + hash = (37 * hash) + JSON_PATH_FIELD_NUMBER; + hash = (53 * hash) + getJsonPath().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * ResourceFilter specifies matching criteria to limit the scope of a
+     * change to a specific set of kubernetes resources that are selected for
+     * restoration from a backup.
+     * 
+ * + * Protobuf type {@code google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter) + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_ResourceFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_ResourceFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter.class, + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter.Builder.class); + } + + // Construct using com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + namespaces_ = com.google.protobuf.LazyStringArrayList.emptyList(); + if (groupKindsBuilder_ == null) { + groupKinds_ = java.util.Collections.emptyList(); + } else { + groupKinds_ = null; + groupKindsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + jsonPath_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_ResourceFilter_descriptor; + } + + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter + getDefaultInstanceForType() { + return com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter build() { + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter buildPartial() { + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter result = + new com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter result) { + if (groupKindsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + groupKinds_ = java.util.Collections.unmodifiableList(groupKinds_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.groupKinds_ = groupKinds_; + } else { + result.groupKinds_ = groupKindsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + namespaces_.makeImmutable(); + result.namespaces_ = namespaces_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.jsonPath_ = jsonPath_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter) { + return mergeFrom((com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter other) { + if (other + == com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter.getDefaultInstance()) + return this; + if (!other.namespaces_.isEmpty()) { + if (namespaces_.isEmpty()) { + namespaces_ = other.namespaces_; + bitField0_ |= 0x00000001; + } else { + ensureNamespacesIsMutable(); + namespaces_.addAll(other.namespaces_); + } + onChanged(); + } + if (groupKindsBuilder_ == null) { + if (!other.groupKinds_.isEmpty()) { + if (groupKinds_.isEmpty()) { + groupKinds_ = other.groupKinds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureGroupKindsIsMutable(); + groupKinds_.addAll(other.groupKinds_); + } + onChanged(); + } + } else { + if (!other.groupKinds_.isEmpty()) { + if (groupKindsBuilder_.isEmpty()) { + groupKindsBuilder_.dispose(); + groupKindsBuilder_ = null; + groupKinds_ = other.groupKinds_; + bitField0_ = (bitField0_ & ~0x00000002); + groupKindsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getGroupKindsFieldBuilder() + : null; + } else { + groupKindsBuilder_.addAllMessages(other.groupKinds_); + } + } + } + if (!other.getJsonPath().isEmpty()) { + jsonPath_ = other.jsonPath_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureNamespacesIsMutable(); + namespaces_.add(s); + break; + } // case 10 + case 18: + { + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind m = + input.readMessage( + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.parser(), + extensionRegistry); + if (groupKindsBuilder_ == null) { + ensureGroupKindsIsMutable(); + groupKinds_.add(m); + } else { + groupKindsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + jsonPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList namespaces_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureNamespacesIsMutable() { + if (!namespaces_.isModifiable()) { + namespaces_ = new com.google.protobuf.LazyStringArrayList(namespaces_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for transformation).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string namespaces = 1; + * + * @return A list containing the namespaces. + */ + public com.google.protobuf.ProtocolStringList getNamespacesList() { + namespaces_.makeImmutable(); + return namespaces_; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for transformation).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string namespaces = 1; + * + * @return The count of namespaces. + */ + public int getNamespacesCount() { + return namespaces_.size(); + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for transformation).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string namespaces = 1; + * + * @param index The index of the element to return. + * @return The namespaces at the given index. + */ + public java.lang.String getNamespaces(int index) { + return namespaces_.get(index); + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for transformation).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string namespaces = 1; + * + * @param index The index of the value to return. + * @return The bytes of the namespaces at the given index. + */ + public com.google.protobuf.ByteString getNamespacesBytes(int index) { + return namespaces_.getByteString(index); + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for transformation).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string namespaces = 1; + * + * @param index The index to set the value at. + * @param value The namespaces to set. + * @return This builder for chaining. + */ + public Builder setNamespaces(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamespacesIsMutable(); + namespaces_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for transformation).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string namespaces = 1; + * + * @param value The namespaces to add. + * @return This builder for chaining. + */ + public Builder addNamespaces(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamespacesIsMutable(); + namespaces_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for transformation).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string namespaces = 1; + * + * @param values The namespaces to add. + * @return This builder for chaining. + */ + public Builder addAllNamespaces(java.lang.Iterable values) { + ensureNamespacesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, namespaces_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for transformation).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string namespaces = 1; + * + * @return This builder for chaining. + */ + public Builder clearNamespaces() { + namespaces_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must be
+       * contained within one of the listed Kubernetes Namespace in the Backup.
+       * If this field is not provided, no namespace filtering will be performed
+       * (all resources in all Namespaces, including all cluster-scoped resources,
+       * will be candidates for transformation).
+       * To mix cluster-scoped and namespaced resources in the same rule, use an
+       * empty string ("") as one of the target namespaces.
+       * 
+ * + * repeated string namespaces = 1; + * + * @param value The bytes of the namespaces to add. + * @return This builder for chaining. + */ + public Builder addNamespacesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureNamespacesIsMutable(); + namespaces_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List groupKinds_ = + java.util.Collections.emptyList(); + + private void ensureGroupKindsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + groupKinds_ = + new java.util.ArrayList( + groupKinds_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder> + groupKindsBuilder_; + + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public java.util.List + getGroupKindsList() { + if (groupKindsBuilder_ == null) { + return java.util.Collections.unmodifiableList(groupKinds_); + } else { + return groupKindsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public int getGroupKindsCount() { + if (groupKindsBuilder_ == null) { + return groupKinds_.size(); + } else { + return groupKindsBuilder_.getCount(); + } + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind getGroupKinds(int index) { + if (groupKindsBuilder_ == null) { + return groupKinds_.get(index); + } else { + return groupKindsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public Builder setGroupKinds( + int index, com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind value) { + if (groupKindsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupKindsIsMutable(); + groupKinds_.set(index, value); + onChanged(); + } else { + groupKindsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public Builder setGroupKinds( + int index, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder builderForValue) { + if (groupKindsBuilder_ == null) { + ensureGroupKindsIsMutable(); + groupKinds_.set(index, builderForValue.build()); + onChanged(); + } else { + groupKindsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public Builder addGroupKinds(com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind value) { + if (groupKindsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupKindsIsMutable(); + groupKinds_.add(value); + onChanged(); + } else { + groupKindsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public Builder addGroupKinds( + int index, com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind value) { + if (groupKindsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupKindsIsMutable(); + groupKinds_.add(index, value); + onChanged(); + } else { + groupKindsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public Builder addGroupKinds( + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder builderForValue) { + if (groupKindsBuilder_ == null) { + ensureGroupKindsIsMutable(); + groupKinds_.add(builderForValue.build()); + onChanged(); + } else { + groupKindsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public Builder addGroupKinds( + int index, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder builderForValue) { + if (groupKindsBuilder_ == null) { + ensureGroupKindsIsMutable(); + groupKinds_.add(index, builderForValue.build()); + onChanged(); + } else { + groupKindsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public Builder addAllGroupKinds( + java.lang.Iterable + values) { + if (groupKindsBuilder_ == null) { + ensureGroupKindsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, groupKinds_); + onChanged(); + } else { + groupKindsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public Builder clearGroupKinds() { + if (groupKindsBuilder_ == null) { + groupKinds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + groupKindsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public Builder removeGroupKinds(int index) { + if (groupKindsBuilder_ == null) { + ensureGroupKindsIsMutable(); + groupKinds_.remove(index); + onChanged(); + } else { + groupKindsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder getGroupKindsBuilder( + int index) { + return getGroupKindsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder getGroupKindsOrBuilder( + int index) { + if (groupKindsBuilder_ == null) { + return groupKinds_.get(index); + } else { + return groupKindsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public java.util.List< + ? extends com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder> + getGroupKindsOrBuilderList() { + if (groupKindsBuilder_ != null) { + return groupKindsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(groupKinds_); + } + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder addGroupKindsBuilder() { + return getGroupKindsFieldBuilder() + .addBuilder(com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.getDefaultInstance()); + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder addGroupKindsBuilder( + int index) { + return getGroupKindsFieldBuilder() + .addBuilder( + index, com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.getDefaultInstance()); + } + /** + * + * + *
+       * (Filtering parameter) Any resource subject to transformation must belong
+       * to one of the listed "types". If this field is not provided, no type
+       * filtering will be performed (all resources of all types matching previous
+       * filtering parameters will be candidates for transformation).
+       * 
+ * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kinds = 2; + */ + public java.util.List + getGroupKindsBuilderList() { + return getGroupKindsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder> + getGroupKindsFieldBuilder() { + if (groupKindsBuilder_ == null) { + groupKindsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder>( + groupKinds_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + groupKinds_ = null; + } + return groupKindsBuilder_; + } + + private java.lang.Object jsonPath_ = ""; + /** + * + * + *
+       * This is a [JSONPath]
+       * (https://github.com/json-path/JsonPath/blob/master/README.md)
+       * expression that matches specific fields of candidate
+       * resources and it operates as a filtering parameter (resources that
+       * are not matched with this expression will not be candidates for
+       * transformation).
+       * 
+ * + * string json_path = 3; + * + * @return The jsonPath. + */ + public java.lang.String getJsonPath() { + java.lang.Object ref = jsonPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + jsonPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * This is a [JSONPath]
+       * (https://github.com/json-path/JsonPath/blob/master/README.md)
+       * expression that matches specific fields of candidate
+       * resources and it operates as a filtering parameter (resources that
+       * are not matched with this expression will not be candidates for
+       * transformation).
+       * 
+ * + * string json_path = 3; + * + * @return The bytes for jsonPath. + */ + public com.google.protobuf.ByteString getJsonPathBytes() { + java.lang.Object ref = jsonPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + jsonPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * This is a [JSONPath]
+       * (https://github.com/json-path/JsonPath/blob/master/README.md)
+       * expression that matches specific fields of candidate
+       * resources and it operates as a filtering parameter (resources that
+       * are not matched with this expression will not be candidates for
+       * transformation).
+       * 
+ * + * string json_path = 3; + * + * @param value The jsonPath to set. + * @return This builder for chaining. + */ + public Builder setJsonPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + jsonPath_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * This is a [JSONPath]
+       * (https://github.com/json-path/JsonPath/blob/master/README.md)
+       * expression that matches specific fields of candidate
+       * resources and it operates as a filtering parameter (resources that
+       * are not matched with this expression will not be candidates for
+       * transformation).
+       * 
+ * + * string json_path = 3; + * + * @return This builder for chaining. + */ + public Builder clearJsonPath() { + jsonPath_ = getDefaultInstance().getJsonPath(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * This is a [JSONPath]
+       * (https://github.com/json-path/JsonPath/blob/master/README.md)
+       * expression that matches specific fields of candidate
+       * resources and it operates as a filtering parameter (resources that
+       * are not matched with this expression will not be candidates for
+       * transformation).
+       * 
+ * + * string json_path = 3; + * + * @param value The bytes for jsonPath to set. + * @return This builder for chaining. + */ + public Builder setJsonPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + jsonPath_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter) + } + + // @@protoc_insertion_point(class_scope:google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter) + private static final com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter(); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResourceFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(builder.buildPartial()); } @@ -2618,286 +9215,177 @@ public ClusterResourceRestoreScope parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope - getDefaultInstanceForType() { + public com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface SubstitutionRuleOrBuilder + public interface TransformationRuleOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) + // @@protoc_insertion_point(interface_extends:google.cloud.gkebackup.v1.RestoreConfig.TransformationRule) com.google.protobuf.MessageOrBuilder { /** * * *
-     * (Filtering parameter) Any resource subject to substitution must be
-     * contained within one of the listed Kubernetes Namespace in the Backup.
-     * If this field is not provided, no namespace filtering will be performed
-     * (all resources in all Namespaces, including all cluster-scoped resources,
-     * will be candidates for substitution).
-     * To mix cluster-scoped and namespaced resources in the same rule, use an
-     * empty string ("") as one of the target namespaces.
-     * 
- * - * repeated string target_namespaces = 1; - * - * @return A list containing the targetNamespaces. - */ - java.util.List getTargetNamespacesList(); - /** - * - * - *
-     * (Filtering parameter) Any resource subject to substitution must be
-     * contained within one of the listed Kubernetes Namespace in the Backup.
-     * If this field is not provided, no namespace filtering will be performed
-     * (all resources in all Namespaces, including all cluster-scoped resources,
-     * will be candidates for substitution).
-     * To mix cluster-scoped and namespaced resources in the same rule, use an
-     * empty string ("") as one of the target namespaces.
-     * 
- * - * repeated string target_namespaces = 1; - * - * @return The count of targetNamespaces. - */ - int getTargetNamespacesCount(); - /** - * - * - *
-     * (Filtering parameter) Any resource subject to substitution must be
-     * contained within one of the listed Kubernetes Namespace in the Backup.
-     * If this field is not provided, no namespace filtering will be performed
-     * (all resources in all Namespaces, including all cluster-scoped resources,
-     * will be candidates for substitution).
-     * To mix cluster-scoped and namespaced resources in the same rule, use an
-     * empty string ("") as one of the target namespaces.
-     * 
- * - * repeated string target_namespaces = 1; - * - * @param index The index of the element to return. - * @return The targetNamespaces at the given index. - */ - java.lang.String getTargetNamespaces(int index); - /** - * - * - *
-     * (Filtering parameter) Any resource subject to substitution must be
-     * contained within one of the listed Kubernetes Namespace in the Backup.
-     * If this field is not provided, no namespace filtering will be performed
-     * (all resources in all Namespaces, including all cluster-scoped resources,
-     * will be candidates for substitution).
-     * To mix cluster-scoped and namespaced resources in the same rule, use an
-     * empty string ("") as one of the target namespaces.
-     * 
- * - * repeated string target_namespaces = 1; - * - * @param index The index of the value to return. - * @return The bytes of the targetNamespaces at the given index. - */ - com.google.protobuf.ByteString getTargetNamespacesBytes(int index); - - /** - * - * - *
-     * (Filtering parameter) Any resource subject to substitution must belong to
-     * one of the listed "types".
-     * If this field is not provided, no type filtering will be performed (all
-     * resources of all types matching previous filtering parameters will be
-     * candidates for substitution).
+     * Required. A list of transformation rule actions to take against candidate
+     * resources. Actions are executed in order defined - this order matters, as
+     * they could potentially interfere with each other and the first operation
+     * could affect the outcome of the second operation.
      * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - java.util.List getTargetGroupKindsList(); + java.util.List + getFieldActionsList(); /** * * *
-     * (Filtering parameter) Any resource subject to substitution must belong to
-     * one of the listed "types".
-     * If this field is not provided, no type filtering will be performed (all
-     * resources of all types matching previous filtering parameters will be
-     * candidates for substitution).
+     * Required. A list of transformation rule actions to take against candidate
+     * resources. Actions are executed in order defined - this order matters, as
+     * they could potentially interfere with each other and the first operation
+     * could affect the outcome of the second operation.
      * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind getTargetGroupKinds(int index); + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction getFieldActions(int index); /** * * *
-     * (Filtering parameter) Any resource subject to substitution must belong to
-     * one of the listed "types".
-     * If this field is not provided, no type filtering will be performed (all
-     * resources of all types matching previous filtering parameters will be
-     * candidates for substitution).
+     * Required. A list of transformation rule actions to take against candidate
+     * resources. Actions are executed in order defined - this order matters, as
+     * they could potentially interfere with each other and the first operation
+     * could affect the outcome of the second operation.
      * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - int getTargetGroupKindsCount(); + int getFieldActionsCount(); /** * * *
-     * (Filtering parameter) Any resource subject to substitution must belong to
-     * one of the listed "types".
-     * If this field is not provided, no type filtering will be performed (all
-     * resources of all types matching previous filtering parameters will be
-     * candidates for substitution).
+     * Required. A list of transformation rule actions to take against candidate
+     * resources. Actions are executed in order defined - this order matters, as
+     * they could potentially interfere with each other and the first operation
+     * could affect the outcome of the second operation.
      * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - java.util.List - getTargetGroupKindsOrBuilderList(); + java.util.List< + ? extends com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleActionOrBuilder> + getFieldActionsOrBuilderList(); /** * * *
-     * (Filtering parameter) Any resource subject to substitution must belong to
-     * one of the listed "types".
-     * If this field is not provided, no type filtering will be performed (all
-     * resources of all types matching previous filtering parameters will be
-     * candidates for substitution).
+     * Required. A list of transformation rule actions to take against candidate
+     * resources. Actions are executed in order defined - this order matters, as
+     * they could potentially interfere with each other and the first operation
+     * could affect the outcome of the second operation.
      * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder getTargetGroupKindsOrBuilder( - int index); + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleActionOrBuilder + getFieldActionsOrBuilder(int index); /** * * *
-     * Required. This is a [JSONPath]
-     * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
-     * expression that matches specific fields of candidate
-     * resources and it operates as both a filtering parameter (resources that
-     * are not matched with this expression will not be candidates for
-     * substitution) as well as a field identifier (identifies exactly which
-     * fields out of the candidate resources will be modified).
-     * 
- * - * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The targetJsonPath. - */ - java.lang.String getTargetJsonPath(); - /** - * - * - *
-     * Required. This is a [JSONPath]
-     * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
-     * expression that matches specific fields of candidate
-     * resources and it operates as both a filtering parameter (resources that
-     * are not matched with this expression will not be candidates for
-     * substitution) as well as a field identifier (identifies exactly which
-     * fields out of the candidate resources will be modified).
+     * This field is used to specify a set of fields that should be used to
+     * determine which resources in backup should be acted upon by the supplied
+     * transformation rule actions, and this will ensure that only specific
+     * resources are affected by transformation rule actions.
      * 
* - * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resource_filter = 2; * - * @return The bytes for targetJsonPath. + * @return Whether the resourceFilter field is set. */ - com.google.protobuf.ByteString getTargetJsonPathBytes(); - + boolean hasResourceFilter(); /** * * *
-     * (Filtering parameter) This is a [regular expression]
-     * (https://en.wikipedia.org/wiki/Regular_expression)
-     * that is compared against the fields matched by the target_json_path
-     * expression (and must also have passed the previous filters).
-     * Substitution will not be performed against fields whose
-     * value does not match this expression. If this field is NOT specified,
-     * then ALL fields matched by the target_json_path expression will undergo
-     * substitution. Note that an empty (e.g., "", rather than unspecified)
-     * value for this field will only match empty fields.
+     * This field is used to specify a set of fields that should be used to
+     * determine which resources in backup should be acted upon by the supplied
+     * transformation rule actions, and this will ensure that only specific
+     * resources are affected by transformation rule actions.
      * 
* - * string original_value_pattern = 4; + * .google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resource_filter = 2; * - * @return The originalValuePattern. + * @return The resourceFilter. */ - java.lang.String getOriginalValuePattern(); + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter getResourceFilter(); /** * * *
-     * (Filtering parameter) This is a [regular expression]
-     * (https://en.wikipedia.org/wiki/Regular_expression)
-     * that is compared against the fields matched by the target_json_path
-     * expression (and must also have passed the previous filters).
-     * Substitution will not be performed against fields whose
-     * value does not match this expression. If this field is NOT specified,
-     * then ALL fields matched by the target_json_path expression will undergo
-     * substitution. Note that an empty (e.g., "", rather than unspecified)
-     * value for this field will only match empty fields.
+     * This field is used to specify a set of fields that should be used to
+     * determine which resources in backup should be acted upon by the supplied
+     * transformation rule actions, and this will ensure that only specific
+     * resources are affected by transformation rule actions.
      * 
* - * string original_value_pattern = 4; - * - * @return The bytes for originalValuePattern. + * .google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resource_filter = 2; */ - com.google.protobuf.ByteString getOriginalValuePatternBytes(); + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilterOrBuilder + getResourceFilterOrBuilder(); /** * * *
-     * This is the new value to set for any fields that pass the filtering and
-     * selection criteria. To remove a value from a Kubernetes resource, either
-     * leave this field unspecified, or set it to the empty string ("").
+     * The description is a user specified string description of the
+     * transformation rule.
      * 
* - * string new_value = 5; + * string description = 3; * - * @return The newValue. + * @return The description. */ - java.lang.String getNewValue(); + java.lang.String getDescription(); /** * * *
-     * This is the new value to set for any fields that pass the filtering and
-     * selection criteria. To remove a value from a Kubernetes resource, either
-     * leave this field unspecified, or set it to the empty string ("").
+     * The description is a user specified string description of the
+     * transformation rule.
      * 
* - * string new_value = 5; + * string description = 3; * - * @return The bytes for newValue. + * @return The bytes for description. */ - com.google.protobuf.ByteString getNewValueBytes(); + com.google.protobuf.ByteString getDescriptionBytes(); } /** * @@ -2905,392 +9393,233 @@ com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder getTargetGroupKin *
    * A transformation rule to be applied against Kubernetes resources as they
    * are selected for restoration from a Backup. A rule contains both filtering
-   * logic (which resources are subject to substitution) and substitution logic.
+   * logic (which resources are subject to transform) and transformation logic.
    * 
* - * Protobuf type {@code google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule} + * Protobuf type {@code google.cloud.gkebackup.v1.RestoreConfig.TransformationRule} */ - public static final class SubstitutionRule extends com.google.protobuf.GeneratedMessageV3 + public static final class TransformationRule extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) - SubstitutionRuleOrBuilder { + // @@protoc_insertion_point(message_implements:google.cloud.gkebackup.v1.RestoreConfig.TransformationRule) + TransformationRuleOrBuilder { private static final long serialVersionUID = 0L; - // Use SubstitutionRule.newBuilder() to construct. - private SubstitutionRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use TransformationRule.newBuilder() to construct. + private TransformationRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private SubstitutionRule() { - targetNamespaces_ = com.google.protobuf.LazyStringArrayList.emptyList(); - targetGroupKinds_ = java.util.Collections.emptyList(); - targetJsonPath_ = ""; - originalValuePattern_ = ""; - newValue_ = ""; + private TransformationRule() { + fieldActions_ = java.util.Collections.emptyList(); + description_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SubstitutionRule(); + return new TransformationRule(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.gkebackup.v1.RestoreProto - .internal_static_google_cloud_gkebackup_v1_RestoreConfig_SubstitutionRule_descriptor; + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRule_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.gkebackup.v1.RestoreProto - .internal_static_google_cloud_gkebackup_v1_RestoreConfig_SubstitutionRule_fieldAccessorTable + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRule_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.class, - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder.class); - } - - public static final int TARGET_NAMESPACES_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList targetNamespaces_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - /** - * - * - *
-     * (Filtering parameter) Any resource subject to substitution must be
-     * contained within one of the listed Kubernetes Namespace in the Backup.
-     * If this field is not provided, no namespace filtering will be performed
-     * (all resources in all Namespaces, including all cluster-scoped resources,
-     * will be candidates for substitution).
-     * To mix cluster-scoped and namespaced resources in the same rule, use an
-     * empty string ("") as one of the target namespaces.
-     * 
- * - * repeated string target_namespaces = 1; - * - * @return A list containing the targetNamespaces. - */ - public com.google.protobuf.ProtocolStringList getTargetNamespacesList() { - return targetNamespaces_; - } - /** - * - * - *
-     * (Filtering parameter) Any resource subject to substitution must be
-     * contained within one of the listed Kubernetes Namespace in the Backup.
-     * If this field is not provided, no namespace filtering will be performed
-     * (all resources in all Namespaces, including all cluster-scoped resources,
-     * will be candidates for substitution).
-     * To mix cluster-scoped and namespaced resources in the same rule, use an
-     * empty string ("") as one of the target namespaces.
-     * 
- * - * repeated string target_namespaces = 1; - * - * @return The count of targetNamespaces. - */ - public int getTargetNamespacesCount() { - return targetNamespaces_.size(); - } - /** - * - * - *
-     * (Filtering parameter) Any resource subject to substitution must be
-     * contained within one of the listed Kubernetes Namespace in the Backup.
-     * If this field is not provided, no namespace filtering will be performed
-     * (all resources in all Namespaces, including all cluster-scoped resources,
-     * will be candidates for substitution).
-     * To mix cluster-scoped and namespaced resources in the same rule, use an
-     * empty string ("") as one of the target namespaces.
-     * 
- * - * repeated string target_namespaces = 1; - * - * @param index The index of the element to return. - * @return The targetNamespaces at the given index. - */ - public java.lang.String getTargetNamespaces(int index) { - return targetNamespaces_.get(index); - } - /** - * - * - *
-     * (Filtering parameter) Any resource subject to substitution must be
-     * contained within one of the listed Kubernetes Namespace in the Backup.
-     * If this field is not provided, no namespace filtering will be performed
-     * (all resources in all Namespaces, including all cluster-scoped resources,
-     * will be candidates for substitution).
-     * To mix cluster-scoped and namespaced resources in the same rule, use an
-     * empty string ("") as one of the target namespaces.
-     * 
- * - * repeated string target_namespaces = 1; - * - * @param index The index of the value to return. - * @return The bytes of the targetNamespaces at the given index. - */ - public com.google.protobuf.ByteString getTargetNamespacesBytes(int index) { - return targetNamespaces_.getByteString(index); + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.class, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.Builder.class); } - public static final int TARGET_GROUP_KINDS_FIELD_NUMBER = 2; + public static final int FIELD_ACTIONS_FIELD_NUMBER = 1; @SuppressWarnings("serial") - private java.util.List targetGroupKinds_; + private java.util.List + fieldActions_; /** * * *
-     * (Filtering parameter) Any resource subject to substitution must belong to
-     * one of the listed "types".
-     * If this field is not provided, no type filtering will be performed (all
-     * resources of all types matching previous filtering parameters will be
-     * candidates for substitution).
+     * Required. A list of transformation rule actions to take against candidate
+     * resources. Actions are executed in order defined - this order matters, as
+     * they could potentially interfere with each other and the first operation
+     * could affect the outcome of the second operation.
      * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ @java.lang.Override - public java.util.List - getTargetGroupKindsList() { - return targetGroupKinds_; + public java.util.List + getFieldActionsList() { + return fieldActions_; } /** * * *
-     * (Filtering parameter) Any resource subject to substitution must belong to
-     * one of the listed "types".
-     * If this field is not provided, no type filtering will be performed (all
-     * resources of all types matching previous filtering parameters will be
-     * candidates for substitution).
+     * Required. A list of transformation rule actions to take against candidate
+     * resources. Actions are executed in order defined - this order matters, as
+     * they could potentially interfere with each other and the first operation
+     * could affect the outcome of the second operation.
      * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ @java.lang.Override - public java.util.List - getTargetGroupKindsOrBuilderList() { - return targetGroupKinds_; + public java.util.List< + ? extends com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleActionOrBuilder> + getFieldActionsOrBuilderList() { + return fieldActions_; } /** * * *
-     * (Filtering parameter) Any resource subject to substitution must belong to
-     * one of the listed "types".
-     * If this field is not provided, no type filtering will be performed (all
-     * resources of all types matching previous filtering parameters will be
-     * candidates for substitution).
+     * Required. A list of transformation rule actions to take against candidate
+     * resources. Actions are executed in order defined - this order matters, as
+     * they could potentially interfere with each other and the first operation
+     * could affect the outcome of the second operation.
      * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ @java.lang.Override - public int getTargetGroupKindsCount() { - return targetGroupKinds_.size(); + public int getFieldActionsCount() { + return fieldActions_.size(); } /** * * *
-     * (Filtering parameter) Any resource subject to substitution must belong to
-     * one of the listed "types".
-     * If this field is not provided, no type filtering will be performed (all
-     * resources of all types matching previous filtering parameters will be
-     * candidates for substitution).
+     * Required. A list of transformation rule actions to take against candidate
+     * resources. Actions are executed in order defined - this order matters, as
+     * they could potentially interfere with each other and the first operation
+     * could affect the outcome of the second operation.
      * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ @java.lang.Override - public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind getTargetGroupKinds(int index) { - return targetGroupKinds_.get(index); + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction getFieldActions( + int index) { + return fieldActions_.get(index); } /** * * *
-     * (Filtering parameter) Any resource subject to substitution must belong to
-     * one of the listed "types".
-     * If this field is not provided, no type filtering will be performed (all
-     * resources of all types matching previous filtering parameters will be
-     * candidates for substitution).
+     * Required. A list of transformation rule actions to take against candidate
+     * resources. Actions are executed in order defined - this order matters, as
+     * they could potentially interfere with each other and the first operation
+     * could affect the outcome of the second operation.
      * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ @java.lang.Override - public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder - getTargetGroupKindsOrBuilder(int index) { - return targetGroupKinds_.get(index); + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleActionOrBuilder + getFieldActionsOrBuilder(int index) { + return fieldActions_.get(index); } - public static final int TARGET_JSON_PATH_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private volatile java.lang.Object targetJsonPath_ = ""; - /** - * - * - *
-     * Required. This is a [JSONPath]
-     * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
-     * expression that matches specific fields of candidate
-     * resources and it operates as both a filtering parameter (resources that
-     * are not matched with this expression will not be candidates for
-     * substitution) as well as a field identifier (identifies exactly which
-     * fields out of the candidate resources will be modified).
-     * 
- * - * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The targetJsonPath. - */ - @java.lang.Override - public java.lang.String getTargetJsonPath() { - java.lang.Object ref = targetJsonPath_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - targetJsonPath_ = s; - return s; - } - } + public static final int RESOURCE_FILTER_FIELD_NUMBER = 2; + private com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resourceFilter_; /** * * *
-     * Required. This is a [JSONPath]
-     * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
-     * expression that matches specific fields of candidate
-     * resources and it operates as both a filtering parameter (resources that
-     * are not matched with this expression will not be candidates for
-     * substitution) as well as a field identifier (identifies exactly which
-     * fields out of the candidate resources will be modified).
+     * This field is used to specify a set of fields that should be used to
+     * determine which resources in backup should be acted upon by the supplied
+     * transformation rule actions, and this will ensure that only specific
+     * resources are affected by transformation rule actions.
      * 
* - * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for targetJsonPath. - */ - @java.lang.Override - public com.google.protobuf.ByteString getTargetJsonPathBytes() { - java.lang.Object ref = targetJsonPath_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - targetJsonPath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORIGINAL_VALUE_PATTERN_FIELD_NUMBER = 4; - - @SuppressWarnings("serial") - private volatile java.lang.Object originalValuePattern_ = ""; - /** - * + * .google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resource_filter = 2; * - *
-     * (Filtering parameter) This is a [regular expression]
-     * (https://en.wikipedia.org/wiki/Regular_expression)
-     * that is compared against the fields matched by the target_json_path
-     * expression (and must also have passed the previous filters).
-     * Substitution will not be performed against fields whose
-     * value does not match this expression. If this field is NOT specified,
-     * then ALL fields matched by the target_json_path expression will undergo
-     * substitution. Note that an empty (e.g., "", rather than unspecified)
-     * value for this field will only match empty fields.
+     * @return Whether the resourceFilter field is set.
+     */
+    @java.lang.Override
+    public boolean hasResourceFilter() {
+      return resourceFilter_ != null;
+    }
+    /**
+     *
+     *
+     * 
+     * This field is used to specify a set of fields that should be used to
+     * determine which resources in backup should be acted upon by the supplied
+     * transformation rule actions, and this will ensure that only specific
+     * resources are affected by transformation rule actions.
      * 
* - * string original_value_pattern = 4; + * .google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resource_filter = 2; * - * @return The originalValuePattern. + * @return The resourceFilter. */ @java.lang.Override - public java.lang.String getOriginalValuePattern() { - java.lang.Object ref = originalValuePattern_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - originalValuePattern_ = s; - return s; - } + public com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter getResourceFilter() { + return resourceFilter_ == null + ? com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter.getDefaultInstance() + : resourceFilter_; } /** * * *
-     * (Filtering parameter) This is a [regular expression]
-     * (https://en.wikipedia.org/wiki/Regular_expression)
-     * that is compared against the fields matched by the target_json_path
-     * expression (and must also have passed the previous filters).
-     * Substitution will not be performed against fields whose
-     * value does not match this expression. If this field is NOT specified,
-     * then ALL fields matched by the target_json_path expression will undergo
-     * substitution. Note that an empty (e.g., "", rather than unspecified)
-     * value for this field will only match empty fields.
+     * This field is used to specify a set of fields that should be used to
+     * determine which resources in backup should be acted upon by the supplied
+     * transformation rule actions, and this will ensure that only specific
+     * resources are affected by transformation rule actions.
      * 
* - * string original_value_pattern = 4; - * - * @return The bytes for originalValuePattern. + * .google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resource_filter = 2; */ @java.lang.Override - public com.google.protobuf.ByteString getOriginalValuePatternBytes() { - java.lang.Object ref = originalValuePattern_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - originalValuePattern_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilterOrBuilder + getResourceFilterOrBuilder() { + return resourceFilter_ == null + ? com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter.getDefaultInstance() + : resourceFilter_; } - public static final int NEW_VALUE_FIELD_NUMBER = 5; + public static final int DESCRIPTION_FIELD_NUMBER = 3; @SuppressWarnings("serial") - private volatile java.lang.Object newValue_ = ""; + private volatile java.lang.Object description_ = ""; /** * * *
-     * This is the new value to set for any fields that pass the filtering and
-     * selection criteria. To remove a value from a Kubernetes resource, either
-     * leave this field unspecified, or set it to the empty string ("").
+     * The description is a user specified string description of the
+     * transformation rule.
      * 
* - * string new_value = 5; + * string description = 3; * - * @return The newValue. + * @return The description. */ @java.lang.Override - public java.lang.String getNewValue() { - java.lang.Object ref = newValue_; + public java.lang.String getDescription() { + java.lang.Object ref = description_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - newValue_ = s; + description_ = s; return s; } } @@ -3298,22 +9627,21 @@ public java.lang.String getNewValue() { * * *
-     * This is the new value to set for any fields that pass the filtering and
-     * selection criteria. To remove a value from a Kubernetes resource, either
-     * leave this field unspecified, or set it to the empty string ("").
+     * The description is a user specified string description of the
+     * transformation rule.
      * 
* - * string new_value = 5; + * string description = 3; * - * @return The bytes for newValue. + * @return The bytes for description. */ @java.lang.Override - public com.google.protobuf.ByteString getNewValueBytes() { - java.lang.Object ref = newValue_; + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - newValue_ = b; + description_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; @@ -3334,20 +9662,14 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < targetNamespaces_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, targetNamespaces_.getRaw(i)); - } - for (int i = 0; i < targetGroupKinds_.size(); i++) { - output.writeMessage(2, targetGroupKinds_.get(i)); + for (int i = 0; i < fieldActions_.size(); i++) { + output.writeMessage(1, fieldActions_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(targetJsonPath_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, targetJsonPath_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(originalValuePattern_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, originalValuePattern_); + if (resourceFilter_ != null) { + output.writeMessage(2, getResourceFilter()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(newValue_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, newValue_); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); } getUnknownFields().writeTo(output); } @@ -3358,26 +9680,14 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - { - int dataSize = 0; - for (int i = 0; i < targetNamespaces_.size(); i++) { - dataSize += computeStringSizeNoTag(targetNamespaces_.getRaw(i)); - } - size += dataSize; - size += 1 * getTargetNamespacesList().size(); - } - for (int i = 0; i < targetGroupKinds_.size(); i++) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize(2, targetGroupKinds_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(targetJsonPath_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, targetJsonPath_); + for (int i = 0; i < fieldActions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, fieldActions_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(originalValuePattern_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, originalValuePattern_); + if (resourceFilter_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getResourceFilter()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(newValue_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, newValue_); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -3389,17 +9699,18 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule)) { + if (!(obj instanceof com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule)) { return super.equals(obj); } - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule other = - (com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) obj; + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule other = + (com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule) obj; - if (!getTargetNamespacesList().equals(other.getTargetNamespacesList())) return false; - if (!getTargetGroupKindsList().equals(other.getTargetGroupKindsList())) return false; - if (!getTargetJsonPath().equals(other.getTargetJsonPath())) return false; - if (!getOriginalValuePattern().equals(other.getOriginalValuePattern())) return false; - if (!getNewValue().equals(other.getNewValue())) return false; + if (!getFieldActionsList().equals(other.getFieldActionsList())) return false; + if (hasResourceFilter() != other.hasResourceFilter()) return false; + if (hasResourceFilter()) { + if (!getResourceFilter().equals(other.getResourceFilter())) return false; + } + if (!getDescription().equals(other.getDescription())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -3411,762 +9722,501 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getTargetNamespacesCount() > 0) { - hash = (37 * hash) + TARGET_NAMESPACES_FIELD_NUMBER; - hash = (53 * hash) + getTargetNamespacesList().hashCode(); + if (getFieldActionsCount() > 0) { + hash = (37 * hash) + FIELD_ACTIONS_FIELD_NUMBER; + hash = (53 * hash) + getFieldActionsList().hashCode(); } - if (getTargetGroupKindsCount() > 0) { - hash = (37 * hash) + TARGET_GROUP_KINDS_FIELD_NUMBER; - hash = (53 * hash) + getTargetGroupKindsList().hashCode(); + if (hasResourceFilter()) { + hash = (37 * hash) + RESOURCE_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getResourceFilter().hashCode(); } - hash = (37 * hash) + TARGET_JSON_PATH_FIELD_NUMBER; - hash = (53 * hash) + getTargetJsonPath().hashCode(); - hash = (37 * hash) + ORIGINAL_VALUE_PATTERN_FIELD_NUMBER; - hash = (53 * hash) + getOriginalValuePattern().hashCode(); - hash = (37 * hash) + NEW_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getNewValue().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule parseFrom( byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseDelimitedFrom( + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * A transformation rule to be applied against Kubernetes resources as they
-     * are selected for restoration from a Backup. A rule contains both filtering
-     * logic (which resources are subject to substitution) and substitution logic.
-     * 
- * - * Protobuf type {@code google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.gkebackup.v1.RestoreProto - .internal_static_google_cloud_gkebackup_v1_RestoreConfig_SubstitutionRule_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.gkebackup.v1.RestoreProto - .internal_static_google_cloud_gkebackup_v1_RestoreConfig_SubstitutionRule_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.class, - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder.class); - } - - // Construct using com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - targetNamespaces_ = com.google.protobuf.LazyStringArrayList.emptyList(); - if (targetGroupKindsBuilder_ == null) { - targetGroupKinds_ = java.util.Collections.emptyList(); - } else { - targetGroupKinds_ = null; - targetGroupKindsBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - targetJsonPath_ = ""; - originalValuePattern_ = ""; - newValue_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.gkebackup.v1.RestoreProto - .internal_static_google_cloud_gkebackup_v1_RestoreConfig_SubstitutionRule_descriptor; - } - - @java.lang.Override - public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule - getDefaultInstanceForType() { - return com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule build() { - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule buildPartial() { - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule result = - new com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } - private void buildPartialRepeatedFields( - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule result) { - if (targetGroupKindsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - targetGroupKinds_ = java.util.Collections.unmodifiableList(targetGroupKinds_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.targetGroupKinds_ = targetGroupKinds_; - } else { - result.targetGroupKinds_ = targetGroupKindsBuilder_.build(); - } - } + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } - private void buildPartial0( - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - targetNamespaces_.makeImmutable(); - result.targetNamespaces_ = targetNamespaces_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.targetJsonPath_ = targetJsonPath_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.originalValuePattern_ = originalValuePattern_; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.newValue_ = newValue_; - } - } + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } - @java.lang.Override - public Builder clone() { - return super.clone(); - } + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } + public static Builder newBuilder( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A transformation rule to be applied against Kubernetes resources as they
+     * are selected for restoration from a Backup. A rule contains both filtering
+     * logic (which resources are subject to transform) and transformation logic.
+     * 
+ * + * Protobuf type {@code google.cloud.gkebackup.v1.RestoreConfig.TransformationRule} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gkebackup.v1.RestoreConfig.TransformationRule) + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRule_descriptor; } @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) { - return mergeFrom((com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) other); - } else { - super.mergeFrom(other); - return this; - } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.class, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.Builder.class); } - public Builder mergeFrom(com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule other) { - if (other - == com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.getDefaultInstance()) - return this; - if (!other.targetNamespaces_.isEmpty()) { - if (targetNamespaces_.isEmpty()) { - targetNamespaces_ = other.targetNamespaces_; - bitField0_ |= 0x00000001; - } else { - ensureTargetNamespacesIsMutable(); - targetNamespaces_.addAll(other.targetNamespaces_); - } - onChanged(); - } - if (targetGroupKindsBuilder_ == null) { - if (!other.targetGroupKinds_.isEmpty()) { - if (targetGroupKinds_.isEmpty()) { - targetGroupKinds_ = other.targetGroupKinds_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureTargetGroupKindsIsMutable(); - targetGroupKinds_.addAll(other.targetGroupKinds_); - } - onChanged(); - } - } else { - if (!other.targetGroupKinds_.isEmpty()) { - if (targetGroupKindsBuilder_.isEmpty()) { - targetGroupKindsBuilder_.dispose(); - targetGroupKindsBuilder_ = null; - targetGroupKinds_ = other.targetGroupKinds_; - bitField0_ = (bitField0_ & ~0x00000002); - targetGroupKindsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getTargetGroupKindsFieldBuilder() - : null; - } else { - targetGroupKindsBuilder_.addAllMessages(other.targetGroupKinds_); - } - } - } - if (!other.getTargetJsonPath().isEmpty()) { - targetJsonPath_ = other.targetJsonPath_; - bitField0_ |= 0x00000004; - onChanged(); - } - if (!other.getOriginalValuePattern().isEmpty()) { - originalValuePattern_ = other.originalValuePattern_; - bitField0_ |= 0x00000008; - onChanged(); - } - if (!other.getNewValue().isEmpty()) { - newValue_ = other.newValue_; - bitField0_ |= 0x00000010; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } + // Construct using com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.newBuilder() + private Builder() {} - @java.lang.Override - public final boolean isInitialized() { - return true; + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); } @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - ensureTargetNamespacesIsMutable(); - targetNamespaces_.add(s); - break; - } // case 10 - case 18: - { - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind m = - input.readMessage( - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.parser(), - extensionRegistry); - if (targetGroupKindsBuilder_ == null) { - ensureTargetGroupKindsIsMutable(); - targetGroupKinds_.add(m); - } else { - targetGroupKindsBuilder_.addMessage(m); - } - break; - } // case 18 - case 26: - { - targetJsonPath_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - case 34: - { - originalValuePattern_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000008; - break; - } // case 34 - case 42: - { - newValue_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000010; - break; - } // case 42 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (fieldActionsBuilder_ == null) { + fieldActions_ = java.util.Collections.emptyList(); + } else { + fieldActions_ = null; + fieldActionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + resourceFilter_ = null; + if (resourceFilterBuilder_ != null) { + resourceFilterBuilder_.dispose(); + resourceFilterBuilder_ = null; + } + description_ = ""; return this; } - private int bitField0_; + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRule_descriptor; + } - private com.google.protobuf.LazyStringArrayList targetNamespaces_ = - com.google.protobuf.LazyStringArrayList.emptyList(); + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule + getDefaultInstanceForType() { + return com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.getDefaultInstance(); + } - private void ensureTargetNamespacesIsMutable() { - if (!targetNamespaces_.isModifiable()) { - targetNamespaces_ = new com.google.protobuf.LazyStringArrayList(targetNamespaces_); + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule build() { + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } - bitField0_ |= 0x00000001; + return result; } - /** - * - * - *
-       * (Filtering parameter) Any resource subject to substitution must be
-       * contained within one of the listed Kubernetes Namespace in the Backup.
-       * If this field is not provided, no namespace filtering will be performed
-       * (all resources in all Namespaces, including all cluster-scoped resources,
-       * will be candidates for substitution).
-       * To mix cluster-scoped and namespaced resources in the same rule, use an
-       * empty string ("") as one of the target namespaces.
-       * 
- * - * repeated string target_namespaces = 1; - * - * @return A list containing the targetNamespaces. - */ - public com.google.protobuf.ProtocolStringList getTargetNamespacesList() { - targetNamespaces_.makeImmutable(); - return targetNamespaces_; + + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule buildPartial() { + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule result = + new com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; } - /** - * - * - *
-       * (Filtering parameter) Any resource subject to substitution must be
-       * contained within one of the listed Kubernetes Namespace in the Backup.
-       * If this field is not provided, no namespace filtering will be performed
-       * (all resources in all Namespaces, including all cluster-scoped resources,
-       * will be candidates for substitution).
-       * To mix cluster-scoped and namespaced resources in the same rule, use an
-       * empty string ("") as one of the target namespaces.
-       * 
- * - * repeated string target_namespaces = 1; - * - * @return The count of targetNamespaces. - */ - public int getTargetNamespacesCount() { - return targetNamespaces_.size(); + + private void buildPartialRepeatedFields( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule result) { + if (fieldActionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + fieldActions_ = java.util.Collections.unmodifiableList(fieldActions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.fieldActions_ = fieldActions_; + } else { + result.fieldActions_ = fieldActionsBuilder_.build(); + } } - /** - * - * - *
-       * (Filtering parameter) Any resource subject to substitution must be
-       * contained within one of the listed Kubernetes Namespace in the Backup.
-       * If this field is not provided, no namespace filtering will be performed
-       * (all resources in all Namespaces, including all cluster-scoped resources,
-       * will be candidates for substitution).
-       * To mix cluster-scoped and namespaced resources in the same rule, use an
-       * empty string ("") as one of the target namespaces.
-       * 
- * - * repeated string target_namespaces = 1; - * - * @param index The index of the element to return. - * @return The targetNamespaces at the given index. - */ - public java.lang.String getTargetNamespaces(int index) { - return targetNamespaces_.get(index); + + private void buildPartial0( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.resourceFilter_ = + resourceFilterBuilder_ == null ? resourceFilter_ : resourceFilterBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } } - /** - * - * - *
-       * (Filtering parameter) Any resource subject to substitution must be
-       * contained within one of the listed Kubernetes Namespace in the Backup.
-       * If this field is not provided, no namespace filtering will be performed
-       * (all resources in all Namespaces, including all cluster-scoped resources,
-       * will be candidates for substitution).
-       * To mix cluster-scoped and namespaced resources in the same rule, use an
-       * empty string ("") as one of the target namespaces.
-       * 
- * - * repeated string target_namespaces = 1; - * - * @param index The index of the value to return. - * @return The bytes of the targetNamespaces at the given index. - */ - public com.google.protobuf.ByteString getTargetNamespacesBytes(int index) { - return targetNamespaces_.getByteString(index); + + @java.lang.Override + public Builder clone() { + return super.clone(); } - /** - * - * - *
-       * (Filtering parameter) Any resource subject to substitution must be
-       * contained within one of the listed Kubernetes Namespace in the Backup.
-       * If this field is not provided, no namespace filtering will be performed
-       * (all resources in all Namespaces, including all cluster-scoped resources,
-       * will be candidates for substitution).
-       * To mix cluster-scoped and namespaced resources in the same rule, use an
-       * empty string ("") as one of the target namespaces.
-       * 
- * - * repeated string target_namespaces = 1; - * - * @param index The index to set the value at. - * @param value The targetNamespaces to set. - * @return This builder for chaining. - */ - public Builder setTargetNamespaces(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTargetNamespacesIsMutable(); - targetNamespaces_.set(index, value); - bitField0_ |= 0x00000001; - onChanged(); - return this; + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); } - /** - * - * - *
-       * (Filtering parameter) Any resource subject to substitution must be
-       * contained within one of the listed Kubernetes Namespace in the Backup.
-       * If this field is not provided, no namespace filtering will be performed
-       * (all resources in all Namespaces, including all cluster-scoped resources,
-       * will be candidates for substitution).
-       * To mix cluster-scoped and namespaced resources in the same rule, use an
-       * empty string ("") as one of the target namespaces.
-       * 
- * - * repeated string target_namespaces = 1; - * - * @param value The targetNamespaces to add. - * @return This builder for chaining. - */ - public Builder addTargetNamespaces(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule) { + return mergeFrom((com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule) other); + } else { + super.mergeFrom(other); + return this; } - ensureTargetNamespacesIsMutable(); - targetNamespaces_.add(value); - bitField0_ |= 0x00000001; - onChanged(); - return this; } - /** - * - * - *
-       * (Filtering parameter) Any resource subject to substitution must be
-       * contained within one of the listed Kubernetes Namespace in the Backup.
-       * If this field is not provided, no namespace filtering will be performed
-       * (all resources in all Namespaces, including all cluster-scoped resources,
-       * will be candidates for substitution).
-       * To mix cluster-scoped and namespaced resources in the same rule, use an
-       * empty string ("") as one of the target namespaces.
-       * 
- * - * repeated string target_namespaces = 1; - * - * @param values The targetNamespaces to add. - * @return This builder for chaining. - */ - public Builder addAllTargetNamespaces(java.lang.Iterable values) { - ensureTargetNamespacesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, targetNamespaces_); - bitField0_ |= 0x00000001; + + public Builder mergeFrom( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule other) { + if (other + == com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.getDefaultInstance()) + return this; + if (fieldActionsBuilder_ == null) { + if (!other.fieldActions_.isEmpty()) { + if (fieldActions_.isEmpty()) { + fieldActions_ = other.fieldActions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFieldActionsIsMutable(); + fieldActions_.addAll(other.fieldActions_); + } + onChanged(); + } + } else { + if (!other.fieldActions_.isEmpty()) { + if (fieldActionsBuilder_.isEmpty()) { + fieldActionsBuilder_.dispose(); + fieldActionsBuilder_ = null; + fieldActions_ = other.fieldActions_; + bitField0_ = (bitField0_ & ~0x00000001); + fieldActionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFieldActionsFieldBuilder() + : null; + } else { + fieldActionsBuilder_.addAllMessages(other.fieldActions_); + } + } + } + if (other.hasResourceFilter()) { + mergeResourceFilter(other.getResourceFilter()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } - /** - * - * - *
-       * (Filtering parameter) Any resource subject to substitution must be
-       * contained within one of the listed Kubernetes Namespace in the Backup.
-       * If this field is not provided, no namespace filtering will be performed
-       * (all resources in all Namespaces, including all cluster-scoped resources,
-       * will be candidates for substitution).
-       * To mix cluster-scoped and namespaced resources in the same rule, use an
-       * empty string ("") as one of the target namespaces.
-       * 
- * - * repeated string target_namespaces = 1; - * - * @return This builder for chaining. - */ - public Builder clearTargetNamespaces() { - targetNamespaces_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - ; - onChanged(); - return this; + + @java.lang.Override + public final boolean isInitialized() { + return true; } - /** - * - * - *
-       * (Filtering parameter) Any resource subject to substitution must be
-       * contained within one of the listed Kubernetes Namespace in the Backup.
-       * If this field is not provided, no namespace filtering will be performed
-       * (all resources in all Namespaces, including all cluster-scoped resources,
-       * will be candidates for substitution).
-       * To mix cluster-scoped and namespaced resources in the same rule, use an
-       * empty string ("") as one of the target namespaces.
-       * 
- * - * repeated string target_namespaces = 1; - * - * @param value The bytes of the targetNamespaces to add. - * @return This builder for chaining. - */ - public Builder addTargetNamespacesBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); } - checkByteStringIsUtf8(value); - ensureTargetNamespacesIsMutable(); - targetNamespaces_.add(value); - bitField0_ |= 0x00000001; - onChanged(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction m = + input.readMessage( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction + .parser(), + extensionRegistry); + if (fieldActionsBuilder_ == null) { + ensureFieldActionsIsMutable(); + fieldActions_.add(m); + } else { + fieldActionsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + input.readMessage( + getResourceFilterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally return this; } - private java.util.List - targetGroupKinds_ = java.util.Collections.emptyList(); + private int bitField0_; - private void ensureTargetGroupKindsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - targetGroupKinds_ = - new java.util.ArrayList( - targetGroupKinds_); - bitField0_ |= 0x00000002; + private java.util.List + fieldActions_ = java.util.Collections.emptyList(); + + private void ensureFieldActionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + fieldActions_ = + new java.util.ArrayList< + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction>( + fieldActions_); + bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind, - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder, - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder> - targetGroupKindsBuilder_; + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleActionOrBuilder> + fieldActionsBuilder_; /** * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public java.util.List - getTargetGroupKindsList() { - if (targetGroupKindsBuilder_ == null) { - return java.util.Collections.unmodifiableList(targetGroupKinds_); + public java.util.List + getFieldActionsList() { + if (fieldActionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(fieldActions_); } else { - return targetGroupKindsBuilder_.getMessageList(); + return fieldActionsBuilder_.getMessageList(); } } /** * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public int getTargetGroupKindsCount() { - if (targetGroupKindsBuilder_ == null) { - return targetGroupKinds_.size(); + public int getFieldActionsCount() { + if (fieldActionsBuilder_ == null) { + return fieldActions_.size(); } else { - return targetGroupKindsBuilder_.getCount(); + return fieldActionsBuilder_.getCount(); } } /** * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind getTargetGroupKinds(int index) { - if (targetGroupKindsBuilder_ == null) { - return targetGroupKinds_.get(index); + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction getFieldActions( + int index) { + if (fieldActionsBuilder_ == null) { + return fieldActions_.get(index); } else { - return targetGroupKindsBuilder_.getMessage(index); + return fieldActionsBuilder_.getMessage(index); } } /** * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public Builder setTargetGroupKinds( - int index, com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind value) { - if (targetGroupKindsBuilder_ == null) { + public Builder setFieldActions( + int index, com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction value) { + if (fieldActionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureTargetGroupKindsIsMutable(); - targetGroupKinds_.set(index, value); + ensureFieldActionsIsMutable(); + fieldActions_.set(index, value); onChanged(); } else { - targetGroupKindsBuilder_.setMessage(index, value); + fieldActionsBuilder_.setMessage(index, value); } return this; } @@ -4174,25 +10224,26 @@ public Builder setTargetGroupKinds( * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public Builder setTargetGroupKinds( + public Builder setFieldActions( int index, - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder builderForValue) { - if (targetGroupKindsBuilder_ == null) { - ensureTargetGroupKindsIsMutable(); - targetGroupKinds_.set(index, builderForValue.build()); + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Builder + builderForValue) { + if (fieldActionsBuilder_ == null) { + ensureFieldActionsIsMutable(); + fieldActions_.set(index, builderForValue.build()); onChanged(); } else { - targetGroupKindsBuilder_.setMessage(index, builderForValue.build()); + fieldActionsBuilder_.setMessage(index, builderForValue.build()); } return this; } @@ -4200,27 +10251,27 @@ public Builder setTargetGroupKinds( * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public Builder addTargetGroupKinds( - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind value) { - if (targetGroupKindsBuilder_ == null) { + public Builder addFieldActions( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction value) { + if (fieldActionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureTargetGroupKindsIsMutable(); - targetGroupKinds_.add(value); + ensureFieldActionsIsMutable(); + fieldActions_.add(value); onChanged(); } else { - targetGroupKindsBuilder_.addMessage(value); + fieldActionsBuilder_.addMessage(value); } return this; } @@ -4228,27 +10279,27 @@ public Builder addTargetGroupKinds( * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public Builder addTargetGroupKinds( - int index, com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind value) { - if (targetGroupKindsBuilder_ == null) { + public Builder addFieldActions( + int index, com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction value) { + if (fieldActionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureTargetGroupKindsIsMutable(); - targetGroupKinds_.add(index, value); + ensureFieldActionsIsMutable(); + fieldActions_.add(index, value); onChanged(); } else { - targetGroupKindsBuilder_.addMessage(index, value); + fieldActionsBuilder_.addMessage(index, value); } return this; } @@ -4256,24 +10307,25 @@ public Builder addTargetGroupKinds( * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public Builder addTargetGroupKinds( - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder builderForValue) { - if (targetGroupKindsBuilder_ == null) { - ensureTargetGroupKindsIsMutable(); - targetGroupKinds_.add(builderForValue.build()); + public Builder addFieldActions( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Builder + builderForValue) { + if (fieldActionsBuilder_ == null) { + ensureFieldActionsIsMutable(); + fieldActions_.add(builderForValue.build()); onChanged(); } else { - targetGroupKindsBuilder_.addMessage(builderForValue.build()); + fieldActionsBuilder_.addMessage(builderForValue.build()); } return this; } @@ -4281,25 +10333,26 @@ public Builder addTargetGroupKinds( * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public Builder addTargetGroupKinds( + public Builder addFieldActions( int index, - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder builderForValue) { - if (targetGroupKindsBuilder_ == null) { - ensureTargetGroupKindsIsMutable(); - targetGroupKinds_.add(index, builderForValue.build()); + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Builder + builderForValue) { + if (fieldActionsBuilder_ == null) { + ensureFieldActionsIsMutable(); + fieldActions_.add(index, builderForValue.build()); onChanged(); } else { - targetGroupKindsBuilder_.addMessage(index, builderForValue.build()); + fieldActionsBuilder_.addMessage(index, builderForValue.build()); } return this; } @@ -4307,25 +10360,26 @@ public Builder addTargetGroupKinds( * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public Builder addAllTargetGroupKinds( - java.lang.Iterable + public Builder addAllFieldActions( + java.lang.Iterable< + ? extends com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction> values) { - if (targetGroupKindsBuilder_ == null) { - ensureTargetGroupKindsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, targetGroupKinds_); + if (fieldActionsBuilder_ == null) { + ensureFieldActionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fieldActions_); onChanged(); } else { - targetGroupKindsBuilder_.addAllMessages(values); + fieldActionsBuilder_.addAllMessages(values); } return this; } @@ -4333,47 +10387,47 @@ public Builder addAllTargetGroupKinds( * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public Builder clearTargetGroupKinds() { - if (targetGroupKindsBuilder_ == null) { - targetGroupKinds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + public Builder clearFieldActions() { + if (fieldActionsBuilder_ == null) { + fieldActions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - targetGroupKindsBuilder_.clear(); + fieldActionsBuilder_.clear(); } return this; } /** * - * - *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       *
+       * 
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public Builder removeTargetGroupKinds(int index) { - if (targetGroupKindsBuilder_ == null) { - ensureTargetGroupKindsIsMutable(); - targetGroupKinds_.remove(index); + public Builder removeFieldActions(int index) { + if (fieldActionsBuilder_ == null) { + ensureFieldActionsIsMutable(); + fieldActions_.remove(index); onChanged(); } else { - targetGroupKindsBuilder_.remove(index); + fieldActionsBuilder_.remove(index); } return this; } @@ -4381,247 +10435,218 @@ public Builder removeTargetGroupKinds(int index) { * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder - getTargetGroupKindsBuilder(int index) { - return getTargetGroupKindsFieldBuilder().getBuilder(index); + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Builder + getFieldActionsBuilder(int index) { + return getFieldActionsFieldBuilder().getBuilder(index); } /** * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder - getTargetGroupKindsOrBuilder(int index) { - if (targetGroupKindsBuilder_ == null) { - return targetGroupKinds_.get(index); + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleActionOrBuilder + getFieldActionsOrBuilder(int index) { + if (fieldActionsBuilder_ == null) { + return fieldActions_.get(index); } else { - return targetGroupKindsBuilder_.getMessageOrBuilder(index); + return fieldActionsBuilder_.getMessageOrBuilder(index); } } /** * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ public java.util.List< - ? extends com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder> - getTargetGroupKindsOrBuilderList() { - if (targetGroupKindsBuilder_ != null) { - return targetGroupKindsBuilder_.getMessageOrBuilderList(); + ? extends + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleActionOrBuilder> + getFieldActionsOrBuilderList() { + if (fieldActionsBuilder_ != null) { + return fieldActionsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(targetGroupKinds_); + return java.util.Collections.unmodifiableList(fieldActions_); } } /** * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder - addTargetGroupKindsBuilder() { - return getTargetGroupKindsFieldBuilder() - .addBuilder(com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.getDefaultInstance()); + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Builder + addFieldActionsBuilder() { + return getFieldActionsFieldBuilder() + .addBuilder( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction + .getDefaultInstance()); } /** * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder - addTargetGroupKindsBuilder(int index) { - return getTargetGroupKindsFieldBuilder() + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Builder + addFieldActionsBuilder(int index) { + return getFieldActionsFieldBuilder() .addBuilder( - index, com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.getDefaultInstance()); + index, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction + .getDefaultInstance()); } /** * * *
-       * (Filtering parameter) Any resource subject to substitution must belong to
-       * one of the listed "types".
-       * If this field is not provided, no type filtering will be performed (all
-       * resources of all types matching previous filtering parameters will be
-       * candidates for substitution).
+       * Required. A list of transformation rule actions to take against candidate
+       * resources. Actions are executed in order defined - this order matters, as
+       * they could potentially interfere with each other and the first operation
+       * could affect the outcome of the second operation.
        * 
* - * repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction field_actions = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - public java.util.List - getTargetGroupKindsBuilderList() { - return getTargetGroupKindsFieldBuilder().getBuilderList(); + public java.util.List< + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Builder> + getFieldActionsBuilderList() { + return getFieldActionsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind, - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder, - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder> - getTargetGroupKindsFieldBuilder() { - if (targetGroupKindsBuilder_ == null) { - targetGroupKindsBuilder_ = + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleActionOrBuilder> + getFieldActionsFieldBuilder() { + if (fieldActionsBuilder_ == null) { + fieldActionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind, - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKind.Builder, - com.google.cloud.gkebackup.v1.RestoreConfig.GroupKindOrBuilder>( - targetGroupKinds_, - ((bitField0_ & 0x00000002) != 0), + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleAction.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleActionOrBuilder>( + fieldActions_, + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - targetGroupKinds_ = null; + fieldActions_ = null; } - return targetGroupKindsBuilder_; + return fieldActionsBuilder_; } - private java.lang.Object targetJsonPath_ = ""; + private com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resourceFilter_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter, + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilterOrBuilder> + resourceFilterBuilder_; /** * * *
-       * Required. This is a [JSONPath]
-       * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
-       * expression that matches specific fields of candidate
-       * resources and it operates as both a filtering parameter (resources that
-       * are not matched with this expression will not be candidates for
-       * substitution) as well as a field identifier (identifies exactly which
-       * fields out of the candidate resources will be modified).
+       * This field is used to specify a set of fields that should be used to
+       * determine which resources in backup should be acted upon by the supplied
+       * transformation rule actions, and this will ensure that only specific
+       * resources are affected by transformation rule actions.
        * 
* - * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resource_filter = 2; * - * @return The targetJsonPath. + * @return Whether the resourceFilter field is set. */ - public java.lang.String getTargetJsonPath() { - java.lang.Object ref = targetJsonPath_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - targetJsonPath_ = s; - return s; - } else { - return (java.lang.String) ref; - } + public boolean hasResourceFilter() { + return ((bitField0_ & 0x00000002) != 0); } /** * * *
-       * Required. This is a [JSONPath]
-       * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
-       * expression that matches specific fields of candidate
-       * resources and it operates as both a filtering parameter (resources that
-       * are not matched with this expression will not be candidates for
-       * substitution) as well as a field identifier (identifies exactly which
-       * fields out of the candidate resources will be modified).
+       * This field is used to specify a set of fields that should be used to
+       * determine which resources in backup should be acted upon by the supplied
+       * transformation rule actions, and this will ensure that only specific
+       * resources are affected by transformation rule actions.
        * 
* - * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; + * .google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resource_filter = 2; * - * @return The bytes for targetJsonPath. + * @return The resourceFilter. */ - public com.google.protobuf.ByteString getTargetJsonPathBytes() { - java.lang.Object ref = targetJsonPath_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - targetJsonPath_ = b; - return b; + public com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter getResourceFilter() { + if (resourceFilterBuilder_ == null) { + return resourceFilter_ == null + ? com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter.getDefaultInstance() + : resourceFilter_; } else { - return (com.google.protobuf.ByteString) ref; + return resourceFilterBuilder_.getMessage(); } } /** * * *
-       * Required. This is a [JSONPath]
-       * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
-       * expression that matches specific fields of candidate
-       * resources and it operates as both a filtering parameter (resources that
-       * are not matched with this expression will not be candidates for
-       * substitution) as well as a field identifier (identifies exactly which
-       * fields out of the candidate resources will be modified).
+       * This field is used to specify a set of fields that should be used to
+       * determine which resources in backup should be acted upon by the supplied
+       * transformation rule actions, and this will ensure that only specific
+       * resources are affected by transformation rule actions.
        * 
* - * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The targetJsonPath to set. - * @return This builder for chaining. + * .google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resource_filter = 2; */ - public Builder setTargetJsonPath(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public Builder setResourceFilter( + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter value) { + if (resourceFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resourceFilter_ = value; + } else { + resourceFilterBuilder_.setMessage(value); } - targetJsonPath_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-       * Required. This is a [JSONPath]
-       * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
-       * expression that matches specific fields of candidate
-       * resources and it operates as both a filtering parameter (resources that
-       * are not matched with this expression will not be candidates for
-       * substitution) as well as a field identifier (identifies exactly which
-       * fields out of the candidate resources will be modified).
-       * 
- * - * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearTargetJsonPath() { - targetJsonPath_ = getDefaultInstance().getTargetJsonPath(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -4629,197 +10654,166 @@ public Builder clearTargetJsonPath() { * * *
-       * Required. This is a [JSONPath]
-       * (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
-       * expression that matches specific fields of candidate
-       * resources and it operates as both a filtering parameter (resources that
-       * are not matched with this expression will not be candidates for
-       * substitution) as well as a field identifier (identifies exactly which
-       * fields out of the candidate resources will be modified).
+       * This field is used to specify a set of fields that should be used to
+       * determine which resources in backup should be acted upon by the supplied
+       * transformation rule actions, and this will ensure that only specific
+       * resources are affected by transformation rule actions.
        * 
* - * string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for targetJsonPath to set. - * @return This builder for chaining. + * .google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resource_filter = 2; */ - public Builder setTargetJsonPathBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public Builder setResourceFilter( + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter.Builder builderForValue) { + if (resourceFilterBuilder_ == null) { + resourceFilter_ = builderForValue.build(); + } else { + resourceFilterBuilder_.setMessage(builderForValue.build()); } - checkByteStringIsUtf8(value); - targetJsonPath_ = value; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000002; onChanged(); return this; } - - private java.lang.Object originalValuePattern_ = ""; /** * * *
-       * (Filtering parameter) This is a [regular expression]
-       * (https://en.wikipedia.org/wiki/Regular_expression)
-       * that is compared against the fields matched by the target_json_path
-       * expression (and must also have passed the previous filters).
-       * Substitution will not be performed against fields whose
-       * value does not match this expression. If this field is NOT specified,
-       * then ALL fields matched by the target_json_path expression will undergo
-       * substitution. Note that an empty (e.g., "", rather than unspecified)
-       * value for this field will only match empty fields.
+       * This field is used to specify a set of fields that should be used to
+       * determine which resources in backup should be acted upon by the supplied
+       * transformation rule actions, and this will ensure that only specific
+       * resources are affected by transformation rule actions.
        * 
* - * string original_value_pattern = 4; - * - * @return The originalValuePattern. + * .google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resource_filter = 2; */ - public java.lang.String getOriginalValuePattern() { - java.lang.Object ref = originalValuePattern_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - originalValuePattern_ = s; - return s; + public Builder mergeResourceFilter( + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter value) { + if (resourceFilterBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && resourceFilter_ != null + && resourceFilter_ + != com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter + .getDefaultInstance()) { + getResourceFilterBuilder().mergeFrom(value); + } else { + resourceFilter_ = value; + } } else { - return (java.lang.String) ref; + resourceFilterBuilder_.mergeFrom(value); } + bitField0_ |= 0x00000002; + onChanged(); + return this; } /** * * *
-       * (Filtering parameter) This is a [regular expression]
-       * (https://en.wikipedia.org/wiki/Regular_expression)
-       * that is compared against the fields matched by the target_json_path
-       * expression (and must also have passed the previous filters).
-       * Substitution will not be performed against fields whose
-       * value does not match this expression. If this field is NOT specified,
-       * then ALL fields matched by the target_json_path expression will undergo
-       * substitution. Note that an empty (e.g., "", rather than unspecified)
-       * value for this field will only match empty fields.
+       * This field is used to specify a set of fields that should be used to
+       * determine which resources in backup should be acted upon by the supplied
+       * transformation rule actions, and this will ensure that only specific
+       * resources are affected by transformation rule actions.
        * 
* - * string original_value_pattern = 4; - * - * @return The bytes for originalValuePattern. + * .google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resource_filter = 2; */ - public com.google.protobuf.ByteString getOriginalValuePatternBytes() { - java.lang.Object ref = originalValuePattern_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - originalValuePattern_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + public Builder clearResourceFilter() { + bitField0_ = (bitField0_ & ~0x00000002); + resourceFilter_ = null; + if (resourceFilterBuilder_ != null) { + resourceFilterBuilder_.dispose(); + resourceFilterBuilder_ = null; } + onChanged(); + return this; } /** * * *
-       * (Filtering parameter) This is a [regular expression]
-       * (https://en.wikipedia.org/wiki/Regular_expression)
-       * that is compared against the fields matched by the target_json_path
-       * expression (and must also have passed the previous filters).
-       * Substitution will not be performed against fields whose
-       * value does not match this expression. If this field is NOT specified,
-       * then ALL fields matched by the target_json_path expression will undergo
-       * substitution. Note that an empty (e.g., "", rather than unspecified)
-       * value for this field will only match empty fields.
+       * This field is used to specify a set of fields that should be used to
+       * determine which resources in backup should be acted upon by the supplied
+       * transformation rule actions, and this will ensure that only specific
+       * resources are affected by transformation rule actions.
        * 
* - * string original_value_pattern = 4; - * - * @param value The originalValuePattern to set. - * @return This builder for chaining. + * .google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resource_filter = 2; */ - public Builder setOriginalValuePattern(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - originalValuePattern_ = value; - bitField0_ |= 0x00000008; + public com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter.Builder + getResourceFilterBuilder() { + bitField0_ |= 0x00000002; onChanged(); - return this; + return getResourceFilterFieldBuilder().getBuilder(); } /** * * *
-       * (Filtering parameter) This is a [regular expression]
-       * (https://en.wikipedia.org/wiki/Regular_expression)
-       * that is compared against the fields matched by the target_json_path
-       * expression (and must also have passed the previous filters).
-       * Substitution will not be performed against fields whose
-       * value does not match this expression. If this field is NOT specified,
-       * then ALL fields matched by the target_json_path expression will undergo
-       * substitution. Note that an empty (e.g., "", rather than unspecified)
-       * value for this field will only match empty fields.
+       * This field is used to specify a set of fields that should be used to
+       * determine which resources in backup should be acted upon by the supplied
+       * transformation rule actions, and this will ensure that only specific
+       * resources are affected by transformation rule actions.
        * 
* - * string original_value_pattern = 4; - * - * @return This builder for chaining. + * .google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resource_filter = 2; */ - public Builder clearOriginalValuePattern() { - originalValuePattern_ = getDefaultInstance().getOriginalValuePattern(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; + public com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilterOrBuilder + getResourceFilterOrBuilder() { + if (resourceFilterBuilder_ != null) { + return resourceFilterBuilder_.getMessageOrBuilder(); + } else { + return resourceFilter_ == null + ? com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter.getDefaultInstance() + : resourceFilter_; + } } /** * * *
-       * (Filtering parameter) This is a [regular expression]
-       * (https://en.wikipedia.org/wiki/Regular_expression)
-       * that is compared against the fields matched by the target_json_path
-       * expression (and must also have passed the previous filters).
-       * Substitution will not be performed against fields whose
-       * value does not match this expression. If this field is NOT specified,
-       * then ALL fields matched by the target_json_path expression will undergo
-       * substitution. Note that an empty (e.g., "", rather than unspecified)
-       * value for this field will only match empty fields.
+       * This field is used to specify a set of fields that should be used to
+       * determine which resources in backup should be acted upon by the supplied
+       * transformation rule actions, and this will ensure that only specific
+       * resources are affected by transformation rule actions.
        * 
* - * string original_value_pattern = 4; - * - * @param value The bytes for originalValuePattern to set. - * @return This builder for chaining. + * .google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter resource_filter = 2; */ - public Builder setOriginalValuePatternBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter, + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilterOrBuilder> + getResourceFilterFieldBuilder() { + if (resourceFilterBuilder_ == null) { + resourceFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter, + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilter.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.ResourceFilterOrBuilder>( + getResourceFilter(), getParentForChildren(), isClean()); + resourceFilter_ = null; } - checkByteStringIsUtf8(value); - originalValuePattern_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; + return resourceFilterBuilder_; } - private java.lang.Object newValue_ = ""; + private java.lang.Object description_ = ""; /** * * *
-       * This is the new value to set for any fields that pass the filtering and
-       * selection criteria. To remove a value from a Kubernetes resource, either
-       * leave this field unspecified, or set it to the empty string ("").
+       * The description is a user specified string description of the
+       * transformation rule.
        * 
* - * string new_value = 5; + * string description = 3; * - * @return The newValue. + * @return The description. */ - public java.lang.String getNewValue() { - java.lang.Object ref = newValue_; + public java.lang.String getDescription() { + java.lang.Object ref = description_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - newValue_ = s; + description_ = s; return s; } else { return (java.lang.String) ref; @@ -4829,21 +10823,20 @@ public java.lang.String getNewValue() { * * *
-       * This is the new value to set for any fields that pass the filtering and
-       * selection criteria. To remove a value from a Kubernetes resource, either
-       * leave this field unspecified, or set it to the empty string ("").
+       * The description is a user specified string description of the
+       * transformation rule.
        * 
* - * string new_value = 5; + * string description = 3; * - * @return The bytes for newValue. + * @return The bytes for description. */ - public com.google.protobuf.ByteString getNewValueBytes() { - java.lang.Object ref = newValue_; + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - newValue_ = b; + description_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; @@ -4853,22 +10846,21 @@ public com.google.protobuf.ByteString getNewValueBytes() { * * *
-       * This is the new value to set for any fields that pass the filtering and
-       * selection criteria. To remove a value from a Kubernetes resource, either
-       * leave this field unspecified, or set it to the empty string ("").
+       * The description is a user specified string description of the
+       * transformation rule.
        * 
* - * string new_value = 5; + * string description = 3; * - * @param value The newValue to set. + * @param value The description to set. * @return This builder for chaining. */ - public Builder setNewValue(java.lang.String value) { + public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - newValue_ = value; - bitField0_ |= 0x00000010; + description_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -4876,18 +10868,17 @@ public Builder setNewValue(java.lang.String value) { * * *
-       * This is the new value to set for any fields that pass the filtering and
-       * selection criteria. To remove a value from a Kubernetes resource, either
-       * leave this field unspecified, or set it to the empty string ("").
+       * The description is a user specified string description of the
+       * transformation rule.
        * 
* - * string new_value = 5; + * string description = 3; * * @return This builder for chaining. */ - public Builder clearNewValue() { - newValue_ = getDefaultInstance().getNewValue(); - bitField0_ = (bitField0_ & ~0x00000010); + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } @@ -4895,23 +10886,22 @@ public Builder clearNewValue() { * * *
-       * This is the new value to set for any fields that pass the filtering and
-       * selection criteria. To remove a value from a Kubernetes resource, either
-       * leave this field unspecified, or set it to the empty string ("").
+       * The description is a user specified string description of the
+       * transformation rule.
        * 
* - * string new_value = 5; + * string description = 3; * - * @param value The bytes for newValue to set. + * @param value The bytes for description to set. * @return This builder for chaining. */ - public Builder setNewValueBytes(com.google.protobuf.ByteString value) { + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - newValue_ = value; - bitField0_ |= 0x00000010; + description_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -4928,26 +10918,26 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) + // @@protoc_insertion_point(builder_scope:google.cloud.gkebackup.v1.RestoreConfig.TransformationRule) } - // @@protoc_insertion_point(class_scope:google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule) - private static final com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + // @@protoc_insertion_point(class_scope:google.cloud.gkebackup.v1.RestoreConfig.TransformationRule) + private static final com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule(); + DEFAULT_INSTANCE = new com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule(); } - public static com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + public static com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public SubstitutionRule parsePartialFrom( + public TransformationRule parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -4967,17 +10957,17 @@ public SubstitutionRule parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -4995,6 +10985,8 @@ public enum NamespacedResourceRestoreScopeCase ALL_NAMESPACES(5), SELECTED_NAMESPACES(6), SELECTED_APPLICATIONS(7), + NO_NAMESPACES(9), + EXCLUDED_NAMESPACES(10), NAMESPACEDRESOURCERESTORESCOPE_NOT_SET(0); private final int value; @@ -5019,6 +11011,10 @@ public static NamespacedResourceRestoreScopeCase forNumber(int value) { return SELECTED_NAMESPACES; case 7: return SELECTED_APPLICATIONS; + case 9: + return NO_NAMESPACES; + case 10: + return EXCLUDED_NAMESPACES; case 0: return NAMESPACEDRESOURCERESTORESCOPE_NOT_SET; default: @@ -5350,53 +11346,250 @@ public com.google.cloud.gkebackup.v1.NamespacesOrBuilder getSelectedNamespacesOr * @return Whether the selectedApplications field is set. */ @java.lang.Override - public boolean hasSelectedApplications() { - return namespacedResourceRestoreScopeCase_ == 7; + public boolean hasSelectedApplications() { + return namespacedResourceRestoreScopeCase_ == 7; + } + /** + * + * + *
+   * A list of selected ProtectedApplications to restore. The listed
+   * ProtectedApplications and all the resources to which they refer will be
+   * restored.
+   * 
+ * + * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; + * + * @return The selectedApplications. + */ + @java.lang.Override + public com.google.cloud.gkebackup.v1.NamespacedNames getSelectedApplications() { + if (namespacedResourceRestoreScopeCase_ == 7) { + return (com.google.cloud.gkebackup.v1.NamespacedNames) namespacedResourceRestoreScope_; + } + return com.google.cloud.gkebackup.v1.NamespacedNames.getDefaultInstance(); + } + /** + * + * + *
+   * A list of selected ProtectedApplications to restore. The listed
+   * ProtectedApplications and all the resources to which they refer will be
+   * restored.
+   * 
+ * + * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; + */ + @java.lang.Override + public com.google.cloud.gkebackup.v1.NamespacedNamesOrBuilder getSelectedApplicationsOrBuilder() { + if (namespacedResourceRestoreScopeCase_ == 7) { + return (com.google.cloud.gkebackup.v1.NamespacedNames) namespacedResourceRestoreScope_; + } + return com.google.cloud.gkebackup.v1.NamespacedNames.getDefaultInstance(); + } + + public static final int NO_NAMESPACES_FIELD_NUMBER = 9; + /** + * + * + *
+   * Do not restore any namespaced resources if set to "True".
+   * Specifying this field to "False" is not allowed.
+   * 
+ * + * bool no_namespaces = 9; + * + * @return Whether the noNamespaces field is set. + */ + @java.lang.Override + public boolean hasNoNamespaces() { + return namespacedResourceRestoreScopeCase_ == 9; + } + /** + * + * + *
+   * Do not restore any namespaced resources if set to "True".
+   * Specifying this field to "False" is not allowed.
+   * 
+ * + * bool no_namespaces = 9; + * + * @return The noNamespaces. + */ + @java.lang.Override + public boolean getNoNamespaces() { + if (namespacedResourceRestoreScopeCase_ == 9) { + return (java.lang.Boolean) namespacedResourceRestoreScope_; + } + return false; + } + + public static final int EXCLUDED_NAMESPACES_FIELD_NUMBER = 10; + /** + * + * + *
+   * A list of selected namespaces excluded from restoration. All
+   * namespaces except those in this list will be restored.
+   * 
+ * + * .google.cloud.gkebackup.v1.Namespaces excluded_namespaces = 10; + * + * @return Whether the excludedNamespaces field is set. + */ + @java.lang.Override + public boolean hasExcludedNamespaces() { + return namespacedResourceRestoreScopeCase_ == 10; + } + /** + * + * + *
+   * A list of selected namespaces excluded from restoration. All
+   * namespaces except those in this list will be restored.
+   * 
+ * + * .google.cloud.gkebackup.v1.Namespaces excluded_namespaces = 10; + * + * @return The excludedNamespaces. + */ + @java.lang.Override + public com.google.cloud.gkebackup.v1.Namespaces getExcludedNamespaces() { + if (namespacedResourceRestoreScopeCase_ == 10) { + return (com.google.cloud.gkebackup.v1.Namespaces) namespacedResourceRestoreScope_; + } + return com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance(); + } + /** + * + * + *
+   * A list of selected namespaces excluded from restoration. All
+   * namespaces except those in this list will be restored.
+   * 
+ * + * .google.cloud.gkebackup.v1.Namespaces excluded_namespaces = 10; + */ + @java.lang.Override + public com.google.cloud.gkebackup.v1.NamespacesOrBuilder getExcludedNamespacesOrBuilder() { + if (namespacedResourceRestoreScopeCase_ == 10) { + return (com.google.cloud.gkebackup.v1.Namespaces) namespacedResourceRestoreScope_; + } + return com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance(); + } + + public static final int SUBSTITUTION_RULES_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private java.util.List + substitutionRules_; + /** + * + * + *
+   * A list of transformation rules to be applied against Kubernetes resources
+   * as they are selected for restoration from a Backup. Rules are executed in
+   * order defined - this order matters, as changes made by a rule may impact
+   * the filtering logic of subsequent rules. An empty list means no
+   * substitution will occur.
+   * 
+ * + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * + */ + @java.lang.Override + public java.util.List + getSubstitutionRulesList() { + return substitutionRules_; + } + /** + * + * + *
+   * A list of transformation rules to be applied against Kubernetes resources
+   * as they are selected for restoration from a Backup. Rules are executed in
+   * order defined - this order matters, as changes made by a rule may impact
+   * the filtering logic of subsequent rules. An empty list means no
+   * substitution will occur.
+   * 
+ * + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder> + getSubstitutionRulesOrBuilderList() { + return substitutionRules_; + } + /** + * + * + *
+   * A list of transformation rules to be applied against Kubernetes resources
+   * as they are selected for restoration from a Backup. Rules are executed in
+   * order defined - this order matters, as changes made by a rule may impact
+   * the filtering logic of subsequent rules. An empty list means no
+   * substitution will occur.
+   * 
+ * + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * + */ + @java.lang.Override + public int getSubstitutionRulesCount() { + return substitutionRules_.size(); } /** * * *
-   * A list of selected ProtectedApplications to restore. The listed
-   * ProtectedApplications and all the resources to which they refer will be
-   * restored.
+   * A list of transformation rules to be applied against Kubernetes resources
+   * as they are selected for restoration from a Backup. Rules are executed in
+   * order defined - this order matters, as changes made by a rule may impact
+   * the filtering logic of subsequent rules. An empty list means no
+   * substitution will occur.
    * 
* - * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; - * - * @return The selectedApplications. + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ @java.lang.Override - public com.google.cloud.gkebackup.v1.NamespacedNames getSelectedApplications() { - if (namespacedResourceRestoreScopeCase_ == 7) { - return (com.google.cloud.gkebackup.v1.NamespacedNames) namespacedResourceRestoreScope_; - } - return com.google.cloud.gkebackup.v1.NamespacedNames.getDefaultInstance(); + public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule getSubstitutionRules( + int index) { + return substitutionRules_.get(index); } /** * * *
-   * A list of selected ProtectedApplications to restore. The listed
-   * ProtectedApplications and all the resources to which they refer will be
-   * restored.
+   * A list of transformation rules to be applied against Kubernetes resources
+   * as they are selected for restoration from a Backup. Rules are executed in
+   * order defined - this order matters, as changes made by a rule may impact
+   * the filtering logic of subsequent rules. An empty list means no
+   * substitution will occur.
    * 
* - * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ @java.lang.Override - public com.google.cloud.gkebackup.v1.NamespacedNamesOrBuilder getSelectedApplicationsOrBuilder() { - if (namespacedResourceRestoreScopeCase_ == 7) { - return (com.google.cloud.gkebackup.v1.NamespacedNames) namespacedResourceRestoreScope_; - } - return com.google.cloud.gkebackup.v1.NamespacedNames.getDefaultInstance(); + public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder + getSubstitutionRulesOrBuilder(int index) { + return substitutionRules_.get(index); } - public static final int SUBSTITUTION_RULES_FIELD_NUMBER = 8; + public static final int TRANSFORMATION_RULES_FIELD_NUMBER = 11; @SuppressWarnings("serial") - private java.util.List - substitutionRules_; + private java.util.List + transformationRules_; /** * * @@ -5405,17 +11598,17 @@ public com.google.cloud.gkebackup.v1.NamespacedNamesOrBuilder getSelectedApplica * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. *
* * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ @java.lang.Override - public java.util.List - getSubstitutionRulesList() { - return substitutionRules_; + public java.util.List + getTransformationRulesList() { + return transformationRules_; } /** * @@ -5425,18 +11618,18 @@ public com.google.cloud.gkebackup.v1.NamespacedNamesOrBuilder getSelectedApplica * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. *
* * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ @java.lang.Override public java.util.List< - ? extends com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder> - getSubstitutionRulesOrBuilderList() { - return substitutionRules_; + ? extends com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleOrBuilder> + getTransformationRulesOrBuilderList() { + return transformationRules_; } /** * @@ -5446,16 +11639,16 @@ public com.google.cloud.gkebackup.v1.NamespacedNamesOrBuilder getSelectedApplica * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ @java.lang.Override - public int getSubstitutionRulesCount() { - return substitutionRules_.size(); + public int getTransformationRulesCount() { + return transformationRules_.size(); } /** * @@ -5465,17 +11658,17 @@ public int getSubstitutionRulesCount() { * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ @java.lang.Override - public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule getSubstitutionRules( + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule getTransformationRules( int index) { - return substitutionRules_.get(index); + return transformationRules_.get(index); } /** * @@ -5485,17 +11678,17 @@ public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule getSubstitut * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ @java.lang.Override - public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder - getSubstitutionRulesOrBuilder(int index) { - return substitutionRules_.get(index); + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleOrBuilder + getTransformationRulesOrBuilder(int index) { + return transformationRules_.get(index); } private byte memoizedIsInitialized = -1; @@ -5547,6 +11740,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < substitutionRules_.size(); i++) { output.writeMessage(8, substitutionRules_.get(i)); } + if (namespacedResourceRestoreScopeCase_ == 9) { + output.writeBool(9, (boolean) ((java.lang.Boolean) namespacedResourceRestoreScope_)); + } + if (namespacedResourceRestoreScopeCase_ == 10) { + output.writeMessage( + 10, (com.google.cloud.gkebackup.v1.Namespaces) namespacedResourceRestoreScope_); + } + for (int i = 0; i < transformationRules_.size(); i++) { + output.writeMessage(11, transformationRules_.get(i)); + } getUnknownFields().writeTo(output); } @@ -5600,6 +11803,20 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, substitutionRules_.get(i)); } + if (namespacedResourceRestoreScopeCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 9, (boolean) ((java.lang.Boolean) namespacedResourceRestoreScope_)); + } + if (namespacedResourceRestoreScopeCase_ == 10) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, (com.google.cloud.gkebackup.v1.Namespaces) namespacedResourceRestoreScope_); + } + for (int i = 0; i < transformationRules_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(11, transformationRules_.get(i)); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -5625,6 +11842,7 @@ public boolean equals(final java.lang.Object obj) { return false; } if (!getSubstitutionRulesList().equals(other.getSubstitutionRulesList())) return false; + if (!getTransformationRulesList().equals(other.getTransformationRulesList())) return false; if (!getNamespacedResourceRestoreScopeCase() .equals(other.getNamespacedResourceRestoreScopeCase())) return false; switch (namespacedResourceRestoreScopeCase_) { @@ -5637,6 +11855,12 @@ public boolean equals(final java.lang.Object obj) { case 7: if (!getSelectedApplications().equals(other.getSelectedApplications())) return false; break; + case 9: + if (getNoNamespaces() != other.getNoNamespaces()) return false; + break; + case 10: + if (!getExcludedNamespaces().equals(other.getExcludedNamespaces())) return false; + break; case 0: default: } @@ -5665,6 +11889,10 @@ public int hashCode() { hash = (37 * hash) + SUBSTITUTION_RULES_FIELD_NUMBER; hash = (53 * hash) + getSubstitutionRulesList().hashCode(); } + if (getTransformationRulesCount() > 0) { + hash = (37 * hash) + TRANSFORMATION_RULES_FIELD_NUMBER; + hash = (53 * hash) + getTransformationRulesList().hashCode(); + } switch (namespacedResourceRestoreScopeCase_) { case 5: hash = (37 * hash) + ALL_NAMESPACES_FIELD_NUMBER; @@ -5678,924 +11906,1719 @@ public int hashCode() { hash = (37 * hash) + SELECTED_APPLICATIONS_FIELD_NUMBER; hash = (53 * hash) + getSelectedApplications().hashCode(); break; + case 9: + hash = (37 * hash) + NO_NAMESPACES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getNoNamespaces()); + break; + case 10: + hash = (37 * hash) + EXCLUDED_NAMESPACES_FIELD_NUMBER; + hash = (53 * hash) + getExcludedNamespaces().hashCode(); + break; case 0: default: } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.gkebackup.v1.RestoreConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configuration of a restore.
+   * Next id: 12
+   * 
+ * + * Protobuf type {@code google.cloud.gkebackup.v1.RestoreConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.gkebackup.v1.RestoreConfig) + com.google.cloud.gkebackup.v1.RestoreConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.gkebackup.v1.RestoreConfig.class, + com.google.cloud.gkebackup.v1.RestoreConfig.Builder.class); + } + + // Construct using com.google.cloud.gkebackup.v1.RestoreConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + volumeDataRestorePolicy_ = 0; + clusterResourceConflictPolicy_ = 0; + namespacedResourceRestoreMode_ = 0; + clusterResourceRestoreScope_ = null; + if (clusterResourceRestoreScopeBuilder_ != null) { + clusterResourceRestoreScopeBuilder_.dispose(); + clusterResourceRestoreScopeBuilder_ = null; + } + if (selectedNamespacesBuilder_ != null) { + selectedNamespacesBuilder_.clear(); + } + if (selectedApplicationsBuilder_ != null) { + selectedApplicationsBuilder_.clear(); + } + if (excludedNamespacesBuilder_ != null) { + excludedNamespacesBuilder_.clear(); + } + if (substitutionRulesBuilder_ == null) { + substitutionRules_ = java.util.Collections.emptyList(); + } else { + substitutionRules_ = null; + substitutionRulesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + if (transformationRulesBuilder_ == null) { + transformationRules_ = java.util.Collections.emptyList(); + } else { + transformationRules_ = null; + transformationRulesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + namespacedResourceRestoreScopeCase_ = 0; + namespacedResourceRestoreScope_ = null; + return this; + } - public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.gkebackup.v1.RestoreProto + .internal_static_google_cloud_gkebackup_v1_RestoreConfig_descriptor; + } - public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig getDefaultInstanceForType() { + return com.google.cloud.gkebackup.v1.RestoreConfig.getDefaultInstance(); + } - public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig build() { + com.google.cloud.gkebackup.v1.RestoreConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } - public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestoreConfig buildPartial() { + com.google.cloud.gkebackup.v1.RestoreConfig result = + new com.google.cloud.gkebackup.v1.RestoreConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } - public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + private void buildPartialRepeatedFields(com.google.cloud.gkebackup.v1.RestoreConfig result) { + if (substitutionRulesBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0)) { + substitutionRules_ = java.util.Collections.unmodifiableList(substitutionRules_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.substitutionRules_ = substitutionRules_; + } else { + result.substitutionRules_ = substitutionRulesBuilder_.build(); + } + if (transformationRulesBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + transformationRules_ = java.util.Collections.unmodifiableList(transformationRules_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.transformationRules_ = transformationRules_; + } else { + result.transformationRules_ = transformationRulesBuilder_.build(); + } + } - public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + private void buildPartial0(com.google.cloud.gkebackup.v1.RestoreConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.volumeDataRestorePolicy_ = volumeDataRestorePolicy_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clusterResourceConflictPolicy_ = clusterResourceConflictPolicy_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.namespacedResourceRestoreMode_ = namespacedResourceRestoreMode_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.clusterResourceRestoreScope_ = + clusterResourceRestoreScopeBuilder_ == null + ? clusterResourceRestoreScope_ + : clusterResourceRestoreScopeBuilder_.build(); + } + } - public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } + private void buildPartialOneofs(com.google.cloud.gkebackup.v1.RestoreConfig result) { + result.namespacedResourceRestoreScopeCase_ = namespacedResourceRestoreScopeCase_; + result.namespacedResourceRestoreScope_ = this.namespacedResourceRestoreScope_; + if (namespacedResourceRestoreScopeCase_ == 6 && selectedNamespacesBuilder_ != null) { + result.namespacedResourceRestoreScope_ = selectedNamespacesBuilder_.build(); + } + if (namespacedResourceRestoreScopeCase_ == 7 && selectedApplicationsBuilder_ != null) { + result.namespacedResourceRestoreScope_ = selectedApplicationsBuilder_.build(); + } + if (namespacedResourceRestoreScopeCase_ == 10 && excludedNamespacesBuilder_ != null) { + result.namespacedResourceRestoreScope_ = excludedNamespacesBuilder_.build(); + } + } - public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } + @java.lang.Override + public Builder clone() { + return super.clone(); + } - public static com.google.cloud.gkebackup.v1.RestoreConfig parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } - public static com.google.cloud.gkebackup.v1.RestoreConfig parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } - public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } - public static com.google.cloud.gkebackup.v1.RestoreConfig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.gkebackup.v1.RestoreConfig) { + return mergeFrom((com.google.cloud.gkebackup.v1.RestoreConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.gkebackup.v1.RestoreConfig other) { + if (other == com.google.cloud.gkebackup.v1.RestoreConfig.getDefaultInstance()) return this; + if (other.volumeDataRestorePolicy_ != 0) { + setVolumeDataRestorePolicyValue(other.getVolumeDataRestorePolicyValue()); + } + if (other.clusterResourceConflictPolicy_ != 0) { + setClusterResourceConflictPolicyValue(other.getClusterResourceConflictPolicyValue()); + } + if (other.namespacedResourceRestoreMode_ != 0) { + setNamespacedResourceRestoreModeValue(other.getNamespacedResourceRestoreModeValue()); + } + if (other.hasClusterResourceRestoreScope()) { + mergeClusterResourceRestoreScope(other.getClusterResourceRestoreScope()); + } + if (substitutionRulesBuilder_ == null) { + if (!other.substitutionRules_.isEmpty()) { + if (substitutionRules_.isEmpty()) { + substitutionRules_ = other.substitutionRules_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensureSubstitutionRulesIsMutable(); + substitutionRules_.addAll(other.substitutionRules_); + } + onChanged(); + } + } else { + if (!other.substitutionRules_.isEmpty()) { + if (substitutionRulesBuilder_.isEmpty()) { + substitutionRulesBuilder_.dispose(); + substitutionRulesBuilder_ = null; + substitutionRules_ = other.substitutionRules_; + bitField0_ = (bitField0_ & ~0x00000200); + substitutionRulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSubstitutionRulesFieldBuilder() + : null; + } else { + substitutionRulesBuilder_.addAllMessages(other.substitutionRules_); + } + } + } + if (transformationRulesBuilder_ == null) { + if (!other.transformationRules_.isEmpty()) { + if (transformationRules_.isEmpty()) { + transformationRules_ = other.transformationRules_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureTransformationRulesIsMutable(); + transformationRules_.addAll(other.transformationRules_); + } + onChanged(); + } + } else { + if (!other.transformationRules_.isEmpty()) { + if (transformationRulesBuilder_.isEmpty()) { + transformationRulesBuilder_.dispose(); + transformationRulesBuilder_ = null; + transformationRules_ = other.transformationRules_; + bitField0_ = (bitField0_ & ~0x00000400); + transformationRulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTransformationRulesFieldBuilder() + : null; + } else { + transformationRulesBuilder_.addAllMessages(other.transformationRules_); + } + } + } + switch (other.getNamespacedResourceRestoreScopeCase()) { + case ALL_NAMESPACES: + { + setAllNamespaces(other.getAllNamespaces()); + break; + } + case SELECTED_NAMESPACES: + { + mergeSelectedNamespaces(other.getSelectedNamespaces()); + break; + } + case SELECTED_APPLICATIONS: + { + mergeSelectedApplications(other.getSelectedApplications()); + break; + } + case NO_NAMESPACES: + { + setNoNamespaces(other.getNoNamespaces()); + break; + } + case EXCLUDED_NAMESPACES: + { + mergeExcludedNamespaces(other.getExcludedNamespaces()); + break; + } + case NAMESPACEDRESOURCERESTORESCOPE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } + @java.lang.Override + public final boolean isInitialized() { + return true; + } - public static Builder newBuilder(com.google.cloud.gkebackup.v1.RestoreConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + volumeDataRestorePolicy_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + clusterResourceConflictPolicy_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + namespacedResourceRestoreMode_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage( + getClusterResourceRestoreScopeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + namespacedResourceRestoreScope_ = input.readBool(); + namespacedResourceRestoreScopeCase_ = 5; + break; + } // case 40 + case 50: + { + input.readMessage( + getSelectedNamespacesFieldBuilder().getBuilder(), extensionRegistry); + namespacedResourceRestoreScopeCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage( + getSelectedApplicationsFieldBuilder().getBuilder(), extensionRegistry); + namespacedResourceRestoreScopeCase_ = 7; + break; + } // case 58 + case 66: + { + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule m = + input.readMessage( + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.parser(), + extensionRegistry); + if (substitutionRulesBuilder_ == null) { + ensureSubstitutionRulesIsMutable(); + substitutionRules_.add(m); + } else { + substitutionRulesBuilder_.addMessage(m); + } + break; + } // case 66 + case 72: + { + namespacedResourceRestoreScope_ = input.readBool(); + namespacedResourceRestoreScopeCase_ = 9; + break; + } // case 72 + case 82: + { + input.readMessage( + getExcludedNamespacesFieldBuilder().getBuilder(), extensionRegistry); + namespacedResourceRestoreScopeCase_ = 10; + break; + } // case 82 + case 90: + { + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule m = + input.readMessage( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.parser(), + extensionRegistry); + if (transformationRulesBuilder_ == null) { + ensureTransformationRulesIsMutable(); + transformationRules_.add(m); + } else { + transformationRulesBuilder_.addMessage(m); + } + break; + } // case 90 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } + private int namespacedResourceRestoreScopeCase_ = 0; + private java.lang.Object namespacedResourceRestoreScope_; - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Configuration of a restore.
-   * Next id: 9
-   * 
- * - * Protobuf type {@code google.cloud.gkebackup.v1.RestoreConfig} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.gkebackup.v1.RestoreConfig) - com.google.cloud.gkebackup.v1.RestoreConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.gkebackup.v1.RestoreProto - .internal_static_google_cloud_gkebackup_v1_RestoreConfig_descriptor; + public NamespacedResourceRestoreScopeCase getNamespacedResourceRestoreScopeCase() { + return NamespacedResourceRestoreScopeCase.forNumber(namespacedResourceRestoreScopeCase_); } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.gkebackup.v1.RestoreProto - .internal_static_google_cloud_gkebackup_v1_RestoreConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.gkebackup.v1.RestoreConfig.class, - com.google.cloud.gkebackup.v1.RestoreConfig.Builder.class); + public Builder clearNamespacedResourceRestoreScope() { + namespacedResourceRestoreScopeCase_ = 0; + namespacedResourceRestoreScope_ = null; + onChanged(); + return this; } - // Construct using com.google.cloud.gkebackup.v1.RestoreConfig.newBuilder() - private Builder() {} + private int bitField0_; - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); + private int volumeDataRestorePolicy_ = 0; + /** + * + * + *
+     * Specifies the mechanism to be used to restore volume data.
+     * Default: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (will be treated as
+     * NO_VOLUME_DATA_RESTORATION).
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy volume_data_restore_policy = 1; + * + * + * @return The enum numeric value on the wire for volumeDataRestorePolicy. + */ + @java.lang.Override + public int getVolumeDataRestorePolicyValue() { + return volumeDataRestorePolicy_; } - + /** + * + * + *
+     * Specifies the mechanism to be used to restore volume data.
+     * Default: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (will be treated as
+     * NO_VOLUME_DATA_RESTORATION).
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy volume_data_restore_policy = 1; + * + * + * @param value The enum numeric value on the wire for volumeDataRestorePolicy to set. + * @return This builder for chaining. + */ + public Builder setVolumeDataRestorePolicyValue(int value) { + volumeDataRestorePolicy_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the mechanism to be used to restore volume data.
+     * Default: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (will be treated as
+     * NO_VOLUME_DATA_RESTORATION).
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy volume_data_restore_policy = 1; + * + * + * @return The volumeDataRestorePolicy. + */ @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - volumeDataRestorePolicy_ = 0; - clusterResourceConflictPolicy_ = 0; - namespacedResourceRestoreMode_ = 0; - clusterResourceRestoreScope_ = null; - if (clusterResourceRestoreScopeBuilder_ != null) { - clusterResourceRestoreScopeBuilder_.dispose(); - clusterResourceRestoreScopeBuilder_ = null; - } - if (selectedNamespacesBuilder_ != null) { - selectedNamespacesBuilder_.clear(); - } - if (selectedApplicationsBuilder_ != null) { - selectedApplicationsBuilder_.clear(); - } - if (substitutionRulesBuilder_ == null) { - substitutionRules_ = java.util.Collections.emptyList(); - } else { - substitutionRules_ = null; - substitutionRulesBuilder_.clear(); + public com.google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy + getVolumeDataRestorePolicy() { + com.google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy result = + com.google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy.forNumber( + volumeDataRestorePolicy_); + return result == null + ? com.google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Specifies the mechanism to be used to restore volume data.
+     * Default: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (will be treated as
+     * NO_VOLUME_DATA_RESTORATION).
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy volume_data_restore_policy = 1; + * + * + * @param value The volumeDataRestorePolicy to set. + * @return This builder for chaining. + */ + public Builder setVolumeDataRestorePolicy( + com.google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy value) { + if (value == null) { + throw new NullPointerException(); } - bitField0_ = (bitField0_ & ~0x00000080); - namespacedResourceRestoreScopeCase_ = 0; - namespacedResourceRestoreScope_ = null; + bitField0_ |= 0x00000001; + volumeDataRestorePolicy_ = value.getNumber(); + onChanged(); return this; } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.gkebackup.v1.RestoreProto - .internal_static_google_cloud_gkebackup_v1_RestoreConfig_descriptor; + /** + * + * + *
+     * Specifies the mechanism to be used to restore volume data.
+     * Default: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (will be treated as
+     * NO_VOLUME_DATA_RESTORATION).
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy volume_data_restore_policy = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearVolumeDataRestorePolicy() { + bitField0_ = (bitField0_ & ~0x00000001); + volumeDataRestorePolicy_ = 0; + onChanged(); + return this; } + private int clusterResourceConflictPolicy_ = 0; + /** + * + * + *
+     * Defines the behavior for handling the situation where cluster-scoped
+     * resources being restored already exist in the target cluster. This MUST be
+     * set to a value other than CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED if
+     * [cluster_resource_restore_scope][google.cloud.gkebackup.v1.RestoreConfig.cluster_resource_restore_scope]
+     * is not empty.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy cluster_resource_conflict_policy = 2; + * + * + * @return The enum numeric value on the wire for clusterResourceConflictPolicy. + */ @java.lang.Override - public com.google.cloud.gkebackup.v1.RestoreConfig getDefaultInstanceForType() { - return com.google.cloud.gkebackup.v1.RestoreConfig.getDefaultInstance(); + public int getClusterResourceConflictPolicyValue() { + return clusterResourceConflictPolicy_; } - - @java.lang.Override - public com.google.cloud.gkebackup.v1.RestoreConfig build() { - com.google.cloud.gkebackup.v1.RestoreConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; + /** + * + * + *
+     * Defines the behavior for handling the situation where cluster-scoped
+     * resources being restored already exist in the target cluster. This MUST be
+     * set to a value other than CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED if
+     * [cluster_resource_restore_scope][google.cloud.gkebackup.v1.RestoreConfig.cluster_resource_restore_scope]
+     * is not empty.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy cluster_resource_conflict_policy = 2; + * + * + * @param value The enum numeric value on the wire for clusterResourceConflictPolicy to set. + * @return This builder for chaining. + */ + public Builder setClusterResourceConflictPolicyValue(int value) { + clusterResourceConflictPolicy_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; } - + /** + * + * + *
+     * Defines the behavior for handling the situation where cluster-scoped
+     * resources being restored already exist in the target cluster. This MUST be
+     * set to a value other than CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED if
+     * [cluster_resource_restore_scope][google.cloud.gkebackup.v1.RestoreConfig.cluster_resource_restore_scope]
+     * is not empty.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy cluster_resource_conflict_policy = 2; + * + * + * @return The clusterResourceConflictPolicy. + */ @java.lang.Override - public com.google.cloud.gkebackup.v1.RestoreConfig buildPartial() { - com.google.cloud.gkebackup.v1.RestoreConfig result = - new com.google.cloud.gkebackup.v1.RestoreConfig(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - buildPartialOneofs(result); - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(com.google.cloud.gkebackup.v1.RestoreConfig result) { - if (substitutionRulesBuilder_ == null) { - if (((bitField0_ & 0x00000080) != 0)) { - substitutionRules_ = java.util.Collections.unmodifiableList(substitutionRules_); - bitField0_ = (bitField0_ & ~0x00000080); - } - result.substitutionRules_ = substitutionRules_; - } else { - result.substitutionRules_ = substitutionRulesBuilder_.build(); - } + public com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy + getClusterResourceConflictPolicy() { + com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy result = + com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy.forNumber( + clusterResourceConflictPolicy_); + return result == null + ? com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy.UNRECOGNIZED + : result; } - - private void buildPartial0(com.google.cloud.gkebackup.v1.RestoreConfig result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.volumeDataRestorePolicy_ = volumeDataRestorePolicy_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.clusterResourceConflictPolicy_ = clusterResourceConflictPolicy_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.namespacedResourceRestoreMode_ = namespacedResourceRestoreMode_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.clusterResourceRestoreScope_ = - clusterResourceRestoreScopeBuilder_ == null - ? clusterResourceRestoreScope_ - : clusterResourceRestoreScopeBuilder_.build(); + /** + * + * + *
+     * Defines the behavior for handling the situation where cluster-scoped
+     * resources being restored already exist in the target cluster. This MUST be
+     * set to a value other than CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED if
+     * [cluster_resource_restore_scope][google.cloud.gkebackup.v1.RestoreConfig.cluster_resource_restore_scope]
+     * is not empty.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy cluster_resource_conflict_policy = 2; + * + * + * @param value The clusterResourceConflictPolicy to set. + * @return This builder for chaining. + */ + public Builder setClusterResourceConflictPolicy( + com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy value) { + if (value == null) { + throw new NullPointerException(); } + bitField0_ |= 0x00000002; + clusterResourceConflictPolicy_ = value.getNumber(); + onChanged(); + return this; } - - private void buildPartialOneofs(com.google.cloud.gkebackup.v1.RestoreConfig result) { - result.namespacedResourceRestoreScopeCase_ = namespacedResourceRestoreScopeCase_; - result.namespacedResourceRestoreScope_ = this.namespacedResourceRestoreScope_; - if (namespacedResourceRestoreScopeCase_ == 6 && selectedNamespacesBuilder_ != null) { - result.namespacedResourceRestoreScope_ = selectedNamespacesBuilder_.build(); - } - if (namespacedResourceRestoreScopeCase_ == 7 && selectedApplicationsBuilder_ != null) { - result.namespacedResourceRestoreScope_ = selectedApplicationsBuilder_.build(); - } + /** + * + * + *
+     * Defines the behavior for handling the situation where cluster-scoped
+     * resources being restored already exist in the target cluster. This MUST be
+     * set to a value other than CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED if
+     * [cluster_resource_restore_scope][google.cloud.gkebackup.v1.RestoreConfig.cluster_resource_restore_scope]
+     * is not empty.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy cluster_resource_conflict_policy = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearClusterResourceConflictPolicy() { + bitField0_ = (bitField0_ & ~0x00000002); + clusterResourceConflictPolicy_ = 0; + onChanged(); + return this; } + private int namespacedResourceRestoreMode_ = 0; + /** + * + * + *
+     * Defines the behavior for handling the situation where sets of namespaced
+     * resources being restored already exist in the target cluster. This MUST be
+     * set to a value other than NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode namespaced_resource_restore_mode = 3; + * + * + * @return The enum numeric value on the wire for namespacedResourceRestoreMode. + */ @java.lang.Override - public Builder clone() { - return super.clone(); + public int getNamespacedResourceRestoreModeValue() { + return namespacedResourceRestoreMode_; } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + /** + * + * + *
+     * Defines the behavior for handling the situation where sets of namespaced
+     * resources being restored already exist in the target cluster. This MUST be
+     * set to a value other than NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode namespaced_resource_restore_mode = 3; + * + * + * @param value The enum numeric value on the wire for namespacedResourceRestoreMode to set. + * @return This builder for chaining. + */ + public Builder setNamespacedResourceRestoreModeValue(int value) { + namespacedResourceRestoreMode_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; } - + /** + * + * + *
+     * Defines the behavior for handling the situation where sets of namespaced
+     * resources being restored already exist in the target cluster. This MUST be
+     * set to a value other than NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode namespaced_resource_restore_mode = 3; + * + * + * @return The namespacedResourceRestoreMode. + */ @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + public com.google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode + getNamespacedResourceRestoreMode() { + com.google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode result = + com.google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode.forNumber( + namespacedResourceRestoreMode_); + return result == null + ? com.google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode.UNRECOGNIZED + : result; } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + /** + * + * + *
+     * Defines the behavior for handling the situation where sets of namespaced
+     * resources being restored already exist in the target cluster. This MUST be
+     * set to a value other than NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode namespaced_resource_restore_mode = 3; + * + * + * @param value The namespacedResourceRestoreMode to set. + * @return This builder for chaining. + */ + public Builder setNamespacedResourceRestoreMode( + com.google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + namespacedResourceRestoreMode_ = value.getNumber(); + onChanged(); + return this; } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + /** + * + * + *
+     * Defines the behavior for handling the situation where sets of namespaced
+     * resources being restored already exist in the target cluster. This MUST be
+     * set to a value other than NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode namespaced_resource_restore_mode = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearNamespacedResourceRestoreMode() { + bitField0_ = (bitField0_ & ~0x00000004); + namespacedResourceRestoreMode_ = 0; + onChanged(); + return this; } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + clusterResourceRestoreScope_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope, + com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScopeOrBuilder> + clusterResourceRestoreScopeBuilder_; + /** + * + * + *
+     * Identifies the cluster-scoped resources to restore from the Backup.
+     * Not specifying it means NO cluster resource will be restored.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; + * + * + * @return Whether the clusterResourceRestoreScope field is set. + */ + public boolean hasClusterResourceRestoreScope() { + return ((bitField0_ & 0x00000008) != 0); } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.gkebackup.v1.RestoreConfig) { - return mergeFrom((com.google.cloud.gkebackup.v1.RestoreConfig) other); + /** + * + * + *
+     * Identifies the cluster-scoped resources to restore from the Backup.
+     * Not specifying it means NO cluster resource will be restored.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; + * + * + * @return The clusterResourceRestoreScope. + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + getClusterResourceRestoreScope() { + if (clusterResourceRestoreScopeBuilder_ == null) { + return clusterResourceRestoreScope_ == null + ? com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + .getDefaultInstance() + : clusterResourceRestoreScope_; } else { - super.mergeFrom(other); - return this; + return clusterResourceRestoreScopeBuilder_.getMessage(); } } - - public Builder mergeFrom(com.google.cloud.gkebackup.v1.RestoreConfig other) { - if (other == com.google.cloud.gkebackup.v1.RestoreConfig.getDefaultInstance()) return this; - if (other.volumeDataRestorePolicy_ != 0) { - setVolumeDataRestorePolicyValue(other.getVolumeDataRestorePolicyValue()); - } - if (other.clusterResourceConflictPolicy_ != 0) { - setClusterResourceConflictPolicyValue(other.getClusterResourceConflictPolicyValue()); - } - if (other.namespacedResourceRestoreMode_ != 0) { - setNamespacedResourceRestoreModeValue(other.getNamespacedResourceRestoreModeValue()); - } - if (other.hasClusterResourceRestoreScope()) { - mergeClusterResourceRestoreScope(other.getClusterResourceRestoreScope()); - } - if (substitutionRulesBuilder_ == null) { - if (!other.substitutionRules_.isEmpty()) { - if (substitutionRules_.isEmpty()) { - substitutionRules_ = other.substitutionRules_; - bitField0_ = (bitField0_ & ~0x00000080); - } else { - ensureSubstitutionRulesIsMutable(); - substitutionRules_.addAll(other.substitutionRules_); - } - onChanged(); + /** + * + * + *
+     * Identifies the cluster-scoped resources to restore from the Backup.
+     * Not specifying it means NO cluster resource will be restored.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; + * + */ + public Builder setClusterResourceRestoreScope( + com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope value) { + if (clusterResourceRestoreScopeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + clusterResourceRestoreScope_ = value; } else { - if (!other.substitutionRules_.isEmpty()) { - if (substitutionRulesBuilder_.isEmpty()) { - substitutionRulesBuilder_.dispose(); - substitutionRulesBuilder_ = null; - substitutionRules_ = other.substitutionRules_; - bitField0_ = (bitField0_ & ~0x00000080); - substitutionRulesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getSubstitutionRulesFieldBuilder() - : null; - } else { - substitutionRulesBuilder_.addAllMessages(other.substitutionRules_); - } - } + clusterResourceRestoreScopeBuilder_.setMessage(value); } - switch (other.getNamespacedResourceRestoreScopeCase()) { - case ALL_NAMESPACES: - { - setAllNamespaces(other.getAllNamespaces()); - break; - } - case SELECTED_NAMESPACES: - { - mergeSelectedNamespaces(other.getSelectedNamespaces()); - break; - } - case SELECTED_APPLICATIONS: - { - mergeSelectedApplications(other.getSelectedApplications()); - break; - } - case NAMESPACEDRESOURCERESTORESCOPE_NOT_SET: - { - break; - } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifies the cluster-scoped resources to restore from the Backup.
+     * Not specifying it means NO cluster resource will be restored.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; + * + */ + public Builder setClusterResourceRestoreScope( + com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.Builder + builderForValue) { + if (clusterResourceRestoreScopeBuilder_ == null) { + clusterResourceRestoreScope_ = builderForValue.build(); + } else { + clusterResourceRestoreScopeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifies the cluster-scoped resources to restore from the Backup.
+     * Not specifying it means NO cluster resource will be restored.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; + * + */ + public Builder mergeClusterResourceRestoreScope( + com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope value) { + if (clusterResourceRestoreScopeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && clusterResourceRestoreScope_ != null + && clusterResourceRestoreScope_ + != com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + .getDefaultInstance()) { + getClusterResourceRestoreScopeBuilder().mergeFrom(value); + } else { + clusterResourceRestoreScope_ = value; + } + } else { + clusterResourceRestoreScopeBuilder_.mergeFrom(value); } - this.mergeUnknownFields(other.getUnknownFields()); + bitField0_ |= 0x00000008; onChanged(); return this; } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); + /** + * + * + *
+     * Identifies the cluster-scoped resources to restore from the Backup.
+     * Not specifying it means NO cluster resource will be restored.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; + * + */ + public Builder clearClusterResourceRestoreScope() { + bitField0_ = (bitField0_ & ~0x00000008); + clusterResourceRestoreScope_ = null; + if (clusterResourceRestoreScopeBuilder_ != null) { + clusterResourceRestoreScopeBuilder_.dispose(); + clusterResourceRestoreScopeBuilder_ = null; } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - volumeDataRestorePolicy_ = input.readEnum(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: - { - clusterResourceConflictPolicy_ = input.readEnum(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 24: - { - namespacedResourceRestoreMode_ = input.readEnum(); - bitField0_ |= 0x00000004; - break; - } // case 24 - case 34: - { - input.readMessage( - getClusterResourceRestoreScopeFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000008; - break; - } // case 34 - case 40: - { - namespacedResourceRestoreScope_ = input.readBool(); - namespacedResourceRestoreScopeCase_ = 5; - break; - } // case 40 - case 50: - { - input.readMessage( - getSelectedNamespacesFieldBuilder().getBuilder(), extensionRegistry); - namespacedResourceRestoreScopeCase_ = 6; - break; - } // case 50 - case 58: - { - input.readMessage( - getSelectedApplicationsFieldBuilder().getBuilder(), extensionRegistry); - namespacedResourceRestoreScopeCase_ = 7; - break; - } // case 58 - case 66: - { - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule m = - input.readMessage( - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.parser(), - extensionRegistry); - if (substitutionRulesBuilder_ == null) { - ensureSubstitutionRulesIsMutable(); - substitutionRules_.add(m); - } else { - substitutionRulesBuilder_.addMessage(m); - } - break; - } // case 66 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally + onChanged(); return this; } - - private int namespacedResourceRestoreScopeCase_ = 0; - private java.lang.Object namespacedResourceRestoreScope_; - - public NamespacedResourceRestoreScopeCase getNamespacedResourceRestoreScopeCase() { - return NamespacedResourceRestoreScopeCase.forNumber(namespacedResourceRestoreScopeCase_); + /** + * + * + *
+     * Identifies the cluster-scoped resources to restore from the Backup.
+     * Not specifying it means NO cluster resource will be restored.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; + * + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.Builder + getClusterResourceRestoreScopeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getClusterResourceRestoreScopeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Identifies the cluster-scoped resources to restore from the Backup.
+     * Not specifying it means NO cluster resource will be restored.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; + * + */ + public com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScopeOrBuilder + getClusterResourceRestoreScopeOrBuilder() { + if (clusterResourceRestoreScopeBuilder_ != null) { + return clusterResourceRestoreScopeBuilder_.getMessageOrBuilder(); + } else { + return clusterResourceRestoreScope_ == null + ? com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope + .getDefaultInstance() + : clusterResourceRestoreScope_; + } + } + /** + * + * + *
+     * Identifies the cluster-scoped resources to restore from the Backup.
+     * Not specifying it means NO cluster resource will be restored.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope, + com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScopeOrBuilder> + getClusterResourceRestoreScopeFieldBuilder() { + if (clusterResourceRestoreScopeBuilder_ == null) { + clusterResourceRestoreScopeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope, + com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScopeOrBuilder>( + getClusterResourceRestoreScope(), getParentForChildren(), isClean()); + clusterResourceRestoreScope_ = null; + } + return clusterResourceRestoreScopeBuilder_; } - public Builder clearNamespacedResourceRestoreScope() { - namespacedResourceRestoreScopeCase_ = 0; - namespacedResourceRestoreScope_ = null; + /** + * + * + *
+     * Restore all namespaced resources in the Backup if set to "True".
+     * Specifying this field to "False" is an error.
+     * 
+ * + * bool all_namespaces = 5; + * + * @return Whether the allNamespaces field is set. + */ + public boolean hasAllNamespaces() { + return namespacedResourceRestoreScopeCase_ == 5; + } + /** + * + * + *
+     * Restore all namespaced resources in the Backup if set to "True".
+     * Specifying this field to "False" is an error.
+     * 
+ * + * bool all_namespaces = 5; + * + * @return The allNamespaces. + */ + public boolean getAllNamespaces() { + if (namespacedResourceRestoreScopeCase_ == 5) { + return (java.lang.Boolean) namespacedResourceRestoreScope_; + } + return false; + } + /** + * + * + *
+     * Restore all namespaced resources in the Backup if set to "True".
+     * Specifying this field to "False" is an error.
+     * 
+ * + * bool all_namespaces = 5; + * + * @param value The allNamespaces to set. + * @return This builder for chaining. + */ + public Builder setAllNamespaces(boolean value) { + + namespacedResourceRestoreScopeCase_ = 5; + namespacedResourceRestoreScope_ = value; onChanged(); return this; } - - private int bitField0_; - - private int volumeDataRestorePolicy_ = 0; /** * * *
-     * Specifies the mechanism to be used to restore volume data.
-     * Default: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (will be treated as
-     * NO_VOLUME_DATA_RESTORATION).
+     * Restore all namespaced resources in the Backup if set to "True".
+     * Specifying this field to "False" is an error.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy volume_data_restore_policy = 1; - * + * bool all_namespaces = 5; * - * @return The enum numeric value on the wire for volumeDataRestorePolicy. + * @return This builder for chaining. */ - @java.lang.Override - public int getVolumeDataRestorePolicyValue() { - return volumeDataRestorePolicy_; + public Builder clearAllNamespaces() { + if (namespacedResourceRestoreScopeCase_ == 5) { + namespacedResourceRestoreScopeCase_ = 0; + namespacedResourceRestoreScope_ = null; + onChanged(); + } + return this; } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkebackup.v1.Namespaces, + com.google.cloud.gkebackup.v1.Namespaces.Builder, + com.google.cloud.gkebackup.v1.NamespacesOrBuilder> + selectedNamespacesBuilder_; /** * * *
-     * Specifies the mechanism to be used to restore volume data.
-     * Default: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (will be treated as
-     * NO_VOLUME_DATA_RESTORATION).
+     * A list of selected Namespaces to restore from the Backup. The listed
+     * Namespaces and all resources contained in them will be restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy volume_data_restore_policy = 1; - * + * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; * - * @param value The enum numeric value on the wire for volumeDataRestorePolicy to set. - * @return This builder for chaining. + * @return Whether the selectedNamespaces field is set. */ - public Builder setVolumeDataRestorePolicyValue(int value) { - volumeDataRestorePolicy_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; + @java.lang.Override + public boolean hasSelectedNamespaces() { + return namespacedResourceRestoreScopeCase_ == 6; } /** * * *
-     * Specifies the mechanism to be used to restore volume data.
-     * Default: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (will be treated as
-     * NO_VOLUME_DATA_RESTORATION).
+     * A list of selected Namespaces to restore from the Backup. The listed
+     * Namespaces and all resources contained in them will be restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy volume_data_restore_policy = 1; - * + * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; * - * @return The volumeDataRestorePolicy. + * @return The selectedNamespaces. */ @java.lang.Override - public com.google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy - getVolumeDataRestorePolicy() { - com.google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy result = - com.google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy.forNumber( - volumeDataRestorePolicy_); - return result == null - ? com.google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy.UNRECOGNIZED - : result; + public com.google.cloud.gkebackup.v1.Namespaces getSelectedNamespaces() { + if (selectedNamespacesBuilder_ == null) { + if (namespacedResourceRestoreScopeCase_ == 6) { + return (com.google.cloud.gkebackup.v1.Namespaces) namespacedResourceRestoreScope_; + } + return com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance(); + } else { + if (namespacedResourceRestoreScopeCase_ == 6) { + return selectedNamespacesBuilder_.getMessage(); + } + return com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance(); + } } /** * * *
-     * Specifies the mechanism to be used to restore volume data.
-     * Default: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (will be treated as
-     * NO_VOLUME_DATA_RESTORATION).
+     * A list of selected Namespaces to restore from the Backup. The listed
+     * Namespaces and all resources contained in them will be restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy volume_data_restore_policy = 1; - * + * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; + */ + public Builder setSelectedNamespaces(com.google.cloud.gkebackup.v1.Namespaces value) { + if (selectedNamespacesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + namespacedResourceRestoreScope_ = value; + onChanged(); + } else { + selectedNamespacesBuilder_.setMessage(value); + } + namespacedResourceRestoreScopeCase_ = 6; + return this; + } + /** * - * @param value The volumeDataRestorePolicy to set. - * @return This builder for chaining. + * + *
+     * A list of selected Namespaces to restore from the Backup. The listed
+     * Namespaces and all resources contained in them will be restored.
+     * 
+ * + * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; */ - public Builder setVolumeDataRestorePolicy( - com.google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy value) { - if (value == null) { - throw new NullPointerException(); + public Builder setSelectedNamespaces( + com.google.cloud.gkebackup.v1.Namespaces.Builder builderForValue) { + if (selectedNamespacesBuilder_ == null) { + namespacedResourceRestoreScope_ = builderForValue.build(); + onChanged(); + } else { + selectedNamespacesBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000001; - volumeDataRestorePolicy_ = value.getNumber(); - onChanged(); + namespacedResourceRestoreScopeCase_ = 6; return this; } /** * * *
-     * Specifies the mechanism to be used to restore volume data.
-     * Default: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (will be treated as
-     * NO_VOLUME_DATA_RESTORATION).
+     * A list of selected Namespaces to restore from the Backup. The listed
+     * Namespaces and all resources contained in them will be restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.VolumeDataRestorePolicy volume_data_restore_policy = 1; - * + * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; + */ + public Builder mergeSelectedNamespaces(com.google.cloud.gkebackup.v1.Namespaces value) { + if (selectedNamespacesBuilder_ == null) { + if (namespacedResourceRestoreScopeCase_ == 6 + && namespacedResourceRestoreScope_ + != com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance()) { + namespacedResourceRestoreScope_ = + com.google.cloud.gkebackup.v1.Namespaces.newBuilder( + (com.google.cloud.gkebackup.v1.Namespaces) namespacedResourceRestoreScope_) + .mergeFrom(value) + .buildPartial(); + } else { + namespacedResourceRestoreScope_ = value; + } + onChanged(); + } else { + if (namespacedResourceRestoreScopeCase_ == 6) { + selectedNamespacesBuilder_.mergeFrom(value); + } else { + selectedNamespacesBuilder_.setMessage(value); + } + } + namespacedResourceRestoreScopeCase_ = 6; + return this; + } + /** * - * @return This builder for chaining. + * + *
+     * A list of selected Namespaces to restore from the Backup. The listed
+     * Namespaces and all resources contained in them will be restored.
+     * 
+ * + * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; */ - public Builder clearVolumeDataRestorePolicy() { - bitField0_ = (bitField0_ & ~0x00000001); - volumeDataRestorePolicy_ = 0; - onChanged(); + public Builder clearSelectedNamespaces() { + if (selectedNamespacesBuilder_ == null) { + if (namespacedResourceRestoreScopeCase_ == 6) { + namespacedResourceRestoreScopeCase_ = 0; + namespacedResourceRestoreScope_ = null; + onChanged(); + } + } else { + if (namespacedResourceRestoreScopeCase_ == 6) { + namespacedResourceRestoreScopeCase_ = 0; + namespacedResourceRestoreScope_ = null; + } + selectedNamespacesBuilder_.clear(); + } return this; } - - private int clusterResourceConflictPolicy_ = 0; /** * * *
-     * Defines the behavior for handling the situation where cluster-scoped
-     * resources being restored already exist in the target cluster. This MUST be
-     * set to a value other than CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED if
-     * [cluster_resource_restore_scope][google.cloud.gkebackup.v1.RestoreConfig.cluster_resource_restore_scope]
-     * is not empty.
+     * A list of selected Namespaces to restore from the Backup. The listed
+     * Namespaces and all resources contained in them will be restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy cluster_resource_conflict_policy = 2; - * + * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; + */ + public com.google.cloud.gkebackup.v1.Namespaces.Builder getSelectedNamespacesBuilder() { + return getSelectedNamespacesFieldBuilder().getBuilder(); + } + /** * - * @return The enum numeric value on the wire for clusterResourceConflictPolicy. + * + *
+     * A list of selected Namespaces to restore from the Backup. The listed
+     * Namespaces and all resources contained in them will be restored.
+     * 
+ * + * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; */ @java.lang.Override - public int getClusterResourceConflictPolicyValue() { - return clusterResourceConflictPolicy_; + public com.google.cloud.gkebackup.v1.NamespacesOrBuilder getSelectedNamespacesOrBuilder() { + if ((namespacedResourceRestoreScopeCase_ == 6) && (selectedNamespacesBuilder_ != null)) { + return selectedNamespacesBuilder_.getMessageOrBuilder(); + } else { + if (namespacedResourceRestoreScopeCase_ == 6) { + return (com.google.cloud.gkebackup.v1.Namespaces) namespacedResourceRestoreScope_; + } + return com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance(); + } } /** * * *
-     * Defines the behavior for handling the situation where cluster-scoped
-     * resources being restored already exist in the target cluster. This MUST be
-     * set to a value other than CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED if
-     * [cluster_resource_restore_scope][google.cloud.gkebackup.v1.RestoreConfig.cluster_resource_restore_scope]
-     * is not empty.
+     * A list of selected Namespaces to restore from the Backup. The listed
+     * Namespaces and all resources contained in them will be restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy cluster_resource_conflict_policy = 2; - * - * - * @param value The enum numeric value on the wire for clusterResourceConflictPolicy to set. - * @return This builder for chaining. + * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; */ - public Builder setClusterResourceConflictPolicyValue(int value) { - clusterResourceConflictPolicy_ = value; - bitField0_ |= 0x00000002; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkebackup.v1.Namespaces, + com.google.cloud.gkebackup.v1.Namespaces.Builder, + com.google.cloud.gkebackup.v1.NamespacesOrBuilder> + getSelectedNamespacesFieldBuilder() { + if (selectedNamespacesBuilder_ == null) { + if (!(namespacedResourceRestoreScopeCase_ == 6)) { + namespacedResourceRestoreScope_ = + com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance(); + } + selectedNamespacesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkebackup.v1.Namespaces, + com.google.cloud.gkebackup.v1.Namespaces.Builder, + com.google.cloud.gkebackup.v1.NamespacesOrBuilder>( + (com.google.cloud.gkebackup.v1.Namespaces) namespacedResourceRestoreScope_, + getParentForChildren(), + isClean()); + namespacedResourceRestoreScope_ = null; + } + namespacedResourceRestoreScopeCase_ = 6; onChanged(); - return this; + return selectedNamespacesBuilder_; } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkebackup.v1.NamespacedNames, + com.google.cloud.gkebackup.v1.NamespacedNames.Builder, + com.google.cloud.gkebackup.v1.NamespacedNamesOrBuilder> + selectedApplicationsBuilder_; /** * * *
-     * Defines the behavior for handling the situation where cluster-scoped
-     * resources being restored already exist in the target cluster. This MUST be
-     * set to a value other than CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED if
-     * [cluster_resource_restore_scope][google.cloud.gkebackup.v1.RestoreConfig.cluster_resource_restore_scope]
-     * is not empty.
+     * A list of selected ProtectedApplications to restore. The listed
+     * ProtectedApplications and all the resources to which they refer will be
+     * restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy cluster_resource_conflict_policy = 2; - * + * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; * - * @return The clusterResourceConflictPolicy. + * @return Whether the selectedApplications field is set. */ @java.lang.Override - public com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy - getClusterResourceConflictPolicy() { - com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy result = - com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy.forNumber( - clusterResourceConflictPolicy_); - return result == null - ? com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy.UNRECOGNIZED - : result; + public boolean hasSelectedApplications() { + return namespacedResourceRestoreScopeCase_ == 7; } /** * * *
-     * Defines the behavior for handling the situation where cluster-scoped
-     * resources being restored already exist in the target cluster. This MUST be
-     * set to a value other than CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED if
-     * [cluster_resource_restore_scope][google.cloud.gkebackup.v1.RestoreConfig.cluster_resource_restore_scope]
-     * is not empty.
+     * A list of selected ProtectedApplications to restore. The listed
+     * ProtectedApplications and all the resources to which they refer will be
+     * restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy cluster_resource_conflict_policy = 2; - * + * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; * - * @param value The clusterResourceConflictPolicy to set. - * @return This builder for chaining. + * @return The selectedApplications. */ - public Builder setClusterResourceConflictPolicy( - com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy value) { - if (value == null) { - throw new NullPointerException(); + @java.lang.Override + public com.google.cloud.gkebackup.v1.NamespacedNames getSelectedApplications() { + if (selectedApplicationsBuilder_ == null) { + if (namespacedResourceRestoreScopeCase_ == 7) { + return (com.google.cloud.gkebackup.v1.NamespacedNames) namespacedResourceRestoreScope_; + } + return com.google.cloud.gkebackup.v1.NamespacedNames.getDefaultInstance(); + } else { + if (namespacedResourceRestoreScopeCase_ == 7) { + return selectedApplicationsBuilder_.getMessage(); + } + return com.google.cloud.gkebackup.v1.NamespacedNames.getDefaultInstance(); } - bitField0_ |= 0x00000002; - clusterResourceConflictPolicy_ = value.getNumber(); - onChanged(); - return this; } /** * * *
-     * Defines the behavior for handling the situation where cluster-scoped
-     * resources being restored already exist in the target cluster. This MUST be
-     * set to a value other than CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED if
-     * [cluster_resource_restore_scope][google.cloud.gkebackup.v1.RestoreConfig.cluster_resource_restore_scope]
-     * is not empty.
+     * A list of selected ProtectedApplications to restore. The listed
+     * ProtectedApplications and all the resources to which they refer will be
+     * restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceConflictPolicy cluster_resource_conflict_policy = 2; - * - * - * @return This builder for chaining. + * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; */ - public Builder clearClusterResourceConflictPolicy() { - bitField0_ = (bitField0_ & ~0x00000002); - clusterResourceConflictPolicy_ = 0; - onChanged(); + public Builder setSelectedApplications(com.google.cloud.gkebackup.v1.NamespacedNames value) { + if (selectedApplicationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + namespacedResourceRestoreScope_ = value; + onChanged(); + } else { + selectedApplicationsBuilder_.setMessage(value); + } + namespacedResourceRestoreScopeCase_ = 7; return this; } - - private int namespacedResourceRestoreMode_ = 0; /** * * *
-     * Defines the behavior for handling the situation where sets of namespaced
-     * resources being restored already exist in the target cluster. This MUST be
-     * set to a value other than NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED.
+     * A list of selected ProtectedApplications to restore. The listed
+     * ProtectedApplications and all the resources to which they refer will be
+     * restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode namespaced_resource_restore_mode = 3; - * - * - * @return The enum numeric value on the wire for namespacedResourceRestoreMode. + * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; */ - @java.lang.Override - public int getNamespacedResourceRestoreModeValue() { - return namespacedResourceRestoreMode_; + public Builder setSelectedApplications( + com.google.cloud.gkebackup.v1.NamespacedNames.Builder builderForValue) { + if (selectedApplicationsBuilder_ == null) { + namespacedResourceRestoreScope_ = builderForValue.build(); + onChanged(); + } else { + selectedApplicationsBuilder_.setMessage(builderForValue.build()); + } + namespacedResourceRestoreScopeCase_ = 7; + return this; } /** * * *
-     * Defines the behavior for handling the situation where sets of namespaced
-     * resources being restored already exist in the target cluster. This MUST be
-     * set to a value other than NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED.
+     * A list of selected ProtectedApplications to restore. The listed
+     * ProtectedApplications and all the resources to which they refer will be
+     * restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode namespaced_resource_restore_mode = 3; - * - * - * @param value The enum numeric value on the wire for namespacedResourceRestoreMode to set. - * @return This builder for chaining. + * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; */ - public Builder setNamespacedResourceRestoreModeValue(int value) { - namespacedResourceRestoreMode_ = value; - bitField0_ |= 0x00000004; - onChanged(); + public Builder mergeSelectedApplications(com.google.cloud.gkebackup.v1.NamespacedNames value) { + if (selectedApplicationsBuilder_ == null) { + if (namespacedResourceRestoreScopeCase_ == 7 + && namespacedResourceRestoreScope_ + != com.google.cloud.gkebackup.v1.NamespacedNames.getDefaultInstance()) { + namespacedResourceRestoreScope_ = + com.google.cloud.gkebackup.v1.NamespacedNames.newBuilder( + (com.google.cloud.gkebackup.v1.NamespacedNames) + namespacedResourceRestoreScope_) + .mergeFrom(value) + .buildPartial(); + } else { + namespacedResourceRestoreScope_ = value; + } + onChanged(); + } else { + if (namespacedResourceRestoreScopeCase_ == 7) { + selectedApplicationsBuilder_.mergeFrom(value); + } else { + selectedApplicationsBuilder_.setMessage(value); + } + } + namespacedResourceRestoreScopeCase_ = 7; return this; } /** * * *
-     * Defines the behavior for handling the situation where sets of namespaced
-     * resources being restored already exist in the target cluster. This MUST be
-     * set to a value other than NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED.
+     * A list of selected ProtectedApplications to restore. The listed
+     * ProtectedApplications and all the resources to which they refer will be
+     * restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode namespaced_resource_restore_mode = 3; - * - * - * @return The namespacedResourceRestoreMode. + * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; */ - @java.lang.Override - public com.google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode - getNamespacedResourceRestoreMode() { - com.google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode result = - com.google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode.forNumber( - namespacedResourceRestoreMode_); - return result == null - ? com.google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode.UNRECOGNIZED - : result; + public Builder clearSelectedApplications() { + if (selectedApplicationsBuilder_ == null) { + if (namespacedResourceRestoreScopeCase_ == 7) { + namespacedResourceRestoreScopeCase_ = 0; + namespacedResourceRestoreScope_ = null; + onChanged(); + } + } else { + if (namespacedResourceRestoreScopeCase_ == 7) { + namespacedResourceRestoreScopeCase_ = 0; + namespacedResourceRestoreScope_ = null; + } + selectedApplicationsBuilder_.clear(); + } + return this; } /** * * *
-     * Defines the behavior for handling the situation where sets of namespaced
-     * resources being restored already exist in the target cluster. This MUST be
-     * set to a value other than NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED.
+     * A list of selected ProtectedApplications to restore. The listed
+     * ProtectedApplications and all the resources to which they refer will be
+     * restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode namespaced_resource_restore_mode = 3; - * - * - * @param value The namespacedResourceRestoreMode to set. - * @return This builder for chaining. + * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; */ - public Builder setNamespacedResourceRestoreMode( - com.google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - namespacedResourceRestoreMode_ = value.getNumber(); - onChanged(); - return this; + public com.google.cloud.gkebackup.v1.NamespacedNames.Builder getSelectedApplicationsBuilder() { + return getSelectedApplicationsFieldBuilder().getBuilder(); } /** * * *
-     * Defines the behavior for handling the situation where sets of namespaced
-     * resources being restored already exist in the target cluster. This MUST be
-     * set to a value other than NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED.
+     * A list of selected ProtectedApplications to restore. The listed
+     * ProtectedApplications and all the resources to which they refer will be
+     * restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreMode namespaced_resource_restore_mode = 3; - * - * - * @return This builder for chaining. + * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; */ - public Builder clearNamespacedResourceRestoreMode() { - bitField0_ = (bitField0_ & ~0x00000004); - namespacedResourceRestoreMode_ = 0; - onChanged(); - return this; + @java.lang.Override + public com.google.cloud.gkebackup.v1.NamespacedNamesOrBuilder + getSelectedApplicationsOrBuilder() { + if ((namespacedResourceRestoreScopeCase_ == 7) && (selectedApplicationsBuilder_ != null)) { + return selectedApplicationsBuilder_.getMessageOrBuilder(); + } else { + if (namespacedResourceRestoreScopeCase_ == 7) { + return (com.google.cloud.gkebackup.v1.NamespacedNames) namespacedResourceRestoreScope_; + } + return com.google.cloud.gkebackup.v1.NamespacedNames.getDefaultInstance(); + } } - - private com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope - clusterResourceRestoreScope_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope, - com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.Builder, - com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScopeOrBuilder> - clusterResourceRestoreScopeBuilder_; /** * * *
-     * Identifies the cluster-scoped resources to restore from the Backup.
-     * Not specifying it means NO cluster resource will be restored.
+     * A list of selected ProtectedApplications to restore. The listed
+     * ProtectedApplications and all the resources to which they refer will be
+     * restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; - * - * - * @return Whether the clusterResourceRestoreScope field is set. + * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; */ - public boolean hasClusterResourceRestoreScope() { - return ((bitField0_ & 0x00000008) != 0); + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkebackup.v1.NamespacedNames, + com.google.cloud.gkebackup.v1.NamespacedNames.Builder, + com.google.cloud.gkebackup.v1.NamespacedNamesOrBuilder> + getSelectedApplicationsFieldBuilder() { + if (selectedApplicationsBuilder_ == null) { + if (!(namespacedResourceRestoreScopeCase_ == 7)) { + namespacedResourceRestoreScope_ = + com.google.cloud.gkebackup.v1.NamespacedNames.getDefaultInstance(); + } + selectedApplicationsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkebackup.v1.NamespacedNames, + com.google.cloud.gkebackup.v1.NamespacedNames.Builder, + com.google.cloud.gkebackup.v1.NamespacedNamesOrBuilder>( + (com.google.cloud.gkebackup.v1.NamespacedNames) namespacedResourceRestoreScope_, + getParentForChildren(), + isClean()); + namespacedResourceRestoreScope_ = null; + } + namespacedResourceRestoreScopeCase_ = 7; + onChanged(); + return selectedApplicationsBuilder_; } + /** * * *
-     * Identifies the cluster-scoped resources to restore from the Backup.
-     * Not specifying it means NO cluster resource will be restored.
+     * Do not restore any namespaced resources if set to "True".
+     * Specifying this field to "False" is not allowed.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; - * + * bool no_namespaces = 9; * - * @return The clusterResourceRestoreScope. + * @return Whether the noNamespaces field is set. */ - public com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope - getClusterResourceRestoreScope() { - if (clusterResourceRestoreScopeBuilder_ == null) { - return clusterResourceRestoreScope_ == null - ? com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope - .getDefaultInstance() - : clusterResourceRestoreScope_; - } else { - return clusterResourceRestoreScopeBuilder_.getMessage(); - } + public boolean hasNoNamespaces() { + return namespacedResourceRestoreScopeCase_ == 9; } /** * * *
-     * Identifies the cluster-scoped resources to restore from the Backup.
-     * Not specifying it means NO cluster resource will be restored.
+     * Do not restore any namespaced resources if set to "True".
+     * Specifying this field to "False" is not allowed.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; - * + * bool no_namespaces = 9; + * + * @return The noNamespaces. */ - public Builder setClusterResourceRestoreScope( - com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope value) { - if (clusterResourceRestoreScopeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - clusterResourceRestoreScope_ = value; - } else { - clusterResourceRestoreScopeBuilder_.setMessage(value); + public boolean getNoNamespaces() { + if (namespacedResourceRestoreScopeCase_ == 9) { + return (java.lang.Boolean) namespacedResourceRestoreScope_; } - bitField0_ |= 0x00000008; - onChanged(); - return this; + return false; } /** * * *
-     * Identifies the cluster-scoped resources to restore from the Backup.
-     * Not specifying it means NO cluster resource will be restored.
+     * Do not restore any namespaced resources if set to "True".
+     * Specifying this field to "False" is not allowed.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; - * + * bool no_namespaces = 9; + * + * @param value The noNamespaces to set. + * @return This builder for chaining. */ - public Builder setClusterResourceRestoreScope( - com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.Builder - builderForValue) { - if (clusterResourceRestoreScopeBuilder_ == null) { - clusterResourceRestoreScope_ = builderForValue.build(); - } else { - clusterResourceRestoreScopeBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000008; + public Builder setNoNamespaces(boolean value) { + + namespacedResourceRestoreScopeCase_ = 9; + namespacedResourceRestoreScope_ = value; onChanged(); return this; } @@ -6603,347 +13626,411 @@ public Builder setClusterResourceRestoreScope( * * *
-     * Identifies the cluster-scoped resources to restore from the Backup.
-     * Not specifying it means NO cluster resource will be restored.
+     * Do not restore any namespaced resources if set to "True".
+     * Specifying this field to "False" is not allowed.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; - * + * bool no_namespaces = 9; + * + * @return This builder for chaining. */ - public Builder mergeClusterResourceRestoreScope( - com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope value) { - if (clusterResourceRestoreScopeBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0) - && clusterResourceRestoreScope_ != null - && clusterResourceRestoreScope_ - != com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope - .getDefaultInstance()) { - getClusterResourceRestoreScopeBuilder().mergeFrom(value); - } else { - clusterResourceRestoreScope_ = value; - } - } else { - clusterResourceRestoreScopeBuilder_.mergeFrom(value); + public Builder clearNoNamespaces() { + if (namespacedResourceRestoreScopeCase_ == 9) { + namespacedResourceRestoreScopeCase_ = 0; + namespacedResourceRestoreScope_ = null; + onChanged(); } - bitField0_ |= 0x00000008; - onChanged(); return this; } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkebackup.v1.Namespaces, + com.google.cloud.gkebackup.v1.Namespaces.Builder, + com.google.cloud.gkebackup.v1.NamespacesOrBuilder> + excludedNamespacesBuilder_; /** * * *
-     * Identifies the cluster-scoped resources to restore from the Backup.
-     * Not specifying it means NO cluster resource will be restored.
+     * A list of selected namespaces excluded from restoration. All
+     * namespaces except those in this list will be restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; - * + * .google.cloud.gkebackup.v1.Namespaces excluded_namespaces = 10; + * + * @return Whether the excludedNamespaces field is set. */ - public Builder clearClusterResourceRestoreScope() { - bitField0_ = (bitField0_ & ~0x00000008); - clusterResourceRestoreScope_ = null; - if (clusterResourceRestoreScopeBuilder_ != null) { - clusterResourceRestoreScopeBuilder_.dispose(); - clusterResourceRestoreScopeBuilder_ = null; - } - onChanged(); - return this; + @java.lang.Override + public boolean hasExcludedNamespaces() { + return namespacedResourceRestoreScopeCase_ == 10; } /** * * *
-     * Identifies the cluster-scoped resources to restore from the Backup.
-     * Not specifying it means NO cluster resource will be restored.
+     * A list of selected namespaces excluded from restoration. All
+     * namespaces except those in this list will be restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; - * + * .google.cloud.gkebackup.v1.Namespaces excluded_namespaces = 10; + * + * @return The excludedNamespaces. */ - public com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.Builder - getClusterResourceRestoreScopeBuilder() { - bitField0_ |= 0x00000008; - onChanged(); - return getClusterResourceRestoreScopeFieldBuilder().getBuilder(); + @java.lang.Override + public com.google.cloud.gkebackup.v1.Namespaces getExcludedNamespaces() { + if (excludedNamespacesBuilder_ == null) { + if (namespacedResourceRestoreScopeCase_ == 10) { + return (com.google.cloud.gkebackup.v1.Namespaces) namespacedResourceRestoreScope_; + } + return com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance(); + } else { + if (namespacedResourceRestoreScopeCase_ == 10) { + return excludedNamespacesBuilder_.getMessage(); + } + return com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance(); + } } /** * * *
-     * Identifies the cluster-scoped resources to restore from the Backup.
-     * Not specifying it means NO cluster resource will be restored.
+     * A list of selected namespaces excluded from restoration. All
+     * namespaces except those in this list will be restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; - * + * .google.cloud.gkebackup.v1.Namespaces excluded_namespaces = 10; */ - public com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScopeOrBuilder - getClusterResourceRestoreScopeOrBuilder() { - if (clusterResourceRestoreScopeBuilder_ != null) { - return clusterResourceRestoreScopeBuilder_.getMessageOrBuilder(); + public Builder setExcludedNamespaces(com.google.cloud.gkebackup.v1.Namespaces value) { + if (excludedNamespacesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + namespacedResourceRestoreScope_ = value; + onChanged(); } else { - return clusterResourceRestoreScope_ == null - ? com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope - .getDefaultInstance() - : clusterResourceRestoreScope_; + excludedNamespacesBuilder_.setMessage(value); } + namespacedResourceRestoreScopeCase_ = 10; + return this; } /** * * *
-     * Identifies the cluster-scoped resources to restore from the Backup.
-     * Not specifying it means NO cluster resource will be restored.
+     * A list of selected namespaces excluded from restoration. All
+     * namespaces except those in this list will be restored.
      * 
* - * - * .google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope cluster_resource_restore_scope = 4; - * + * .google.cloud.gkebackup.v1.Namespaces excluded_namespaces = 10; */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope, - com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.Builder, - com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScopeOrBuilder> - getClusterResourceRestoreScopeFieldBuilder() { - if (clusterResourceRestoreScopeBuilder_ == null) { - clusterResourceRestoreScopeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope, - com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScope.Builder, - com.google.cloud.gkebackup.v1.RestoreConfig.ClusterResourceRestoreScopeOrBuilder>( - getClusterResourceRestoreScope(), getParentForChildren(), isClean()); - clusterResourceRestoreScope_ = null; + public Builder setExcludedNamespaces( + com.google.cloud.gkebackup.v1.Namespaces.Builder builderForValue) { + if (excludedNamespacesBuilder_ == null) { + namespacedResourceRestoreScope_ = builderForValue.build(); + onChanged(); + } else { + excludedNamespacesBuilder_.setMessage(builderForValue.build()); } - return clusterResourceRestoreScopeBuilder_; + namespacedResourceRestoreScopeCase_ = 10; + return this; } - /** * * *
-     * Restore all namespaced resources in the Backup if set to "True".
-     * Specifying this field to "False" is an error.
+     * A list of selected namespaces excluded from restoration. All
+     * namespaces except those in this list will be restored.
      * 
* - * bool all_namespaces = 5; - * - * @return Whether the allNamespaces field is set. + * .google.cloud.gkebackup.v1.Namespaces excluded_namespaces = 10; */ - public boolean hasAllNamespaces() { - return namespacedResourceRestoreScopeCase_ == 5; + public Builder mergeExcludedNamespaces(com.google.cloud.gkebackup.v1.Namespaces value) { + if (excludedNamespacesBuilder_ == null) { + if (namespacedResourceRestoreScopeCase_ == 10 + && namespacedResourceRestoreScope_ + != com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance()) { + namespacedResourceRestoreScope_ = + com.google.cloud.gkebackup.v1.Namespaces.newBuilder( + (com.google.cloud.gkebackup.v1.Namespaces) namespacedResourceRestoreScope_) + .mergeFrom(value) + .buildPartial(); + } else { + namespacedResourceRestoreScope_ = value; + } + onChanged(); + } else { + if (namespacedResourceRestoreScopeCase_ == 10) { + excludedNamespacesBuilder_.mergeFrom(value); + } else { + excludedNamespacesBuilder_.setMessage(value); + } + } + namespacedResourceRestoreScopeCase_ = 10; + return this; } /** * * *
-     * Restore all namespaced resources in the Backup if set to "True".
-     * Specifying this field to "False" is an error.
+     * A list of selected namespaces excluded from restoration. All
+     * namespaces except those in this list will be restored.
      * 
* - * bool all_namespaces = 5; - * - * @return The allNamespaces. + * .google.cloud.gkebackup.v1.Namespaces excluded_namespaces = 10; */ - public boolean getAllNamespaces() { - if (namespacedResourceRestoreScopeCase_ == 5) { - return (java.lang.Boolean) namespacedResourceRestoreScope_; + public Builder clearExcludedNamespaces() { + if (excludedNamespacesBuilder_ == null) { + if (namespacedResourceRestoreScopeCase_ == 10) { + namespacedResourceRestoreScopeCase_ = 0; + namespacedResourceRestoreScope_ = null; + onChanged(); + } + } else { + if (namespacedResourceRestoreScopeCase_ == 10) { + namespacedResourceRestoreScopeCase_ = 0; + namespacedResourceRestoreScope_ = null; + } + excludedNamespacesBuilder_.clear(); } - return false; + return this; } /** * * *
-     * Restore all namespaced resources in the Backup if set to "True".
-     * Specifying this field to "False" is an error.
+     * A list of selected namespaces excluded from restoration. All
+     * namespaces except those in this list will be restored.
      * 
* - * bool all_namespaces = 5; - * - * @param value The allNamespaces to set. - * @return This builder for chaining. + * .google.cloud.gkebackup.v1.Namespaces excluded_namespaces = 10; */ - public Builder setAllNamespaces(boolean value) { - - namespacedResourceRestoreScopeCase_ = 5; - namespacedResourceRestoreScope_ = value; - onChanged(); - return this; + public com.google.cloud.gkebackup.v1.Namespaces.Builder getExcludedNamespacesBuilder() { + return getExcludedNamespacesFieldBuilder().getBuilder(); } /** * * *
-     * Restore all namespaced resources in the Backup if set to "True".
-     * Specifying this field to "False" is an error.
+     * A list of selected namespaces excluded from restoration. All
+     * namespaces except those in this list will be restored.
      * 
* - * bool all_namespaces = 5; - * - * @return This builder for chaining. + * .google.cloud.gkebackup.v1.Namespaces excluded_namespaces = 10; */ - public Builder clearAllNamespaces() { - if (namespacedResourceRestoreScopeCase_ == 5) { - namespacedResourceRestoreScopeCase_ = 0; - namespacedResourceRestoreScope_ = null; - onChanged(); + @java.lang.Override + public com.google.cloud.gkebackup.v1.NamespacesOrBuilder getExcludedNamespacesOrBuilder() { + if ((namespacedResourceRestoreScopeCase_ == 10) && (excludedNamespacesBuilder_ != null)) { + return excludedNamespacesBuilder_.getMessageOrBuilder(); + } else { + if (namespacedResourceRestoreScopeCase_ == 10) { + return (com.google.cloud.gkebackup.v1.Namespaces) namespacedResourceRestoreScope_; + } + return com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance(); } - return this; } - + /** + * + * + *
+     * A list of selected namespaces excluded from restoration. All
+     * namespaces except those in this list will be restored.
+     * 
+ * + * .google.cloud.gkebackup.v1.Namespaces excluded_namespaces = 10; + */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.gkebackup.v1.Namespaces, com.google.cloud.gkebackup.v1.Namespaces.Builder, com.google.cloud.gkebackup.v1.NamespacesOrBuilder> - selectedNamespacesBuilder_; + getExcludedNamespacesFieldBuilder() { + if (excludedNamespacesBuilder_ == null) { + if (!(namespacedResourceRestoreScopeCase_ == 10)) { + namespacedResourceRestoreScope_ = + com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance(); + } + excludedNamespacesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.gkebackup.v1.Namespaces, + com.google.cloud.gkebackup.v1.Namespaces.Builder, + com.google.cloud.gkebackup.v1.NamespacesOrBuilder>( + (com.google.cloud.gkebackup.v1.Namespaces) namespacedResourceRestoreScope_, + getParentForChildren(), + isClean()); + namespacedResourceRestoreScope_ = null; + } + namespacedResourceRestoreScopeCase_ = 10; + onChanged(); + return excludedNamespacesBuilder_; + } + + private java.util.List + substitutionRules_ = java.util.Collections.emptyList(); + + private void ensureSubstitutionRulesIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + substitutionRules_ = + new java.util.ArrayList( + substitutionRules_); + bitField0_ |= 0x00000200; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule, + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder> + substitutionRulesBuilder_; + /** * * *
-     * A list of selected Namespaces to restore from the Backup. The listed
-     * Namespaces and all resources contained in them will be restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; - * - * @return Whether the selectedNamespaces field is set. + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - @java.lang.Override - public boolean hasSelectedNamespaces() { - return namespacedResourceRestoreScopeCase_ == 6; + public java.util.List + getSubstitutionRulesList() { + if (substitutionRulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(substitutionRules_); + } else { + return substitutionRulesBuilder_.getMessageList(); + } } /** * * *
-     * A list of selected Namespaces to restore from the Backup. The listed
-     * Namespaces and all resources contained in them will be restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; - * - * @return The selectedNamespaces. + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - @java.lang.Override - public com.google.cloud.gkebackup.v1.Namespaces getSelectedNamespaces() { - if (selectedNamespacesBuilder_ == null) { - if (namespacedResourceRestoreScopeCase_ == 6) { - return (com.google.cloud.gkebackup.v1.Namespaces) namespacedResourceRestoreScope_; - } - return com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance(); + public int getSubstitutionRulesCount() { + if (substitutionRulesBuilder_ == null) { + return substitutionRules_.size(); } else { - if (namespacedResourceRestoreScopeCase_ == 6) { - return selectedNamespacesBuilder_.getMessage(); - } - return com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance(); + return substitutionRulesBuilder_.getCount(); } } /** * * *
-     * A list of selected Namespaces to restore from the Backup. The listed
-     * Namespaces and all resources contained in them will be restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - public Builder setSelectedNamespaces(com.google.cloud.gkebackup.v1.Namespaces value) { - if (selectedNamespacesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - namespacedResourceRestoreScope_ = value; - onChanged(); + public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule getSubstitutionRules( + int index) { + if (substitutionRulesBuilder_ == null) { + return substitutionRules_.get(index); } else { - selectedNamespacesBuilder_.setMessage(value); + return substitutionRulesBuilder_.getMessage(index); } - namespacedResourceRestoreScopeCase_ = 6; - return this; } /** * * *
-     * A list of selected Namespaces to restore from the Backup. The listed
-     * Namespaces and all resources contained in them will be restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - public Builder setSelectedNamespaces( - com.google.cloud.gkebackup.v1.Namespaces.Builder builderForValue) { - if (selectedNamespacesBuilder_ == null) { - namespacedResourceRestoreScope_ = builderForValue.build(); + public Builder setSubstitutionRules( + int index, com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule value) { + if (substitutionRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubstitutionRulesIsMutable(); + substitutionRules_.set(index, value); onChanged(); } else { - selectedNamespacesBuilder_.setMessage(builderForValue.build()); + substitutionRulesBuilder_.setMessage(index, value); } - namespacedResourceRestoreScopeCase_ = 6; return this; } /** * * *
-     * A list of selected Namespaces to restore from the Backup. The listed
-     * Namespaces and all resources contained in them will be restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - public Builder mergeSelectedNamespaces(com.google.cloud.gkebackup.v1.Namespaces value) { - if (selectedNamespacesBuilder_ == null) { - if (namespacedResourceRestoreScopeCase_ == 6 - && namespacedResourceRestoreScope_ - != com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance()) { - namespacedResourceRestoreScope_ = - com.google.cloud.gkebackup.v1.Namespaces.newBuilder( - (com.google.cloud.gkebackup.v1.Namespaces) namespacedResourceRestoreScope_) - .mergeFrom(value) - .buildPartial(); - } else { - namespacedResourceRestoreScope_ = value; - } + public Builder setSubstitutionRules( + int index, + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder builderForValue) { + if (substitutionRulesBuilder_ == null) { + ensureSubstitutionRulesIsMutable(); + substitutionRules_.set(index, builderForValue.build()); onChanged(); } else { - if (namespacedResourceRestoreScopeCase_ == 6) { - selectedNamespacesBuilder_.mergeFrom(value); - } else { - selectedNamespacesBuilder_.setMessage(value); - } + substitutionRulesBuilder_.setMessage(index, builderForValue.build()); } - namespacedResourceRestoreScopeCase_ = 6; return this; } /** * * *
-     * A list of selected Namespaces to restore from the Backup. The listed
-     * Namespaces and all resources contained in them will be restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - public Builder clearSelectedNamespaces() { - if (selectedNamespacesBuilder_ == null) { - if (namespacedResourceRestoreScopeCase_ == 6) { - namespacedResourceRestoreScopeCase_ = 0; - namespacedResourceRestoreScope_ = null; - onChanged(); + public Builder addSubstitutionRules( + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule value) { + if (substitutionRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureSubstitutionRulesIsMutable(); + substitutionRules_.add(value); + onChanged(); } else { - if (namespacedResourceRestoreScopeCase_ == 6) { - namespacedResourceRestoreScopeCase_ = 0; - namespacedResourceRestoreScope_ = null; - } - selectedNamespacesBuilder_.clear(); + substitutionRulesBuilder_.addMessage(value); } return this; } @@ -6951,319 +14038,327 @@ public Builder clearSelectedNamespaces() { * * *
-     * A list of selected Namespaces to restore from the Backup. The listed
-     * Namespaces and all resources contained in them will be restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - public com.google.cloud.gkebackup.v1.Namespaces.Builder getSelectedNamespacesBuilder() { - return getSelectedNamespacesFieldBuilder().getBuilder(); + public Builder addSubstitutionRules( + int index, com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule value) { + if (substitutionRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubstitutionRulesIsMutable(); + substitutionRules_.add(index, value); + onChanged(); + } else { + substitutionRulesBuilder_.addMessage(index, value); + } + return this; } /** * * *
-     * A list of selected Namespaces to restore from the Backup. The listed
-     * Namespaces and all resources contained in them will be restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - @java.lang.Override - public com.google.cloud.gkebackup.v1.NamespacesOrBuilder getSelectedNamespacesOrBuilder() { - if ((namespacedResourceRestoreScopeCase_ == 6) && (selectedNamespacesBuilder_ != null)) { - return selectedNamespacesBuilder_.getMessageOrBuilder(); + public Builder addSubstitutionRules( + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder builderForValue) { + if (substitutionRulesBuilder_ == null) { + ensureSubstitutionRulesIsMutable(); + substitutionRules_.add(builderForValue.build()); + onChanged(); } else { - if (namespacedResourceRestoreScopeCase_ == 6) { - return (com.google.cloud.gkebackup.v1.Namespaces) namespacedResourceRestoreScope_; - } - return com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance(); + substitutionRulesBuilder_.addMessage(builderForValue.build()); } + return this; } /** * * *
-     * A list of selected Namespaces to restore from the Backup. The listed
-     * Namespaces and all resources contained in them will be restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.Namespaces selected_namespaces = 6; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.gkebackup.v1.Namespaces, - com.google.cloud.gkebackup.v1.Namespaces.Builder, - com.google.cloud.gkebackup.v1.NamespacesOrBuilder> - getSelectedNamespacesFieldBuilder() { - if (selectedNamespacesBuilder_ == null) { - if (!(namespacedResourceRestoreScopeCase_ == 6)) { - namespacedResourceRestoreScope_ = - com.google.cloud.gkebackup.v1.Namespaces.getDefaultInstance(); - } - selectedNamespacesBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.gkebackup.v1.Namespaces, - com.google.cloud.gkebackup.v1.Namespaces.Builder, - com.google.cloud.gkebackup.v1.NamespacesOrBuilder>( - (com.google.cloud.gkebackup.v1.Namespaces) namespacedResourceRestoreScope_, - getParentForChildren(), - isClean()); - namespacedResourceRestoreScope_ = null; + public Builder addSubstitutionRules( + int index, + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder builderForValue) { + if (substitutionRulesBuilder_ == null) { + ensureSubstitutionRulesIsMutable(); + substitutionRules_.add(index, builderForValue.build()); + onChanged(); + } else { + substitutionRulesBuilder_.addMessage(index, builderForValue.build()); } - namespacedResourceRestoreScopeCase_ = 6; - onChanged(); - return selectedNamespacesBuilder_; + return this; } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.gkebackup.v1.NamespacedNames, - com.google.cloud.gkebackup.v1.NamespacedNames.Builder, - com.google.cloud.gkebackup.v1.NamespacedNamesOrBuilder> - selectedApplicationsBuilder_; /** * * *
-     * A list of selected ProtectedApplications to restore. The listed
-     * ProtectedApplications and all the resources to which they refer will be
-     * restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; - * - * @return Whether the selectedApplications field is set. + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - @java.lang.Override - public boolean hasSelectedApplications() { - return namespacedResourceRestoreScopeCase_ == 7; + public Builder addAllSubstitutionRules( + java.lang.Iterable + values) { + if (substitutionRulesBuilder_ == null) { + ensureSubstitutionRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, substitutionRules_); + onChanged(); + } else { + substitutionRulesBuilder_.addAllMessages(values); + } + return this; } /** * * *
-     * A list of selected ProtectedApplications to restore. The listed
-     * ProtectedApplications and all the resources to which they refer will be
-     * restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; - * - * @return The selectedApplications. + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - @java.lang.Override - public com.google.cloud.gkebackup.v1.NamespacedNames getSelectedApplications() { - if (selectedApplicationsBuilder_ == null) { - if (namespacedResourceRestoreScopeCase_ == 7) { - return (com.google.cloud.gkebackup.v1.NamespacedNames) namespacedResourceRestoreScope_; - } - return com.google.cloud.gkebackup.v1.NamespacedNames.getDefaultInstance(); + public Builder clearSubstitutionRules() { + if (substitutionRulesBuilder_ == null) { + substitutionRules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); } else { - if (namespacedResourceRestoreScopeCase_ == 7) { - return selectedApplicationsBuilder_.getMessage(); - } - return com.google.cloud.gkebackup.v1.NamespacedNames.getDefaultInstance(); + substitutionRulesBuilder_.clear(); } + return this; } /** * * *
-     * A list of selected ProtectedApplications to restore. The listed
-     * ProtectedApplications and all the resources to which they refer will be
-     * restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - public Builder setSelectedApplications(com.google.cloud.gkebackup.v1.NamespacedNames value) { - if (selectedApplicationsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - namespacedResourceRestoreScope_ = value; + public Builder removeSubstitutionRules(int index) { + if (substitutionRulesBuilder_ == null) { + ensureSubstitutionRulesIsMutable(); + substitutionRules_.remove(index); onChanged(); } else { - selectedApplicationsBuilder_.setMessage(value); + substitutionRulesBuilder_.remove(index); } - namespacedResourceRestoreScopeCase_ = 7; return this; } /** * * *
-     * A list of selected ProtectedApplications to restore. The listed
-     * ProtectedApplications and all the resources to which they refer will be
-     * restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - public Builder setSelectedApplications( - com.google.cloud.gkebackup.v1.NamespacedNames.Builder builderForValue) { - if (selectedApplicationsBuilder_ == null) { - namespacedResourceRestoreScope_ = builderForValue.build(); - onChanged(); - } else { - selectedApplicationsBuilder_.setMessage(builderForValue.build()); - } - namespacedResourceRestoreScopeCase_ = 7; - return this; + public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder + getSubstitutionRulesBuilder(int index) { + return getSubstitutionRulesFieldBuilder().getBuilder(index); } /** * * *
-     * A list of selected ProtectedApplications to restore. The listed
-     * ProtectedApplications and all the resources to which they refer will be
-     * restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - public Builder mergeSelectedApplications(com.google.cloud.gkebackup.v1.NamespacedNames value) { - if (selectedApplicationsBuilder_ == null) { - if (namespacedResourceRestoreScopeCase_ == 7 - && namespacedResourceRestoreScope_ - != com.google.cloud.gkebackup.v1.NamespacedNames.getDefaultInstance()) { - namespacedResourceRestoreScope_ = - com.google.cloud.gkebackup.v1.NamespacedNames.newBuilder( - (com.google.cloud.gkebackup.v1.NamespacedNames) - namespacedResourceRestoreScope_) - .mergeFrom(value) - .buildPartial(); - } else { - namespacedResourceRestoreScope_ = value; - } - onChanged(); + public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder + getSubstitutionRulesOrBuilder(int index) { + if (substitutionRulesBuilder_ == null) { + return substitutionRules_.get(index); } else { - if (namespacedResourceRestoreScopeCase_ == 7) { - selectedApplicationsBuilder_.mergeFrom(value); - } else { - selectedApplicationsBuilder_.setMessage(value); - } + return substitutionRulesBuilder_.getMessageOrBuilder(index); } - namespacedResourceRestoreScopeCase_ = 7; - return this; } /** * * *
-     * A list of selected ProtectedApplications to restore. The listed
-     * ProtectedApplications and all the resources to which they refer will be
-     * restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - public Builder clearSelectedApplications() { - if (selectedApplicationsBuilder_ == null) { - if (namespacedResourceRestoreScopeCase_ == 7) { - namespacedResourceRestoreScopeCase_ = 0; - namespacedResourceRestoreScope_ = null; - onChanged(); - } + public java.util.List< + ? extends com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder> + getSubstitutionRulesOrBuilderList() { + if (substitutionRulesBuilder_ != null) { + return substitutionRulesBuilder_.getMessageOrBuilderList(); } else { - if (namespacedResourceRestoreScopeCase_ == 7) { - namespacedResourceRestoreScopeCase_ = 0; - namespacedResourceRestoreScope_ = null; - } - selectedApplicationsBuilder_.clear(); + return java.util.Collections.unmodifiableList(substitutionRules_); } - return this; } /** * * *
-     * A list of selected ProtectedApplications to restore. The listed
-     * ProtectedApplications and all the resources to which they refer will be
-     * restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - public com.google.cloud.gkebackup.v1.NamespacedNames.Builder getSelectedApplicationsBuilder() { - return getSelectedApplicationsFieldBuilder().getBuilder(); + public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder + addSubstitutionRulesBuilder() { + return getSubstitutionRulesFieldBuilder() + .addBuilder( + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.getDefaultInstance()); } /** * * *
-     * A list of selected ProtectedApplications to restore. The listed
-     * ProtectedApplications and all the resources to which they refer will be
-     * restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - @java.lang.Override - public com.google.cloud.gkebackup.v1.NamespacedNamesOrBuilder - getSelectedApplicationsOrBuilder() { - if ((namespacedResourceRestoreScopeCase_ == 7) && (selectedApplicationsBuilder_ != null)) { - return selectedApplicationsBuilder_.getMessageOrBuilder(); - } else { - if (namespacedResourceRestoreScopeCase_ == 7) { - return (com.google.cloud.gkebackup.v1.NamespacedNames) namespacedResourceRestoreScope_; - } - return com.google.cloud.gkebackup.v1.NamespacedNames.getDefaultInstance(); - } + public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder + addSubstitutionRulesBuilder(int index) { + return getSubstitutionRulesFieldBuilder() + .addBuilder( + index, + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.getDefaultInstance()); } /** * * *
-     * A list of selected ProtectedApplications to restore. The listed
-     * ProtectedApplications and all the resources to which they refer will be
-     * restored.
+     * A list of transformation rules to be applied against Kubernetes resources
+     * as they are selected for restoration from a Backup. Rules are executed in
+     * order defined - this order matters, as changes made by a rule may impact
+     * the filtering logic of subsequent rules. An empty list means no
+     * substitution will occur.
      * 
* - * .google.cloud.gkebackup.v1.NamespacedNames selected_applications = 7; + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.gkebackup.v1.NamespacedNames, - com.google.cloud.gkebackup.v1.NamespacedNames.Builder, - com.google.cloud.gkebackup.v1.NamespacedNamesOrBuilder> - getSelectedApplicationsFieldBuilder() { - if (selectedApplicationsBuilder_ == null) { - if (!(namespacedResourceRestoreScopeCase_ == 7)) { - namespacedResourceRestoreScope_ = - com.google.cloud.gkebackup.v1.NamespacedNames.getDefaultInstance(); - } - selectedApplicationsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.gkebackup.v1.NamespacedNames, - com.google.cloud.gkebackup.v1.NamespacedNames.Builder, - com.google.cloud.gkebackup.v1.NamespacedNamesOrBuilder>( - (com.google.cloud.gkebackup.v1.NamespacedNames) namespacedResourceRestoreScope_, + public java.util.List + getSubstitutionRulesBuilderList() { + return getSubstitutionRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule, + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder> + getSubstitutionRulesFieldBuilder() { + if (substitutionRulesBuilder_ == null) { + substitutionRulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule, + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder>( + substitutionRules_, + ((bitField0_ & 0x00000200) != 0), getParentForChildren(), isClean()); - namespacedResourceRestoreScope_ = null; + substitutionRules_ = null; } - namespacedResourceRestoreScopeCase_ = 7; - onChanged(); - return selectedApplicationsBuilder_; + return substitutionRulesBuilder_; } - private java.util.List - substitutionRules_ = java.util.Collections.emptyList(); + private java.util.List + transformationRules_ = java.util.Collections.emptyList(); - private void ensureSubstitutionRulesIsMutable() { - if (!((bitField0_ & 0x00000080) != 0)) { - substitutionRules_ = - new java.util.ArrayList( - substitutionRules_); - bitField0_ |= 0x00000080; + private void ensureTransformationRulesIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + transformationRules_ = + new java.util.ArrayList( + transformationRules_); + bitField0_ |= 0x00000400; } } private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule, - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder, - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder> - substitutionRulesBuilder_; + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleOrBuilder> + transformationRulesBuilder_; /** * @@ -7273,19 +14368,19 @@ private void ensureSubstitutionRulesIsMutable() { * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public java.util.List - getSubstitutionRulesList() { - if (substitutionRulesBuilder_ == null) { - return java.util.Collections.unmodifiableList(substitutionRules_); + public java.util.List + getTransformationRulesList() { + if (transformationRulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(transformationRules_); } else { - return substitutionRulesBuilder_.getMessageList(); + return transformationRulesBuilder_.getMessageList(); } } /** @@ -7296,18 +14391,18 @@ private void ensureSubstitutionRulesIsMutable() { * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public int getSubstitutionRulesCount() { - if (substitutionRulesBuilder_ == null) { - return substitutionRules_.size(); + public int getTransformationRulesCount() { + if (transformationRulesBuilder_ == null) { + return transformationRules_.size(); } else { - return substitutionRulesBuilder_.getCount(); + return transformationRulesBuilder_.getCount(); } } /** @@ -7318,19 +14413,19 @@ public int getSubstitutionRulesCount() { * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule getSubstitutionRules( + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule getTransformationRules( int index) { - if (substitutionRulesBuilder_ == null) { - return substitutionRules_.get(index); + if (transformationRulesBuilder_ == null) { + return transformationRules_.get(index); } else { - return substitutionRulesBuilder_.getMessage(index); + return transformationRulesBuilder_.getMessage(index); } } /** @@ -7341,24 +14436,24 @@ public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule getSubstitut * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public Builder setSubstitutionRules( - int index, com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule value) { - if (substitutionRulesBuilder_ == null) { + public Builder setTransformationRules( + int index, com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule value) { + if (transformationRulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureSubstitutionRulesIsMutable(); - substitutionRules_.set(index, value); + ensureTransformationRulesIsMutable(); + transformationRules_.set(index, value); onChanged(); } else { - substitutionRulesBuilder_.setMessage(index, value); + transformationRulesBuilder_.setMessage(index, value); } return this; } @@ -7370,22 +14465,22 @@ public Builder setSubstitutionRules( * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public Builder setSubstitutionRules( + public Builder setTransformationRules( int index, - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder builderForValue) { - if (substitutionRulesBuilder_ == null) { - ensureSubstitutionRulesIsMutable(); - substitutionRules_.set(index, builderForValue.build()); + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.Builder builderForValue) { + if (transformationRulesBuilder_ == null) { + ensureTransformationRulesIsMutable(); + transformationRules_.set(index, builderForValue.build()); onChanged(); } else { - substitutionRulesBuilder_.setMessage(index, builderForValue.build()); + transformationRulesBuilder_.setMessage(index, builderForValue.build()); } return this; } @@ -7397,24 +14492,24 @@ public Builder setSubstitutionRules( * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public Builder addSubstitutionRules( - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule value) { - if (substitutionRulesBuilder_ == null) { + public Builder addTransformationRules( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule value) { + if (transformationRulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureSubstitutionRulesIsMutable(); - substitutionRules_.add(value); + ensureTransformationRulesIsMutable(); + transformationRules_.add(value); onChanged(); } else { - substitutionRulesBuilder_.addMessage(value); + transformationRulesBuilder_.addMessage(value); } return this; } @@ -7426,24 +14521,24 @@ public Builder addSubstitutionRules( * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public Builder addSubstitutionRules( - int index, com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule value) { - if (substitutionRulesBuilder_ == null) { + public Builder addTransformationRules( + int index, com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule value) { + if (transformationRulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureSubstitutionRulesIsMutable(); - substitutionRules_.add(index, value); + ensureTransformationRulesIsMutable(); + transformationRules_.add(index, value); onChanged(); } else { - substitutionRulesBuilder_.addMessage(index, value); + transformationRulesBuilder_.addMessage(index, value); } return this; } @@ -7455,21 +14550,21 @@ public Builder addSubstitutionRules( * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public Builder addSubstitutionRules( - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder builderForValue) { - if (substitutionRulesBuilder_ == null) { - ensureSubstitutionRulesIsMutable(); - substitutionRules_.add(builderForValue.build()); + public Builder addTransformationRules( + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.Builder builderForValue) { + if (transformationRulesBuilder_ == null) { + ensureTransformationRulesIsMutable(); + transformationRules_.add(builderForValue.build()); onChanged(); } else { - substitutionRulesBuilder_.addMessage(builderForValue.build()); + transformationRulesBuilder_.addMessage(builderForValue.build()); } return this; } @@ -7481,22 +14576,22 @@ public Builder addSubstitutionRules( * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public Builder addSubstitutionRules( + public Builder addTransformationRules( int index, - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder builderForValue) { - if (substitutionRulesBuilder_ == null) { - ensureSubstitutionRulesIsMutable(); - substitutionRules_.add(index, builderForValue.build()); + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.Builder builderForValue) { + if (transformationRulesBuilder_ == null) { + ensureTransformationRulesIsMutable(); + transformationRules_.add(index, builderForValue.build()); onChanged(); } else { - substitutionRulesBuilder_.addMessage(index, builderForValue.build()); + transformationRulesBuilder_.addMessage(index, builderForValue.build()); } return this; } @@ -7508,22 +14603,22 @@ public Builder addSubstitutionRules( * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public Builder addAllSubstitutionRules( - java.lang.Iterable + public Builder addAllTransformationRules( + java.lang.Iterable values) { - if (substitutionRulesBuilder_ == null) { - ensureSubstitutionRulesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, substitutionRules_); + if (transformationRulesBuilder_ == null) { + ensureTransformationRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, transformationRules_); onChanged(); } else { - substitutionRulesBuilder_.addAllMessages(values); + transformationRulesBuilder_.addAllMessages(values); } return this; } @@ -7535,20 +14630,20 @@ public Builder addAllSubstitutionRules( * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public Builder clearSubstitutionRules() { - if (substitutionRulesBuilder_ == null) { - substitutionRules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); + public Builder clearTransformationRules() { + if (transformationRulesBuilder_ == null) { + transformationRules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); onChanged(); } else { - substitutionRulesBuilder_.clear(); + transformationRulesBuilder_.clear(); } return this; } @@ -7560,20 +14655,20 @@ public Builder clearSubstitutionRules() { * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public Builder removeSubstitutionRules(int index) { - if (substitutionRulesBuilder_ == null) { - ensureSubstitutionRulesIsMutable(); - substitutionRules_.remove(index); + public Builder removeTransformationRules(int index) { + if (transformationRulesBuilder_ == null) { + ensureTransformationRulesIsMutable(); + transformationRules_.remove(index); onChanged(); } else { - substitutionRulesBuilder_.remove(index); + transformationRulesBuilder_.remove(index); } return this; } @@ -7585,16 +14680,16 @@ public Builder removeSubstitutionRules(int index) { * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder - getSubstitutionRulesBuilder(int index) { - return getSubstitutionRulesFieldBuilder().getBuilder(index); + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.Builder + getTransformationRulesBuilder(int index) { + return getTransformationRulesFieldBuilder().getBuilder(index); } /** * @@ -7604,19 +14699,19 @@ public Builder removeSubstitutionRules(int index) { * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder - getSubstitutionRulesOrBuilder(int index) { - if (substitutionRulesBuilder_ == null) { - return substitutionRules_.get(index); + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleOrBuilder + getTransformationRulesOrBuilder(int index) { + if (transformationRulesBuilder_ == null) { + return transformationRules_.get(index); } else { - return substitutionRulesBuilder_.getMessageOrBuilder(index); + return transformationRulesBuilder_.getMessageOrBuilder(index); } } /** @@ -7627,20 +14722,20 @@ public Builder removeSubstitutionRules(int index) { * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ public java.util.List< - ? extends com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder> - getSubstitutionRulesOrBuilderList() { - if (substitutionRulesBuilder_ != null) { - return substitutionRulesBuilder_.getMessageOrBuilderList(); + ? extends com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleOrBuilder> + getTransformationRulesOrBuilderList() { + if (transformationRulesBuilder_ != null) { + return transformationRulesBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(substitutionRules_); + return java.util.Collections.unmodifiableList(transformationRules_); } } /** @@ -7651,18 +14746,18 @@ public Builder removeSubstitutionRules(int index) { * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder - addSubstitutionRulesBuilder() { - return getSubstitutionRulesFieldBuilder() + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.Builder + addTransformationRulesBuilder() { + return getTransformationRulesFieldBuilder() .addBuilder( - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.getDefaultInstance()); + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.getDefaultInstance()); } /** * @@ -7672,19 +14767,19 @@ public Builder removeSubstitutionRules(int index) { * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder - addSubstitutionRulesBuilder(int index) { - return getSubstitutionRulesFieldBuilder() + public com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.Builder + addTransformationRulesBuilder(int index) { + return getTransformationRulesFieldBuilder() .addBuilder( index, - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.getDefaultInstance()); + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.getDefaultInstance()); } /** * @@ -7694,36 +14789,36 @@ public Builder removeSubstitutionRules(int index) { * as they are selected for restoration from a Backup. Rules are executed in * order defined - this order matters, as changes made by a rule may impact * the filtering logic of subsequent rules. An empty list means no - * substitution will occur. + * transformation will occur. * * * - * repeated .google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule substitution_rules = 8; + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; * */ - public java.util.List - getSubstitutionRulesBuilderList() { - return getSubstitutionRulesFieldBuilder().getBuilderList(); + public java.util.List + getTransformationRulesBuilderList() { + return getTransformationRulesFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule, - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder, - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder> - getSubstitutionRulesFieldBuilder() { - if (substitutionRulesBuilder_ == null) { - substitutionRulesBuilder_ = + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleOrBuilder> + getTransformationRulesFieldBuilder() { + if (transformationRulesBuilder_ == null) { + transformationRulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule, - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule.Builder, - com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder>( - substitutionRules_, - ((bitField0_ & 0x00000080) != 0), + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule.Builder, + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleOrBuilder>( + transformationRules_, + ((bitField0_ & 0x00000400) != 0), getParentForChildren(), isClean()); - substitutionRules_ = null; + transformationRules_ = null; } - return substitutionRulesBuilder_; + return transformationRulesBuilder_; } @java.lang.Override diff --git a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestoreConfigOrBuilder.java b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestoreConfigOrBuilder.java index a775b48bc8d8..c820e19b0092 100644 --- a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestoreConfigOrBuilder.java +++ b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestoreConfigOrBuilder.java @@ -280,6 +280,71 @@ public interface RestoreConfigOrBuilder */ com.google.cloud.gkebackup.v1.NamespacedNamesOrBuilder getSelectedApplicationsOrBuilder(); + /** + * + * + *
+   * Do not restore any namespaced resources if set to "True".
+   * Specifying this field to "False" is not allowed.
+   * 
+ * + * bool no_namespaces = 9; + * + * @return Whether the noNamespaces field is set. + */ + boolean hasNoNamespaces(); + /** + * + * + *
+   * Do not restore any namespaced resources if set to "True".
+   * Specifying this field to "False" is not allowed.
+   * 
+ * + * bool no_namespaces = 9; + * + * @return The noNamespaces. + */ + boolean getNoNamespaces(); + + /** + * + * + *
+   * A list of selected namespaces excluded from restoration. All
+   * namespaces except those in this list will be restored.
+   * 
+ * + * .google.cloud.gkebackup.v1.Namespaces excluded_namespaces = 10; + * + * @return Whether the excludedNamespaces field is set. + */ + boolean hasExcludedNamespaces(); + /** + * + * + *
+   * A list of selected namespaces excluded from restoration. All
+   * namespaces except those in this list will be restored.
+   * 
+ * + * .google.cloud.gkebackup.v1.Namespaces excluded_namespaces = 10; + * + * @return The excludedNamespaces. + */ + com.google.cloud.gkebackup.v1.Namespaces getExcludedNamespaces(); + /** + * + * + *
+   * A list of selected namespaces excluded from restoration. All
+   * namespaces except those in this list will be restored.
+   * 
+ * + * .google.cloud.gkebackup.v1.Namespaces excluded_namespaces = 10; + */ + com.google.cloud.gkebackup.v1.NamespacesOrBuilder getExcludedNamespacesOrBuilder(); + /** * * @@ -364,6 +429,90 @@ public interface RestoreConfigOrBuilder com.google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRuleOrBuilder getSubstitutionRulesOrBuilder(int index); + /** + * + * + *
+   * A list of transformation rules to be applied against Kubernetes resources
+   * as they are selected for restoration from a Backup. Rules are executed in
+   * order defined - this order matters, as changes made by a rule may impact
+   * the filtering logic of subsequent rules. An empty list means no
+   * transformation will occur.
+   * 
+ * + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; + * + */ + java.util.List + getTransformationRulesList(); + /** + * + * + *
+   * A list of transformation rules to be applied against Kubernetes resources
+   * as they are selected for restoration from a Backup. Rules are executed in
+   * order defined - this order matters, as changes made by a rule may impact
+   * the filtering logic of subsequent rules. An empty list means no
+   * transformation will occur.
+   * 
+ * + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; + * + */ + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRule getTransformationRules(int index); + /** + * + * + *
+   * A list of transformation rules to be applied against Kubernetes resources
+   * as they are selected for restoration from a Backup. Rules are executed in
+   * order defined - this order matters, as changes made by a rule may impact
+   * the filtering logic of subsequent rules. An empty list means no
+   * transformation will occur.
+   * 
+ * + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; + * + */ + int getTransformationRulesCount(); + /** + * + * + *
+   * A list of transformation rules to be applied against Kubernetes resources
+   * as they are selected for restoration from a Backup. Rules are executed in
+   * order defined - this order matters, as changes made by a rule may impact
+   * the filtering logic of subsequent rules. An empty list means no
+   * transformation will occur.
+   * 
+ * + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; + * + */ + java.util.List + getTransformationRulesOrBuilderList(); + /** + * + * + *
+   * A list of transformation rules to be applied against Kubernetes resources
+   * as they are selected for restoration from a Backup. Rules are executed in
+   * order defined - this order matters, as changes made by a rule may impact
+   * the filtering logic of subsequent rules. An empty list means no
+   * transformation will occur.
+   * 
+ * + * + * repeated .google.cloud.gkebackup.v1.RestoreConfig.TransformationRule transformation_rules = 11; + * + */ + com.google.cloud.gkebackup.v1.RestoreConfig.TransformationRuleOrBuilder + getTransformationRulesOrBuilder(int index); + com.google.cloud.gkebackup.v1.RestoreConfig.NamespacedResourceRestoreScopeCase getNamespacedResourceRestoreScopeCase(); } diff --git a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestorePlan.java b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestorePlan.java index f6a5d1df764e..a66e987c620d 100644 --- a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestorePlan.java +++ b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestorePlan.java @@ -24,7 +24,7 @@ *
  * The configuration of a potential series of Restore operations to be performed
  * against Backups belong to a particular BackupPlan.
- * Next id: 11
+ * Next id: 13
  * 
* * Protobuf type {@code google.cloud.gkebackup.v1.RestorePlan} @@ -46,6 +46,8 @@ private RestorePlan() { backupPlan_ = ""; cluster_ = ""; etag_ = ""; + state_ = 0; + stateReason_ = ""; } @java.lang.Override @@ -80,6 +82,207 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { com.google.cloud.gkebackup.v1.RestorePlan.Builder.class); } + /** + * + * + *
+   * State
+   * 
+ * + * Protobuf enum {@code google.cloud.gkebackup.v1.RestorePlan.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default first value for Enums.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Waiting for cluster state to be RUNNING.
+     * 
+ * + * CLUSTER_PENDING = 1; + */ + CLUSTER_PENDING(1), + /** + * + * + *
+     * The RestorePlan has successfully been created and is ready for Restores.
+     * 
+ * + * READY = 2; + */ + READY(2), + /** + * + * + *
+     * RestorePlan creation has failed.
+     * 
+ * + * FAILED = 3; + */ + FAILED(3), + /** + * + * + *
+     * The RestorePlan is in the process of being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default first value for Enums.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Waiting for cluster state to be RUNNING.
+     * 
+ * + * CLUSTER_PENDING = 1; + */ + public static final int CLUSTER_PENDING_VALUE = 1; + /** + * + * + *
+     * The RestorePlan has successfully been created and is ready for Restores.
+     * 
+ * + * READY = 2; + */ + public static final int READY_VALUE = 2; + /** + * + * + *
+     * RestorePlan creation has failed.
+     * 
+ * + * FAILED = 3; + */ + public static final int FAILED_VALUE = 3; + /** + * + * + *
+     * The RestorePlan is in the process of being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return CLUSTER_PENDING; + case 2: + return READY; + case 3: + return FAILED; + case 4: + return DELETING; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.gkebackup.v1.RestorePlan.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.gkebackup.v1.RestorePlan.State) + } + public static final int NAME_FIELD_NUMBER = 1; @SuppressWarnings("serial") @@ -690,6 +893,102 @@ public com.google.protobuf.ByteString getEtagBytes() { } } + public static final int STATE_FIELD_NUMBER = 11; + private int state_ = 0; + /** + * + * + *
+   * Output only. State of the RestorePlan. This State field reflects the
+   * various stages a RestorePlan can be in
+   * during the Create operation.
+   * 
+ * + * + * .google.cloud.gkebackup.v1.RestorePlan.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. State of the RestorePlan. This State field reflects the
+   * various stages a RestorePlan can be in
+   * during the Create operation.
+   * 
+ * + * + * .google.cloud.gkebackup.v1.RestorePlan.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestorePlan.State getState() { + com.google.cloud.gkebackup.v1.RestorePlan.State result = + com.google.cloud.gkebackup.v1.RestorePlan.State.forNumber(state_); + return result == null ? com.google.cloud.gkebackup.v1.RestorePlan.State.UNRECOGNIZED : result; + } + + public static final int STATE_REASON_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object stateReason_ = ""; + /** + * + * + *
+   * Output only. Human-readable description of why RestorePlan is in the
+   * current `state`
+   * 
+ * + * string state_reason = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The stateReason. + */ + @java.lang.Override + public java.lang.String getStateReason() { + java.lang.Object ref = stateReason_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stateReason_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable description of why RestorePlan is in the
+   * current `state`
+   * 
+ * + * string state_reason = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for stateReason. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStateReasonBytes() { + java.lang.Object ref = stateReason_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stateReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -733,6 +1032,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 10, etag_); } + if (state_ != com.google.cloud.gkebackup.v1.RestorePlan.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(11, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stateReason_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, stateReason_); + } getUnknownFields().writeTo(output); } @@ -779,6 +1084,12 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, etag_); } + if (state_ != com.google.cloud.gkebackup.v1.RestorePlan.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stateReason_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, stateReason_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -814,6 +1125,8 @@ public boolean equals(final java.lang.Object obj) { } if (!internalGetLabels().equals(other.internalGetLabels())) return false; if (!getEtag().equals(other.getEtag())) return false; + if (state_ != other.state_) return false; + if (!getStateReason().equals(other.getStateReason())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -853,6 +1166,10 @@ public int hashCode() { } hash = (37 * hash) + ETAG_FIELD_NUMBER; hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + STATE_REASON_FIELD_NUMBER; + hash = (53 * hash) + getStateReason().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -959,7 +1276,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build *
    * The configuration of a potential series of Restore operations to be performed
    * against Backups belong to a particular BackupPlan.
-   * Next id: 11
+   * Next id: 13
    * 
* * Protobuf type {@code google.cloud.gkebackup.v1.RestorePlan} @@ -1036,6 +1353,8 @@ public Builder clear() { } internalGetMutableLabels().clear(); etag_ = ""; + state_ = 0; + stateReason_ = ""; return this; } @@ -1104,6 +1423,12 @@ private void buildPartial0(com.google.cloud.gkebackup.v1.RestorePlan result) { if (((from_bitField0_ & 0x00000200) != 0)) { result.etag_ = etag_; } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.stateReason_ = stateReason_; + } } @java.lang.Override @@ -1192,6 +1517,14 @@ public Builder mergeFrom(com.google.cloud.gkebackup.v1.RestorePlan other) { bitField0_ |= 0x00000200; onChanged(); } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getStateReason().isEmpty()) { + stateReason_ = other.stateReason_; + bitField0_ |= 0x00000800; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1284,6 +1617,18 @@ public Builder mergeFrom( bitField0_ |= 0x00000200; break; } // case 82 + case 88: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 98: + { + stateReason_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 98 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2829,6 +3174,227 @@ public Builder setEtagBytes(com.google.protobuf.ByteString value) { return this; } + private int state_ = 0; + /** + * + * + *
+     * Output only. State of the RestorePlan. This State field reflects the
+     * various stages a RestorePlan can be in
+     * during the Create operation.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestorePlan.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. State of the RestorePlan. This State field reflects the
+     * various stages a RestorePlan can be in
+     * during the Create operation.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestorePlan.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the RestorePlan. This State field reflects the
+     * various stages a RestorePlan can be in
+     * during the Create operation.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestorePlan.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.gkebackup.v1.RestorePlan.State getState() { + com.google.cloud.gkebackup.v1.RestorePlan.State result = + com.google.cloud.gkebackup.v1.RestorePlan.State.forNumber(state_); + return result == null ? com.google.cloud.gkebackup.v1.RestorePlan.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. State of the RestorePlan. This State field reflects the
+     * various stages a RestorePlan can be in
+     * during the Create operation.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestorePlan.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.gkebackup.v1.RestorePlan.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the RestorePlan. This State field reflects the
+     * various stages a RestorePlan can be in
+     * during the Create operation.
+     * 
+ * + * + * .google.cloud.gkebackup.v1.RestorePlan.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000400); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object stateReason_ = ""; + /** + * + * + *
+     * Output only. Human-readable description of why RestorePlan is in the
+     * current `state`
+     * 
+ * + * string state_reason = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The stateReason. + */ + public java.lang.String getStateReason() { + java.lang.Object ref = stateReason_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stateReason_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable description of why RestorePlan is in the
+     * current `state`
+     * 
+ * + * string state_reason = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for stateReason. + */ + public com.google.protobuf.ByteString getStateReasonBytes() { + java.lang.Object ref = stateReason_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stateReason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable description of why RestorePlan is in the
+     * current `state`
+     * 
+ * + * string state_reason = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The stateReason to set. + * @return This builder for chaining. + */ + public Builder setStateReason(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + stateReason_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable description of why RestorePlan is in the
+     * current `state`
+     * 
+ * + * string state_reason = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStateReason() { + stateReason_ = getDefaultInstance().getStateReason(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable description of why RestorePlan is in the
+     * current `state`
+     * 
+ * + * string state_reason = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for stateReason to set. + * @return This builder for chaining. + */ + public Builder setStateReasonBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + stateReason_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestorePlanOrBuilder.java b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestorePlanOrBuilder.java index 0ba954f4362c..012333f85e74 100644 --- a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestorePlanOrBuilder.java +++ b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestorePlanOrBuilder.java @@ -395,4 +395,64 @@ java.lang.String getLabelsOrDefault( * @return The bytes for etag. */ com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Output only. State of the RestorePlan. This State field reflects the
+   * various stages a RestorePlan can be in
+   * during the Create operation.
+   * 
+ * + * + * .google.cloud.gkebackup.v1.RestorePlan.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. State of the RestorePlan. This State field reflects the
+   * various stages a RestorePlan can be in
+   * during the Create operation.
+   * 
+ * + * + * .google.cloud.gkebackup.v1.RestorePlan.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.gkebackup.v1.RestorePlan.State getState(); + + /** + * + * + *
+   * Output only. Human-readable description of why RestorePlan is in the
+   * current `state`
+   * 
+ * + * string state_reason = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The stateReason. + */ + java.lang.String getStateReason(); + /** + * + * + *
+   * Output only. Human-readable description of why RestorePlan is in the
+   * current `state`
+   * 
+ * + * string state_reason = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for stateReason. + */ + com.google.protobuf.ByteString getStateReasonBytes(); } diff --git a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestorePlanProto.java b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestorePlanProto.java index bdd0f7681554..7ee240967c17 100644 --- a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestorePlanProto.java +++ b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestorePlanProto.java @@ -49,7 +49,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "e/api/field_behavior.proto\032\031google/api/r" + "esource.proto\032\'google/cloud/gkebackup/v1" + "/restore.proto\032\037google/protobuf/timestam" - + "p.proto\"\367\004\n\013RestorePlan\022\022\n\004name\030\001 \001(\tB\004\342" + + "p.proto\"\260\006\n\013RestorePlan\022\022\n\004name\030\001 \001(\tB\004\342" + "A\001\003\022\021\n\003uid\030\002 \001(\tB\004\342A\001\003\0225\n\013create_time\030\003 " + "\001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\0225\n" + "\013update_time\030\004 \001(\0132\032.google.protobuf.Tim" @@ -61,16 +61,20 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "d.gkebackup.v1.RestoreConfigB\004\342A\001\002\022B\n\006la" + "bels\030\t \003(\01322.google.cloud.gkebackup.v1.R" + "estorePlan.LabelsEntry\022\022\n\004etag\030\n \001(\tB\004\342A" - + "\001\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030" - + "\002 \001(\t:\0028\001:n\352Ak\n$gkebackup.googleapis.com" - + "/RestorePlan\022Cprojects/{project}/locatio" - + "ns/{location}/restorePlans/{restore_plan" - + "}B\307\001\n\035com.google.cloud.gkebackup.v1B\020Res" - + "torePlanProtoP\001Z;cloud.google.com/go/gke" - + "backup/apiv1/gkebackuppb;gkebackuppb\252\002\031G" - + "oogle.Cloud.GkeBackup.V1\312\002\031Google\\Cloud\\" - + "GkeBackup\\V1\352\002\034Google::Cloud::GkeBackup:" - + ":V1b\006proto3" + + "\001\003\022A\n\005state\030\013 \001(\0162,.google.cloud.gkeback" + + "up.v1.RestorePlan.StateB\004\342A\001\003\022\032\n\014state_r" + + "eason\030\014 \001(\tB\004\342A\001\003\032-\n\013LabelsEntry\022\013\n\003key\030" + + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"X\n\005State\022\025\n\021STA" + + "TE_UNSPECIFIED\020\000\022\023\n\017CLUSTER_PENDING\020\001\022\t\n" + + "\005READY\020\002\022\n\n\006FAILED\020\003\022\014\n\010DELETING\020\004:n\352Ak\n" + + "$gkebackup.googleapis.com/RestorePlan\022Cp" + + "rojects/{project}/locations/{location}/r" + + "estorePlans/{restore_plan}B\307\001\n\035com.googl" + + "e.cloud.gkebackup.v1B\020RestorePlanProtoP\001" + + "Z;cloud.google.com/go/gkebackup/apiv1/gk" + + "ebackuppb;gkebackuppb\252\002\031Google.Cloud.Gke" + + "Backup.V1\312\002\031Google\\Cloud\\GkeBackup\\V1\352\002\034" + + "Google::Cloud::GkeBackup::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -97,6 +101,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "RestoreConfig", "Labels", "Etag", + "State", + "StateReason", }); internal_static_google_cloud_gkebackup_v1_RestorePlan_LabelsEntry_descriptor = internal_static_google_cloud_gkebackup_v1_RestorePlan_descriptor.getNestedTypes().get(0); diff --git a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestoreProto.java b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestoreProto.java index 8a4515b8452c..9fbf1521dc36 100644 --- a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestoreProto.java +++ b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/java/com/google/cloud/gkebackup/v1/RestoreProto.java @@ -51,6 +51,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_gkebackup_v1_RestoreConfig_SubstitutionRule_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_gkebackup_v1_RestoreConfig_SubstitutionRule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRuleAction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRuleAction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gkebackup_v1_RestoreConfig_ResourceFilter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gkebackup_v1_RestoreConfig_ResourceFilter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRule_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -91,7 +103,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "gkebackup.googleapis.com/Restore\022Vprojec" + "ts/{project}/locations/{location}/restor" + "ePlans/{restore_plan}/restores/{restore}" - + "\"\251\014\n\rRestoreConfig\022d\n\032volume_data_restor" + + "\"\307\023\n\rRestoreConfig\022d\n\032volume_data_restor" + "e_policy\030\001 \001(\0162@.google.cloud.gkebackup." + "v1.RestoreConfig.VolumeDataRestorePolicy" + "\022p\n cluster_resource_conflict_policy\030\002 \001" @@ -106,36 +118,59 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "(\010H\000\022D\n\023selected_namespaces\030\006 \001(\0132%.goog" + "le.cloud.gkebackup.v1.NamespacesH\000\022K\n\025se" + "lected_applications\030\007 \001(\0132*.google.cloud" - + ".gkebackup.v1.NamespacedNamesH\000\022U\n\022subst" - + "itution_rules\030\010 \003(\01329.google.cloud.gkeba" - + "ckup.v1.RestoreConfig.SubstitutionRule\032:" - + "\n\tGroupKind\022\026\n\016resource_group\030\001 \001(\t\022\025\n\rr" - + "esource_kind\030\002 \001(\t\032o\n\033ClusterResourceRes" - + "toreScope\022P\n\024selected_group_kinds\030\001 \003(\0132" - + "2.google.cloud.gkebackup.v1.RestoreConfi" - + "g.GroupKind\032\320\001\n\020SubstitutionRule\022\031\n\021targ" - + "et_namespaces\030\001 \003(\t\022N\n\022target_group_kind" - + "s\030\002 \003(\01322.google.cloud.gkebackup.v1.Rest" - + "oreConfig.GroupKind\022\036\n\020target_json_path\030" - + "\003 \001(\tB\004\342A\001\002\022\036\n\026original_value_pattern\030\004 " - + "\001(\t\022\021\n\tnew_value\030\005 \001(\t\"\257\001\n\027VolumeDataRes" - + "torePolicy\022*\n&VOLUME_DATA_RESTORE_POLICY" - + "_UNSPECIFIED\020\000\022#\n\037RESTORE_VOLUME_DATA_FR" - + "OM_BACKUP\020\001\022#\n\037REUSE_VOLUME_HANDLE_FROM_" - + "BACKUP\020\002\022\036\n\032NO_VOLUME_DATA_RESTORATION\020\003" - + "\"\203\001\n\035ClusterResourceConflictPolicy\0220\n,CL" - + "USTER_RESOURCE_CONFLICT_POLICY_UNSPECIFI" - + "ED\020\000\022\030\n\024USE_EXISTING_VERSION\020\001\022\026\n\022USE_BA" - + "CKUP_VERSION\020\002\"\177\n\035NamespacedResourceRest" - + "oreMode\0220\n,NAMESPACED_RESOURCE_RESTORE_M" - + "ODE_UNSPECIFIED\020\000\022\026\n\022DELETE_AND_RESTORE\020" - + "\001\022\024\n\020FAIL_ON_CONFLICT\020\002B#\n!namespaced_re" - + "source_restore_scopeB\303\001\n\035com.google.clou" - + "d.gkebackup.v1B\014RestoreProtoP\001Z;cloud.go" - + "ogle.com/go/gkebackup/apiv1/gkebackuppb;" - + "gkebackuppb\252\002\031Google.Cloud.GkeBackup.V1\312" - + "\002\031Google\\Cloud\\GkeBackup\\V1\352\002\034Google::Cl" - + "oud::GkeBackup::V1b\006proto3" + + ".gkebackup.v1.NamespacedNamesH\000\022\027\n\rno_na" + + "mespaces\030\t \001(\010H\000\022D\n\023excluded_namespaces\030" + + "\n \001(\0132%.google.cloud.gkebackup.v1.Namesp" + + "acesH\000\022U\n\022substitution_rules\030\010 \003(\01329.goo" + + "gle.cloud.gkebackup.v1.RestoreConfig.Sub" + + "stitutionRule\022Y\n\024transformation_rules\030\013 " + + "\003(\0132;.google.cloud.gkebackup.v1.RestoreC" + + "onfig.TransformationRule\032:\n\tGroupKind\022\026\n" + + "\016resource_group\030\001 \001(\t\022\025\n\rresource_kind\030\002" + + " \001(\t\032\362\001\n\033ClusterResourceRestoreScope\022P\n\024" + + "selected_group_kinds\030\001 \003(\01322.google.clou" + + "d.gkebackup.v1.RestoreConfig.GroupKind\022P" + + "\n\024excluded_group_kinds\030\002 \003(\01322.google.cl" + + "oud.gkebackup.v1.RestoreConfig.GroupKind" + + "\022\027\n\017all_group_kinds\030\003 \001(\010\022\026\n\016no_group_ki" + + "nds\030\004 \001(\010\032\320\001\n\020SubstitutionRule\022\031\n\021target" + + "_namespaces\030\001 \003(\t\022N\n\022target_group_kinds\030" + + "\002 \003(\01322.google.cloud.gkebackup.v1.Restor" + + "eConfig.GroupKind\022\036\n\020target_json_path\030\003 " + + "\001(\tB\004\342A\001\002\022\036\n\026original_value_pattern\030\004 \001(" + + "\t\022\021\n\tnew_value\030\005 \001(\t\032\374\001\n\030TransformationR" + + "uleAction\022V\n\002op\030\001 \001(\0162D.google.cloud.gke" + + "backup.v1.RestoreConfig.TransformationRu" + + "leAction.OpB\004\342A\001\002\022\021\n\tfrom_path\030\002 \001(\t\022\014\n\004" + + "path\030\003 \001(\t\022\r\n\005value\030\004 \001(\t\"X\n\002Op\022\022\n\016OP_UN" + + "SPECIFIED\020\000\022\n\n\006REMOVE\020\001\022\010\n\004MOVE\020\002\022\010\n\004COP" + + "Y\020\003\022\007\n\003ADD\020\004\022\010\n\004TEST\020\005\022\013\n\007REPLACE\020\006\032\200\001\n\016" + + "ResourceFilter\022\022\n\nnamespaces\030\001 \003(\t\022G\n\013gr" + + "oup_kinds\030\002 \003(\01322.google.cloud.gkebackup" + + ".v1.RestoreConfig.GroupKind\022\021\n\tjson_path" + + "\030\003 \001(\t\032\333\001\n\022TransformationRule\022^\n\rfield_a" + + "ctions\030\001 \003(\0132A.google.cloud.gkebackup.v1" + + ".RestoreConfig.TransformationRuleActionB" + + "\004\342A\001\002\022P\n\017resource_filter\030\002 \001(\01327.google." + + "cloud.gkebackup.v1.RestoreConfig.Resourc" + + "eFilter\022\023\n\013description\030\003 \001(\t\"\257\001\n\027VolumeD" + + "ataRestorePolicy\022*\n&VOLUME_DATA_RESTORE_" + + "POLICY_UNSPECIFIED\020\000\022#\n\037RESTORE_VOLUME_D" + + "ATA_FROM_BACKUP\020\001\022#\n\037REUSE_VOLUME_HANDLE" + + "_FROM_BACKUP\020\002\022\036\n\032NO_VOLUME_DATA_RESTORA" + + "TION\020\003\"\203\001\n\035ClusterResourceConflictPolicy" + + "\0220\n,CLUSTER_RESOURCE_CONFLICT_POLICY_UNS" + + "PECIFIED\020\000\022\030\n\024USE_EXISTING_VERSION\020\001\022\026\n\022" + + "USE_BACKUP_VERSION\020\002\"\177\n\035NamespacedResour" + + "ceRestoreMode\0220\n,NAMESPACED_RESOURCE_RES" + + "TORE_MODE_UNSPECIFIED\020\000\022\026\n\022DELETE_AND_RE" + + "STORE\020\001\022\024\n\020FAIL_ON_CONFLICT\020\002B#\n!namespa" + + "ced_resource_restore_scopeB\303\001\n\035com.googl" + + "e.cloud.gkebackup.v1B\014RestoreProtoP\001Z;cl" + + "oud.google.com/go/gkebackup/apiv1/gkebac" + + "kuppb;gkebackuppb\252\002\031Google.Cloud.GkeBack" + + "up.V1\312\002\031Google\\Cloud\\GkeBackup\\V1\352\002\034Goog" + + "le::Cloud::GkeBackup::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -191,7 +226,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "AllNamespaces", "SelectedNamespaces", "SelectedApplications", + "NoNamespaces", + "ExcludedNamespaces", "SubstitutionRules", + "TransformationRules", "NamespacedResourceRestoreScope", }); internal_static_google_cloud_gkebackup_v1_RestoreConfig_GroupKind_descriptor = @@ -208,7 +246,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_gkebackup_v1_RestoreConfig_ClusterResourceRestoreScope_descriptor, new java.lang.String[] { - "SelectedGroupKinds", + "SelectedGroupKinds", "ExcludedGroupKinds", "AllGroupKinds", "NoGroupKinds", }); internal_static_google_cloud_gkebackup_v1_RestoreConfig_SubstitutionRule_descriptor = internal_static_google_cloud_gkebackup_v1_RestoreConfig_descriptor.getNestedTypes().get(2); @@ -222,6 +260,30 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "OriginalValuePattern", "NewValue", }); + internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRuleAction_descriptor = + internal_static_google_cloud_gkebackup_v1_RestoreConfig_descriptor.getNestedTypes().get(3); + internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRuleAction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRuleAction_descriptor, + new java.lang.String[] { + "Op", "FromPath", "Path", "Value", + }); + internal_static_google_cloud_gkebackup_v1_RestoreConfig_ResourceFilter_descriptor = + internal_static_google_cloud_gkebackup_v1_RestoreConfig_descriptor.getNestedTypes().get(4); + internal_static_google_cloud_gkebackup_v1_RestoreConfig_ResourceFilter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gkebackup_v1_RestoreConfig_ResourceFilter_descriptor, + new java.lang.String[] { + "Namespaces", "GroupKinds", "JsonPath", + }); + internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRule_descriptor = + internal_static_google_cloud_gkebackup_v1_RestoreConfig_descriptor.getNestedTypes().get(5); + internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_gkebackup_v1_RestoreConfig_TransformationRule_descriptor, + new java.lang.String[] { + "FieldActions", "ResourceFilter", "Description", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); diff --git a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/proto/google/cloud/gkebackup/v1/backup_plan.proto b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/proto/google/cloud/gkebackup/v1/backup_plan.proto index 6c30cf18b633..42ed47db4a9d 100644 --- a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/proto/google/cloud/gkebackup/v1/backup_plan.proto +++ b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/proto/google/cloud/gkebackup/v1/backup_plan.proto @@ -77,7 +77,7 @@ message BackupPlan { bool locked = 3; } - // Schedule defines scheduling parameters for automatically creating Backups + // Defines scheduling parameters for automatically creating Backups // via this BackupPlan. message Schedule { // A standard [cron](https://wikipedia.com/wiki/cron) string that defines a @@ -134,6 +134,30 @@ message BackupPlan { EncryptionKey encryption_key = 6; } + // State + enum State { + // Default first value for Enums. + STATE_UNSPECIFIED = 0; + + // Waiting for cluster state to be RUNNING. + CLUSTER_PENDING = 1; + + // The BackupPlan is in the process of being created. + PROVISIONING = 2; + + // The BackupPlan has successfully been created and is ready for Backups. + READY = 3; + + // BackupPlan creation has failed. + FAILED = 4; + + // The BackupPlan has been deactivated. + DEACTIVATED = 5; + + // The BackupPlan is in the process of being deleted. + DELETING = 6; + } + // Output only. The full name of the BackupPlan resource. // Format: `projects/*/locations/*/backupPlans/*` string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -201,4 +225,14 @@ message BackupPlan { // Output only. The number of Kubernetes Pods backed up in the // last successful Backup created via this BackupPlan. int32 protected_pod_count = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the BackupPlan. This State field reflects the + // various stages a BackupPlan can be in + // during the Create operation. It will be set to "DEACTIVATED" + // if the BackupPlan is deactivated on an Update + State state = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable description of why BackupPlan is in the current + // `state` + string state_reason = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/proto/google/cloud/gkebackup/v1/restore.proto b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/proto/google/cloud/gkebackup/v1/restore.proto index f83b872a47b4..968b4f447d9a 100644 --- a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/proto/google/cloud/gkebackup/v1/restore.proto +++ b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/proto/google/cloud/gkebackup/v1/restore.proto @@ -157,7 +157,7 @@ message Restore { } // Configuration of a restore. -// Next id: 9 +// Next id: 12 message RestoreConfig { // Defines how volume data should be restored. enum VolumeDataRestorePolicy { @@ -257,6 +257,21 @@ message RestoreConfig { // backup. If specified, only the selected resources will be restored. // Mutually exclusive to any other field in the message. repeated GroupKind selected_group_kinds = 1; + + // A list of cluster-scoped resource group kinds to NOT restore from the + // backup. If specified, all valid cluster-scoped resources will be + // restored except for those specified in the list. + // Mutually exclusive to any other field in the message. + repeated GroupKind excluded_group_kinds = 2; + + // If True, all valid cluster-scoped resources will be restored. + // Mutually exclusive to any other field in the message. + bool all_group_kinds = 3; + + // If True, no cluster-scoped resources will be restored. + // This has the same restore scope as if the message is not defined. + // Mutually exclusive to any other field in the message. + bool no_group_kinds = 4; } // A transformation rule to be applied against Kubernetes resources as they @@ -305,6 +320,111 @@ message RestoreConfig { string new_value = 5; } + // TransformationRuleAction defines a TransformationRule action based on the + // JSON Patch RFC (https://www.rfc-editor.org/rfc/rfc6902) + message TransformationRuleAction { + // Possible values for operations of a transformation rule action. + enum Op { + // Unspecified operation + OP_UNSPECIFIED = 0; + + // The "remove" operation removes the value at the target location. + REMOVE = 1; + + // The "move" operation removes the value at a specified location and + // adds it to the target location. + MOVE = 2; + + // The "copy" operation copies the value at a specified location to the + // target location. + COPY = 3; + + // The "add" operation performs one of the following functions, + // depending upon what the target location references: + // 1. If the target location specifies an array index, a new value is + // inserted into the array at the specified index. + // 2. If the target location specifies an object member that does not + // already exist, a new member is added to the object. + // 3. If the target location specifies an object member that does exist, + // that member's value is replaced. + ADD = 4; + + // The "test" operation tests that a value at the target location is + // equal to a specified value. + TEST = 5; + + // The "replace" operation replaces the value at the target location + // with a new value. The operation object MUST contain a "value" member + // whose content specifies the replacement value. + REPLACE = 6; + } + + // Required. op specifies the operation to perform. + Op op = 1 [(google.api.field_behavior) = REQUIRED]; + + // A string containing a JSON Pointer value that references the location in + // the target document to move the value from. + string from_path = 2; + + // A string containing a JSON-Pointer value that references a location + // within the target document where the operation is performed. + string path = 3; + + // A string that specifies the desired value in string format to + // use for transformation. + string value = 4; + } + + // ResourceFilter specifies matching criteria to limit the scope of a + // change to a specific set of kubernetes resources that are selected for + // restoration from a backup. + message ResourceFilter { + // (Filtering parameter) Any resource subject to transformation must be + // contained within one of the listed Kubernetes Namespace in the Backup. + // If this field is not provided, no namespace filtering will be performed + // (all resources in all Namespaces, including all cluster-scoped resources, + // will be candidates for transformation). + // To mix cluster-scoped and namespaced resources in the same rule, use an + // empty string ("") as one of the target namespaces. + repeated string namespaces = 1; + + // (Filtering parameter) Any resource subject to transformation must belong + // to one of the listed "types". If this field is not provided, no type + // filtering will be performed (all resources of all types matching previous + // filtering parameters will be candidates for transformation). + repeated GroupKind group_kinds = 2; + + // This is a [JSONPath] + // (https://github.com/json-path/JsonPath/blob/master/README.md) + // expression that matches specific fields of candidate + // resources and it operates as a filtering parameter (resources that + // are not matched with this expression will not be candidates for + // transformation). + string json_path = 3; + } + + // A transformation rule to be applied against Kubernetes resources as they + // are selected for restoration from a Backup. A rule contains both filtering + // logic (which resources are subject to transform) and transformation logic. + message TransformationRule { + // Required. A list of transformation rule actions to take against candidate + // resources. Actions are executed in order defined - this order matters, as + // they could potentially interfere with each other and the first operation + // could affect the outcome of the second operation. + repeated TransformationRuleAction field_actions = 1 + [(google.api.field_behavior) = REQUIRED]; + + // This field is used to specify a set of fields that should be used to + // determine which resources in backup should be acted upon by the supplied + // transformation rule actions, and this will ensure that only specific + // resources are affected by transformation rule actions. + ResourceFilter resource_filter = 2; + + // The description is a user specified string description of the + // transformation rule. + string description = 3; + } + // Specifies the mechanism to be used to restore volume data. // Default: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (will be treated as // NO_VOLUME_DATA_RESTORATION). @@ -348,6 +468,14 @@ message RestoreConfig { // ProtectedApplications and all the resources to which they refer will be // restored. NamespacedNames selected_applications = 7; + + // Do not restore any namespaced resources if set to "True". + // Specifying this field to "False" is not allowed. + bool no_namespaces = 9; + + // A list of selected namespaces excluded from restoration. All + // namespaces except those in this list will be restored. + Namespaces excluded_namespaces = 10; } // A list of transformation rules to be applied against Kubernetes resources @@ -356,4 +484,11 @@ message RestoreConfig { // the filtering logic of subsequent rules. An empty list means no // substitution will occur. repeated SubstitutionRule substitution_rules = 8; + + // A list of transformation rules to be applied against Kubernetes resources + // as they are selected for restoration from a Backup. Rules are executed in + // order defined - this order matters, as changes made by a rule may impact + // the filtering logic of subsequent rules. An empty list means no + // transformation will occur. + repeated TransformationRule transformation_rules = 11; } diff --git a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/proto/google/cloud/gkebackup/v1/restore_plan.proto b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/proto/google/cloud/gkebackup/v1/restore_plan.proto index 8102f3570c3e..117412190cae 100644 --- a/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/proto/google/cloud/gkebackup/v1/restore_plan.proto +++ b/java-gke-backup/proto-google-cloud-gke-backup-v1/src/main/proto/google/cloud/gkebackup/v1/restore_plan.proto @@ -31,13 +31,31 @@ option ruby_package = "Google::Cloud::GkeBackup::V1"; // The configuration of a potential series of Restore operations to be performed // against Backups belong to a particular BackupPlan. -// Next id: 11 +// Next id: 13 message RestorePlan { option (google.api.resource) = { type: "gkebackup.googleapis.com/RestorePlan" pattern: "projects/{project}/locations/{location}/restorePlans/{restore_plan}" }; + // State + enum State { + // Default first value for Enums. + STATE_UNSPECIFIED = 0; + + // Waiting for cluster state to be RUNNING. + CLUSTER_PENDING = 1; + + // The RestorePlan has successfully been created and is ready for Restores. + READY = 2; + + // RestorePlan creation has failed. + FAILED = 3; + + // The RestorePlan is in the process of being deleted. + DELETING = 4; + } + // Output only. The full name of the RestorePlan resource. // Format: `projects/*/locations/*/restorePlans/*`. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -100,4 +118,13 @@ message RestorePlan { // `UpdateRestorePlan` or `DeleteRestorePlan` to ensure that their change // will be applied to the same version of the resource. string etag = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the RestorePlan. This State field reflects the + // various stages a RestorePlan can be in + // during the Create operation. + State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable description of why RestorePlan is in the + // current `state` + string state_reason = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; }