1 // Code generated by protoc-gen-go. DO NOT EDIT.
2 // source: google/spanner/v1/mutation.proto
6 import proto "github.com/golang/protobuf/proto"
9 import _ "google.golang.org/genproto/googleapis/api/annotations"
10 import google_protobuf1 "github.com/golang/protobuf/ptypes/struct"
12 // Reference imports to suppress errors if they are not otherwise used.
17 // A modification to one or more Cloud Spanner rows. Mutations can be
18 // applied to a Cloud Spanner database by sending them in a
19 // [Commit][google.spanner.v1.Spanner.Commit] call.
20 type Mutation struct {
21 // Required. The operation to perform.
23 // Types that are valid to be assigned to Operation:
26 // *Mutation_InsertOrUpdate
29 Operation isMutation_Operation `protobuf_oneof:"operation"`
32 func (m *Mutation) Reset() { *m = Mutation{} }
33 func (m *Mutation) String() string { return proto.CompactTextString(m) }
34 func (*Mutation) ProtoMessage() {}
35 func (*Mutation) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
37 type isMutation_Operation interface {
38 isMutation_Operation()
41 type Mutation_Insert struct {
42 Insert *Mutation_Write `protobuf:"bytes,1,opt,name=insert,oneof"`
44 type Mutation_Update struct {
45 Update *Mutation_Write `protobuf:"bytes,2,opt,name=update,oneof"`
47 type Mutation_InsertOrUpdate struct {
48 InsertOrUpdate *Mutation_Write `protobuf:"bytes,3,opt,name=insert_or_update,json=insertOrUpdate,oneof"`
50 type Mutation_Replace struct {
51 Replace *Mutation_Write `protobuf:"bytes,4,opt,name=replace,oneof"`
53 type Mutation_Delete_ struct {
54 Delete *Mutation_Delete `protobuf:"bytes,5,opt,name=delete,oneof"`
57 func (*Mutation_Insert) isMutation_Operation() {}
58 func (*Mutation_Update) isMutation_Operation() {}
59 func (*Mutation_InsertOrUpdate) isMutation_Operation() {}
60 func (*Mutation_Replace) isMutation_Operation() {}
61 func (*Mutation_Delete_) isMutation_Operation() {}
63 func (m *Mutation) GetOperation() isMutation_Operation {
70 func (m *Mutation) GetInsert() *Mutation_Write {
71 if x, ok := m.GetOperation().(*Mutation_Insert); ok {
77 func (m *Mutation) GetUpdate() *Mutation_Write {
78 if x, ok := m.GetOperation().(*Mutation_Update); ok {
84 func (m *Mutation) GetInsertOrUpdate() *Mutation_Write {
85 if x, ok := m.GetOperation().(*Mutation_InsertOrUpdate); ok {
86 return x.InsertOrUpdate
91 func (m *Mutation) GetReplace() *Mutation_Write {
92 if x, ok := m.GetOperation().(*Mutation_Replace); ok {
98 func (m *Mutation) GetDelete() *Mutation_Delete {
99 if x, ok := m.GetOperation().(*Mutation_Delete_); ok {
105 // XXX_OneofFuncs is for the internal use of the proto package.
106 func (*Mutation) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
107 return _Mutation_OneofMarshaler, _Mutation_OneofUnmarshaler, _Mutation_OneofSizer, []interface{}{
108 (*Mutation_Insert)(nil),
109 (*Mutation_Update)(nil),
110 (*Mutation_InsertOrUpdate)(nil),
111 (*Mutation_Replace)(nil),
112 (*Mutation_Delete_)(nil),
116 func _Mutation_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
119 switch x := m.Operation.(type) {
120 case *Mutation_Insert:
121 b.EncodeVarint(1<<3 | proto.WireBytes)
122 if err := b.EncodeMessage(x.Insert); err != nil {
125 case *Mutation_Update:
126 b.EncodeVarint(2<<3 | proto.WireBytes)
127 if err := b.EncodeMessage(x.Update); err != nil {
130 case *Mutation_InsertOrUpdate:
131 b.EncodeVarint(3<<3 | proto.WireBytes)
132 if err := b.EncodeMessage(x.InsertOrUpdate); err != nil {
135 case *Mutation_Replace:
136 b.EncodeVarint(4<<3 | proto.WireBytes)
137 if err := b.EncodeMessage(x.Replace); err != nil {
140 case *Mutation_Delete_:
141 b.EncodeVarint(5<<3 | proto.WireBytes)
142 if err := b.EncodeMessage(x.Delete); err != nil {
147 return fmt.Errorf("Mutation.Operation has unexpected type %T", x)
152 func _Mutation_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
155 case 1: // operation.insert
156 if wire != proto.WireBytes {
157 return true, proto.ErrInternalBadWireType
159 msg := new(Mutation_Write)
160 err := b.DecodeMessage(msg)
161 m.Operation = &Mutation_Insert{msg}
163 case 2: // operation.update
164 if wire != proto.WireBytes {
165 return true, proto.ErrInternalBadWireType
167 msg := new(Mutation_Write)
168 err := b.DecodeMessage(msg)
169 m.Operation = &Mutation_Update{msg}
171 case 3: // operation.insert_or_update
172 if wire != proto.WireBytes {
173 return true, proto.ErrInternalBadWireType
175 msg := new(Mutation_Write)
176 err := b.DecodeMessage(msg)
177 m.Operation = &Mutation_InsertOrUpdate{msg}
179 case 4: // operation.replace
180 if wire != proto.WireBytes {
181 return true, proto.ErrInternalBadWireType
183 msg := new(Mutation_Write)
184 err := b.DecodeMessage(msg)
185 m.Operation = &Mutation_Replace{msg}
187 case 5: // operation.delete
188 if wire != proto.WireBytes {
189 return true, proto.ErrInternalBadWireType
191 msg := new(Mutation_Delete)
192 err := b.DecodeMessage(msg)
193 m.Operation = &Mutation_Delete_{msg}
200 func _Mutation_OneofSizer(msg proto.Message) (n int) {
203 switch x := m.Operation.(type) {
204 case *Mutation_Insert:
205 s := proto.Size(x.Insert)
206 n += proto.SizeVarint(1<<3 | proto.WireBytes)
207 n += proto.SizeVarint(uint64(s))
209 case *Mutation_Update:
210 s := proto.Size(x.Update)
211 n += proto.SizeVarint(2<<3 | proto.WireBytes)
212 n += proto.SizeVarint(uint64(s))
214 case *Mutation_InsertOrUpdate:
215 s := proto.Size(x.InsertOrUpdate)
216 n += proto.SizeVarint(3<<3 | proto.WireBytes)
217 n += proto.SizeVarint(uint64(s))
219 case *Mutation_Replace:
220 s := proto.Size(x.Replace)
221 n += proto.SizeVarint(4<<3 | proto.WireBytes)
222 n += proto.SizeVarint(uint64(s))
224 case *Mutation_Delete_:
225 s := proto.Size(x.Delete)
226 n += proto.SizeVarint(5<<3 | proto.WireBytes)
227 n += proto.SizeVarint(uint64(s))
231 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
236 // Arguments to [insert][google.spanner.v1.Mutation.insert], [update][google.spanner.v1.Mutation.update], [insert_or_update][google.spanner.v1.Mutation.insert_or_update], and
237 // [replace][google.spanner.v1.Mutation.replace] operations.
238 type Mutation_Write struct {
239 // Required. The table whose rows will be written.
240 Table string `protobuf:"bytes,1,opt,name=table" json:"table,omitempty"`
241 // The names of the columns in [table][google.spanner.v1.Mutation.Write.table] to be written.
243 // The list of columns must contain enough columns to allow
244 // Cloud Spanner to derive values for all primary key columns in the
245 // row(s) to be modified.
246 Columns []string `protobuf:"bytes,2,rep,name=columns" json:"columns,omitempty"`
247 // The values to be written. `values` can contain more than one
248 // list of values. If it does, then multiple rows are written, one
249 // for each entry in `values`. Each list in `values` must have
250 // exactly as many entries as there are entries in [columns][google.spanner.v1.Mutation.Write.columns]
251 // above. Sending multiple lists is equivalent to sending multiple
252 // `Mutation`s, each containing one `values` entry and repeating
253 // [table][google.spanner.v1.Mutation.Write.table] and [columns][google.spanner.v1.Mutation.Write.columns]. Individual values in each list are
254 // encoded as described [here][google.spanner.v1.TypeCode].
255 Values []*google_protobuf1.ListValue `protobuf:"bytes,3,rep,name=values" json:"values,omitempty"`
258 func (m *Mutation_Write) Reset() { *m = Mutation_Write{} }
259 func (m *Mutation_Write) String() string { return proto.CompactTextString(m) }
260 func (*Mutation_Write) ProtoMessage() {}
261 func (*Mutation_Write) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 0} }
263 func (m *Mutation_Write) GetTable() string {
270 func (m *Mutation_Write) GetColumns() []string {
277 func (m *Mutation_Write) GetValues() []*google_protobuf1.ListValue {
284 // Arguments to [delete][google.spanner.v1.Mutation.delete] operations.
285 type Mutation_Delete struct {
286 // Required. The table whose rows will be deleted.
287 Table string `protobuf:"bytes,1,opt,name=table" json:"table,omitempty"`
288 // Required. The primary keys of the rows within [table][google.spanner.v1.Mutation.Delete.table] to delete.
289 KeySet *KeySet `protobuf:"bytes,2,opt,name=key_set,json=keySet" json:"key_set,omitempty"`
292 func (m *Mutation_Delete) Reset() { *m = Mutation_Delete{} }
293 func (m *Mutation_Delete) String() string { return proto.CompactTextString(m) }
294 func (*Mutation_Delete) ProtoMessage() {}
295 func (*Mutation_Delete) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 1} }
297 func (m *Mutation_Delete) GetTable() string {
304 func (m *Mutation_Delete) GetKeySet() *KeySet {
312 proto.RegisterType((*Mutation)(nil), "google.spanner.v1.Mutation")
313 proto.RegisterType((*Mutation_Write)(nil), "google.spanner.v1.Mutation.Write")
314 proto.RegisterType((*Mutation_Delete)(nil), "google.spanner.v1.Mutation.Delete")
317 func init() { proto.RegisterFile("google/spanner/v1/mutation.proto", fileDescriptor1) }
319 var fileDescriptor1 = []byte{
320 // 402 bytes of a gzipped FileDescriptorProto
321 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x41, 0x6b, 0xdb, 0x30,
322 0x14, 0xc7, 0x97, 0x38, 0x71, 0x16, 0x85, 0x8d, 0xcd, 0x6c, 0xcc, 0x33, 0x3b, 0x78, 0x39, 0xe5,
323 0x24, 0x13, 0xef, 0x32, 0xc8, 0x76, 0xc9, 0x06, 0x1b, 0x6c, 0xa1, 0xc1, 0xa1, 0x29, 0xf4, 0x12,
324 0x14, 0xe7, 0xd5, 0x18, 0x2b, 0x92, 0x91, 0xe4, 0x40, 0xa0, 0x9f, 0xa5, 0x1f, 0xa0, 0x9f, 0xb2,
325 0x58, 0x92, 0x4b, 0x68, 0xda, 0x92, 0x9e, 0xec, 0xc7, 0xfb, 0xff, 0xfe, 0xff, 0xf7, 0x24, 0xa1,
326 0x30, 0xe3, 0x3c, 0xa3, 0x10, 0xc9, 0x92, 0x30, 0x06, 0x22, 0xda, 0x8d, 0xa3, 0x6d, 0xa5, 0x88,
327 0xca, 0x39, 0xc3, 0xa5, 0xe0, 0x8a, 0x7b, 0xef, 0x8d, 0x02, 0x5b, 0x05, 0xde, 0x8d, 0x83, 0x2f,
328 0x16, 0x22, 0x65, 0x1e, 0x11, 0xc6, 0xb8, 0xd1, 0x4b, 0x03, 0xdc, 0x77, 0x75, 0xb5, 0xae, 0xae,
329 0x22, 0xa9, 0x44, 0x95, 0xaa, 0x07, 0xdd, 0x83, 0xc0, 0x02, 0xf6, 0x96, 0x1d, 0xde, 0x74, 0xd0,
330 0xeb, 0x99, 0xcd, 0xf7, 0x26, 0xc8, 0xcd, 0x99, 0x04, 0xa1, 0xfc, 0x56, 0xd8, 0x1a, 0x0d, 0xe2,
331 0xaf, 0xf8, 0x68, 0x14, 0xdc, 0x88, 0xf1, 0x85, 0xc8, 0x15, 0xfc, 0x7d, 0x95, 0x58, 0xa4, 0x86,
332 0xab, 0x72, 0x43, 0x14, 0xf8, 0xed, 0x17, 0xc0, 0x06, 0xf1, 0x66, 0xe8, 0x9d, 0xb1, 0x59, 0x71,
333 0xb1, 0xb2, 0x36, 0xce, 0xe9, 0x36, 0x6f, 0x0d, 0x7c, 0x26, 0xce, 0x8d, 0xdd, 0x4f, 0xd4, 0x13,
334 0x50, 0x52, 0x92, 0x82, 0xdf, 0x39, 0xdd, 0xa5, 0x61, 0xbc, 0x1f, 0xc8, 0xdd, 0x00, 0x05, 0x05,
335 0x7e, 0x57, 0xd3, 0xc3, 0xe7, 0xe8, 0xdf, 0x5a, 0x59, 0xef, 0x62, 0x98, 0xa0, 0x40, 0x5d, 0xed,
336 0xe8, 0x7d, 0x40, 0x5d, 0x45, 0xd6, 0x14, 0xf4, 0x69, 0xf6, 0x13, 0x53, 0x78, 0x3e, 0xea, 0xa5,
337 0x9c, 0x56, 0x5b, 0x26, 0xfd, 0x76, 0xe8, 0x8c, 0xfa, 0x49, 0x53, 0x7a, 0x31, 0x72, 0x77, 0x84,
338 0x56, 0x20, 0x7d, 0x27, 0x74, 0x46, 0x83, 0x38, 0x68, 0x62, 0x9b, 0x8b, 0xc5, 0xff, 0x73, 0xa9,
339 0x96, 0xb5, 0x24, 0xb1, 0xca, 0x20, 0x41, 0xae, 0x19, 0xe0, 0x89, 0xb4, 0x18, 0xf5, 0x0a, 0xd8,
340 0xaf, 0x24, 0x28, 0x7b, 0x2d, 0x9f, 0x1f, 0xd9, 0xe5, 0x1f, 0xec, 0x17, 0xa0, 0x12, 0xb7, 0xd0,
341 0xdf, 0xe9, 0x00, 0xf5, 0x79, 0x09, 0x42, 0xaf, 0x37, 0xbd, 0x46, 0x1f, 0x53, 0xbe, 0x3d, 0x86,
342 0xa6, 0x6f, 0x9a, 0x13, 0x98, 0xd7, 0xd3, 0xcd, 0x5b, 0x97, 0xdf, 0xad, 0x26, 0xe3, 0x94, 0xb0,
343 0x0c, 0x73, 0x91, 0x45, 0x19, 0x30, 0x3d, 0x7b, 0x64, 0x5a, 0xa4, 0xcc, 0xe5, 0xc1, 0x3b, 0x9c,
344 0xd8, 0xdf, 0xdb, 0xf6, 0xa7, 0x3f, 0x06, 0xfd, 0x45, 0x79, 0xb5, 0xc1, 0x0b, 0x1b, 0xb2, 0x1c,
345 0xaf, 0x5d, 0x8d, 0x7f, 0xbb, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x94, 0x52, 0x99, 0xf3, 0x36, 0x03,