|
| 1 | +/* |
| 2 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
| 3 | + * in compliance with the License. You may obtain a copy of the License at |
| 4 | + * |
| 5 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | + * |
| 7 | + * Unless required by applicable law or agreed to in writing, software distributed under the License |
| 8 | + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
| 9 | + * or implied. See the License for the specific language governing permissions and limitations under |
| 10 | + * the License. |
| 11 | + */ |
| 12 | +/* |
| 13 | + * This code was generated by https://github.com/googleapis/google-api-java-client-services/ |
| 14 | + * Modify at your own risk. |
| 15 | + */ |
| 16 | + |
| 17 | +package com.google.api.services.spanner.v1.model; |
| 18 | + |
| 19 | +/** |
| 20 | + * Spanner Change Streams enable customers to capture and stream out changes to their Spanner |
| 21 | + * databases in real-time. A change stream can be created with option |
| 22 | + * partition_mode='IMMUTABLE_KEY_RANGE' or partition_mode='MUTABLE_KEY_RANGE'. This message is only |
| 23 | + * used in Change Streams created with the option partition_mode='MUTABLE_KEY_RANGE'. Spanner |
| 24 | + * automatically creates a special Table-Valued Function (TVF) along with each Change Streams. The |
| 25 | + * function provides access to the change stream's records. The function is named READ_ (where is |
| 26 | + * the name of the change stream), and it returns a table with only one column called ChangeRecord. |
| 27 | + * |
| 28 | + * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is |
| 29 | + * transmitted over HTTP when working with the Cloud Spanner API. For a detailed explanation see: |
| 30 | + * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> |
| 31 | + * </p> |
| 32 | + * |
| 33 | + * @author Google, Inc. |
| 34 | + */ |
| 35 | +@SuppressWarnings("javadoc") |
| 36 | +public final class ChangeStreamRecord extends com.google.api.client.json.GenericJson { |
| 37 | + |
| 38 | + /** |
| 39 | + * Data change record describing a data change for a change stream partition. |
| 40 | + * The value may be {@code null}. |
| 41 | + */ |
| 42 | + @com.google.api.client.util.Key |
| 43 | + private DataChangeRecord dataChangeRecord; |
| 44 | + |
| 45 | + /** |
| 46 | + * Heartbeat record describing a heartbeat for a change stream partition. |
| 47 | + * The value may be {@code null}. |
| 48 | + */ |
| 49 | + @com.google.api.client.util.Key |
| 50 | + private HeartbeatRecord heartbeatRecord; |
| 51 | + |
| 52 | + /** |
| 53 | + * Partition end record describing a terminated change stream partition. |
| 54 | + * The value may be {@code null}. |
| 55 | + */ |
| 56 | + @com.google.api.client.util.Key |
| 57 | + private PartitionEndRecord partitionEndRecord; |
| 58 | + |
| 59 | + /** |
| 60 | + * Partition event record describing key range changes for a change stream partition. |
| 61 | + * The value may be {@code null}. |
| 62 | + */ |
| 63 | + @com.google.api.client.util.Key |
| 64 | + private PartitionEventRecord partitionEventRecord; |
| 65 | + |
| 66 | + /** |
| 67 | + * Partition start record describing a new change stream partition. |
| 68 | + * The value may be {@code null}. |
| 69 | + */ |
| 70 | + @com.google.api.client.util.Key |
| 71 | + private PartitionStartRecord partitionStartRecord; |
| 72 | + |
| 73 | + /** |
| 74 | + * Data change record describing a data change for a change stream partition. |
| 75 | + * @return value or {@code null} for none |
| 76 | + */ |
| 77 | + public DataChangeRecord getDataChangeRecord() { |
| 78 | + return dataChangeRecord; |
| 79 | + } |
| 80 | + |
| 81 | + /** |
| 82 | + * Data change record describing a data change for a change stream partition. |
| 83 | + * @param dataChangeRecord dataChangeRecord or {@code null} for none |
| 84 | + */ |
| 85 | + public ChangeStreamRecord setDataChangeRecord(DataChangeRecord dataChangeRecord) { |
| 86 | + this.dataChangeRecord = dataChangeRecord; |
| 87 | + return this; |
| 88 | + } |
| 89 | + |
| 90 | + /** |
| 91 | + * Heartbeat record describing a heartbeat for a change stream partition. |
| 92 | + * @return value or {@code null} for none |
| 93 | + */ |
| 94 | + public HeartbeatRecord getHeartbeatRecord() { |
| 95 | + return heartbeatRecord; |
| 96 | + } |
| 97 | + |
| 98 | + /** |
| 99 | + * Heartbeat record describing a heartbeat for a change stream partition. |
| 100 | + * @param heartbeatRecord heartbeatRecord or {@code null} for none |
| 101 | + */ |
| 102 | + public ChangeStreamRecord setHeartbeatRecord(HeartbeatRecord heartbeatRecord) { |
| 103 | + this.heartbeatRecord = heartbeatRecord; |
| 104 | + return this; |
| 105 | + } |
| 106 | + |
| 107 | + /** |
| 108 | + * Partition end record describing a terminated change stream partition. |
| 109 | + * @return value or {@code null} for none |
| 110 | + */ |
| 111 | + public PartitionEndRecord getPartitionEndRecord() { |
| 112 | + return partitionEndRecord; |
| 113 | + } |
| 114 | + |
| 115 | + /** |
| 116 | + * Partition end record describing a terminated change stream partition. |
| 117 | + * @param partitionEndRecord partitionEndRecord or {@code null} for none |
| 118 | + */ |
| 119 | + public ChangeStreamRecord setPartitionEndRecord(PartitionEndRecord partitionEndRecord) { |
| 120 | + this.partitionEndRecord = partitionEndRecord; |
| 121 | + return this; |
| 122 | + } |
| 123 | + |
| 124 | + /** |
| 125 | + * Partition event record describing key range changes for a change stream partition. |
| 126 | + * @return value or {@code null} for none |
| 127 | + */ |
| 128 | + public PartitionEventRecord getPartitionEventRecord() { |
| 129 | + return partitionEventRecord; |
| 130 | + } |
| 131 | + |
| 132 | + /** |
| 133 | + * Partition event record describing key range changes for a change stream partition. |
| 134 | + * @param partitionEventRecord partitionEventRecord or {@code null} for none |
| 135 | + */ |
| 136 | + public ChangeStreamRecord setPartitionEventRecord(PartitionEventRecord partitionEventRecord) { |
| 137 | + this.partitionEventRecord = partitionEventRecord; |
| 138 | + return this; |
| 139 | + } |
| 140 | + |
| 141 | + /** |
| 142 | + * Partition start record describing a new change stream partition. |
| 143 | + * @return value or {@code null} for none |
| 144 | + */ |
| 145 | + public PartitionStartRecord getPartitionStartRecord() { |
| 146 | + return partitionStartRecord; |
| 147 | + } |
| 148 | + |
| 149 | + /** |
| 150 | + * Partition start record describing a new change stream partition. |
| 151 | + * @param partitionStartRecord partitionStartRecord or {@code null} for none |
| 152 | + */ |
| 153 | + public ChangeStreamRecord setPartitionStartRecord(PartitionStartRecord partitionStartRecord) { |
| 154 | + this.partitionStartRecord = partitionStartRecord; |
| 155 | + return this; |
| 156 | + } |
| 157 | + |
| 158 | + @Override |
| 159 | + public ChangeStreamRecord set(String fieldName, Object value) { |
| 160 | + return (ChangeStreamRecord) super.set(fieldName, value); |
| 161 | + } |
| 162 | + |
| 163 | + @Override |
| 164 | + public ChangeStreamRecord clone() { |
| 165 | + return (ChangeStreamRecord) super.clone(); |
| 166 | + } |
| 167 | + |
| 168 | +} |
0 commit comments