348 lines
12 KiB
Go
348 lines
12 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: google/spanner/v1/mutation.proto
|
|
|
|
package spanner
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
import _ "google.golang.org/genproto/googleapis/api/annotations"
|
|
import google_protobuf1 "github.com/golang/protobuf/ptypes/struct"
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// A modification to one or more Cloud Spanner rows. Mutations can be
|
|
// applied to a Cloud Spanner database by sending them in a
|
|
// [Commit][google.spanner.v1.Spanner.Commit] call.
|
|
type Mutation struct {
|
|
// Required. The operation to perform.
|
|
//
|
|
// Types that are valid to be assigned to Operation:
|
|
// *Mutation_Insert
|
|
// *Mutation_Update
|
|
// *Mutation_InsertOrUpdate
|
|
// *Mutation_Replace
|
|
// *Mutation_Delete_
|
|
Operation isMutation_Operation `protobuf_oneof:"operation"`
|
|
}
|
|
|
|
func (m *Mutation) Reset() { *m = Mutation{} }
|
|
func (m *Mutation) String() string { return proto.CompactTextString(m) }
|
|
func (*Mutation) ProtoMessage() {}
|
|
func (*Mutation) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
|
|
|
|
type isMutation_Operation interface {
|
|
isMutation_Operation()
|
|
}
|
|
|
|
type Mutation_Insert struct {
|
|
Insert *Mutation_Write `protobuf:"bytes,1,opt,name=insert,oneof"`
|
|
}
|
|
type Mutation_Update struct {
|
|
Update *Mutation_Write `protobuf:"bytes,2,opt,name=update,oneof"`
|
|
}
|
|
type Mutation_InsertOrUpdate struct {
|
|
InsertOrUpdate *Mutation_Write `protobuf:"bytes,3,opt,name=insert_or_update,json=insertOrUpdate,oneof"`
|
|
}
|
|
type Mutation_Replace struct {
|
|
Replace *Mutation_Write `protobuf:"bytes,4,opt,name=replace,oneof"`
|
|
}
|
|
type Mutation_Delete_ struct {
|
|
Delete *Mutation_Delete `protobuf:"bytes,5,opt,name=delete,oneof"`
|
|
}
|
|
|
|
func (*Mutation_Insert) isMutation_Operation() {}
|
|
func (*Mutation_Update) isMutation_Operation() {}
|
|
func (*Mutation_InsertOrUpdate) isMutation_Operation() {}
|
|
func (*Mutation_Replace) isMutation_Operation() {}
|
|
func (*Mutation_Delete_) isMutation_Operation() {}
|
|
|
|
func (m *Mutation) GetOperation() isMutation_Operation {
|
|
if m != nil {
|
|
return m.Operation
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Mutation) GetInsert() *Mutation_Write {
|
|
if x, ok := m.GetOperation().(*Mutation_Insert); ok {
|
|
return x.Insert
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Mutation) GetUpdate() *Mutation_Write {
|
|
if x, ok := m.GetOperation().(*Mutation_Update); ok {
|
|
return x.Update
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Mutation) GetInsertOrUpdate() *Mutation_Write {
|
|
if x, ok := m.GetOperation().(*Mutation_InsertOrUpdate); ok {
|
|
return x.InsertOrUpdate
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Mutation) GetReplace() *Mutation_Write {
|
|
if x, ok := m.GetOperation().(*Mutation_Replace); ok {
|
|
return x.Replace
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Mutation) GetDelete() *Mutation_Delete {
|
|
if x, ok := m.GetOperation().(*Mutation_Delete_); ok {
|
|
return x.Delete
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// XXX_OneofFuncs is for the internal use of the proto package.
|
|
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{}) {
|
|
return _Mutation_OneofMarshaler, _Mutation_OneofUnmarshaler, _Mutation_OneofSizer, []interface{}{
|
|
(*Mutation_Insert)(nil),
|
|
(*Mutation_Update)(nil),
|
|
(*Mutation_InsertOrUpdate)(nil),
|
|
(*Mutation_Replace)(nil),
|
|
(*Mutation_Delete_)(nil),
|
|
}
|
|
}
|
|
|
|
func _Mutation_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
|
|
m := msg.(*Mutation)
|
|
// operation
|
|
switch x := m.Operation.(type) {
|
|
case *Mutation_Insert:
|
|
b.EncodeVarint(1<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.Insert); err != nil {
|
|
return err
|
|
}
|
|
case *Mutation_Update:
|
|
b.EncodeVarint(2<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.Update); err != nil {
|
|
return err
|
|
}
|
|
case *Mutation_InsertOrUpdate:
|
|
b.EncodeVarint(3<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.InsertOrUpdate); err != nil {
|
|
return err
|
|
}
|
|
case *Mutation_Replace:
|
|
b.EncodeVarint(4<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.Replace); err != nil {
|
|
return err
|
|
}
|
|
case *Mutation_Delete_:
|
|
b.EncodeVarint(5<<3 | proto.WireBytes)
|
|
if err := b.EncodeMessage(x.Delete); err != nil {
|
|
return err
|
|
}
|
|
case nil:
|
|
default:
|
|
return fmt.Errorf("Mutation.Operation has unexpected type %T", x)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func _Mutation_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
|
|
m := msg.(*Mutation)
|
|
switch tag {
|
|
case 1: // operation.insert
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(Mutation_Write)
|
|
err := b.DecodeMessage(msg)
|
|
m.Operation = &Mutation_Insert{msg}
|
|
return true, err
|
|
case 2: // operation.update
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(Mutation_Write)
|
|
err := b.DecodeMessage(msg)
|
|
m.Operation = &Mutation_Update{msg}
|
|
return true, err
|
|
case 3: // operation.insert_or_update
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(Mutation_Write)
|
|
err := b.DecodeMessage(msg)
|
|
m.Operation = &Mutation_InsertOrUpdate{msg}
|
|
return true, err
|
|
case 4: // operation.replace
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(Mutation_Write)
|
|
err := b.DecodeMessage(msg)
|
|
m.Operation = &Mutation_Replace{msg}
|
|
return true, err
|
|
case 5: // operation.delete
|
|
if wire != proto.WireBytes {
|
|
return true, proto.ErrInternalBadWireType
|
|
}
|
|
msg := new(Mutation_Delete)
|
|
err := b.DecodeMessage(msg)
|
|
m.Operation = &Mutation_Delete_{msg}
|
|
return true, err
|
|
default:
|
|
return false, nil
|
|
}
|
|
}
|
|
|
|
func _Mutation_OneofSizer(msg proto.Message) (n int) {
|
|
m := msg.(*Mutation)
|
|
// operation
|
|
switch x := m.Operation.(type) {
|
|
case *Mutation_Insert:
|
|
s := proto.Size(x.Insert)
|
|
n += proto.SizeVarint(1<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case *Mutation_Update:
|
|
s := proto.Size(x.Update)
|
|
n += proto.SizeVarint(2<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case *Mutation_InsertOrUpdate:
|
|
s := proto.Size(x.InsertOrUpdate)
|
|
n += proto.SizeVarint(3<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case *Mutation_Replace:
|
|
s := proto.Size(x.Replace)
|
|
n += proto.SizeVarint(4<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case *Mutation_Delete_:
|
|
s := proto.Size(x.Delete)
|
|
n += proto.SizeVarint(5<<3 | proto.WireBytes)
|
|
n += proto.SizeVarint(uint64(s))
|
|
n += s
|
|
case nil:
|
|
default:
|
|
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
|
|
}
|
|
return n
|
|
}
|
|
|
|
// 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
|
|
// [replace][google.spanner.v1.Mutation.replace] operations.
|
|
type Mutation_Write struct {
|
|
// Required. The table whose rows will be written.
|
|
Table string `protobuf:"bytes,1,opt,name=table" json:"table,omitempty"`
|
|
// The names of the columns in [table][google.spanner.v1.Mutation.Write.table] to be written.
|
|
//
|
|
// The list of columns must contain enough columns to allow
|
|
// Cloud Spanner to derive values for all primary key columns in the
|
|
// row(s) to be modified.
|
|
Columns []string `protobuf:"bytes,2,rep,name=columns" json:"columns,omitempty"`
|
|
// The values to be written. `values` can contain more than one
|
|
// list of values. If it does, then multiple rows are written, one
|
|
// for each entry in `values`. Each list in `values` must have
|
|
// exactly as many entries as there are entries in [columns][google.spanner.v1.Mutation.Write.columns]
|
|
// above. Sending multiple lists is equivalent to sending multiple
|
|
// `Mutation`s, each containing one `values` entry and repeating
|
|
// [table][google.spanner.v1.Mutation.Write.table] and [columns][google.spanner.v1.Mutation.Write.columns]. Individual values in each list are
|
|
// encoded as described [here][google.spanner.v1.TypeCode].
|
|
Values []*google_protobuf1.ListValue `protobuf:"bytes,3,rep,name=values" json:"values,omitempty"`
|
|
}
|
|
|
|
func (m *Mutation_Write) Reset() { *m = Mutation_Write{} }
|
|
func (m *Mutation_Write) String() string { return proto.CompactTextString(m) }
|
|
func (*Mutation_Write) ProtoMessage() {}
|
|
func (*Mutation_Write) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 0} }
|
|
|
|
func (m *Mutation_Write) GetTable() string {
|
|
if m != nil {
|
|
return m.Table
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Mutation_Write) GetColumns() []string {
|
|
if m != nil {
|
|
return m.Columns
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Mutation_Write) GetValues() []*google_protobuf1.ListValue {
|
|
if m != nil {
|
|
return m.Values
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Arguments to [delete][google.spanner.v1.Mutation.delete] operations.
|
|
type Mutation_Delete struct {
|
|
// Required. The table whose rows will be deleted.
|
|
Table string `protobuf:"bytes,1,opt,name=table" json:"table,omitempty"`
|
|
// Required. The primary keys of the rows within [table][google.spanner.v1.Mutation.Delete.table] to delete.
|
|
KeySet *KeySet `protobuf:"bytes,2,opt,name=key_set,json=keySet" json:"key_set,omitempty"`
|
|
}
|
|
|
|
func (m *Mutation_Delete) Reset() { *m = Mutation_Delete{} }
|
|
func (m *Mutation_Delete) String() string { return proto.CompactTextString(m) }
|
|
func (*Mutation_Delete) ProtoMessage() {}
|
|
func (*Mutation_Delete) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 1} }
|
|
|
|
func (m *Mutation_Delete) GetTable() string {
|
|
if m != nil {
|
|
return m.Table
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Mutation_Delete) GetKeySet() *KeySet {
|
|
if m != nil {
|
|
return m.KeySet
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*Mutation)(nil), "google.spanner.v1.Mutation")
|
|
proto.RegisterType((*Mutation_Write)(nil), "google.spanner.v1.Mutation.Write")
|
|
proto.RegisterType((*Mutation_Delete)(nil), "google.spanner.v1.Mutation.Delete")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("google/spanner/v1/mutation.proto", fileDescriptor1) }
|
|
|
|
var fileDescriptor1 = []byte{
|
|
// 402 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x41, 0x6b, 0xdb, 0x30,
|
|
0x14, 0xc7, 0x97, 0x38, 0x71, 0x16, 0x85, 0x8d, 0xcd, 0x6c, 0xcc, 0x33, 0x3b, 0x78, 0x39,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