github.com/kaisenlinux/docker@v0.0.0-20230510090727-ea55db55fac7/swarmkit/api/watch.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: github.com/docker/swarmkit/api/watch.proto
     3  
     4  package api
     5  
     6  import (
     7  	context "context"
     8  	fmt "fmt"
     9  	github_com_docker_swarmkit_api_deepcopy "github.com/docker/swarmkit/api/deepcopy"
    10  	raftselector "github.com/docker/swarmkit/manager/raftselector"
    11  	_ "github.com/docker/swarmkit/protobuf/plugin"
    12  	_ "github.com/gogo/protobuf/gogoproto"
    13  	proto "github.com/gogo/protobuf/proto"
    14  	grpc "google.golang.org/grpc"
    15  	codes "google.golang.org/grpc/codes"
    16  	metadata "google.golang.org/grpc/metadata"
    17  	peer "google.golang.org/grpc/peer"
    18  	status "google.golang.org/grpc/status"
    19  	io "io"
    20  	math "math"
    21  	reflect "reflect"
    22  	strings "strings"
    23  	rafttime "time"
    24  )
    25  
    26  // Reference imports to suppress errors if they are not otherwise used.
    27  var _ = proto.Marshal
    28  var _ = fmt.Errorf
    29  var _ = math.Inf
    30  
    31  // This is a compile-time assertion to ensure that this generated file
    32  // is compatible with the proto package it is being compiled against.
    33  // A compilation error at this line likely means your copy of the
    34  // proto package needs to be updated.
    35  const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
    36  
    37  // WatchActionKind distinguishes between creations, updates, and removals. It
    38  // is structured as a bitmap so multiple kinds of events can be requested with
    39  // a mask.
    40  type WatchActionKind int32
    41  
    42  const (
    43  	WatchActionKindUnknown WatchActionKind = 0
    44  	WatchActionKindCreate  WatchActionKind = 1
    45  	WatchActionKindUpdate  WatchActionKind = 2
    46  	WatchActionKindRemove  WatchActionKind = 4
    47  )
    48  
    49  var WatchActionKind_name = map[int32]string{
    50  	0: "WATCH_ACTION_UNKNOWN",
    51  	1: "WATCH_ACTION_CREATE",
    52  	2: "WATCH_ACTION_UPDATE",
    53  	4: "WATCH_ACTION_REMOVE",
    54  }
    55  
    56  var WatchActionKind_value = map[string]int32{
    57  	"WATCH_ACTION_UNKNOWN": 0,
    58  	"WATCH_ACTION_CREATE":  1,
    59  	"WATCH_ACTION_UPDATE":  2,
    60  	"WATCH_ACTION_REMOVE":  4,
    61  }
    62  
    63  func (x WatchActionKind) String() string {
    64  	return proto.EnumName(WatchActionKind_name, int32(x))
    65  }
    66  
    67  func (WatchActionKind) EnumDescriptor() ([]byte, []int) {
    68  	return fileDescriptor_da25266013800cd9, []int{0}
    69  }
    70  
    71  type Object struct {
    72  	// Types that are valid to be assigned to Object:
    73  	//	*Object_Node
    74  	//	*Object_Service
    75  	//	*Object_Network
    76  	//	*Object_Task
    77  	//	*Object_Cluster
    78  	//	*Object_Secret
    79  	//	*Object_Resource
    80  	//	*Object_Extension
    81  	//	*Object_Config
    82  	Object isObject_Object `protobuf_oneof:"Object"`
    83  }
    84  
    85  func (m *Object) Reset()      { *m = Object{} }
    86  func (*Object) ProtoMessage() {}
    87  func (*Object) Descriptor() ([]byte, []int) {
    88  	return fileDescriptor_da25266013800cd9, []int{0}
    89  }
    90  func (m *Object) XXX_Unmarshal(b []byte) error {
    91  	return m.Unmarshal(b)
    92  }
    93  func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    94  	if deterministic {
    95  		return xxx_messageInfo_Object.Marshal(b, m, deterministic)
    96  	} else {
    97  		b = b[:cap(b)]
    98  		n, err := m.MarshalTo(b)
    99  		if err != nil {
   100  			return nil, err
   101  		}
   102  		return b[:n], nil
   103  	}
   104  }
   105  func (m *Object) XXX_Merge(src proto.Message) {
   106  	xxx_messageInfo_Object.Merge(m, src)
   107  }
   108  func (m *Object) XXX_Size() int {
   109  	return m.Size()
   110  }
   111  func (m *Object) XXX_DiscardUnknown() {
   112  	xxx_messageInfo_Object.DiscardUnknown(m)
   113  }
   114  
   115  var xxx_messageInfo_Object proto.InternalMessageInfo
   116  
   117  type isObject_Object interface {
   118  	isObject_Object()
   119  	MarshalTo([]byte) (int, error)
   120  	Size() int
   121  }
   122  
   123  type Object_Node struct {
   124  	Node *Node `protobuf:"bytes,1,opt,name=node,proto3,oneof"`
   125  }
   126  type Object_Service struct {
   127  	Service *Service `protobuf:"bytes,2,opt,name=service,proto3,oneof"`
   128  }
   129  type Object_Network struct {
   130  	Network *Network `protobuf:"bytes,3,opt,name=network,proto3,oneof"`
   131  }
   132  type Object_Task struct {
   133  	Task *Task `protobuf:"bytes,4,opt,name=task,proto3,oneof"`
   134  }
   135  type Object_Cluster struct {
   136  	Cluster *Cluster `protobuf:"bytes,5,opt,name=cluster,proto3,oneof"`
   137  }
   138  type Object_Secret struct {
   139  	Secret *Secret `protobuf:"bytes,6,opt,name=secret,proto3,oneof"`
   140  }
   141  type Object_Resource struct {
   142  	Resource *Resource `protobuf:"bytes,7,opt,name=resource,proto3,oneof"`
   143  }
   144  type Object_Extension struct {
   145  	Extension *Extension `protobuf:"bytes,8,opt,name=extension,proto3,oneof"`
   146  }
   147  type Object_Config struct {
   148  	Config *Config `protobuf:"bytes,9,opt,name=config,proto3,oneof"`
   149  }
   150  
   151  func (*Object_Node) isObject_Object()      {}
   152  func (*Object_Service) isObject_Object()   {}
   153  func (*Object_Network) isObject_Object()   {}
   154  func (*Object_Task) isObject_Object()      {}
   155  func (*Object_Cluster) isObject_Object()   {}
   156  func (*Object_Secret) isObject_Object()    {}
   157  func (*Object_Resource) isObject_Object()  {}
   158  func (*Object_Extension) isObject_Object() {}
   159  func (*Object_Config) isObject_Object()    {}
   160  
   161  func (m *Object) GetObject() isObject_Object {
   162  	if m != nil {
   163  		return m.Object
   164  	}
   165  	return nil
   166  }
   167  
   168  func (m *Object) GetNode() *Node {
   169  	if x, ok := m.GetObject().(*Object_Node); ok {
   170  		return x.Node
   171  	}
   172  	return nil
   173  }
   174  
   175  func (m *Object) GetService() *Service {
   176  	if x, ok := m.GetObject().(*Object_Service); ok {
   177  		return x.Service
   178  	}
   179  	return nil
   180  }
   181  
   182  func (m *Object) GetNetwork() *Network {
   183  	if x, ok := m.GetObject().(*Object_Network); ok {
   184  		return x.Network
   185  	}
   186  	return nil
   187  }
   188  
   189  func (m *Object) GetTask() *Task {
   190  	if x, ok := m.GetObject().(*Object_Task); ok {
   191  		return x.Task
   192  	}
   193  	return nil
   194  }
   195  
   196  func (m *Object) GetCluster() *Cluster {
   197  	if x, ok := m.GetObject().(*Object_Cluster); ok {
   198  		return x.Cluster
   199  	}
   200  	return nil
   201  }
   202  
   203  func (m *Object) GetSecret() *Secret {
   204  	if x, ok := m.GetObject().(*Object_Secret); ok {
   205  		return x.Secret
   206  	}
   207  	return nil
   208  }
   209  
   210  func (m *Object) GetResource() *Resource {
   211  	if x, ok := m.GetObject().(*Object_Resource); ok {
   212  		return x.Resource
   213  	}
   214  	return nil
   215  }
   216  
   217  func (m *Object) GetExtension() *Extension {
   218  	if x, ok := m.GetObject().(*Object_Extension); ok {
   219  		return x.Extension
   220  	}
   221  	return nil
   222  }
   223  
   224  func (m *Object) GetConfig() *Config {
   225  	if x, ok := m.GetObject().(*Object_Config); ok {
   226  		return x.Config
   227  	}
   228  	return nil
   229  }
   230  
   231  // XXX_OneofFuncs is for the internal use of the proto package.
   232  func (*Object) 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{}) {
   233  	return _Object_OneofMarshaler, _Object_OneofUnmarshaler, _Object_OneofSizer, []interface{}{
   234  		(*Object_Node)(nil),
   235  		(*Object_Service)(nil),
   236  		(*Object_Network)(nil),
   237  		(*Object_Task)(nil),
   238  		(*Object_Cluster)(nil),
   239  		(*Object_Secret)(nil),
   240  		(*Object_Resource)(nil),
   241  		(*Object_Extension)(nil),
   242  		(*Object_Config)(nil),
   243  	}
   244  }
   245  
   246  func _Object_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
   247  	m := msg.(*Object)
   248  	// Object
   249  	switch x := m.Object.(type) {
   250  	case *Object_Node:
   251  		_ = b.EncodeVarint(1<<3 | proto.WireBytes)
   252  		if err := b.EncodeMessage(x.Node); err != nil {
   253  			return err
   254  		}
   255  	case *Object_Service:
   256  		_ = b.EncodeVarint(2<<3 | proto.WireBytes)
   257  		if err := b.EncodeMessage(x.Service); err != nil {
   258  			return err
   259  		}
   260  	case *Object_Network:
   261  		_ = b.EncodeVarint(3<<3 | proto.WireBytes)
   262  		if err := b.EncodeMessage(x.Network); err != nil {
   263  			return err
   264  		}
   265  	case *Object_Task:
   266  		_ = b.EncodeVarint(4<<3 | proto.WireBytes)
   267  		if err := b.EncodeMessage(x.Task); err != nil {
   268  			return err
   269  		}
   270  	case *Object_Cluster:
   271  		_ = b.EncodeVarint(5<<3 | proto.WireBytes)
   272  		if err := b.EncodeMessage(x.Cluster); err != nil {
   273  			return err
   274  		}
   275  	case *Object_Secret:
   276  		_ = b.EncodeVarint(6<<3 | proto.WireBytes)
   277  		if err := b.EncodeMessage(x.Secret); err != nil {
   278  			return err
   279  		}
   280  	case *Object_Resource:
   281  		_ = b.EncodeVarint(7<<3 | proto.WireBytes)
   282  		if err := b.EncodeMessage(x.Resource); err != nil {
   283  			return err
   284  		}
   285  	case *Object_Extension:
   286  		_ = b.EncodeVarint(8<<3 | proto.WireBytes)
   287  		if err := b.EncodeMessage(x.Extension); err != nil {
   288  			return err
   289  		}
   290  	case *Object_Config:
   291  		_ = b.EncodeVarint(9<<3 | proto.WireBytes)
   292  		if err := b.EncodeMessage(x.Config); err != nil {
   293  			return err
   294  		}
   295  	case nil:
   296  	default:
   297  		return fmt.Errorf("Object.Object has unexpected type %T", x)
   298  	}
   299  	return nil
   300  }
   301  
   302  func _Object_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
   303  	m := msg.(*Object)
   304  	switch tag {
   305  	case 1: // Object.node
   306  		if wire != proto.WireBytes {
   307  			return true, proto.ErrInternalBadWireType
   308  		}
   309  		msg := new(Node)
   310  		err := b.DecodeMessage(msg)
   311  		m.Object = &Object_Node{msg}
   312  		return true, err
   313  	case 2: // Object.service
   314  		if wire != proto.WireBytes {
   315  			return true, proto.ErrInternalBadWireType
   316  		}
   317  		msg := new(Service)
   318  		err := b.DecodeMessage(msg)
   319  		m.Object = &Object_Service{msg}
   320  		return true, err
   321  	case 3: // Object.network
   322  		if wire != proto.WireBytes {
   323  			return true, proto.ErrInternalBadWireType
   324  		}
   325  		msg := new(Network)
   326  		err := b.DecodeMessage(msg)
   327  		m.Object = &Object_Network{msg}
   328  		return true, err
   329  	case 4: // Object.task
   330  		if wire != proto.WireBytes {
   331  			return true, proto.ErrInternalBadWireType
   332  		}
   333  		msg := new(Task)
   334  		err := b.DecodeMessage(msg)
   335  		m.Object = &Object_Task{msg}
   336  		return true, err
   337  	case 5: // Object.cluster
   338  		if wire != proto.WireBytes {
   339  			return true, proto.ErrInternalBadWireType
   340  		}
   341  		msg := new(Cluster)
   342  		err := b.DecodeMessage(msg)
   343  		m.Object = &Object_Cluster{msg}
   344  		return true, err
   345  	case 6: // Object.secret
   346  		if wire != proto.WireBytes {
   347  			return true, proto.ErrInternalBadWireType
   348  		}
   349  		msg := new(Secret)
   350  		err := b.DecodeMessage(msg)
   351  		m.Object = &Object_Secret{msg}
   352  		return true, err
   353  	case 7: // Object.resource
   354  		if wire != proto.WireBytes {
   355  			return true, proto.ErrInternalBadWireType
   356  		}
   357  		msg := new(Resource)
   358  		err := b.DecodeMessage(msg)
   359  		m.Object = &Object_Resource{msg}
   360  		return true, err
   361  	case 8: // Object.extension
   362  		if wire != proto.WireBytes {
   363  			return true, proto.ErrInternalBadWireType
   364  		}
   365  		msg := new(Extension)
   366  		err := b.DecodeMessage(msg)
   367  		m.Object = &Object_Extension{msg}
   368  		return true, err
   369  	case 9: // Object.config
   370  		if wire != proto.WireBytes {
   371  			return true, proto.ErrInternalBadWireType
   372  		}
   373  		msg := new(Config)
   374  		err := b.DecodeMessage(msg)
   375  		m.Object = &Object_Config{msg}
   376  		return true, err
   377  	default:
   378  		return false, nil
   379  	}
   380  }
   381  
   382  func _Object_OneofSizer(msg proto.Message) (n int) {
   383  	m := msg.(*Object)
   384  	// Object
   385  	switch x := m.Object.(type) {
   386  	case *Object_Node:
   387  		s := proto.Size(x.Node)
   388  		n += 1 // tag and wire
   389  		n += proto.SizeVarint(uint64(s))
   390  		n += s
   391  	case *Object_Service:
   392  		s := proto.Size(x.Service)
   393  		n += 1 // tag and wire
   394  		n += proto.SizeVarint(uint64(s))
   395  		n += s
   396  	case *Object_Network:
   397  		s := proto.Size(x.Network)
   398  		n += 1 // tag and wire
   399  		n += proto.SizeVarint(uint64(s))
   400  		n += s
   401  	case *Object_Task:
   402  		s := proto.Size(x.Task)
   403  		n += 1 // tag and wire
   404  		n += proto.SizeVarint(uint64(s))
   405  		n += s
   406  	case *Object_Cluster:
   407  		s := proto.Size(x.Cluster)
   408  		n += 1 // tag and wire
   409  		n += proto.SizeVarint(uint64(s))
   410  		n += s
   411  	case *Object_Secret:
   412  		s := proto.Size(x.Secret)
   413  		n += 1 // tag and wire
   414  		n += proto.SizeVarint(uint64(s))
   415  		n += s
   416  	case *Object_Resource:
   417  		s := proto.Size(x.Resource)
   418  		n += 1 // tag and wire
   419  		n += proto.SizeVarint(uint64(s))
   420  		n += s
   421  	case *Object_Extension:
   422  		s := proto.Size(x.Extension)
   423  		n += 1 // tag and wire
   424  		n += proto.SizeVarint(uint64(s))
   425  		n += s
   426  	case *Object_Config:
   427  		s := proto.Size(x.Config)
   428  		n += 1 // tag and wire
   429  		n += proto.SizeVarint(uint64(s))
   430  		n += s
   431  	case nil:
   432  	default:
   433  		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
   434  	}
   435  	return n
   436  }
   437  
   438  // FIXME(aaronl): These messages should ideally be embedded in SelectBy, but
   439  // protoc generates bad code for that.
   440  type SelectBySlot struct {
   441  	ServiceID string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
   442  	Slot      uint64 `protobuf:"varint,2,opt,name=slot,proto3" json:"slot,omitempty"`
   443  }
   444  
   445  func (m *SelectBySlot) Reset()      { *m = SelectBySlot{} }
   446  func (*SelectBySlot) ProtoMessage() {}
   447  func (*SelectBySlot) Descriptor() ([]byte, []int) {
   448  	return fileDescriptor_da25266013800cd9, []int{1}
   449  }
   450  func (m *SelectBySlot) XXX_Unmarshal(b []byte) error {
   451  	return m.Unmarshal(b)
   452  }
   453  func (m *SelectBySlot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   454  	if deterministic {
   455  		return xxx_messageInfo_SelectBySlot.Marshal(b, m, deterministic)
   456  	} else {
   457  		b = b[:cap(b)]
   458  		n, err := m.MarshalTo(b)
   459  		if err != nil {
   460  			return nil, err
   461  		}
   462  		return b[:n], nil
   463  	}
   464  }
   465  func (m *SelectBySlot) XXX_Merge(src proto.Message) {
   466  	xxx_messageInfo_SelectBySlot.Merge(m, src)
   467  }
   468  func (m *SelectBySlot) XXX_Size() int {
   469  	return m.Size()
   470  }
   471  func (m *SelectBySlot) XXX_DiscardUnknown() {
   472  	xxx_messageInfo_SelectBySlot.DiscardUnknown(m)
   473  }
   474  
   475  var xxx_messageInfo_SelectBySlot proto.InternalMessageInfo
   476  
   477  type SelectByCustom struct {
   478  	Kind  string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
   479  	Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"`
   480  	Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
   481  }
   482  
   483  func (m *SelectByCustom) Reset()      { *m = SelectByCustom{} }
   484  func (*SelectByCustom) ProtoMessage() {}
   485  func (*SelectByCustom) Descriptor() ([]byte, []int) {
   486  	return fileDescriptor_da25266013800cd9, []int{2}
   487  }
   488  func (m *SelectByCustom) XXX_Unmarshal(b []byte) error {
   489  	return m.Unmarshal(b)
   490  }
   491  func (m *SelectByCustom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   492  	if deterministic {
   493  		return xxx_messageInfo_SelectByCustom.Marshal(b, m, deterministic)
   494  	} else {
   495  		b = b[:cap(b)]
   496  		n, err := m.MarshalTo(b)
   497  		if err != nil {
   498  			return nil, err
   499  		}
   500  		return b[:n], nil
   501  	}
   502  }
   503  func (m *SelectByCustom) XXX_Merge(src proto.Message) {
   504  	xxx_messageInfo_SelectByCustom.Merge(m, src)
   505  }
   506  func (m *SelectByCustom) XXX_Size() int {
   507  	return m.Size()
   508  }
   509  func (m *SelectByCustom) XXX_DiscardUnknown() {
   510  	xxx_messageInfo_SelectByCustom.DiscardUnknown(m)
   511  }
   512  
   513  var xxx_messageInfo_SelectByCustom proto.InternalMessageInfo
   514  
   515  type SelectBy struct {
   516  	// TODO(aaronl): Are all of these things we want to expose in
   517  	// the API? Exposing them may commit us to maintaining those
   518  	// internal indices going forward.
   519  	//
   520  	// Types that are valid to be assigned to By:
   521  	//	*SelectBy_ID
   522  	//	*SelectBy_IDPrefix
   523  	//	*SelectBy_Name
   524  	//	*SelectBy_NamePrefix
   525  	//	*SelectBy_Custom
   526  	//	*SelectBy_CustomPrefix
   527  	//	*SelectBy_ServiceID
   528  	//	*SelectBy_NodeID
   529  	//	*SelectBy_Slot
   530  	//	*SelectBy_DesiredState
   531  	//	*SelectBy_Role
   532  	//	*SelectBy_Membership
   533  	//	*SelectBy_ReferencedNetworkID
   534  	//	*SelectBy_ReferencedSecretID
   535  	//	*SelectBy_ReferencedConfigID
   536  	//	*SelectBy_Kind
   537  	By isSelectBy_By `protobuf_oneof:"By"`
   538  }
   539  
   540  func (m *SelectBy) Reset()      { *m = SelectBy{} }
   541  func (*SelectBy) ProtoMessage() {}
   542  func (*SelectBy) Descriptor() ([]byte, []int) {
   543  	return fileDescriptor_da25266013800cd9, []int{3}
   544  }
   545  func (m *SelectBy) XXX_Unmarshal(b []byte) error {
   546  	return m.Unmarshal(b)
   547  }
   548  func (m *SelectBy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   549  	if deterministic {
   550  		return xxx_messageInfo_SelectBy.Marshal(b, m, deterministic)
   551  	} else {
   552  		b = b[:cap(b)]
   553  		n, err := m.MarshalTo(b)
   554  		if err != nil {
   555  			return nil, err
   556  		}
   557  		return b[:n], nil
   558  	}
   559  }
   560  func (m *SelectBy) XXX_Merge(src proto.Message) {
   561  	xxx_messageInfo_SelectBy.Merge(m, src)
   562  }
   563  func (m *SelectBy) XXX_Size() int {
   564  	return m.Size()
   565  }
   566  func (m *SelectBy) XXX_DiscardUnknown() {
   567  	xxx_messageInfo_SelectBy.DiscardUnknown(m)
   568  }
   569  
   570  var xxx_messageInfo_SelectBy proto.InternalMessageInfo
   571  
   572  type isSelectBy_By interface {
   573  	isSelectBy_By()
   574  	MarshalTo([]byte) (int, error)
   575  	Size() int
   576  }
   577  
   578  type SelectBy_ID struct {
   579  	ID string `protobuf:"bytes,1,opt,name=id,proto3,oneof"`
   580  }
   581  type SelectBy_IDPrefix struct {
   582  	IDPrefix string `protobuf:"bytes,2,opt,name=id_prefix,json=idPrefix,proto3,oneof"`
   583  }
   584  type SelectBy_Name struct {
   585  	Name string `protobuf:"bytes,3,opt,name=name,proto3,oneof"`
   586  }
   587  type SelectBy_NamePrefix struct {
   588  	NamePrefix string `protobuf:"bytes,4,opt,name=name_prefix,json=namePrefix,proto3,oneof"`
   589  }
   590  type SelectBy_Custom struct {
   591  	Custom *SelectByCustom `protobuf:"bytes,5,opt,name=custom,proto3,oneof"`
   592  }
   593  type SelectBy_CustomPrefix struct {
   594  	CustomPrefix *SelectByCustom `protobuf:"bytes,6,opt,name=custom_prefix,json=customPrefix,proto3,oneof"`
   595  }
   596  type SelectBy_ServiceID struct {
   597  	ServiceID string `protobuf:"bytes,7,opt,name=service_id,json=serviceId,proto3,oneof"`
   598  }
   599  type SelectBy_NodeID struct {
   600  	NodeID string `protobuf:"bytes,8,opt,name=node_id,json=nodeId,proto3,oneof"`
   601  }
   602  type SelectBy_Slot struct {
   603  	Slot *SelectBySlot `protobuf:"bytes,9,opt,name=slot,proto3,oneof"`
   604  }
   605  type SelectBy_DesiredState struct {
   606  	DesiredState TaskState `protobuf:"varint,10,opt,name=desired_state,json=desiredState,proto3,enum=docker.swarmkit.v1.TaskState,oneof"`
   607  }
   608  type SelectBy_Role struct {
   609  	Role NodeRole `protobuf:"varint,11,opt,name=role,proto3,enum=docker.swarmkit.v1.NodeRole,oneof"`
   610  }
   611  type SelectBy_Membership struct {
   612  	Membership NodeSpec_Membership `protobuf:"varint,12,opt,name=membership,proto3,enum=docker.swarmkit.v1.NodeSpec_Membership,oneof"`
   613  }
   614  type SelectBy_ReferencedNetworkID struct {
   615  	ReferencedNetworkID string `protobuf:"bytes,13,opt,name=referenced_network_id,json=referencedNetworkId,proto3,oneof"`
   616  }
   617  type SelectBy_ReferencedSecretID struct {
   618  	ReferencedSecretID string `protobuf:"bytes,14,opt,name=referenced_secret_id,json=referencedSecretId,proto3,oneof"`
   619  }
   620  type SelectBy_ReferencedConfigID struct {
   621  	ReferencedConfigID string `protobuf:"bytes,16,opt,name=referenced_config_id,json=referencedConfigId,proto3,oneof"`
   622  }
   623  type SelectBy_Kind struct {
   624  	Kind string `protobuf:"bytes,15,opt,name=kind,proto3,oneof"`
   625  }
   626  
   627  func (*SelectBy_ID) isSelectBy_By()                  {}
   628  func (*SelectBy_IDPrefix) isSelectBy_By()            {}
   629  func (*SelectBy_Name) isSelectBy_By()                {}
   630  func (*SelectBy_NamePrefix) isSelectBy_By()          {}
   631  func (*SelectBy_Custom) isSelectBy_By()              {}
   632  func (*SelectBy_CustomPrefix) isSelectBy_By()        {}
   633  func (*SelectBy_ServiceID) isSelectBy_By()           {}
   634  func (*SelectBy_NodeID) isSelectBy_By()              {}
   635  func (*SelectBy_Slot) isSelectBy_By()                {}
   636  func (*SelectBy_DesiredState) isSelectBy_By()        {}
   637  func (*SelectBy_Role) isSelectBy_By()                {}
   638  func (*SelectBy_Membership) isSelectBy_By()          {}
   639  func (*SelectBy_ReferencedNetworkID) isSelectBy_By() {}
   640  func (*SelectBy_ReferencedSecretID) isSelectBy_By()  {}
   641  func (*SelectBy_ReferencedConfigID) isSelectBy_By()  {}
   642  func (*SelectBy_Kind) isSelectBy_By()                {}
   643  
   644  func (m *SelectBy) GetBy() isSelectBy_By {
   645  	if m != nil {
   646  		return m.By
   647  	}
   648  	return nil
   649  }
   650  
   651  func (m *SelectBy) GetID() string {
   652  	if x, ok := m.GetBy().(*SelectBy_ID); ok {
   653  		return x.ID
   654  	}
   655  	return ""
   656  }
   657  
   658  func (m *SelectBy) GetIDPrefix() string {
   659  	if x, ok := m.GetBy().(*SelectBy_IDPrefix); ok {
   660  		return x.IDPrefix
   661  	}
   662  	return ""
   663  }
   664  
   665  func (m *SelectBy) GetName() string {
   666  	if x, ok := m.GetBy().(*SelectBy_Name); ok {
   667  		return x.Name
   668  	}
   669  	return ""
   670  }
   671  
   672  func (m *SelectBy) GetNamePrefix() string {
   673  	if x, ok := m.GetBy().(*SelectBy_NamePrefix); ok {
   674  		return x.NamePrefix
   675  	}
   676  	return ""
   677  }
   678  
   679  func (m *SelectBy) GetCustom() *SelectByCustom {
   680  	if x, ok := m.GetBy().(*SelectBy_Custom); ok {
   681  		return x.Custom
   682  	}
   683  	return nil
   684  }
   685  
   686  func (m *SelectBy) GetCustomPrefix() *SelectByCustom {
   687  	if x, ok := m.GetBy().(*SelectBy_CustomPrefix); ok {
   688  		return x.CustomPrefix
   689  	}
   690  	return nil
   691  }
   692  
   693  func (m *SelectBy) GetServiceID() string {
   694  	if x, ok := m.GetBy().(*SelectBy_ServiceID); ok {
   695  		return x.ServiceID
   696  	}
   697  	return ""
   698  }
   699  
   700  func (m *SelectBy) GetNodeID() string {
   701  	if x, ok := m.GetBy().(*SelectBy_NodeID); ok {
   702  		return x.NodeID
   703  	}
   704  	return ""
   705  }
   706  
   707  func (m *SelectBy) GetSlot() *SelectBySlot {
   708  	if x, ok := m.GetBy().(*SelectBy_Slot); ok {
   709  		return x.Slot
   710  	}
   711  	return nil
   712  }
   713  
   714  func (m *SelectBy) GetDesiredState() TaskState {
   715  	if x, ok := m.GetBy().(*SelectBy_DesiredState); ok {
   716  		return x.DesiredState
   717  	}
   718  	return TaskStateNew
   719  }
   720  
   721  func (m *SelectBy) GetRole() NodeRole {
   722  	if x, ok := m.GetBy().(*SelectBy_Role); ok {
   723  		return x.Role
   724  	}
   725  	return NodeRoleWorker
   726  }
   727  
   728  func (m *SelectBy) GetMembership() NodeSpec_Membership {
   729  	if x, ok := m.GetBy().(*SelectBy_Membership); ok {
   730  		return x.Membership
   731  	}
   732  	return NodeMembershipPending
   733  }
   734  
   735  func (m *SelectBy) GetReferencedNetworkID() string {
   736  	if x, ok := m.GetBy().(*SelectBy_ReferencedNetworkID); ok {
   737  		return x.ReferencedNetworkID
   738  	}
   739  	return ""
   740  }
   741  
   742  func (m *SelectBy) GetReferencedSecretID() string {
   743  	if x, ok := m.GetBy().(*SelectBy_ReferencedSecretID); ok {
   744  		return x.ReferencedSecretID
   745  	}
   746  	return ""
   747  }
   748  
   749  func (m *SelectBy) GetReferencedConfigID() string {
   750  	if x, ok := m.GetBy().(*SelectBy_ReferencedConfigID); ok {
   751  		return x.ReferencedConfigID
   752  	}
   753  	return ""
   754  }
   755  
   756  func (m *SelectBy) GetKind() string {
   757  	if x, ok := m.GetBy().(*SelectBy_Kind); ok {
   758  		return x.Kind
   759  	}
   760  	return ""
   761  }
   762  
   763  // XXX_OneofFuncs is for the internal use of the proto package.
   764  func (*SelectBy) 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{}) {
   765  	return _SelectBy_OneofMarshaler, _SelectBy_OneofUnmarshaler, _SelectBy_OneofSizer, []interface{}{
   766  		(*SelectBy_ID)(nil),
   767  		(*SelectBy_IDPrefix)(nil),
   768  		(*SelectBy_Name)(nil),
   769  		(*SelectBy_NamePrefix)(nil),
   770  		(*SelectBy_Custom)(nil),
   771  		(*SelectBy_CustomPrefix)(nil),
   772  		(*SelectBy_ServiceID)(nil),
   773  		(*SelectBy_NodeID)(nil),
   774  		(*SelectBy_Slot)(nil),
   775  		(*SelectBy_DesiredState)(nil),
   776  		(*SelectBy_Role)(nil),
   777  		(*SelectBy_Membership)(nil),
   778  		(*SelectBy_ReferencedNetworkID)(nil),
   779  		(*SelectBy_ReferencedSecretID)(nil),
   780  		(*SelectBy_ReferencedConfigID)(nil),
   781  		(*SelectBy_Kind)(nil),
   782  	}
   783  }
   784  
   785  func _SelectBy_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
   786  	m := msg.(*SelectBy)
   787  	// By
   788  	switch x := m.By.(type) {
   789  	case *SelectBy_ID:
   790  		_ = b.EncodeVarint(1<<3 | proto.WireBytes)
   791  		_ = b.EncodeStringBytes(x.ID)
   792  	case *SelectBy_IDPrefix:
   793  		_ = b.EncodeVarint(2<<3 | proto.WireBytes)
   794  		_ = b.EncodeStringBytes(x.IDPrefix)
   795  	case *SelectBy_Name:
   796  		_ = b.EncodeVarint(3<<3 | proto.WireBytes)
   797  		_ = b.EncodeStringBytes(x.Name)
   798  	case *SelectBy_NamePrefix:
   799  		_ = b.EncodeVarint(4<<3 | proto.WireBytes)
   800  		_ = b.EncodeStringBytes(x.NamePrefix)
   801  	case *SelectBy_Custom:
   802  		_ = b.EncodeVarint(5<<3 | proto.WireBytes)
   803  		if err := b.EncodeMessage(x.Custom); err != nil {
   804  			return err
   805  		}
   806  	case *SelectBy_CustomPrefix:
   807  		_ = b.EncodeVarint(6<<3 | proto.WireBytes)
   808  		if err := b.EncodeMessage(x.CustomPrefix); err != nil {
   809  			return err
   810  		}
   811  	case *SelectBy_ServiceID:
   812  		_ = b.EncodeVarint(7<<3 | proto.WireBytes)
   813  		_ = b.EncodeStringBytes(x.ServiceID)
   814  	case *SelectBy_NodeID:
   815  		_ = b.EncodeVarint(8<<3 | proto.WireBytes)
   816  		_ = b.EncodeStringBytes(x.NodeID)
   817  	case *SelectBy_Slot:
   818  		_ = b.EncodeVarint(9<<3 | proto.WireBytes)
   819  		if err := b.EncodeMessage(x.Slot); err != nil {
   820  			return err
   821  		}
   822  	case *SelectBy_DesiredState:
   823  		_ = b.EncodeVarint(10<<3 | proto.WireVarint)
   824  		_ = b.EncodeVarint(uint64(x.DesiredState))
   825  	case *SelectBy_Role:
   826  		_ = b.EncodeVarint(11<<3 | proto.WireVarint)
   827  		_ = b.EncodeVarint(uint64(x.Role))
   828  	case *SelectBy_Membership:
   829  		_ = b.EncodeVarint(12<<3 | proto.WireVarint)
   830  		_ = b.EncodeVarint(uint64(x.Membership))
   831  	case *SelectBy_ReferencedNetworkID:
   832  		_ = b.EncodeVarint(13<<3 | proto.WireBytes)
   833  		_ = b.EncodeStringBytes(x.ReferencedNetworkID)
   834  	case *SelectBy_ReferencedSecretID:
   835  		_ = b.EncodeVarint(14<<3 | proto.WireBytes)
   836  		_ = b.EncodeStringBytes(x.ReferencedSecretID)
   837  	case *SelectBy_ReferencedConfigID:
   838  		_ = b.EncodeVarint(16<<3 | proto.WireBytes)
   839  		_ = b.EncodeStringBytes(x.ReferencedConfigID)
   840  	case *SelectBy_Kind:
   841  		_ = b.EncodeVarint(15<<3 | proto.WireBytes)
   842  		_ = b.EncodeStringBytes(x.Kind)
   843  	case nil:
   844  	default:
   845  		return fmt.Errorf("SelectBy.By has unexpected type %T", x)
   846  	}
   847  	return nil
   848  }
   849  
   850  func _SelectBy_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
   851  	m := msg.(*SelectBy)
   852  	switch tag {
   853  	case 1: // By.id
   854  		if wire != proto.WireBytes {
   855  			return true, proto.ErrInternalBadWireType
   856  		}
   857  		x, err := b.DecodeStringBytes()
   858  		m.By = &SelectBy_ID{x}
   859  		return true, err
   860  	case 2: // By.id_prefix
   861  		if wire != proto.WireBytes {
   862  			return true, proto.ErrInternalBadWireType
   863  		}
   864  		x, err := b.DecodeStringBytes()
   865  		m.By = &SelectBy_IDPrefix{x}
   866  		return true, err
   867  	case 3: // By.name
   868  		if wire != proto.WireBytes {
   869  			return true, proto.ErrInternalBadWireType
   870  		}
   871  		x, err := b.DecodeStringBytes()
   872  		m.By = &SelectBy_Name{x}
   873  		return true, err
   874  	case 4: // By.name_prefix
   875  		if wire != proto.WireBytes {
   876  			return true, proto.ErrInternalBadWireType
   877  		}
   878  		x, err := b.DecodeStringBytes()
   879  		m.By = &SelectBy_NamePrefix{x}
   880  		return true, err
   881  	case 5: // By.custom
   882  		if wire != proto.WireBytes {
   883  			return true, proto.ErrInternalBadWireType
   884  		}
   885  		msg := new(SelectByCustom)
   886  		err := b.DecodeMessage(msg)
   887  		m.By = &SelectBy_Custom{msg}
   888  		return true, err
   889  	case 6: // By.custom_prefix
   890  		if wire != proto.WireBytes {
   891  			return true, proto.ErrInternalBadWireType
   892  		}
   893  		msg := new(SelectByCustom)
   894  		err := b.DecodeMessage(msg)
   895  		m.By = &SelectBy_CustomPrefix{msg}
   896  		return true, err
   897  	case 7: // By.service_id
   898  		if wire != proto.WireBytes {
   899  			return true, proto.ErrInternalBadWireType
   900  		}
   901  		x, err := b.DecodeStringBytes()
   902  		m.By = &SelectBy_ServiceID{x}
   903  		return true, err
   904  	case 8: // By.node_id
   905  		if wire != proto.WireBytes {
   906  			return true, proto.ErrInternalBadWireType
   907  		}
   908  		x, err := b.DecodeStringBytes()
   909  		m.By = &SelectBy_NodeID{x}
   910  		return true, err
   911  	case 9: // By.slot
   912  		if wire != proto.WireBytes {
   913  			return true, proto.ErrInternalBadWireType
   914  		}
   915  		msg := new(SelectBySlot)
   916  		err := b.DecodeMessage(msg)
   917  		m.By = &SelectBy_Slot{msg}
   918  		return true, err
   919  	case 10: // By.desired_state
   920  		if wire != proto.WireVarint {
   921  			return true, proto.ErrInternalBadWireType
   922  		}
   923  		x, err := b.DecodeVarint()
   924  		m.By = &SelectBy_DesiredState{TaskState(x)}
   925  		return true, err
   926  	case 11: // By.role
   927  		if wire != proto.WireVarint {
   928  			return true, proto.ErrInternalBadWireType
   929  		}
   930  		x, err := b.DecodeVarint()
   931  		m.By = &SelectBy_Role{NodeRole(x)}
   932  		return true, err
   933  	case 12: // By.membership
   934  		if wire != proto.WireVarint {
   935  			return true, proto.ErrInternalBadWireType
   936  		}
   937  		x, err := b.DecodeVarint()
   938  		m.By = &SelectBy_Membership{NodeSpec_Membership(x)}
   939  		return true, err
   940  	case 13: // By.referenced_network_id
   941  		if wire != proto.WireBytes {
   942  			return true, proto.ErrInternalBadWireType
   943  		}
   944  		x, err := b.DecodeStringBytes()
   945  		m.By = &SelectBy_ReferencedNetworkID{x}
   946  		return true, err
   947  	case 14: // By.referenced_secret_id
   948  		if wire != proto.WireBytes {
   949  			return true, proto.ErrInternalBadWireType
   950  		}
   951  		x, err := b.DecodeStringBytes()
   952  		m.By = &SelectBy_ReferencedSecretID{x}
   953  		return true, err
   954  	case 16: // By.referenced_config_id
   955  		if wire != proto.WireBytes {
   956  			return true, proto.ErrInternalBadWireType
   957  		}
   958  		x, err := b.DecodeStringBytes()
   959  		m.By = &SelectBy_ReferencedConfigID{x}
   960  		return true, err
   961  	case 15: // By.kind
   962  		if wire != proto.WireBytes {
   963  			return true, proto.ErrInternalBadWireType
   964  		}
   965  		x, err := b.DecodeStringBytes()
   966  		m.By = &SelectBy_Kind{x}
   967  		return true, err
   968  	default:
   969  		return false, nil
   970  	}
   971  }
   972  
   973  func _SelectBy_OneofSizer(msg proto.Message) (n int) {
   974  	m := msg.(*SelectBy)
   975  	// By
   976  	switch x := m.By.(type) {
   977  	case *SelectBy_ID:
   978  		n += 1 // tag and wire
   979  		n += proto.SizeVarint(uint64(len(x.ID)))
   980  		n += len(x.ID)
   981  	case *SelectBy_IDPrefix:
   982  		n += 1 // tag and wire
   983  		n += proto.SizeVarint(uint64(len(x.IDPrefix)))
   984  		n += len(x.IDPrefix)
   985  	case *SelectBy_Name:
   986  		n += 1 // tag and wire
   987  		n += proto.SizeVarint(uint64(len(x.Name)))
   988  		n += len(x.Name)
   989  	case *SelectBy_NamePrefix:
   990  		n += 1 // tag and wire
   991  		n += proto.SizeVarint(uint64(len(x.NamePrefix)))
   992  		n += len(x.NamePrefix)
   993  	case *SelectBy_Custom:
   994  		s := proto.Size(x.Custom)
   995  		n += 1 // tag and wire
   996  		n += proto.SizeVarint(uint64(s))
   997  		n += s
   998  	case *SelectBy_CustomPrefix:
   999  		s := proto.Size(x.CustomPrefix)
  1000  		n += 1 // tag and wire
  1001  		n += proto.SizeVarint(uint64(s))
  1002  		n += s
  1003  	case *SelectBy_ServiceID:
  1004  		n += 1 // tag and wire
  1005  		n += proto.SizeVarint(uint64(len(x.ServiceID)))
  1006  		n += len(x.ServiceID)
  1007  	case *SelectBy_NodeID:
  1008  		n += 1 // tag and wire
  1009  		n += proto.SizeVarint(uint64(len(x.NodeID)))
  1010  		n += len(x.NodeID)
  1011  	case *SelectBy_Slot:
  1012  		s := proto.Size(x.Slot)
  1013  		n += 1 // tag and wire
  1014  		n += proto.SizeVarint(uint64(s))
  1015  		n += s
  1016  	case *SelectBy_DesiredState:
  1017  		n += 1 // tag and wire
  1018  		n += proto.SizeVarint(uint64(x.DesiredState))
  1019  	case *SelectBy_Role:
  1020  		n += 1 // tag and wire
  1021  		n += proto.SizeVarint(uint64(x.Role))
  1022  	case *SelectBy_Membership:
  1023  		n += 1 // tag and wire
  1024  		n += proto.SizeVarint(uint64(x.Membership))
  1025  	case *SelectBy_ReferencedNetworkID:
  1026  		n += 1 // tag and wire
  1027  		n += proto.SizeVarint(uint64(len(x.ReferencedNetworkID)))
  1028  		n += len(x.ReferencedNetworkID)
  1029  	case *SelectBy_ReferencedSecretID:
  1030  		n += 1 // tag and wire
  1031  		n += proto.SizeVarint(uint64(len(x.ReferencedSecretID)))
  1032  		n += len(x.ReferencedSecretID)
  1033  	case *SelectBy_ReferencedConfigID:
  1034  		n += 2 // tag and wire
  1035  		n += proto.SizeVarint(uint64(len(x.ReferencedConfigID)))
  1036  		n += len(x.ReferencedConfigID)
  1037  	case *SelectBy_Kind:
  1038  		n += 1 // tag and wire
  1039  		n += proto.SizeVarint(uint64(len(x.Kind)))
  1040  		n += len(x.Kind)
  1041  	case nil:
  1042  	default:
  1043  		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  1044  	}
  1045  	return n
  1046  }
  1047  
  1048  type WatchRequest struct {
  1049  	// Multiple entries are combined using OR logic - i.e. if an event
  1050  	// matches all of the selectors specified in any single watch entry,
  1051  	// the event will be sent to the client.
  1052  	Entries []*WatchRequest_WatchEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
  1053  	// ResumeFrom provides an version to resume the watch from, if non-nil.
  1054  	// The watch will return changes since this version, and continue to
  1055  	// return new changes afterwards. Watch will return an error if the
  1056  	// server has compacted its log and no longer has complete history to
  1057  	// this point.
  1058  	ResumeFrom *Version `protobuf:"bytes,2,opt,name=resume_from,json=resumeFrom,proto3" json:"resume_from,omitempty"`
  1059  	// IncludeOldObject causes WatchMessages to include a copy of the
  1060  	// previous version of the object on updates. Note that only live
  1061  	// changes will include the old object (not historical changes
  1062  	// retrieved using ResumeFrom).
  1063  	IncludeOldObject bool `protobuf:"varint,3,opt,name=include_old_object,json=includeOldObject,proto3" json:"include_old_object,omitempty"`
  1064  }
  1065  
  1066  func (m *WatchRequest) Reset()      { *m = WatchRequest{} }
  1067  func (*WatchRequest) ProtoMessage() {}
  1068  func (*WatchRequest) Descriptor() ([]byte, []int) {
  1069  	return fileDescriptor_da25266013800cd9, []int{4}
  1070  }
  1071  func (m *WatchRequest) XXX_Unmarshal(b []byte) error {
  1072  	return m.Unmarshal(b)
  1073  }
  1074  func (m *WatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  1075  	if deterministic {
  1076  		return xxx_messageInfo_WatchRequest.Marshal(b, m, deterministic)
  1077  	} else {
  1078  		b = b[:cap(b)]
  1079  		n, err := m.MarshalTo(b)
  1080  		if err != nil {
  1081  			return nil, err
  1082  		}
  1083  		return b[:n], nil
  1084  	}
  1085  }
  1086  func (m *WatchRequest) XXX_Merge(src proto.Message) {
  1087  	xxx_messageInfo_WatchRequest.Merge(m, src)
  1088  }
  1089  func (m *WatchRequest) XXX_Size() int {
  1090  	return m.Size()
  1091  }
  1092  func (m *WatchRequest) XXX_DiscardUnknown() {
  1093  	xxx_messageInfo_WatchRequest.DiscardUnknown(m)
  1094  }
  1095  
  1096  var xxx_messageInfo_WatchRequest proto.InternalMessageInfo
  1097  
  1098  type WatchRequest_WatchEntry struct {
  1099  	// Kind can contain a builtin type such as "node", "secret", etc. or
  1100  	// the kind specified by a custom-defined object.
  1101  	Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
  1102  	// Action (create/update/delete)
  1103  	// This is a bitmask, so multiple actions may be OR'd together
  1104  	Action WatchActionKind `protobuf:"varint,2,opt,name=action,proto3,enum=docker.swarmkit.v1.WatchActionKind" json:"action,omitempty"`
  1105  	// Filters are combined using AND logic - an event must match
  1106  	// all of them to pass the filter.
  1107  	Filters []*SelectBy `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters,omitempty"`
  1108  }
  1109  
  1110  func (m *WatchRequest_WatchEntry) Reset()      { *m = WatchRequest_WatchEntry{} }
  1111  func (*WatchRequest_WatchEntry) ProtoMessage() {}
  1112  func (*WatchRequest_WatchEntry) Descriptor() ([]byte, []int) {
  1113  	return fileDescriptor_da25266013800cd9, []int{4, 0}
  1114  }
  1115  func (m *WatchRequest_WatchEntry) XXX_Unmarshal(b []byte) error {
  1116  	return m.Unmarshal(b)
  1117  }
  1118  func (m *WatchRequest_WatchEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  1119  	if deterministic {
  1120  		return xxx_messageInfo_WatchRequest_WatchEntry.Marshal(b, m, deterministic)
  1121  	} else {
  1122  		b = b[:cap(b)]
  1123  		n, err := m.MarshalTo(b)
  1124  		if err != nil {
  1125  			return nil, err
  1126  		}
  1127  		return b[:n], nil
  1128  	}
  1129  }
  1130  func (m *WatchRequest_WatchEntry) XXX_Merge(src proto.Message) {
  1131  	xxx_messageInfo_WatchRequest_WatchEntry.Merge(m, src)
  1132  }
  1133  func (m *WatchRequest_WatchEntry) XXX_Size() int {
  1134  	return m.Size()
  1135  }
  1136  func (m *WatchRequest_WatchEntry) XXX_DiscardUnknown() {
  1137  	xxx_messageInfo_WatchRequest_WatchEntry.DiscardUnknown(m)
  1138  }
  1139  
  1140  var xxx_messageInfo_WatchRequest_WatchEntry proto.InternalMessageInfo
  1141  
  1142  // WatchMessage is the type of the stream that's returned to the client by
  1143  // Watch. Note that the first item of this stream will always be a WatchMessage
  1144  // with a nil Object, to signal that the stream has started.
  1145  type WatchMessage struct {
  1146  	Events []*WatchMessage_Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
  1147  	// Index versions this change to the data store. It can be used to
  1148  	// resume the watch from this point.
  1149  	Version *Version `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
  1150  }
  1151  
  1152  func (m *WatchMessage) Reset()      { *m = WatchMessage{} }
  1153  func (*WatchMessage) ProtoMessage() {}
  1154  func (*WatchMessage) Descriptor() ([]byte, []int) {
  1155  	return fileDescriptor_da25266013800cd9, []int{5}
  1156  }
  1157  func (m *WatchMessage) XXX_Unmarshal(b []byte) error {
  1158  	return m.Unmarshal(b)
  1159  }
  1160  func (m *WatchMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  1161  	if deterministic {
  1162  		return xxx_messageInfo_WatchMessage.Marshal(b, m, deterministic)
  1163  	} else {
  1164  		b = b[:cap(b)]
  1165  		n, err := m.MarshalTo(b)
  1166  		if err != nil {
  1167  			return nil, err
  1168  		}
  1169  		return b[:n], nil
  1170  	}
  1171  }
  1172  func (m *WatchMessage) XXX_Merge(src proto.Message) {
  1173  	xxx_messageInfo_WatchMessage.Merge(m, src)
  1174  }
  1175  func (m *WatchMessage) XXX_Size() int {
  1176  	return m.Size()
  1177  }
  1178  func (m *WatchMessage) XXX_DiscardUnknown() {
  1179  	xxx_messageInfo_WatchMessage.DiscardUnknown(m)
  1180  }
  1181  
  1182  var xxx_messageInfo_WatchMessage proto.InternalMessageInfo
  1183  
  1184  type WatchMessage_Event struct {
  1185  	// Action (create/update/delete)
  1186  	// Note that WatchMessage does not expose "commit" events that
  1187  	// mark transaction boundaries.
  1188  	Action WatchActionKind `protobuf:"varint,1,opt,name=action,proto3,enum=docker.swarmkit.v1.WatchActionKind" json:"action,omitempty"`
  1189  	// Matched object
  1190  	Object *Object `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"`
  1191  	// For updates, OldObject will optionally be included in the
  1192  	// watch message, containing the previous version of the
  1193  	// object, if IncludeOldObject was set in WatchRequest.
  1194  	OldObject *Object `protobuf:"bytes,3,opt,name=old_object,json=oldObject,proto3" json:"old_object,omitempty"`
  1195  }
  1196  
  1197  func (m *WatchMessage_Event) Reset()      { *m = WatchMessage_Event{} }
  1198  func (*WatchMessage_Event) ProtoMessage() {}
  1199  func (*WatchMessage_Event) Descriptor() ([]byte, []int) {
  1200  	return fileDescriptor_da25266013800cd9, []int{5, 0}
  1201  }
  1202  func (m *WatchMessage_Event) XXX_Unmarshal(b []byte) error {
  1203  	return m.Unmarshal(b)
  1204  }
  1205  func (m *WatchMessage_Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  1206  	if deterministic {
  1207  		return xxx_messageInfo_WatchMessage_Event.Marshal(b, m, deterministic)
  1208  	} else {
  1209  		b = b[:cap(b)]
  1210  		n, err := m.MarshalTo(b)
  1211  		if err != nil {
  1212  			return nil, err
  1213  		}
  1214  		return b[:n], nil
  1215  	}
  1216  }
  1217  func (m *WatchMessage_Event) XXX_Merge(src proto.Message) {
  1218  	xxx_messageInfo_WatchMessage_Event.Merge(m, src)
  1219  }
  1220  func (m *WatchMessage_Event) XXX_Size() int {
  1221  	return m.Size()
  1222  }
  1223  func (m *WatchMessage_Event) XXX_DiscardUnknown() {
  1224  	xxx_messageInfo_WatchMessage_Event.DiscardUnknown(m)
  1225  }
  1226  
  1227  var xxx_messageInfo_WatchMessage_Event proto.InternalMessageInfo
  1228  
  1229  func init() {
  1230  	proto.RegisterEnum("docker.swarmkit.v1.WatchActionKind", WatchActionKind_name, WatchActionKind_value)
  1231  	proto.RegisterType((*Object)(nil), "docker.swarmkit.v1.Object")
  1232  	proto.RegisterType((*SelectBySlot)(nil), "docker.swarmkit.v1.SelectBySlot")
  1233  	proto.RegisterType((*SelectByCustom)(nil), "docker.swarmkit.v1.SelectByCustom")
  1234  	proto.RegisterType((*SelectBy)(nil), "docker.swarmkit.v1.SelectBy")
  1235  	proto.RegisterType((*WatchRequest)(nil), "docker.swarmkit.v1.WatchRequest")
  1236  	proto.RegisterType((*WatchRequest_WatchEntry)(nil), "docker.swarmkit.v1.WatchRequest.WatchEntry")
  1237  	proto.RegisterType((*WatchMessage)(nil), "docker.swarmkit.v1.WatchMessage")
  1238  	proto.RegisterType((*WatchMessage_Event)(nil), "docker.swarmkit.v1.WatchMessage.Event")
  1239  }
  1240  
  1241  func init() {
  1242  	proto.RegisterFile("github.com/docker/swarmkit/api/watch.proto", fileDescriptor_da25266013800cd9)
  1243  }
  1244  
  1245  var fileDescriptor_da25266013800cd9 = []byte{
  1246  	// 1199 bytes of a gzipped FileDescriptorProto
  1247  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x96, 0xbd, 0x73, 0x1b, 0xc5,
  1248  	0x1b, 0xc7, 0xef, 0x14, 0xf9, 0x24, 0x3d, 0xb6, 0x13, 0xcf, 0xc6, 0x49, 0xee, 0xa7, 0x5f, 0x90,
  1249  	0x85, 0x78, 0xcb, 0x24, 0x41, 0x06, 0x13, 0x92, 0x01, 0x02, 0x33, 0x96, 0x2c, 0x46, 0x22, 0xe3,
  1250  	0x97, 0x59, 0xdb, 0x49, 0xa9, 0x39, 0xdf, 0x3d, 0x56, 0x0e, 0xdf, 0xdd, 0x8a, 0xbd, 0x93, 0x1d,
  1251  	0x77, 0x14, 0x14, 0x4c, 0x2a, 0x1a, 0x66, 0x68, 0x52, 0x41, 0x4d, 0x43, 0x07, 0xff, 0x40, 0x86,
  1252  	0x2a, 0x65, 0x68, 0x3c, 0x44, 0xe9, 0x28, 0xf8, 0x0b, 0x28, 0x98, 0x7d, 0x39, 0xdb, 0x51, 0x4e,
  1253  	0x36, 0xa9, 0xb4, 0xb7, 0xf7, 0xf9, 0x3e, 0xfb, 0xec, 0xf3, 0x76, 0x82, 0xab, 0x3d, 0x3f, 0xb9,
  1254  	0x3f, 0xd8, 0xaa, 0xbb, 0x2c, 0x9c, 0xf7, 0x98, 0xbb, 0x83, 0x7c, 0x3e, 0xde, 0x73, 0x78, 0xb8,
  1255  	0xe3, 0x27, 0xf3, 0x4e, 0xdf, 0x9f, 0xdf, 0x73, 0x12, 0xf7, 0x7e, 0xbd, 0xcf, 0x59, 0xc2, 0x08,
  1256  	0x51, 0x40, 0x3d, 0x05, 0xea, 0xbb, 0xef, 0x97, 0x4f, 0xd3, 0xc7, 0x7d, 0x74, 0x63, 0xa5, 0x2f,
  1257  	0x5f, 0x3f, 0x85, 0x65, 0x5b, 0x5f, 0xa2, 0x9b, 0xa4, 0xf4, 0x69, 0x96, 0x93, 0xfd, 0x3e, 0xa6,
  1258  	0xec, 0x6c, 0x8f, 0xf5, 0x98, 0x5c, 0xce, 0x8b, 0x95, 0xde, 0xbd, 0x75, 0x82, 0x05, 0x49, 0x6c,
  1259  	0x0d, 0xb6, 0xe7, 0xfb, 0xc1, 0xa0, 0xe7, 0x47, 0xfa, 0x47, 0x09, 0x6b, 0xdf, 0xe4, 0xc1, 0x5a,
  1260  	0x95, 0xce, 0x90, 0x3a, 0xe4, 0x23, 0xe6, 0xa1, 0x6d, 0x56, 0xcd, 0x2b, 0x93, 0x0b, 0x76, 0xfd,
  1261  	0xe5, 0x10, 0xd4, 0x57, 0x98, 0x87, 0x6d, 0x83, 0x4a, 0x8e, 0xdc, 0x82, 0x42, 0x8c, 0x7c, 0xd7,
  1262  	0x77, 0xd1, 0xce, 0x49, 0xc9, 0xff, 0xb3, 0x24, 0xeb, 0x0a, 0x69, 0x1b, 0x34, 0xa5, 0x85, 0x30,
  1263  	0xc2, 0x64, 0x8f, 0xf1, 0x1d, 0xfb, 0xcc, 0x78, 0xe1, 0x8a, 0x42, 0x84, 0x50, 0xd3, 0xc2, 0xc3,
  1264  	0xc4, 0x89, 0x77, 0xec, 0xfc, 0x78, 0x0f, 0x37, 0x9c, 0x58, 0x48, 0x24, 0x27, 0x0e, 0x72, 0x83,
  1265  	0x41, 0x9c, 0x20, 0xb7, 0x27, 0xc6, 0x1f, 0xd4, 0x54, 0x88, 0x38, 0x48, 0xd3, 0xe4, 0x06, 0x58,
  1266  	0x31, 0xba, 0x1c, 0x13, 0xdb, 0x92, 0xba, 0x72, 0xf6, 0xcd, 0x04, 0xd1, 0x36, 0xa8, 0x66, 0xc9,
  1267  	0xc7, 0x50, 0xe4, 0x18, 0xb3, 0x01, 0x77, 0xd1, 0x2e, 0x48, 0xdd, 0xe5, 0x2c, 0x1d, 0xd5, 0x4c,
  1268  	0xdb, 0xa0, 0x87, 0x3c, 0xf9, 0x14, 0x4a, 0xf8, 0x20, 0xc1, 0x28, 0xf6, 0x59, 0x64, 0x17, 0xa5,
  1269  	0xf8, 0xb5, 0x2c, 0x71, 0x2b, 0x85, 0xda, 0x06, 0x3d, 0x52, 0x08, 0x87, 0x5d, 0x16, 0x6d, 0xfb,
  1270  	0x3d, 0xbb, 0x34, 0xde, 0xe1, 0xa6, 0x24, 0x84, 0xc3, 0x8a, 0x6d, 0x14, 0xd3, 0xdc, 0xd7, 0xd6,
  1271  	0x60, 0x6a, 0x1d, 0x03, 0x74, 0x93, 0xc6, 0xfe, 0x7a, 0xc0, 0x12, 0x72, 0x1d, 0x40, 0x67, 0xab,
  1272  	0xeb, 0x7b, 0xb2, 0x22, 0x4a, 0x8d, 0xe9, 0xe1, 0xc1, 0x5c, 0x49, 0xa7, 0xb3, 0xb3, 0x44, 0x4b,
  1273  	0x1a, 0xe8, 0x78, 0x84, 0x40, 0x3e, 0x0e, 0x58, 0x22, 0xcb, 0x20, 0x4f, 0xe5, 0xba, 0xb6, 0x06,
  1274  	0x67, 0x53, 0x8b, 0xcd, 0x41, 0x9c, 0xb0, 0x50, 0x50, 0x3b, 0x7e, 0xa4, 0xad, 0x51, 0xb9, 0x26,
  1275  	0xb3, 0x30, 0xe1, 0x47, 0x1e, 0x3e, 0x90, 0xd2, 0x12, 0x55, 0x0f, 0x62, 0x77, 0xd7, 0x09, 0x06,
  1276  	0x28, 0xcb, 0xa3, 0x44, 0xd5, 0x43, 0xed, 0x2f, 0x0b, 0x8a, 0xa9, 0x49, 0x62, 0x43, 0xee, 0xd0,
  1277  	0x31, 0x6b, 0x78, 0x30, 0x97, 0xeb, 0x2c, 0xb5, 0x0d, 0x9a, 0xf3, 0x3d, 0x72, 0x0d, 0x4a, 0xbe,
  1278  	0xd7, 0xed, 0x73, 0xdc, 0xf6, 0xb5, 0xd9, 0xc6, 0xd4, 0xf0, 0x60, 0xae, 0xd8, 0x59, 0x5a, 0x93,
  1279  	0x7b, 0x22, 0xec, 0xbe, 0xa7, 0xd6, 0x64, 0x16, 0xf2, 0x91, 0x13, 0xea, 0x83, 0x64, 0x65, 0x3b,
  1280  	0x21, 0x92, 0xd7, 0x61, 0x52, 0xfc, 0xa6, 0x46, 0xf2, 0xfa, 0x25, 0x88, 0x4d, 0x2d, 0xbc, 0x0d,
  1281  	0x96, 0x2b, 0xaf, 0xa5, 0x2b, 0xab, 0x96, 0x5d, 0x21, 0xc7, 0x03, 0x20, 0x03, 0xaf, 0x42, 0xd1,
  1282  	0x81, 0x69, 0xb5, 0x4a, 0x8f, 0xb0, 0x5e, 0xc1, 0xc8, 0x94, 0x92, 0x6a, 0x47, 0xea, 0x2f, 0x64,
  1283  	0xaa, 0x90, 0x91, 0x29, 0x51, 0x29, 0x47, 0xb9, 0x7a, 0x0b, 0x0a, 0xa2, 0x7b, 0x05, 0x5c, 0x94,
  1284  	0x30, 0x0c, 0x0f, 0xe6, 0x2c, 0xd1, 0xd8, 0x92, 0xb4, 0xc4, 0xcb, 0x8e, 0x47, 0x6e, 0xea, 0x94,
  1285  	0xaa, 0x72, 0xaa, 0x9e, 0xe4, 0x98, 0x28, 0x18, 0x11, 0x3a, 0xc1, 0x93, 0x25, 0x98, 0xf6, 0x30,
  1286  	0xf6, 0x39, 0x7a, 0xdd, 0x38, 0x71, 0x12, 0xb4, 0xa1, 0x6a, 0x5e, 0x39, 0x9b, 0x5d, 0xcb, 0xa2,
  1287  	0x57, 0xd7, 0x05, 0x24, 0x2e, 0xa5, 0x55, 0xf2, 0x99, 0x2c, 0x40, 0x9e, 0xb3, 0x00, 0xed, 0x49,
  1288  	0x29, 0xbe, 0x3c, 0x6e, 0x14, 0x51, 0x16, 0xc8, 0x71, 0x24, 0x58, 0xd2, 0x01, 0x08, 0x31, 0xdc,
  1289  	0x42, 0x1e, 0xdf, 0xf7, 0xfb, 0xf6, 0x94, 0x54, 0xbe, 0x33, 0x4e, 0xb9, 0xde, 0x47, 0xb7, 0xbe,
  1290  	0x7c, 0x88, 0x8b, 0xe4, 0x1e, 0x89, 0xc9, 0x32, 0x5c, 0xe0, 0xb8, 0x8d, 0x1c, 0x23, 0x17, 0xbd,
  1291  	0xae, 0x9e, 0x3e, 0x22, 0x62, 0xd3, 0x32, 0x62, 0x97, 0x86, 0x07, 0x73, 0xe7, 0xe9, 0x21, 0xa0,
  1292  	0x07, 0x95, 0x0c, 0xdf, 0x79, 0xfe, 0xd2, 0xb6, 0x47, 0xbe, 0x80, 0xd9, 0x63, 0xe6, 0xd4, 0xb0,
  1293  	0x10, 0xd6, 0xce, 0x4a, 0x6b, 0x17, 0x87, 0x07, 0x73, 0xe4, 0xc8, 0x9a, 0x9a, 0x2a, 0xd2, 0x18,
  1294  	0xe1, 0xa3, 0xbb, 0xa3, 0xb6, 0x54, 0x1f, 0x0b, 0x5b, 0x33, 0x59, 0xb6, 0x54, 0xc3, 0x8f, 0xda,
  1295  	0xd2, 0xbb, 0xa2, 0xf9, 0x54, 0x43, 0x9e, 0x4b, 0x8b, 0x5f, 0x3c, 0x35, 0xf2, 0x90, 0x6b, 0xec,
  1296  	0xd7, 0xfe, 0xc8, 0xc1, 0xd4, 0x3d, 0xf1, 0x41, 0xa4, 0xf8, 0xd5, 0x00, 0xe3, 0x84, 0xb4, 0xa0,
  1297  	0x80, 0x51, 0xc2, 0x7d, 0x8c, 0x6d, 0xb3, 0x7a, 0xe6, 0xca, 0xe4, 0xc2, 0xb5, 0xac, 0xd8, 0x1e,
  1298  	0x97, 0xa8, 0x87, 0x56, 0x94, 0xf0, 0x7d, 0x9a, 0x6a, 0xc9, 0x6d, 0x98, 0xe4, 0x18, 0x0f, 0x42,
  1299  	0xec, 0x6e, 0x73, 0x16, 0x9e, 0xf4, 0xe1, 0xb8, 0x8b, 0x5c, 0x8c, 0x36, 0x0a, 0x8a, 0xff, 0x9c,
  1300  	0xb3, 0x90, 0x5c, 0x07, 0xe2, 0x47, 0x6e, 0x30, 0xf0, 0xb0, 0xcb, 0x02, 0xaf, 0xab, 0xbe, 0xa2,
  1301  	0xb2, 0x79, 0x8b, 0x74, 0x46, 0xbf, 0x59, 0x0d, 0x3c, 0x35, 0xd4, 0xca, 0xdf, 0x9b, 0x00, 0x47,
  1302  	0x3e, 0x64, 0xce, 0x9f, 0x4f, 0xc0, 0x72, 0xdc, 0x44, 0xcc, 0xdc, 0x9c, 0x2c, 0x98, 0x37, 0xc6,
  1303  	0x5e, 0x6a, 0x51, 0x62, 0x77, 0xfc, 0xc8, 0xa3, 0x5a, 0x42, 0x6e, 0x42, 0x61, 0xdb, 0x0f, 0x12,
  1304  	0xe4, 0xb1, 0x7d, 0x46, 0x86, 0xe4, 0xf2, 0x49, 0x6d, 0x42, 0x53, 0xb8, 0xf6, 0x5b, 0x1a, 0xdb,
  1305  	0x65, 0x8c, 0x63, 0xa7, 0x87, 0xe4, 0x33, 0xb0, 0x70, 0x17, 0xa3, 0x24, 0x0d, 0xed, 0xdb, 0x63,
  1306  	0xbd, 0xd0, 0x8a, 0x7a, 0x4b, 0xe0, 0x54, 0xab, 0xc8, 0x87, 0x50, 0xd8, 0x55, 0xd1, 0xfa, 0x2f,
  1307  	0x01, 0x4d, 0xd9, 0xf2, 0x2f, 0x26, 0x4c, 0x48, 0x43, 0xc7, 0xc2, 0x60, 0xbe, 0x7a, 0x18, 0x16,
  1308  	0xc0, 0xd2, 0x89, 0xc8, 0x8d, 0xff, 0xf6, 0xa8, 0x94, 0x50, 0x4d, 0x92, 0x8f, 0x00, 0x46, 0x12,
  1309  	0x78, 0xb2, 0xae, 0xc4, 0xd2, 0xac, 0x5e, 0xfd, 0xc7, 0x84, 0x73, 0x23, 0xae, 0x90, 0x1b, 0x30,
  1310  	0x7b, 0x6f, 0x71, 0xa3, 0xd9, 0xee, 0x2e, 0x36, 0x37, 0x3a, 0xab, 0x2b, 0xdd, 0xcd, 0x95, 0x3b,
  1311  	0x2b, 0xab, 0xf7, 0x56, 0x66, 0x8c, 0x72, 0xf9, 0xe1, 0xa3, 0xea, 0xc5, 0x11, 0x7c, 0x33, 0xda,
  1312  	0x89, 0xd8, 0x9e, 0x70, 0xfc, 0xfc, 0x0b, 0xaa, 0x26, 0x6d, 0x2d, 0x6e, 0xb4, 0x66, 0xcc, 0xf2,
  1313  	0xff, 0x1e, 0x3e, 0xaa, 0x5e, 0x18, 0x11, 0x35, 0x39, 0xaa, 0xc9, 0xf4, 0xa2, 0x66, 0x73, 0x6d,
  1314  	0x49, 0x68, 0x72, 0x99, 0x9a, 0xcd, 0xbe, 0x97, 0xa5, 0xa1, 0xad, 0xe5, 0xd5, 0xbb, 0xad, 0x99,
  1315  	0x7c, 0xa6, 0x86, 0x62, 0xc8, 0x76, 0xb1, 0x7c, 0xe9, 0xdb, 0x1f, 0x2b, 0xc6, 0xaf, 0x3f, 0x55,
  1316  	0x46, 0xaf, 0xba, 0x10, 0xc2, 0x84, 0xdc, 0x22, 0x5e, 0xba, 0xa8, 0x9e, 0xd6, 0x88, 0xe5, 0xea,
  1317  	0x69, 0xf5, 0x54, 0xbb, 0xf0, 0xfb, 0xcf, 0x7f, 0xff, 0x90, 0x3b, 0x07, 0xd3, 0x92, 0x78, 0x37,
  1318  	0x74, 0x22, 0xa7, 0x87, 0xfc, 0x3d, 0xb3, 0xf1, 0xe6, 0xe3, 0x67, 0x15, 0xe3, 0xe9, 0xb3, 0x8a,
  1319  	0xf1, 0xf5, 0xb0, 0x62, 0x3e, 0x1e, 0x56, 0xcc, 0x27, 0xc3, 0x8a, 0xf9, 0xe7, 0xb0, 0x62, 0x7e,
  1320  	0xf7, 0xbc, 0x62, 0x3c, 0x79, 0x5e, 0x31, 0x9e, 0x3e, 0xaf, 0x18, 0x5b, 0x96, 0xfc, 0x33, 0xf9,
  1321  	0xc1, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x96, 0x4e, 0x58, 0x61, 0x63, 0x0b, 0x00, 0x00,
  1322  }
  1323  
  1324  type authenticatedWrapperWatchServer struct {
  1325  	local     WatchServer
  1326  	authorize func(context.Context, []string) error
  1327  }
  1328  
  1329  func NewAuthenticatedWrapperWatchServer(local WatchServer, authorize func(context.Context, []string) error) WatchServer {
  1330  	return &authenticatedWrapperWatchServer{
  1331  		local:     local,
  1332  		authorize: authorize,
  1333  	}
  1334  }
  1335  
  1336  func (p *authenticatedWrapperWatchServer) Watch(r *WatchRequest, stream Watch_WatchServer) error {
  1337  
  1338  	if err := p.authorize(stream.Context(), []string{"swarm-manager"}); err != nil {
  1339  		return err
  1340  	}
  1341  	return p.local.Watch(r, stream)
  1342  }
  1343  
  1344  func (m *Object) Copy() *Object {
  1345  	if m == nil {
  1346  		return nil
  1347  	}
  1348  	o := &Object{}
  1349  	o.CopyFrom(m)
  1350  	return o
  1351  }
  1352  
  1353  func (m *Object) CopyFrom(src interface{}) {
  1354  
  1355  	o := src.(*Object)
  1356  	*m = *o
  1357  	if o.Object != nil {
  1358  		switch o.Object.(type) {
  1359  		case *Object_Node:
  1360  			v := Object_Node{
  1361  				Node: &Node{},
  1362  			}
  1363  			github_com_docker_swarmkit_api_deepcopy.Copy(v.Node, o.GetNode())
  1364  			m.Object = &v
  1365  		case *Object_Service:
  1366  			v := Object_Service{
  1367  				Service: &Service{},
  1368  			}
  1369  			github_com_docker_swarmkit_api_deepcopy.Copy(v.Service, o.GetService())
  1370  			m.Object = &v
  1371  		case *Object_Network:
  1372  			v := Object_Network{
  1373  				Network: &Network{},
  1374  			}
  1375  			github_com_docker_swarmkit_api_deepcopy.Copy(v.Network, o.GetNetwork())
  1376  			m.Object = &v
  1377  		case *Object_Task:
  1378  			v := Object_Task{
  1379  				Task: &Task{},
  1380  			}
  1381  			github_com_docker_swarmkit_api_deepcopy.Copy(v.Task, o.GetTask())
  1382  			m.Object = &v
  1383  		case *Object_Cluster:
  1384  			v := Object_Cluster{
  1385  				Cluster: &Cluster{},
  1386  			}
  1387  			github_com_docker_swarmkit_api_deepcopy.Copy(v.Cluster, o.GetCluster())
  1388  			m.Object = &v
  1389  		case *Object_Secret:
  1390  			v := Object_Secret{
  1391  				Secret: &Secret{},
  1392  			}
  1393  			github_com_docker_swarmkit_api_deepcopy.Copy(v.Secret, o.GetSecret())
  1394  			m.Object = &v
  1395  		case *Object_Resource:
  1396  			v := Object_Resource{
  1397  				Resource: &Resource{},
  1398  			}
  1399  			github_com_docker_swarmkit_api_deepcopy.Copy(v.Resource, o.GetResource())
  1400  			m.Object = &v
  1401  		case *Object_Extension:
  1402  			v := Object_Extension{
  1403  				Extension: &Extension{},
  1404  			}
  1405  			github_com_docker_swarmkit_api_deepcopy.Copy(v.Extension, o.GetExtension())
  1406  			m.Object = &v
  1407  		case *Object_Config:
  1408  			v := Object_Config{
  1409  				Config: &Config{},
  1410  			}
  1411  			github_com_docker_swarmkit_api_deepcopy.Copy(v.Config, o.GetConfig())
  1412  			m.Object = &v
  1413  		}
  1414  	}
  1415  
  1416  }
  1417  
  1418  func (m *SelectBySlot) Copy() *SelectBySlot {
  1419  	if m == nil {
  1420  		return nil
  1421  	}
  1422  	o := &SelectBySlot{}
  1423  	o.CopyFrom(m)
  1424  	return o
  1425  }
  1426  
  1427  func (m *SelectBySlot) CopyFrom(src interface{}) {
  1428  
  1429  	o := src.(*SelectBySlot)
  1430  	*m = *o
  1431  }
  1432  
  1433  func (m *SelectByCustom) Copy() *SelectByCustom {
  1434  	if m == nil {
  1435  		return nil
  1436  	}
  1437  	o := &SelectByCustom{}
  1438  	o.CopyFrom(m)
  1439  	return o
  1440  }
  1441  
  1442  func (m *SelectByCustom) CopyFrom(src interface{}) {
  1443  
  1444  	o := src.(*SelectByCustom)
  1445  	*m = *o
  1446  }
  1447  
  1448  func (m *SelectBy) Copy() *SelectBy {
  1449  	if m == nil {
  1450  		return nil
  1451  	}
  1452  	o := &SelectBy{}
  1453  	o.CopyFrom(m)
  1454  	return o
  1455  }
  1456  
  1457  func (m *SelectBy) CopyFrom(src interface{}) {
  1458  
  1459  	o := src.(*SelectBy)
  1460  	*m = *o
  1461  	if o.By != nil {
  1462  		switch o.By.(type) {
  1463  		case *SelectBy_ID:
  1464  			v := SelectBy_ID{
  1465  				ID: o.GetID(),
  1466  			}
  1467  			m.By = &v
  1468  		case *SelectBy_IDPrefix:
  1469  			v := SelectBy_IDPrefix{
  1470  				IDPrefix: o.GetIDPrefix(),
  1471  			}
  1472  			m.By = &v
  1473  		case *SelectBy_Name:
  1474  			v := SelectBy_Name{
  1475  				Name: o.GetName(),
  1476  			}
  1477  			m.By = &v
  1478  		case *SelectBy_NamePrefix:
  1479  			v := SelectBy_NamePrefix{
  1480  				NamePrefix: o.GetNamePrefix(),
  1481  			}
  1482  			m.By = &v
  1483  		case *SelectBy_Custom:
  1484  			v := SelectBy_Custom{
  1485  				Custom: &SelectByCustom{},
  1486  			}
  1487  			github_com_docker_swarmkit_api_deepcopy.Copy(v.Custom, o.GetCustom())
  1488  			m.By = &v
  1489  		case *SelectBy_CustomPrefix:
  1490  			v := SelectBy_CustomPrefix{
  1491  				CustomPrefix: &SelectByCustom{},
  1492  			}
  1493  			github_com_docker_swarmkit_api_deepcopy.Copy(v.CustomPrefix, o.GetCustomPrefix())
  1494  			m.By = &v
  1495  		case *SelectBy_ServiceID:
  1496  			v := SelectBy_ServiceID{
  1497  				ServiceID: o.GetServiceID(),
  1498  			}
  1499  			m.By = &v
  1500  		case *SelectBy_NodeID:
  1501  			v := SelectBy_NodeID{
  1502  				NodeID: o.GetNodeID(),
  1503  			}
  1504  			m.By = &v
  1505  		case *SelectBy_Slot:
  1506  			v := SelectBy_Slot{
  1507  				Slot: &SelectBySlot{},
  1508  			}
  1509  			github_com_docker_swarmkit_api_deepcopy.Copy(v.Slot, o.GetSlot())
  1510  			m.By = &v
  1511  		case *SelectBy_DesiredState:
  1512  			v := SelectBy_DesiredState{
  1513  				DesiredState: o.GetDesiredState(),
  1514  			}
  1515  			m.By = &v
  1516  		case *SelectBy_Role:
  1517  			v := SelectBy_Role{
  1518  				Role: o.GetRole(),
  1519  			}
  1520  			m.By = &v
  1521  		case *SelectBy_Membership:
  1522  			v := SelectBy_Membership{
  1523  				Membership: o.GetMembership(),
  1524  			}
  1525  			m.By = &v
  1526  		case *SelectBy_ReferencedNetworkID:
  1527  			v := SelectBy_ReferencedNetworkID{
  1528  				ReferencedNetworkID: o.GetReferencedNetworkID(),
  1529  			}
  1530  			m.By = &v
  1531  		case *SelectBy_ReferencedSecretID:
  1532  			v := SelectBy_ReferencedSecretID{
  1533  				ReferencedSecretID: o.GetReferencedSecretID(),
  1534  			}
  1535  			m.By = &v
  1536  		case *SelectBy_ReferencedConfigID:
  1537  			v := SelectBy_ReferencedConfigID{
  1538  				ReferencedConfigID: o.GetReferencedConfigID(),
  1539  			}
  1540  			m.By = &v
  1541  		case *SelectBy_Kind:
  1542  			v := SelectBy_Kind{
  1543  				Kind: o.GetKind(),
  1544  			}
  1545  			m.By = &v
  1546  		}
  1547  	}
  1548  
  1549  }
  1550  
  1551  func (m *WatchRequest) Copy() *WatchRequest {
  1552  	if m == nil {
  1553  		return nil
  1554  	}
  1555  	o := &WatchRequest{}
  1556  	o.CopyFrom(m)
  1557  	return o
  1558  }
  1559  
  1560  func (m *WatchRequest) CopyFrom(src interface{}) {
  1561  
  1562  	o := src.(*WatchRequest)
  1563  	*m = *o
  1564  	if o.Entries != nil {
  1565  		m.Entries = make([]*WatchRequest_WatchEntry, len(o.Entries))
  1566  		for i := range m.Entries {
  1567  			m.Entries[i] = &WatchRequest_WatchEntry{}
  1568  			github_com_docker_swarmkit_api_deepcopy.Copy(m.Entries[i], o.Entries[i])
  1569  		}
  1570  	}
  1571  
  1572  	if o.ResumeFrom != nil {
  1573  		m.ResumeFrom = &Version{}
  1574  		github_com_docker_swarmkit_api_deepcopy.Copy(m.ResumeFrom, o.ResumeFrom)
  1575  	}
  1576  }
  1577  
  1578  func (m *WatchRequest_WatchEntry) Copy() *WatchRequest_WatchEntry {
  1579  	if m == nil {
  1580  		return nil
  1581  	}
  1582  	o := &WatchRequest_WatchEntry{}
  1583  	o.CopyFrom(m)
  1584  	return o
  1585  }
  1586  
  1587  func (m *WatchRequest_WatchEntry) CopyFrom(src interface{}) {
  1588  
  1589  	o := src.(*WatchRequest_WatchEntry)
  1590  	*m = *o
  1591  	if o.Filters != nil {
  1592  		m.Filters = make([]*SelectBy, len(o.Filters))
  1593  		for i := range m.Filters {
  1594  			m.Filters[i] = &SelectBy{}
  1595  			github_com_docker_swarmkit_api_deepcopy.Copy(m.Filters[i], o.Filters[i])
  1596  		}
  1597  	}
  1598  
  1599  }
  1600  
  1601  func (m *WatchMessage) Copy() *WatchMessage {
  1602  	if m == nil {
  1603  		return nil
  1604  	}
  1605  	o := &WatchMessage{}
  1606  	o.CopyFrom(m)
  1607  	return o
  1608  }
  1609  
  1610  func (m *WatchMessage) CopyFrom(src interface{}) {
  1611  
  1612  	o := src.(*WatchMessage)
  1613  	*m = *o
  1614  	if o.Events != nil {
  1615  		m.Events = make([]*WatchMessage_Event, len(o.Events))
  1616  		for i := range m.Events {
  1617  			m.Events[i] = &WatchMessage_Event{}
  1618  			github_com_docker_swarmkit_api_deepcopy.Copy(m.Events[i], o.Events[i])
  1619  		}
  1620  	}
  1621  
  1622  	if o.Version != nil {
  1623  		m.Version = &Version{}
  1624  		github_com_docker_swarmkit_api_deepcopy.Copy(m.Version, o.Version)
  1625  	}
  1626  }
  1627  
  1628  func (m *WatchMessage_Event) Copy() *WatchMessage_Event {
  1629  	if m == nil {
  1630  		return nil
  1631  	}
  1632  	o := &WatchMessage_Event{}
  1633  	o.CopyFrom(m)
  1634  	return o
  1635  }
  1636  
  1637  func (m *WatchMessage_Event) CopyFrom(src interface{}) {
  1638  
  1639  	o := src.(*WatchMessage_Event)
  1640  	*m = *o
  1641  	if o.Object != nil {
  1642  		m.Object = &Object{}
  1643  		github_com_docker_swarmkit_api_deepcopy.Copy(m.Object, o.Object)
  1644  	}
  1645  	if o.OldObject != nil {
  1646  		m.OldObject = &Object{}
  1647  		github_com_docker_swarmkit_api_deepcopy.Copy(m.OldObject, o.OldObject)
  1648  	}
  1649  }
  1650  
  1651  // Reference imports to suppress errors if they are not otherwise used.
  1652  var _ context.Context
  1653  var _ grpc.ClientConn
  1654  
  1655  // This is a compile-time assertion to ensure that this generated file
  1656  // is compatible with the grpc package it is being compiled against.
  1657  const _ = grpc.SupportPackageIsVersion4
  1658  
  1659  // WatchClient is the client API for Watch service.
  1660  //
  1661  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  1662  type WatchClient interface {
  1663  	// Watch starts a stream that returns any changes to objects that match
  1664  	// the specified selectors. When the stream begins, it immediately sends
  1665  	// an empty message back to the client. It is important to wait for
  1666  	// this message before taking any actions that depend on an established
  1667  	// stream of changes for consistency.
  1668  	Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Watch_WatchClient, error)
  1669  }
  1670  
  1671  type watchClient struct {
  1672  	cc *grpc.ClientConn
  1673  }
  1674  
  1675  func NewWatchClient(cc *grpc.ClientConn) WatchClient {
  1676  	return &watchClient{cc}
  1677  }
  1678  
  1679  func (c *watchClient) Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Watch_WatchClient, error) {
  1680  	stream, err := c.cc.NewStream(ctx, &_Watch_serviceDesc.Streams[0], "/docker.swarmkit.v1.Watch/Watch", opts...)
  1681  	if err != nil {
  1682  		return nil, err
  1683  	}
  1684  	x := &watchWatchClient{stream}
  1685  	if err := x.ClientStream.SendMsg(in); err != nil {
  1686  		return nil, err
  1687  	}
  1688  	if err := x.ClientStream.CloseSend(); err != nil {
  1689  		return nil, err
  1690  	}
  1691  	return x, nil
  1692  }
  1693  
  1694  type Watch_WatchClient interface {
  1695  	Recv() (*WatchMessage, error)
  1696  	grpc.ClientStream
  1697  }
  1698  
  1699  type watchWatchClient struct {
  1700  	grpc.ClientStream
  1701  }
  1702  
  1703  func (x *watchWatchClient) Recv() (*WatchMessage, error) {
  1704  	m := new(WatchMessage)
  1705  	if err := x.ClientStream.RecvMsg(m); err != nil {
  1706  		return nil, err
  1707  	}
  1708  	return m, nil
  1709  }
  1710  
  1711  // WatchServer is the server API for Watch service.
  1712  type WatchServer interface {
  1713  	// Watch starts a stream that returns any changes to objects that match
  1714  	// the specified selectors. When the stream begins, it immediately sends
  1715  	// an empty message back to the client. It is important to wait for
  1716  	// this message before taking any actions that depend on an established
  1717  	// stream of changes for consistency.
  1718  	Watch(*WatchRequest, Watch_WatchServer) error
  1719  }
  1720  
  1721  func RegisterWatchServer(s *grpc.Server, srv WatchServer) {
  1722  	s.RegisterService(&_Watch_serviceDesc, srv)
  1723  }
  1724  
  1725  func _Watch_Watch_Handler(srv interface{}, stream grpc.ServerStream) error {
  1726  	m := new(WatchRequest)
  1727  	if err := stream.RecvMsg(m); err != nil {
  1728  		return err
  1729  	}
  1730  	return srv.(WatchServer).Watch(m, &watchWatchServer{stream})
  1731  }
  1732  
  1733  type Watch_WatchServer interface {
  1734  	Send(*WatchMessage) error
  1735  	grpc.ServerStream
  1736  }
  1737  
  1738  type watchWatchServer struct {
  1739  	grpc.ServerStream
  1740  }
  1741  
  1742  func (x *watchWatchServer) Send(m *WatchMessage) error {
  1743  	return x.ServerStream.SendMsg(m)
  1744  }
  1745  
  1746  var _Watch_serviceDesc = grpc.ServiceDesc{
  1747  	ServiceName: "docker.swarmkit.v1.Watch",
  1748  	HandlerType: (*WatchServer)(nil),
  1749  	Methods:     []grpc.MethodDesc{},
  1750  	Streams: []grpc.StreamDesc{
  1751  		{
  1752  			StreamName:    "Watch",
  1753  			Handler:       _Watch_Watch_Handler,
  1754  			ServerStreams: true,
  1755  		},
  1756  	},
  1757  	Metadata: "github.com/docker/swarmkit/api/watch.proto",
  1758  }
  1759  
  1760  func (m *Object) Marshal() (dAtA []byte, err error) {
  1761  	size := m.Size()
  1762  	dAtA = make([]byte, size)
  1763  	n, err := m.MarshalTo(dAtA)
  1764  	if err != nil {
  1765  		return nil, err
  1766  	}
  1767  	return dAtA[:n], nil
  1768  }
  1769  
  1770  func (m *Object) MarshalTo(dAtA []byte) (int, error) {
  1771  	var i int
  1772  	_ = i
  1773  	var l int
  1774  	_ = l
  1775  	if m.Object != nil {
  1776  		nn1, err := m.Object.MarshalTo(dAtA[i:])
  1777  		if err != nil {
  1778  			return 0, err
  1779  		}
  1780  		i += nn1
  1781  	}
  1782  	return i, nil
  1783  }
  1784  
  1785  func (m *Object_Node) MarshalTo(dAtA []byte) (int, error) {
  1786  	i := 0
  1787  	if m.Node != nil {
  1788  		dAtA[i] = 0xa
  1789  		i++
  1790  		i = encodeVarintWatch(dAtA, i, uint64(m.Node.Size()))
  1791  		n2, err := m.Node.MarshalTo(dAtA[i:])
  1792  		if err != nil {
  1793  			return 0, err
  1794  		}
  1795  		i += n2
  1796  	}
  1797  	return i, nil
  1798  }
  1799  func (m *Object_Service) MarshalTo(dAtA []byte) (int, error) {
  1800  	i := 0
  1801  	if m.Service != nil {
  1802  		dAtA[i] = 0x12
  1803  		i++
  1804  		i = encodeVarintWatch(dAtA, i, uint64(m.Service.Size()))
  1805  		n3, err := m.Service.MarshalTo(dAtA[i:])
  1806  		if err != nil {
  1807  			return 0, err
  1808  		}
  1809  		i += n3
  1810  	}
  1811  	return i, nil
  1812  }
  1813  func (m *Object_Network) MarshalTo(dAtA []byte) (int, error) {
  1814  	i := 0
  1815  	if m.Network != nil {
  1816  		dAtA[i] = 0x1a
  1817  		i++
  1818  		i = encodeVarintWatch(dAtA, i, uint64(m.Network.Size()))
  1819  		n4, err := m.Network.MarshalTo(dAtA[i:])
  1820  		if err != nil {
  1821  			return 0, err
  1822  		}
  1823  		i += n4
  1824  	}
  1825  	return i, nil
  1826  }
  1827  func (m *Object_Task) MarshalTo(dAtA []byte) (int, error) {
  1828  	i := 0
  1829  	if m.Task != nil {
  1830  		dAtA[i] = 0x22
  1831  		i++
  1832  		i = encodeVarintWatch(dAtA, i, uint64(m.Task.Size()))
  1833  		n5, err := m.Task.MarshalTo(dAtA[i:])
  1834  		if err != nil {
  1835  			return 0, err
  1836  		}
  1837  		i += n5
  1838  	}
  1839  	return i, nil
  1840  }
  1841  func (m *Object_Cluster) MarshalTo(dAtA []byte) (int, error) {
  1842  	i := 0
  1843  	if m.Cluster != nil {
  1844  		dAtA[i] = 0x2a
  1845  		i++
  1846  		i = encodeVarintWatch(dAtA, i, uint64(m.Cluster.Size()))
  1847  		n6, err := m.Cluster.MarshalTo(dAtA[i:])
  1848  		if err != nil {
  1849  			return 0, err
  1850  		}
  1851  		i += n6
  1852  	}
  1853  	return i, nil
  1854  }
  1855  func (m *Object_Secret) MarshalTo(dAtA []byte) (int, error) {
  1856  	i := 0
  1857  	if m.Secret != nil {
  1858  		dAtA[i] = 0x32
  1859  		i++
  1860  		i = encodeVarintWatch(dAtA, i, uint64(m.Secret.Size()))
  1861  		n7, err := m.Secret.MarshalTo(dAtA[i:])
  1862  		if err != nil {
  1863  			return 0, err
  1864  		}
  1865  		i += n7
  1866  	}
  1867  	return i, nil
  1868  }
  1869  func (m *Object_Resource) MarshalTo(dAtA []byte) (int, error) {
  1870  	i := 0
  1871  	if m.Resource != nil {
  1872  		dAtA[i] = 0x3a
  1873  		i++
  1874  		i = encodeVarintWatch(dAtA, i, uint64(m.Resource.Size()))
  1875  		n8, err := m.Resource.MarshalTo(dAtA[i:])
  1876  		if err != nil {
  1877  			return 0, err
  1878  		}
  1879  		i += n8
  1880  	}
  1881  	return i, nil
  1882  }
  1883  func (m *Object_Extension) MarshalTo(dAtA []byte) (int, error) {
  1884  	i := 0
  1885  	if m.Extension != nil {
  1886  		dAtA[i] = 0x42
  1887  		i++
  1888  		i = encodeVarintWatch(dAtA, i, uint64(m.Extension.Size()))
  1889  		n9, err := m.Extension.MarshalTo(dAtA[i:])
  1890  		if err != nil {
  1891  			return 0, err
  1892  		}
  1893  		i += n9
  1894  	}
  1895  	return i, nil
  1896  }
  1897  func (m *Object_Config) MarshalTo(dAtA []byte) (int, error) {
  1898  	i := 0
  1899  	if m.Config != nil {
  1900  		dAtA[i] = 0x4a
  1901  		i++
  1902  		i = encodeVarintWatch(dAtA, i, uint64(m.Config.Size()))
  1903  		n10, err := m.Config.MarshalTo(dAtA[i:])
  1904  		if err != nil {
  1905  			return 0, err
  1906  		}
  1907  		i += n10
  1908  	}
  1909  	return i, nil
  1910  }
  1911  func (m *SelectBySlot) Marshal() (dAtA []byte, err error) {
  1912  	size := m.Size()
  1913  	dAtA = make([]byte, size)
  1914  	n, err := m.MarshalTo(dAtA)
  1915  	if err != nil {
  1916  		return nil, err
  1917  	}
  1918  	return dAtA[:n], nil
  1919  }
  1920  
  1921  func (m *SelectBySlot) MarshalTo(dAtA []byte) (int, error) {
  1922  	var i int
  1923  	_ = i
  1924  	var l int
  1925  	_ = l
  1926  	if len(m.ServiceID) > 0 {
  1927  		dAtA[i] = 0xa
  1928  		i++
  1929  		i = encodeVarintWatch(dAtA, i, uint64(len(m.ServiceID)))
  1930  		i += copy(dAtA[i:], m.ServiceID)
  1931  	}
  1932  	if m.Slot != 0 {
  1933  		dAtA[i] = 0x10
  1934  		i++
  1935  		i = encodeVarintWatch(dAtA, i, uint64(m.Slot))
  1936  	}
  1937  	return i, nil
  1938  }
  1939  
  1940  func (m *SelectByCustom) Marshal() (dAtA []byte, err error) {
  1941  	size := m.Size()
  1942  	dAtA = make([]byte, size)
  1943  	n, err := m.MarshalTo(dAtA)
  1944  	if err != nil {
  1945  		return nil, err
  1946  	}
  1947  	return dAtA[:n], nil
  1948  }
  1949  
  1950  func (m *SelectByCustom) MarshalTo(dAtA []byte) (int, error) {
  1951  	var i int
  1952  	_ = i
  1953  	var l int
  1954  	_ = l
  1955  	if len(m.Kind) > 0 {
  1956  		dAtA[i] = 0xa
  1957  		i++
  1958  		i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind)))
  1959  		i += copy(dAtA[i:], m.Kind)
  1960  	}
  1961  	if len(m.Index) > 0 {
  1962  		dAtA[i] = 0x12
  1963  		i++
  1964  		i = encodeVarintWatch(dAtA, i, uint64(len(m.Index)))
  1965  		i += copy(dAtA[i:], m.Index)
  1966  	}
  1967  	if len(m.Value) > 0 {
  1968  		dAtA[i] = 0x1a
  1969  		i++
  1970  		i = encodeVarintWatch(dAtA, i, uint64(len(m.Value)))
  1971  		i += copy(dAtA[i:], m.Value)
  1972  	}
  1973  	return i, nil
  1974  }
  1975  
  1976  func (m *SelectBy) Marshal() (dAtA []byte, err error) {
  1977  	size := m.Size()
  1978  	dAtA = make([]byte, size)
  1979  	n, err := m.MarshalTo(dAtA)
  1980  	if err != nil {
  1981  		return nil, err
  1982  	}
  1983  	return dAtA[:n], nil
  1984  }
  1985  
  1986  func (m *SelectBy) MarshalTo(dAtA []byte) (int, error) {
  1987  	var i int
  1988  	_ = i
  1989  	var l int
  1990  	_ = l
  1991  	if m.By != nil {
  1992  		nn11, err := m.By.MarshalTo(dAtA[i:])
  1993  		if err != nil {
  1994  			return 0, err
  1995  		}
  1996  		i += nn11
  1997  	}
  1998  	return i, nil
  1999  }
  2000  
  2001  func (m *SelectBy_ID) MarshalTo(dAtA []byte) (int, error) {
  2002  	i := 0
  2003  	dAtA[i] = 0xa
  2004  	i++
  2005  	i = encodeVarintWatch(dAtA, i, uint64(len(m.ID)))
  2006  	i += copy(dAtA[i:], m.ID)
  2007  	return i, nil
  2008  }
  2009  func (m *SelectBy_IDPrefix) MarshalTo(dAtA []byte) (int, error) {
  2010  	i := 0
  2011  	dAtA[i] = 0x12
  2012  	i++
  2013  	i = encodeVarintWatch(dAtA, i, uint64(len(m.IDPrefix)))
  2014  	i += copy(dAtA[i:], m.IDPrefix)
  2015  	return i, nil
  2016  }
  2017  func (m *SelectBy_Name) MarshalTo(dAtA []byte) (int, error) {
  2018  	i := 0
  2019  	dAtA[i] = 0x1a
  2020  	i++
  2021  	i = encodeVarintWatch(dAtA, i, uint64(len(m.Name)))
  2022  	i += copy(dAtA[i:], m.Name)
  2023  	return i, nil
  2024  }
  2025  func (m *SelectBy_NamePrefix) MarshalTo(dAtA []byte) (int, error) {
  2026  	i := 0
  2027  	dAtA[i] = 0x22
  2028  	i++
  2029  	i = encodeVarintWatch(dAtA, i, uint64(len(m.NamePrefix)))
  2030  	i += copy(dAtA[i:], m.NamePrefix)
  2031  	return i, nil
  2032  }
  2033  func (m *SelectBy_Custom) MarshalTo(dAtA []byte) (int, error) {
  2034  	i := 0
  2035  	if m.Custom != nil {
  2036  		dAtA[i] = 0x2a
  2037  		i++
  2038  		i = encodeVarintWatch(dAtA, i, uint64(m.Custom.Size()))
  2039  		n12, err := m.Custom.MarshalTo(dAtA[i:])
  2040  		if err != nil {
  2041  			return 0, err
  2042  		}
  2043  		i += n12
  2044  	}
  2045  	return i, nil
  2046  }
  2047  func (m *SelectBy_CustomPrefix) MarshalTo(dAtA []byte) (int, error) {
  2048  	i := 0
  2049  	if m.CustomPrefix != nil {
  2050  		dAtA[i] = 0x32
  2051  		i++
  2052  		i = encodeVarintWatch(dAtA, i, uint64(m.CustomPrefix.Size()))
  2053  		n13, err := m.CustomPrefix.MarshalTo(dAtA[i:])
  2054  		if err != nil {
  2055  			return 0, err
  2056  		}
  2057  		i += n13
  2058  	}
  2059  	return i, nil
  2060  }
  2061  func (m *SelectBy_ServiceID) MarshalTo(dAtA []byte) (int, error) {
  2062  	i := 0
  2063  	dAtA[i] = 0x3a
  2064  	i++
  2065  	i = encodeVarintWatch(dAtA, i, uint64(len(m.ServiceID)))
  2066  	i += copy(dAtA[i:], m.ServiceID)
  2067  	return i, nil
  2068  }
  2069  func (m *SelectBy_NodeID) MarshalTo(dAtA []byte) (int, error) {
  2070  	i := 0
  2071  	dAtA[i] = 0x42
  2072  	i++
  2073  	i = encodeVarintWatch(dAtA, i, uint64(len(m.NodeID)))
  2074  	i += copy(dAtA[i:], m.NodeID)
  2075  	return i, nil
  2076  }
  2077  func (m *SelectBy_Slot) MarshalTo(dAtA []byte) (int, error) {
  2078  	i := 0
  2079  	if m.Slot != nil {
  2080  		dAtA[i] = 0x4a
  2081  		i++
  2082  		i = encodeVarintWatch(dAtA, i, uint64(m.Slot.Size()))
  2083  		n14, err := m.Slot.MarshalTo(dAtA[i:])
  2084  		if err != nil {
  2085  			return 0, err
  2086  		}
  2087  		i += n14
  2088  	}
  2089  	return i, nil
  2090  }
  2091  func (m *SelectBy_DesiredState) MarshalTo(dAtA []byte) (int, error) {
  2092  	i := 0
  2093  	dAtA[i] = 0x50
  2094  	i++
  2095  	i = encodeVarintWatch(dAtA, i, uint64(m.DesiredState))
  2096  	return i, nil
  2097  }
  2098  func (m *SelectBy_Role) MarshalTo(dAtA []byte) (int, error) {
  2099  	i := 0
  2100  	dAtA[i] = 0x58
  2101  	i++
  2102  	i = encodeVarintWatch(dAtA, i, uint64(m.Role))
  2103  	return i, nil
  2104  }
  2105  func (m *SelectBy_Membership) MarshalTo(dAtA []byte) (int, error) {
  2106  	i := 0
  2107  	dAtA[i] = 0x60
  2108  	i++
  2109  	i = encodeVarintWatch(dAtA, i, uint64(m.Membership))
  2110  	return i, nil
  2111  }
  2112  func (m *SelectBy_ReferencedNetworkID) MarshalTo(dAtA []byte) (int, error) {
  2113  	i := 0
  2114  	dAtA[i] = 0x6a
  2115  	i++
  2116  	i = encodeVarintWatch(dAtA, i, uint64(len(m.ReferencedNetworkID)))
  2117  	i += copy(dAtA[i:], m.ReferencedNetworkID)
  2118  	return i, nil
  2119  }
  2120  func (m *SelectBy_ReferencedSecretID) MarshalTo(dAtA []byte) (int, error) {
  2121  	i := 0
  2122  	dAtA[i] = 0x72
  2123  	i++
  2124  	i = encodeVarintWatch(dAtA, i, uint64(len(m.ReferencedSecretID)))
  2125  	i += copy(dAtA[i:], m.ReferencedSecretID)
  2126  	return i, nil
  2127  }
  2128  func (m *SelectBy_Kind) MarshalTo(dAtA []byte) (int, error) {
  2129  	i := 0
  2130  	dAtA[i] = 0x7a
  2131  	i++
  2132  	i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind)))
  2133  	i += copy(dAtA[i:], m.Kind)
  2134  	return i, nil
  2135  }
  2136  func (m *SelectBy_ReferencedConfigID) MarshalTo(dAtA []byte) (int, error) {
  2137  	i := 0
  2138  	dAtA[i] = 0x82
  2139  	i++
  2140  	dAtA[i] = 0x1
  2141  	i++
  2142  	i = encodeVarintWatch(dAtA, i, uint64(len(m.ReferencedConfigID)))
  2143  	i += copy(dAtA[i:], m.ReferencedConfigID)
  2144  	return i, nil
  2145  }
  2146  func (m *WatchRequest) Marshal() (dAtA []byte, err error) {
  2147  	size := m.Size()
  2148  	dAtA = make([]byte, size)
  2149  	n, err := m.MarshalTo(dAtA)
  2150  	if err != nil {
  2151  		return nil, err
  2152  	}
  2153  	return dAtA[:n], nil
  2154  }
  2155  
  2156  func (m *WatchRequest) MarshalTo(dAtA []byte) (int, error) {
  2157  	var i int
  2158  	_ = i
  2159  	var l int
  2160  	_ = l
  2161  	if len(m.Entries) > 0 {
  2162  		for _, msg := range m.Entries {
  2163  			dAtA[i] = 0xa
  2164  			i++
  2165  			i = encodeVarintWatch(dAtA, i, uint64(msg.Size()))
  2166  			n, err := msg.MarshalTo(dAtA[i:])
  2167  			if err != nil {
  2168  				return 0, err
  2169  			}
  2170  			i += n
  2171  		}
  2172  	}
  2173  	if m.ResumeFrom != nil {
  2174  		dAtA[i] = 0x12
  2175  		i++
  2176  		i = encodeVarintWatch(dAtA, i, uint64(m.ResumeFrom.Size()))
  2177  		n15, err := m.ResumeFrom.MarshalTo(dAtA[i:])
  2178  		if err != nil {
  2179  			return 0, err
  2180  		}
  2181  		i += n15
  2182  	}
  2183  	if m.IncludeOldObject {
  2184  		dAtA[i] = 0x18
  2185  		i++
  2186  		if m.IncludeOldObject {
  2187  			dAtA[i] = 1
  2188  		} else {
  2189  			dAtA[i] = 0
  2190  		}
  2191  		i++
  2192  	}
  2193  	return i, nil
  2194  }
  2195  
  2196  func (m *WatchRequest_WatchEntry) Marshal() (dAtA []byte, err error) {
  2197  	size := m.Size()
  2198  	dAtA = make([]byte, size)
  2199  	n, err := m.MarshalTo(dAtA)
  2200  	if err != nil {
  2201  		return nil, err
  2202  	}
  2203  	return dAtA[:n], nil
  2204  }
  2205  
  2206  func (m *WatchRequest_WatchEntry) MarshalTo(dAtA []byte) (int, error) {
  2207  	var i int
  2208  	_ = i
  2209  	var l int
  2210  	_ = l
  2211  	if len(m.Kind) > 0 {
  2212  		dAtA[i] = 0xa
  2213  		i++
  2214  		i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind)))
  2215  		i += copy(dAtA[i:], m.Kind)
  2216  	}
  2217  	if m.Action != 0 {
  2218  		dAtA[i] = 0x10
  2219  		i++
  2220  		i = encodeVarintWatch(dAtA, i, uint64(m.Action))
  2221  	}
  2222  	if len(m.Filters) > 0 {
  2223  		for _, msg := range m.Filters {
  2224  			dAtA[i] = 0x1a
  2225  			i++
  2226  			i = encodeVarintWatch(dAtA, i, uint64(msg.Size()))
  2227  			n, err := msg.MarshalTo(dAtA[i:])
  2228  			if err != nil {
  2229  				return 0, err
  2230  			}
  2231  			i += n
  2232  		}
  2233  	}
  2234  	return i, nil
  2235  }
  2236  
  2237  func (m *WatchMessage) Marshal() (dAtA []byte, err error) {
  2238  	size := m.Size()
  2239  	dAtA = make([]byte, size)
  2240  	n, err := m.MarshalTo(dAtA)
  2241  	if err != nil {
  2242  		return nil, err
  2243  	}
  2244  	return dAtA[:n], nil
  2245  }
  2246  
  2247  func (m *WatchMessage) MarshalTo(dAtA []byte) (int, error) {
  2248  	var i int
  2249  	_ = i
  2250  	var l int
  2251  	_ = l
  2252  	if len(m.Events) > 0 {
  2253  		for _, msg := range m.Events {
  2254  			dAtA[i] = 0xa
  2255  			i++
  2256  			i = encodeVarintWatch(dAtA, i, uint64(msg.Size()))
  2257  			n, err := msg.MarshalTo(dAtA[i:])
  2258  			if err != nil {
  2259  				return 0, err
  2260  			}
  2261  			i += n
  2262  		}
  2263  	}
  2264  	if m.Version != nil {
  2265  		dAtA[i] = 0x12
  2266  		i++
  2267  		i = encodeVarintWatch(dAtA, i, uint64(m.Version.Size()))
  2268  		n16, err := m.Version.MarshalTo(dAtA[i:])
  2269  		if err != nil {
  2270  			return 0, err
  2271  		}
  2272  		i += n16
  2273  	}
  2274  	return i, nil
  2275  }
  2276  
  2277  func (m *WatchMessage_Event) Marshal() (dAtA []byte, err error) {
  2278  	size := m.Size()
  2279  	dAtA = make([]byte, size)
  2280  	n, err := m.MarshalTo(dAtA)
  2281  	if err != nil {
  2282  		return nil, err
  2283  	}
  2284  	return dAtA[:n], nil
  2285  }
  2286  
  2287  func (m *WatchMessage_Event) MarshalTo(dAtA []byte) (int, error) {
  2288  	var i int
  2289  	_ = i
  2290  	var l int
  2291  	_ = l
  2292  	if m.Action != 0 {
  2293  		dAtA[i] = 0x8
  2294  		i++
  2295  		i = encodeVarintWatch(dAtA, i, uint64(m.Action))
  2296  	}
  2297  	if m.Object != nil {
  2298  		dAtA[i] = 0x12
  2299  		i++
  2300  		i = encodeVarintWatch(dAtA, i, uint64(m.Object.Size()))
  2301  		n17, err := m.Object.MarshalTo(dAtA[i:])
  2302  		if err != nil {
  2303  			return 0, err
  2304  		}
  2305  		i += n17
  2306  	}
  2307  	if m.OldObject != nil {
  2308  		dAtA[i] = 0x1a
  2309  		i++
  2310  		i = encodeVarintWatch(dAtA, i, uint64(m.OldObject.Size()))
  2311  		n18, err := m.OldObject.MarshalTo(dAtA[i:])
  2312  		if err != nil {
  2313  			return 0, err
  2314  		}
  2315  		i += n18
  2316  	}
  2317  	return i, nil
  2318  }
  2319  
  2320  func encodeVarintWatch(dAtA []byte, offset int, v uint64) int {
  2321  	for v >= 1<<7 {
  2322  		dAtA[offset] = uint8(v&0x7f | 0x80)
  2323  		v >>= 7
  2324  		offset++
  2325  	}
  2326  	dAtA[offset] = uint8(v)
  2327  	return offset + 1
  2328  }
  2329  
  2330  type raftProxyWatchServer struct {
  2331  	local                       WatchServer
  2332  	connSelector                raftselector.ConnProvider
  2333  	localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error)
  2334  }
  2335  
  2336  func NewRaftProxyWatchServer(local WatchServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) WatchServer {
  2337  	redirectChecker := func(ctx context.Context) (context.Context, error) {
  2338  		p, ok := peer.FromContext(ctx)
  2339  		if !ok {
  2340  			return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
  2341  		}
  2342  		addr := p.Addr.String()
  2343  		md, ok := metadata.FromIncomingContext(ctx)
  2344  		if ok && len(md["redirect"]) != 0 {
  2345  			return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"])
  2346  		}
  2347  		if !ok {
  2348  			md = metadata.New(map[string]string{})
  2349  		}
  2350  		md["redirect"] = append(md["redirect"], addr)
  2351  		return metadata.NewOutgoingContext(ctx, md), nil
  2352  	}
  2353  	remoteMods := []func(context.Context) (context.Context, error){redirectChecker}
  2354  	remoteMods = append(remoteMods, remoteCtxMod)
  2355  
  2356  	var localMods []func(context.Context) (context.Context, error)
  2357  	if localCtxMod != nil {
  2358  		localMods = []func(context.Context) (context.Context, error){localCtxMod}
  2359  	}
  2360  
  2361  	return &raftProxyWatchServer{
  2362  		local:         local,
  2363  		connSelector:  connSelector,
  2364  		localCtxMods:  localMods,
  2365  		remoteCtxMods: remoteMods,
  2366  	}
  2367  }
  2368  func (p *raftProxyWatchServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
  2369  	var err error
  2370  	for _, mod := range ctxMods {
  2371  		ctx, err = mod(ctx)
  2372  		if err != nil {
  2373  			return ctx, err
  2374  		}
  2375  	}
  2376  	return ctx, nil
  2377  }
  2378  func (p *raftProxyWatchServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) {
  2379  	ticker := rafttime.NewTicker(500 * rafttime.Millisecond)
  2380  	defer ticker.Stop()
  2381  	for {
  2382  		select {
  2383  		case <-ticker.C:
  2384  			conn, err := p.connSelector.LeaderConn(ctx)
  2385  			if err != nil {
  2386  				return nil, err
  2387  			}
  2388  
  2389  			client := NewHealthClient(conn)
  2390  
  2391  			resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"})
  2392  			if err != nil || resp.Status != HealthCheckResponse_SERVING {
  2393  				continue
  2394  			}
  2395  			return conn, nil
  2396  		case <-ctx.Done():
  2397  			return nil, ctx.Err()
  2398  		}
  2399  	}
  2400  }
  2401  
  2402  type Watch_WatchServerWrapper struct {
  2403  	Watch_WatchServer
  2404  	ctx context.Context
  2405  }
  2406  
  2407  func (s Watch_WatchServerWrapper) Context() context.Context {
  2408  	return s.ctx
  2409  }
  2410  
  2411  func (p *raftProxyWatchServer) Watch(r *WatchRequest, stream Watch_WatchServer) error {
  2412  	ctx := stream.Context()
  2413  	conn, err := p.connSelector.LeaderConn(ctx)
  2414  	if err != nil {
  2415  		if err == raftselector.ErrIsLeader {
  2416  			ctx, err = p.runCtxMods(ctx, p.localCtxMods)
  2417  			if err != nil {
  2418  				return err
  2419  			}
  2420  			streamWrapper := Watch_WatchServerWrapper{
  2421  				Watch_WatchServer: stream,
  2422  				ctx:               ctx,
  2423  			}
  2424  			return p.local.Watch(r, streamWrapper)
  2425  		}
  2426  		return err
  2427  	}
  2428  	ctx, err = p.runCtxMods(ctx, p.remoteCtxMods)
  2429  	if err != nil {
  2430  		return err
  2431  	}
  2432  	clientStream, err := NewWatchClient(conn).Watch(ctx, r)
  2433  
  2434  	if err != nil {
  2435  		return err
  2436  	}
  2437  
  2438  	for {
  2439  		msg, err := clientStream.Recv()
  2440  		if err == io.EOF {
  2441  			break
  2442  		}
  2443  		if err != nil {
  2444  			return err
  2445  		}
  2446  		if err := stream.Send(msg); err != nil {
  2447  			return err
  2448  		}
  2449  	}
  2450  	return nil
  2451  }
  2452  
  2453  func (m *Object) Size() (n int) {
  2454  	if m == nil {
  2455  		return 0
  2456  	}
  2457  	var l int
  2458  	_ = l
  2459  	if m.Object != nil {
  2460  		n += m.Object.Size()
  2461  	}
  2462  	return n
  2463  }
  2464  
  2465  func (m *Object_Node) Size() (n int) {
  2466  	if m == nil {
  2467  		return 0
  2468  	}
  2469  	var l int
  2470  	_ = l
  2471  	if m.Node != nil {
  2472  		l = m.Node.Size()
  2473  		n += 1 + l + sovWatch(uint64(l))
  2474  	}
  2475  	return n
  2476  }
  2477  func (m *Object_Service) Size() (n int) {
  2478  	if m == nil {
  2479  		return 0
  2480  	}
  2481  	var l int
  2482  	_ = l
  2483  	if m.Service != nil {
  2484  		l = m.Service.Size()
  2485  		n += 1 + l + sovWatch(uint64(l))
  2486  	}
  2487  	return n
  2488  }
  2489  func (m *Object_Network) Size() (n int) {
  2490  	if m == nil {
  2491  		return 0
  2492  	}
  2493  	var l int
  2494  	_ = l
  2495  	if m.Network != nil {
  2496  		l = m.Network.Size()
  2497  		n += 1 + l + sovWatch(uint64(l))
  2498  	}
  2499  	return n
  2500  }
  2501  func (m *Object_Task) Size() (n int) {
  2502  	if m == nil {
  2503  		return 0
  2504  	}
  2505  	var l int
  2506  	_ = l
  2507  	if m.Task != nil {
  2508  		l = m.Task.Size()
  2509  		n += 1 + l + sovWatch(uint64(l))
  2510  	}
  2511  	return n
  2512  }
  2513  func (m *Object_Cluster) Size() (n int) {
  2514  	if m == nil {
  2515  		return 0
  2516  	}
  2517  	var l int
  2518  	_ = l
  2519  	if m.Cluster != nil {
  2520  		l = m.Cluster.Size()
  2521  		n += 1 + l + sovWatch(uint64(l))
  2522  	}
  2523  	return n
  2524  }
  2525  func (m *Object_Secret) Size() (n int) {
  2526  	if m == nil {
  2527  		return 0
  2528  	}
  2529  	var l int
  2530  	_ = l
  2531  	if m.Secret != nil {
  2532  		l = m.Secret.Size()
  2533  		n += 1 + l + sovWatch(uint64(l))
  2534  	}
  2535  	return n
  2536  }
  2537  func (m *Object_Resource) Size() (n int) {
  2538  	if m == nil {
  2539  		return 0
  2540  	}
  2541  	var l int
  2542  	_ = l
  2543  	if m.Resource != nil {
  2544  		l = m.Resource.Size()
  2545  		n += 1 + l + sovWatch(uint64(l))
  2546  	}
  2547  	return n
  2548  }
  2549  func (m *Object_Extension) Size() (n int) {
  2550  	if m == nil {
  2551  		return 0
  2552  	}
  2553  	var l int
  2554  	_ = l
  2555  	if m.Extension != nil {
  2556  		l = m.Extension.Size()
  2557  		n += 1 + l + sovWatch(uint64(l))
  2558  	}
  2559  	return n
  2560  }
  2561  func (m *Object_Config) Size() (n int) {
  2562  	if m == nil {
  2563  		return 0
  2564  	}
  2565  	var l int
  2566  	_ = l
  2567  	if m.Config != nil {
  2568  		l = m.Config.Size()
  2569  		n += 1 + l + sovWatch(uint64(l))
  2570  	}
  2571  	return n
  2572  }
  2573  func (m *SelectBySlot) Size() (n int) {
  2574  	if m == nil {
  2575  		return 0
  2576  	}
  2577  	var l int
  2578  	_ = l
  2579  	l = len(m.ServiceID)
  2580  	if l > 0 {
  2581  		n += 1 + l + sovWatch(uint64(l))
  2582  	}
  2583  	if m.Slot != 0 {
  2584  		n += 1 + sovWatch(uint64(m.Slot))
  2585  	}
  2586  	return n
  2587  }
  2588  
  2589  func (m *SelectByCustom) Size() (n int) {
  2590  	if m == nil {
  2591  		return 0
  2592  	}
  2593  	var l int
  2594  	_ = l
  2595  	l = len(m.Kind)
  2596  	if l > 0 {
  2597  		n += 1 + l + sovWatch(uint64(l))
  2598  	}
  2599  	l = len(m.Index)
  2600  	if l > 0 {
  2601  		n += 1 + l + sovWatch(uint64(l))
  2602  	}
  2603  	l = len(m.Value)
  2604  	if l > 0 {
  2605  		n += 1 + l + sovWatch(uint64(l))
  2606  	}
  2607  	return n
  2608  }
  2609  
  2610  func (m *SelectBy) Size() (n int) {
  2611  	if m == nil {
  2612  		return 0
  2613  	}
  2614  	var l int
  2615  	_ = l
  2616  	if m.By != nil {
  2617  		n += m.By.Size()
  2618  	}
  2619  	return n
  2620  }
  2621  
  2622  func (m *SelectBy_ID) Size() (n int) {
  2623  	if m == nil {
  2624  		return 0
  2625  	}
  2626  	var l int
  2627  	_ = l
  2628  	l = len(m.ID)
  2629  	n += 1 + l + sovWatch(uint64(l))
  2630  	return n
  2631  }
  2632  func (m *SelectBy_IDPrefix) Size() (n int) {
  2633  	if m == nil {
  2634  		return 0
  2635  	}
  2636  	var l int
  2637  	_ = l
  2638  	l = len(m.IDPrefix)
  2639  	n += 1 + l + sovWatch(uint64(l))
  2640  	return n
  2641  }
  2642  func (m *SelectBy_Name) Size() (n int) {
  2643  	if m == nil {
  2644  		return 0
  2645  	}
  2646  	var l int
  2647  	_ = l
  2648  	l = len(m.Name)
  2649  	n += 1 + l + sovWatch(uint64(l))
  2650  	return n
  2651  }
  2652  func (m *SelectBy_NamePrefix) Size() (n int) {
  2653  	if m == nil {
  2654  		return 0
  2655  	}
  2656  	var l int
  2657  	_ = l
  2658  	l = len(m.NamePrefix)
  2659  	n += 1 + l + sovWatch(uint64(l))
  2660  	return n
  2661  }
  2662  func (m *SelectBy_Custom) Size() (n int) {
  2663  	if m == nil {
  2664  		return 0
  2665  	}
  2666  	var l int
  2667  	_ = l
  2668  	if m.Custom != nil {
  2669  		l = m.Custom.Size()
  2670  		n += 1 + l + sovWatch(uint64(l))
  2671  	}
  2672  	return n
  2673  }
  2674  func (m *SelectBy_CustomPrefix) Size() (n int) {
  2675  	if m == nil {
  2676  		return 0
  2677  	}
  2678  	var l int
  2679  	_ = l
  2680  	if m.CustomPrefix != nil {
  2681  		l = m.CustomPrefix.Size()
  2682  		n += 1 + l + sovWatch(uint64(l))
  2683  	}
  2684  	return n
  2685  }
  2686  func (m *SelectBy_ServiceID) Size() (n int) {
  2687  	if m == nil {
  2688  		return 0
  2689  	}
  2690  	var l int
  2691  	_ = l
  2692  	l = len(m.ServiceID)
  2693  	n += 1 + l + sovWatch(uint64(l))
  2694  	return n
  2695  }
  2696  func (m *SelectBy_NodeID) Size() (n int) {
  2697  	if m == nil {
  2698  		return 0
  2699  	}
  2700  	var l int
  2701  	_ = l
  2702  	l = len(m.NodeID)
  2703  	n += 1 + l + sovWatch(uint64(l))
  2704  	return n
  2705  }
  2706  func (m *SelectBy_Slot) Size() (n int) {
  2707  	if m == nil {
  2708  		return 0
  2709  	}
  2710  	var l int
  2711  	_ = l
  2712  	if m.Slot != nil {
  2713  		l = m.Slot.Size()
  2714  		n += 1 + l + sovWatch(uint64(l))
  2715  	}
  2716  	return n
  2717  }
  2718  func (m *SelectBy_DesiredState) Size() (n int) {
  2719  	if m == nil {
  2720  		return 0
  2721  	}
  2722  	var l int
  2723  	_ = l
  2724  	n += 1 + sovWatch(uint64(m.DesiredState))
  2725  	return n
  2726  }
  2727  func (m *SelectBy_Role) Size() (n int) {
  2728  	if m == nil {
  2729  		return 0
  2730  	}
  2731  	var l int
  2732  	_ = l
  2733  	n += 1 + sovWatch(uint64(m.Role))
  2734  	return n
  2735  }
  2736  func (m *SelectBy_Membership) Size() (n int) {
  2737  	if m == nil {
  2738  		return 0
  2739  	}
  2740  	var l int
  2741  	_ = l
  2742  	n += 1 + sovWatch(uint64(m.Membership))
  2743  	return n
  2744  }
  2745  func (m *SelectBy_ReferencedNetworkID) Size() (n int) {
  2746  	if m == nil {
  2747  		return 0
  2748  	}
  2749  	var l int
  2750  	_ = l
  2751  	l = len(m.ReferencedNetworkID)
  2752  	n += 1 + l + sovWatch(uint64(l))
  2753  	return n
  2754  }
  2755  func (m *SelectBy_ReferencedSecretID) Size() (n int) {
  2756  	if m == nil {
  2757  		return 0
  2758  	}
  2759  	var l int
  2760  	_ = l
  2761  	l = len(m.ReferencedSecretID)
  2762  	n += 1 + l + sovWatch(uint64(l))
  2763  	return n
  2764  }
  2765  func (m *SelectBy_Kind) Size() (n int) {
  2766  	if m == nil {
  2767  		return 0
  2768  	}
  2769  	var l int
  2770  	_ = l
  2771  	l = len(m.Kind)
  2772  	n += 1 + l + sovWatch(uint64(l))
  2773  	return n
  2774  }
  2775  func (m *SelectBy_ReferencedConfigID) Size() (n int) {
  2776  	if m == nil {
  2777  		return 0
  2778  	}
  2779  	var l int
  2780  	_ = l
  2781  	l = len(m.ReferencedConfigID)
  2782  	n += 2 + l + sovWatch(uint64(l))
  2783  	return n
  2784  }
  2785  func (m *WatchRequest) Size() (n int) {
  2786  	if m == nil {
  2787  		return 0
  2788  	}
  2789  	var l int
  2790  	_ = l
  2791  	if len(m.Entries) > 0 {
  2792  		for _, e := range m.Entries {
  2793  			l = e.Size()
  2794  			n += 1 + l + sovWatch(uint64(l))
  2795  		}
  2796  	}
  2797  	if m.ResumeFrom != nil {
  2798  		l = m.ResumeFrom.Size()
  2799  		n += 1 + l + sovWatch(uint64(l))
  2800  	}
  2801  	if m.IncludeOldObject {
  2802  		n += 2
  2803  	}
  2804  	return n
  2805  }
  2806  
  2807  func (m *WatchRequest_WatchEntry) Size() (n int) {
  2808  	if m == nil {
  2809  		return 0
  2810  	}
  2811  	var l int
  2812  	_ = l
  2813  	l = len(m.Kind)
  2814  	if l > 0 {
  2815  		n += 1 + l + sovWatch(uint64(l))
  2816  	}
  2817  	if m.Action != 0 {
  2818  		n += 1 + sovWatch(uint64(m.Action))
  2819  	}
  2820  	if len(m.Filters) > 0 {
  2821  		for _, e := range m.Filters {
  2822  			l = e.Size()
  2823  			n += 1 + l + sovWatch(uint64(l))
  2824  		}
  2825  	}
  2826  	return n
  2827  }
  2828  
  2829  func (m *WatchMessage) Size() (n int) {
  2830  	if m == nil {
  2831  		return 0
  2832  	}
  2833  	var l int
  2834  	_ = l
  2835  	if len(m.Events) > 0 {
  2836  		for _, e := range m.Events {
  2837  			l = e.Size()
  2838  			n += 1 + l + sovWatch(uint64(l))
  2839  		}
  2840  	}
  2841  	if m.Version != nil {
  2842  		l = m.Version.Size()
  2843  		n += 1 + l + sovWatch(uint64(l))
  2844  	}
  2845  	return n
  2846  }
  2847  
  2848  func (m *WatchMessage_Event) Size() (n int) {
  2849  	if m == nil {
  2850  		return 0
  2851  	}
  2852  	var l int
  2853  	_ = l
  2854  	if m.Action != 0 {
  2855  		n += 1 + sovWatch(uint64(m.Action))
  2856  	}
  2857  	if m.Object != nil {
  2858  		l = m.Object.Size()
  2859  		n += 1 + l + sovWatch(uint64(l))
  2860  	}
  2861  	if m.OldObject != nil {
  2862  		l = m.OldObject.Size()
  2863  		n += 1 + l + sovWatch(uint64(l))
  2864  	}
  2865  	return n
  2866  }
  2867  
  2868  func sovWatch(x uint64) (n int) {
  2869  	for {
  2870  		n++
  2871  		x >>= 7
  2872  		if x == 0 {
  2873  			break
  2874  		}
  2875  	}
  2876  	return n
  2877  }
  2878  func sozWatch(x uint64) (n int) {
  2879  	return sovWatch(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  2880  }
  2881  func (this *Object) String() string {
  2882  	if this == nil {
  2883  		return "nil"
  2884  	}
  2885  	s := strings.Join([]string{`&Object{`,
  2886  		`Object:` + fmt.Sprintf("%v", this.Object) + `,`,
  2887  		`}`,
  2888  	}, "")
  2889  	return s
  2890  }
  2891  func (this *Object_Node) String() string {
  2892  	if this == nil {
  2893  		return "nil"
  2894  	}
  2895  	s := strings.Join([]string{`&Object_Node{`,
  2896  		`Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "Node", "Node", 1) + `,`,
  2897  		`}`,
  2898  	}, "")
  2899  	return s
  2900  }
  2901  func (this *Object_Service) String() string {
  2902  	if this == nil {
  2903  		return "nil"
  2904  	}
  2905  	s := strings.Join([]string{`&Object_Service{`,
  2906  		`Service:` + strings.Replace(fmt.Sprintf("%v", this.Service), "Service", "Service", 1) + `,`,
  2907  		`}`,
  2908  	}, "")
  2909  	return s
  2910  }
  2911  func (this *Object_Network) String() string {
  2912  	if this == nil {
  2913  		return "nil"
  2914  	}
  2915  	s := strings.Join([]string{`&Object_Network{`,
  2916  		`Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`,
  2917  		`}`,
  2918  	}, "")
  2919  	return s
  2920  }
  2921  func (this *Object_Task) String() string {
  2922  	if this == nil {
  2923  		return "nil"
  2924  	}
  2925  	s := strings.Join([]string{`&Object_Task{`,
  2926  		`Task:` + strings.Replace(fmt.Sprintf("%v", this.Task), "Task", "Task", 1) + `,`,
  2927  		`}`,
  2928  	}, "")
  2929  	return s
  2930  }
  2931  func (this *Object_Cluster) String() string {
  2932  	if this == nil {
  2933  		return "nil"
  2934  	}
  2935  	s := strings.Join([]string{`&Object_Cluster{`,
  2936  		`Cluster:` + strings.Replace(fmt.Sprintf("%v", this.Cluster), "Cluster", "Cluster", 1) + `,`,
  2937  		`}`,
  2938  	}, "")
  2939  	return s
  2940  }
  2941  func (this *Object_Secret) String() string {
  2942  	if this == nil {
  2943  		return "nil"
  2944  	}
  2945  	s := strings.Join([]string{`&Object_Secret{`,
  2946  		`Secret:` + strings.Replace(fmt.Sprintf("%v", this.Secret), "Secret", "Secret", 1) + `,`,
  2947  		`}`,
  2948  	}, "")
  2949  	return s
  2950  }
  2951  func (this *Object_Resource) String() string {
  2952  	if this == nil {
  2953  		return "nil"
  2954  	}
  2955  	s := strings.Join([]string{`&Object_Resource{`,
  2956  		`Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "Resource", "Resource", 1) + `,`,
  2957  		`}`,
  2958  	}, "")
  2959  	return s
  2960  }
  2961  func (this *Object_Extension) String() string {
  2962  	if this == nil {
  2963  		return "nil"
  2964  	}
  2965  	s := strings.Join([]string{`&Object_Extension{`,
  2966  		`Extension:` + strings.Replace(fmt.Sprintf("%v", this.Extension), "Extension", "Extension", 1) + `,`,
  2967  		`}`,
  2968  	}, "")
  2969  	return s
  2970  }
  2971  func (this *Object_Config) String() string {
  2972  	if this == nil {
  2973  		return "nil"
  2974  	}
  2975  	s := strings.Join([]string{`&Object_Config{`,
  2976  		`Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "Config", "Config", 1) + `,`,
  2977  		`}`,
  2978  	}, "")
  2979  	return s
  2980  }
  2981  func (this *SelectBySlot) String() string {
  2982  	if this == nil {
  2983  		return "nil"
  2984  	}
  2985  	s := strings.Join([]string{`&SelectBySlot{`,
  2986  		`ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`,
  2987  		`Slot:` + fmt.Sprintf("%v", this.Slot) + `,`,
  2988  		`}`,
  2989  	}, "")
  2990  	return s
  2991  }
  2992  func (this *SelectByCustom) String() string {
  2993  	if this == nil {
  2994  		return "nil"
  2995  	}
  2996  	s := strings.Join([]string{`&SelectByCustom{`,
  2997  		`Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
  2998  		`Index:` + fmt.Sprintf("%v", this.Index) + `,`,
  2999  		`Value:` + fmt.Sprintf("%v", this.Value) + `,`,
  3000  		`}`,
  3001  	}, "")
  3002  	return s
  3003  }
  3004  func (this *SelectBy) String() string {
  3005  	if this == nil {
  3006  		return "nil"
  3007  	}
  3008  	s := strings.Join([]string{`&SelectBy{`,
  3009  		`By:` + fmt.Sprintf("%v", this.By) + `,`,
  3010  		`}`,
  3011  	}, "")
  3012  	return s
  3013  }
  3014  func (this *SelectBy_ID) String() string {
  3015  	if this == nil {
  3016  		return "nil"
  3017  	}
  3018  	s := strings.Join([]string{`&SelectBy_ID{`,
  3019  		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
  3020  		`}`,
  3021  	}, "")
  3022  	return s
  3023  }
  3024  func (this *SelectBy_IDPrefix) String() string {
  3025  	if this == nil {
  3026  		return "nil"
  3027  	}
  3028  	s := strings.Join([]string{`&SelectBy_IDPrefix{`,
  3029  		`IDPrefix:` + fmt.Sprintf("%v", this.IDPrefix) + `,`,
  3030  		`}`,
  3031  	}, "")
  3032  	return s
  3033  }
  3034  func (this *SelectBy_Name) String() string {
  3035  	if this == nil {
  3036  		return "nil"
  3037  	}
  3038  	s := strings.Join([]string{`&SelectBy_Name{`,
  3039  		`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
  3040  		`}`,
  3041  	}, "")
  3042  	return s
  3043  }
  3044  func (this *SelectBy_NamePrefix) String() string {
  3045  	if this == nil {
  3046  		return "nil"
  3047  	}
  3048  	s := strings.Join([]string{`&SelectBy_NamePrefix{`,
  3049  		`NamePrefix:` + fmt.Sprintf("%v", this.NamePrefix) + `,`,
  3050  		`}`,
  3051  	}, "")
  3052  	return s
  3053  }
  3054  func (this *SelectBy_Custom) String() string {
  3055  	if this == nil {
  3056  		return "nil"
  3057  	}
  3058  	s := strings.Join([]string{`&SelectBy_Custom{`,
  3059  		`Custom:` + strings.Replace(fmt.Sprintf("%v", this.Custom), "SelectByCustom", "SelectByCustom", 1) + `,`,
  3060  		`}`,
  3061  	}, "")
  3062  	return s
  3063  }
  3064  func (this *SelectBy_CustomPrefix) String() string {
  3065  	if this == nil {
  3066  		return "nil"
  3067  	}
  3068  	s := strings.Join([]string{`&SelectBy_CustomPrefix{`,
  3069  		`CustomPrefix:` + strings.Replace(fmt.Sprintf("%v", this.CustomPrefix), "SelectByCustom", "SelectByCustom", 1) + `,`,
  3070  		`}`,
  3071  	}, "")
  3072  	return s
  3073  }
  3074  func (this *SelectBy_ServiceID) String() string {
  3075  	if this == nil {
  3076  		return "nil"
  3077  	}
  3078  	s := strings.Join([]string{`&SelectBy_ServiceID{`,
  3079  		`ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`,
  3080  		`}`,
  3081  	}, "")
  3082  	return s
  3083  }
  3084  func (this *SelectBy_NodeID) String() string {
  3085  	if this == nil {
  3086  		return "nil"
  3087  	}
  3088  	s := strings.Join([]string{`&SelectBy_NodeID{`,
  3089  		`NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`,
  3090  		`}`,
  3091  	}, "")
  3092  	return s
  3093  }
  3094  func (this *SelectBy_Slot) String() string {
  3095  	if this == nil {
  3096  		return "nil"
  3097  	}
  3098  	s := strings.Join([]string{`&SelectBy_Slot{`,
  3099  		`Slot:` + strings.Replace(fmt.Sprintf("%v", this.Slot), "SelectBySlot", "SelectBySlot", 1) + `,`,
  3100  		`}`,
  3101  	}, "")
  3102  	return s
  3103  }
  3104  func (this *SelectBy_DesiredState) String() string {
  3105  	if this == nil {
  3106  		return "nil"
  3107  	}
  3108  	s := strings.Join([]string{`&SelectBy_DesiredState{`,
  3109  		`DesiredState:` + fmt.Sprintf("%v", this.DesiredState) + `,`,
  3110  		`}`,
  3111  	}, "")
  3112  	return s
  3113  }
  3114  func (this *SelectBy_Role) String() string {
  3115  	if this == nil {
  3116  		return "nil"
  3117  	}
  3118  	s := strings.Join([]string{`&SelectBy_Role{`,
  3119  		`Role:` + fmt.Sprintf("%v", this.Role) + `,`,
  3120  		`}`,
  3121  	}, "")
  3122  	return s
  3123  }
  3124  func (this *SelectBy_Membership) String() string {
  3125  	if this == nil {
  3126  		return "nil"
  3127  	}
  3128  	s := strings.Join([]string{`&SelectBy_Membership{`,
  3129  		`Membership:` + fmt.Sprintf("%v", this.Membership) + `,`,
  3130  		`}`,
  3131  	}, "")
  3132  	return s
  3133  }
  3134  func (this *SelectBy_ReferencedNetworkID) String() string {
  3135  	if this == nil {
  3136  		return "nil"
  3137  	}
  3138  	s := strings.Join([]string{`&SelectBy_ReferencedNetworkID{`,
  3139  		`ReferencedNetworkID:` + fmt.Sprintf("%v", this.ReferencedNetworkID) + `,`,
  3140  		`}`,
  3141  	}, "")
  3142  	return s
  3143  }
  3144  func (this *SelectBy_ReferencedSecretID) String() string {
  3145  	if this == nil {
  3146  		return "nil"
  3147  	}
  3148  	s := strings.Join([]string{`&SelectBy_ReferencedSecretID{`,
  3149  		`ReferencedSecretID:` + fmt.Sprintf("%v", this.ReferencedSecretID) + `,`,
  3150  		`}`,
  3151  	}, "")
  3152  	return s
  3153  }
  3154  func (this *SelectBy_Kind) String() string {
  3155  	if this == nil {
  3156  		return "nil"
  3157  	}
  3158  	s := strings.Join([]string{`&SelectBy_Kind{`,
  3159  		`Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
  3160  		`}`,
  3161  	}, "")
  3162  	return s
  3163  }
  3164  func (this *SelectBy_ReferencedConfigID) String() string {
  3165  	if this == nil {
  3166  		return "nil"
  3167  	}
  3168  	s := strings.Join([]string{`&SelectBy_ReferencedConfigID{`,
  3169  		`ReferencedConfigID:` + fmt.Sprintf("%v", this.ReferencedConfigID) + `,`,
  3170  		`}`,
  3171  	}, "")
  3172  	return s
  3173  }
  3174  func (this *WatchRequest) String() string {
  3175  	if this == nil {
  3176  		return "nil"
  3177  	}
  3178  	s := strings.Join([]string{`&WatchRequest{`,
  3179  		`Entries:` + strings.Replace(fmt.Sprintf("%v", this.Entries), "WatchRequest_WatchEntry", "WatchRequest_WatchEntry", 1) + `,`,
  3180  		`ResumeFrom:` + strings.Replace(fmt.Sprintf("%v", this.ResumeFrom), "Version", "Version", 1) + `,`,
  3181  		`IncludeOldObject:` + fmt.Sprintf("%v", this.IncludeOldObject) + `,`,
  3182  		`}`,
  3183  	}, "")
  3184  	return s
  3185  }
  3186  func (this *WatchRequest_WatchEntry) String() string {
  3187  	if this == nil {
  3188  		return "nil"
  3189  	}
  3190  	s := strings.Join([]string{`&WatchRequest_WatchEntry{`,
  3191  		`Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
  3192  		`Action:` + fmt.Sprintf("%v", this.Action) + `,`,
  3193  		`Filters:` + strings.Replace(fmt.Sprintf("%v", this.Filters), "SelectBy", "SelectBy", 1) + `,`,
  3194  		`}`,
  3195  	}, "")
  3196  	return s
  3197  }
  3198  func (this *WatchMessage) String() string {
  3199  	if this == nil {
  3200  		return "nil"
  3201  	}
  3202  	s := strings.Join([]string{`&WatchMessage{`,
  3203  		`Events:` + strings.Replace(fmt.Sprintf("%v", this.Events), "WatchMessage_Event", "WatchMessage_Event", 1) + `,`,
  3204  		`Version:` + strings.Replace(fmt.Sprintf("%v", this.Version), "Version", "Version", 1) + `,`,
  3205  		`}`,
  3206  	}, "")
  3207  	return s
  3208  }
  3209  func (this *WatchMessage_Event) String() string {
  3210  	if this == nil {
  3211  		return "nil"
  3212  	}
  3213  	s := strings.Join([]string{`&WatchMessage_Event{`,
  3214  		`Action:` + fmt.Sprintf("%v", this.Action) + `,`,
  3215  		`Object:` + strings.Replace(fmt.Sprintf("%v", this.Object), "Object", "Object", 1) + `,`,
  3216  		`OldObject:` + strings.Replace(fmt.Sprintf("%v", this.OldObject), "Object", "Object", 1) + `,`,
  3217  		`}`,
  3218  	}, "")
  3219  	return s
  3220  }
  3221  func valueToStringWatch(v interface{}) string {
  3222  	rv := reflect.ValueOf(v)
  3223  	if rv.IsNil() {
  3224  		return "nil"
  3225  	}
  3226  	pv := reflect.Indirect(rv).Interface()
  3227  	return fmt.Sprintf("*%v", pv)
  3228  }
  3229  func (m *Object) Unmarshal(dAtA []byte) error {
  3230  	l := len(dAtA)
  3231  	iNdEx := 0
  3232  	for iNdEx < l {
  3233  		preIndex := iNdEx
  3234  		var wire uint64
  3235  		for shift := uint(0); ; shift += 7 {
  3236  			if shift >= 64 {
  3237  				return ErrIntOverflowWatch
  3238  			}
  3239  			if iNdEx >= l {
  3240  				return io.ErrUnexpectedEOF
  3241  			}
  3242  			b := dAtA[iNdEx]
  3243  			iNdEx++
  3244  			wire |= uint64(b&0x7F) << shift
  3245  			if b < 0x80 {
  3246  				break
  3247  			}
  3248  		}
  3249  		fieldNum := int32(wire >> 3)
  3250  		wireType := int(wire & 0x7)
  3251  		if wireType == 4 {
  3252  			return fmt.Errorf("proto: Object: wiretype end group for non-group")
  3253  		}
  3254  		if fieldNum <= 0 {
  3255  			return fmt.Errorf("proto: Object: illegal tag %d (wire type %d)", fieldNum, wire)
  3256  		}
  3257  		switch fieldNum {
  3258  		case 1:
  3259  			if wireType != 2 {
  3260  				return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType)
  3261  			}
  3262  			var msglen int
  3263  			for shift := uint(0); ; shift += 7 {
  3264  				if shift >= 64 {
  3265  					return ErrIntOverflowWatch
  3266  				}
  3267  				if iNdEx >= l {
  3268  					return io.ErrUnexpectedEOF
  3269  				}
  3270  				b := dAtA[iNdEx]
  3271  				iNdEx++
  3272  				msglen |= int(b&0x7F) << shift
  3273  				if b < 0x80 {
  3274  					break
  3275  				}
  3276  			}
  3277  			if msglen < 0 {
  3278  				return ErrInvalidLengthWatch
  3279  			}
  3280  			postIndex := iNdEx + msglen
  3281  			if postIndex < 0 {
  3282  				return ErrInvalidLengthWatch
  3283  			}
  3284  			if postIndex > l {
  3285  				return io.ErrUnexpectedEOF
  3286  			}
  3287  			v := &Node{}
  3288  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3289  				return err
  3290  			}
  3291  			m.Object = &Object_Node{v}
  3292  			iNdEx = postIndex
  3293  		case 2:
  3294  			if wireType != 2 {
  3295  				return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType)
  3296  			}
  3297  			var msglen int
  3298  			for shift := uint(0); ; shift += 7 {
  3299  				if shift >= 64 {
  3300  					return ErrIntOverflowWatch
  3301  				}
  3302  				if iNdEx >= l {
  3303  					return io.ErrUnexpectedEOF
  3304  				}
  3305  				b := dAtA[iNdEx]
  3306  				iNdEx++
  3307  				msglen |= int(b&0x7F) << shift
  3308  				if b < 0x80 {
  3309  					break
  3310  				}
  3311  			}
  3312  			if msglen < 0 {
  3313  				return ErrInvalidLengthWatch
  3314  			}
  3315  			postIndex := iNdEx + msglen
  3316  			if postIndex < 0 {
  3317  				return ErrInvalidLengthWatch
  3318  			}
  3319  			if postIndex > l {
  3320  				return io.ErrUnexpectedEOF
  3321  			}
  3322  			v := &Service{}
  3323  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3324  				return err
  3325  			}
  3326  			m.Object = &Object_Service{v}
  3327  			iNdEx = postIndex
  3328  		case 3:
  3329  			if wireType != 2 {
  3330  				return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType)
  3331  			}
  3332  			var msglen int
  3333  			for shift := uint(0); ; shift += 7 {
  3334  				if shift >= 64 {
  3335  					return ErrIntOverflowWatch
  3336  				}
  3337  				if iNdEx >= l {
  3338  					return io.ErrUnexpectedEOF
  3339  				}
  3340  				b := dAtA[iNdEx]
  3341  				iNdEx++
  3342  				msglen |= int(b&0x7F) << shift
  3343  				if b < 0x80 {
  3344  					break
  3345  				}
  3346  			}
  3347  			if msglen < 0 {
  3348  				return ErrInvalidLengthWatch
  3349  			}
  3350  			postIndex := iNdEx + msglen
  3351  			if postIndex < 0 {
  3352  				return ErrInvalidLengthWatch
  3353  			}
  3354  			if postIndex > l {
  3355  				return io.ErrUnexpectedEOF
  3356  			}
  3357  			v := &Network{}
  3358  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3359  				return err
  3360  			}
  3361  			m.Object = &Object_Network{v}
  3362  			iNdEx = postIndex
  3363  		case 4:
  3364  			if wireType != 2 {
  3365  				return fmt.Errorf("proto: wrong wireType = %d for field Task", wireType)
  3366  			}
  3367  			var msglen int
  3368  			for shift := uint(0); ; shift += 7 {
  3369  				if shift >= 64 {
  3370  					return ErrIntOverflowWatch
  3371  				}
  3372  				if iNdEx >= l {
  3373  					return io.ErrUnexpectedEOF
  3374  				}
  3375  				b := dAtA[iNdEx]
  3376  				iNdEx++
  3377  				msglen |= int(b&0x7F) << shift
  3378  				if b < 0x80 {
  3379  					break
  3380  				}
  3381  			}
  3382  			if msglen < 0 {
  3383  				return ErrInvalidLengthWatch
  3384  			}
  3385  			postIndex := iNdEx + msglen
  3386  			if postIndex < 0 {
  3387  				return ErrInvalidLengthWatch
  3388  			}
  3389  			if postIndex > l {
  3390  				return io.ErrUnexpectedEOF
  3391  			}
  3392  			v := &Task{}
  3393  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3394  				return err
  3395  			}
  3396  			m.Object = &Object_Task{v}
  3397  			iNdEx = postIndex
  3398  		case 5:
  3399  			if wireType != 2 {
  3400  				return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType)
  3401  			}
  3402  			var msglen int
  3403  			for shift := uint(0); ; shift += 7 {
  3404  				if shift >= 64 {
  3405  					return ErrIntOverflowWatch
  3406  				}
  3407  				if iNdEx >= l {
  3408  					return io.ErrUnexpectedEOF
  3409  				}
  3410  				b := dAtA[iNdEx]
  3411  				iNdEx++
  3412  				msglen |= int(b&0x7F) << shift
  3413  				if b < 0x80 {
  3414  					break
  3415  				}
  3416  			}
  3417  			if msglen < 0 {
  3418  				return ErrInvalidLengthWatch
  3419  			}
  3420  			postIndex := iNdEx + msglen
  3421  			if postIndex < 0 {
  3422  				return ErrInvalidLengthWatch
  3423  			}
  3424  			if postIndex > l {
  3425  				return io.ErrUnexpectedEOF
  3426  			}
  3427  			v := &Cluster{}
  3428  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3429  				return err
  3430  			}
  3431  			m.Object = &Object_Cluster{v}
  3432  			iNdEx = postIndex
  3433  		case 6:
  3434  			if wireType != 2 {
  3435  				return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType)
  3436  			}
  3437  			var msglen int
  3438  			for shift := uint(0); ; shift += 7 {
  3439  				if shift >= 64 {
  3440  					return ErrIntOverflowWatch
  3441  				}
  3442  				if iNdEx >= l {
  3443  					return io.ErrUnexpectedEOF
  3444  				}
  3445  				b := dAtA[iNdEx]
  3446  				iNdEx++
  3447  				msglen |= int(b&0x7F) << shift
  3448  				if b < 0x80 {
  3449  					break
  3450  				}
  3451  			}
  3452  			if msglen < 0 {
  3453  				return ErrInvalidLengthWatch
  3454  			}
  3455  			postIndex := iNdEx + msglen
  3456  			if postIndex < 0 {
  3457  				return ErrInvalidLengthWatch
  3458  			}
  3459  			if postIndex > l {
  3460  				return io.ErrUnexpectedEOF
  3461  			}
  3462  			v := &Secret{}
  3463  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3464  				return err
  3465  			}
  3466  			m.Object = &Object_Secret{v}
  3467  			iNdEx = postIndex
  3468  		case 7:
  3469  			if wireType != 2 {
  3470  				return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType)
  3471  			}
  3472  			var msglen int
  3473  			for shift := uint(0); ; shift += 7 {
  3474  				if shift >= 64 {
  3475  					return ErrIntOverflowWatch
  3476  				}
  3477  				if iNdEx >= l {
  3478  					return io.ErrUnexpectedEOF
  3479  				}
  3480  				b := dAtA[iNdEx]
  3481  				iNdEx++
  3482  				msglen |= int(b&0x7F) << shift
  3483  				if b < 0x80 {
  3484  					break
  3485  				}
  3486  			}
  3487  			if msglen < 0 {
  3488  				return ErrInvalidLengthWatch
  3489  			}
  3490  			postIndex := iNdEx + msglen
  3491  			if postIndex < 0 {
  3492  				return ErrInvalidLengthWatch
  3493  			}
  3494  			if postIndex > l {
  3495  				return io.ErrUnexpectedEOF
  3496  			}
  3497  			v := &Resource{}
  3498  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3499  				return err
  3500  			}
  3501  			m.Object = &Object_Resource{v}
  3502  			iNdEx = postIndex
  3503  		case 8:
  3504  			if wireType != 2 {
  3505  				return fmt.Errorf("proto: wrong wireType = %d for field Extension", wireType)
  3506  			}
  3507  			var msglen int
  3508  			for shift := uint(0); ; shift += 7 {
  3509  				if shift >= 64 {
  3510  					return ErrIntOverflowWatch
  3511  				}
  3512  				if iNdEx >= l {
  3513  					return io.ErrUnexpectedEOF
  3514  				}
  3515  				b := dAtA[iNdEx]
  3516  				iNdEx++
  3517  				msglen |= int(b&0x7F) << shift
  3518  				if b < 0x80 {
  3519  					break
  3520  				}
  3521  			}
  3522  			if msglen < 0 {
  3523  				return ErrInvalidLengthWatch
  3524  			}
  3525  			postIndex := iNdEx + msglen
  3526  			if postIndex < 0 {
  3527  				return ErrInvalidLengthWatch
  3528  			}
  3529  			if postIndex > l {
  3530  				return io.ErrUnexpectedEOF
  3531  			}
  3532  			v := &Extension{}
  3533  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3534  				return err
  3535  			}
  3536  			m.Object = &Object_Extension{v}
  3537  			iNdEx = postIndex
  3538  		case 9:
  3539  			if wireType != 2 {
  3540  				return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType)
  3541  			}
  3542  			var msglen int
  3543  			for shift := uint(0); ; shift += 7 {
  3544  				if shift >= 64 {
  3545  					return ErrIntOverflowWatch
  3546  				}
  3547  				if iNdEx >= l {
  3548  					return io.ErrUnexpectedEOF
  3549  				}
  3550  				b := dAtA[iNdEx]
  3551  				iNdEx++
  3552  				msglen |= int(b&0x7F) << shift
  3553  				if b < 0x80 {
  3554  					break
  3555  				}
  3556  			}
  3557  			if msglen < 0 {
  3558  				return ErrInvalidLengthWatch
  3559  			}
  3560  			postIndex := iNdEx + msglen
  3561  			if postIndex < 0 {
  3562  				return ErrInvalidLengthWatch
  3563  			}
  3564  			if postIndex > l {
  3565  				return io.ErrUnexpectedEOF
  3566  			}
  3567  			v := &Config{}
  3568  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  3569  				return err
  3570  			}
  3571  			m.Object = &Object_Config{v}
  3572  			iNdEx = postIndex
  3573  		default:
  3574  			iNdEx = preIndex
  3575  			skippy, err := skipWatch(dAtA[iNdEx:])
  3576  			if err != nil {
  3577  				return err
  3578  			}
  3579  			if skippy < 0 {
  3580  				return ErrInvalidLengthWatch
  3581  			}
  3582  			if (iNdEx + skippy) < 0 {
  3583  				return ErrInvalidLengthWatch
  3584  			}
  3585  			if (iNdEx + skippy) > l {
  3586  				return io.ErrUnexpectedEOF
  3587  			}
  3588  			iNdEx += skippy
  3589  		}
  3590  	}
  3591  
  3592  	if iNdEx > l {
  3593  		return io.ErrUnexpectedEOF
  3594  	}
  3595  	return nil
  3596  }
  3597  func (m *SelectBySlot) Unmarshal(dAtA []byte) error {
  3598  	l := len(dAtA)
  3599  	iNdEx := 0
  3600  	for iNdEx < l {
  3601  		preIndex := iNdEx
  3602  		var wire uint64
  3603  		for shift := uint(0); ; shift += 7 {
  3604  			if shift >= 64 {
  3605  				return ErrIntOverflowWatch
  3606  			}
  3607  			if iNdEx >= l {
  3608  				return io.ErrUnexpectedEOF
  3609  			}
  3610  			b := dAtA[iNdEx]
  3611  			iNdEx++
  3612  			wire |= uint64(b&0x7F) << shift
  3613  			if b < 0x80 {
  3614  				break
  3615  			}
  3616  		}
  3617  		fieldNum := int32(wire >> 3)
  3618  		wireType := int(wire & 0x7)
  3619  		if wireType == 4 {
  3620  			return fmt.Errorf("proto: SelectBySlot: wiretype end group for non-group")
  3621  		}
  3622  		if fieldNum <= 0 {
  3623  			return fmt.Errorf("proto: SelectBySlot: illegal tag %d (wire type %d)", fieldNum, wire)
  3624  		}
  3625  		switch fieldNum {
  3626  		case 1:
  3627  			if wireType != 2 {
  3628  				return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType)
  3629  			}
  3630  			var stringLen uint64
  3631  			for shift := uint(0); ; shift += 7 {
  3632  				if shift >= 64 {
  3633  					return ErrIntOverflowWatch
  3634  				}
  3635  				if iNdEx >= l {
  3636  					return io.ErrUnexpectedEOF
  3637  				}
  3638  				b := dAtA[iNdEx]
  3639  				iNdEx++
  3640  				stringLen |= uint64(b&0x7F) << shift
  3641  				if b < 0x80 {
  3642  					break
  3643  				}
  3644  			}
  3645  			intStringLen := int(stringLen)
  3646  			if intStringLen < 0 {
  3647  				return ErrInvalidLengthWatch
  3648  			}
  3649  			postIndex := iNdEx + intStringLen
  3650  			if postIndex < 0 {
  3651  				return ErrInvalidLengthWatch
  3652  			}
  3653  			if postIndex > l {
  3654  				return io.ErrUnexpectedEOF
  3655  			}
  3656  			m.ServiceID = string(dAtA[iNdEx:postIndex])
  3657  			iNdEx = postIndex
  3658  		case 2:
  3659  			if wireType != 0 {
  3660  				return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType)
  3661  			}
  3662  			m.Slot = 0
  3663  			for shift := uint(0); ; shift += 7 {
  3664  				if shift >= 64 {
  3665  					return ErrIntOverflowWatch
  3666  				}
  3667  				if iNdEx >= l {
  3668  					return io.ErrUnexpectedEOF
  3669  				}
  3670  				b := dAtA[iNdEx]
  3671  				iNdEx++
  3672  				m.Slot |= uint64(b&0x7F) << shift
  3673  				if b < 0x80 {
  3674  					break
  3675  				}
  3676  			}
  3677  		default:
  3678  			iNdEx = preIndex
  3679  			skippy, err := skipWatch(dAtA[iNdEx:])
  3680  			if err != nil {
  3681  				return err
  3682  			}
  3683  			if skippy < 0 {
  3684  				return ErrInvalidLengthWatch
  3685  			}
  3686  			if (iNdEx + skippy) < 0 {
  3687  				return ErrInvalidLengthWatch
  3688  			}
  3689  			if (iNdEx + skippy) > l {
  3690  				return io.ErrUnexpectedEOF
  3691  			}
  3692  			iNdEx += skippy
  3693  		}
  3694  	}
  3695  
  3696  	if iNdEx > l {
  3697  		return io.ErrUnexpectedEOF
  3698  	}
  3699  	return nil
  3700  }
  3701  func (m *SelectByCustom) Unmarshal(dAtA []byte) error {
  3702  	l := len(dAtA)
  3703  	iNdEx := 0
  3704  	for iNdEx < l {
  3705  		preIndex := iNdEx
  3706  		var wire uint64
  3707  		for shift := uint(0); ; shift += 7 {
  3708  			if shift >= 64 {
  3709  				return ErrIntOverflowWatch
  3710  			}
  3711  			if iNdEx >= l {
  3712  				return io.ErrUnexpectedEOF
  3713  			}
  3714  			b := dAtA[iNdEx]
  3715  			iNdEx++
  3716  			wire |= uint64(b&0x7F) << shift
  3717  			if b < 0x80 {
  3718  				break
  3719  			}
  3720  		}
  3721  		fieldNum := int32(wire >> 3)
  3722  		wireType := int(wire & 0x7)
  3723  		if wireType == 4 {
  3724  			return fmt.Errorf("proto: SelectByCustom: wiretype end group for non-group")
  3725  		}
  3726  		if fieldNum <= 0 {
  3727  			return fmt.Errorf("proto: SelectByCustom: illegal tag %d (wire type %d)", fieldNum, wire)
  3728  		}
  3729  		switch fieldNum {
  3730  		case 1:
  3731  			if wireType != 2 {
  3732  				return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
  3733  			}
  3734  			var stringLen uint64
  3735  			for shift := uint(0); ; shift += 7 {
  3736  				if shift >= 64 {
  3737  					return ErrIntOverflowWatch
  3738  				}
  3739  				if iNdEx >= l {
  3740  					return io.ErrUnexpectedEOF
  3741  				}
  3742  				b := dAtA[iNdEx]
  3743  				iNdEx++
  3744  				stringLen |= uint64(b&0x7F) << shift
  3745  				if b < 0x80 {
  3746  					break
  3747  				}
  3748  			}
  3749  			intStringLen := int(stringLen)
  3750  			if intStringLen < 0 {
  3751  				return ErrInvalidLengthWatch
  3752  			}
  3753  			postIndex := iNdEx + intStringLen
  3754  			if postIndex < 0 {
  3755  				return ErrInvalidLengthWatch
  3756  			}
  3757  			if postIndex > l {
  3758  				return io.ErrUnexpectedEOF
  3759  			}
  3760  			m.Kind = string(dAtA[iNdEx:postIndex])
  3761  			iNdEx = postIndex
  3762  		case 2:
  3763  			if wireType != 2 {
  3764  				return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
  3765  			}
  3766  			var stringLen uint64
  3767  			for shift := uint(0); ; shift += 7 {
  3768  				if shift >= 64 {
  3769  					return ErrIntOverflowWatch
  3770  				}
  3771  				if iNdEx >= l {
  3772  					return io.ErrUnexpectedEOF
  3773  				}
  3774  				b := dAtA[iNdEx]
  3775  				iNdEx++
  3776  				stringLen |= uint64(b&0x7F) << shift
  3777  				if b < 0x80 {
  3778  					break
  3779  				}
  3780  			}
  3781  			intStringLen := int(stringLen)
  3782  			if intStringLen < 0 {
  3783  				return ErrInvalidLengthWatch
  3784  			}
  3785  			postIndex := iNdEx + intStringLen
  3786  			if postIndex < 0 {
  3787  				return ErrInvalidLengthWatch
  3788  			}
  3789  			if postIndex > l {
  3790  				return io.ErrUnexpectedEOF
  3791  			}
  3792  			m.Index = string(dAtA[iNdEx:postIndex])
  3793  			iNdEx = postIndex
  3794  		case 3:
  3795  			if wireType != 2 {
  3796  				return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  3797  			}
  3798  			var stringLen uint64
  3799  			for shift := uint(0); ; shift += 7 {
  3800  				if shift >= 64 {
  3801  					return ErrIntOverflowWatch
  3802  				}
  3803  				if iNdEx >= l {
  3804  					return io.ErrUnexpectedEOF
  3805  				}
  3806  				b := dAtA[iNdEx]
  3807  				iNdEx++
  3808  				stringLen |= uint64(b&0x7F) << shift
  3809  				if b < 0x80 {
  3810  					break
  3811  				}
  3812  			}
  3813  			intStringLen := int(stringLen)
  3814  			if intStringLen < 0 {
  3815  				return ErrInvalidLengthWatch
  3816  			}
  3817  			postIndex := iNdEx + intStringLen
  3818  			if postIndex < 0 {
  3819  				return ErrInvalidLengthWatch
  3820  			}
  3821  			if postIndex > l {
  3822  				return io.ErrUnexpectedEOF
  3823  			}
  3824  			m.Value = string(dAtA[iNdEx:postIndex])
  3825  			iNdEx = postIndex
  3826  		default:
  3827  			iNdEx = preIndex
  3828  			skippy, err := skipWatch(dAtA[iNdEx:])
  3829  			if err != nil {
  3830  				return err
  3831  			}
  3832  			if skippy < 0 {
  3833  				return ErrInvalidLengthWatch
  3834  			}
  3835  			if (iNdEx + skippy) < 0 {
  3836  				return ErrInvalidLengthWatch
  3837  			}
  3838  			if (iNdEx + skippy) > l {
  3839  				return io.ErrUnexpectedEOF
  3840  			}
  3841  			iNdEx += skippy
  3842  		}
  3843  	}
  3844  
  3845  	if iNdEx > l {
  3846  		return io.ErrUnexpectedEOF
  3847  	}
  3848  	return nil
  3849  }
  3850  func (m *SelectBy) Unmarshal(dAtA []byte) error {
  3851  	l := len(dAtA)
  3852  	iNdEx := 0
  3853  	for iNdEx < l {
  3854  		preIndex := iNdEx
  3855  		var wire uint64
  3856  		for shift := uint(0); ; shift += 7 {
  3857  			if shift >= 64 {
  3858  				return ErrIntOverflowWatch
  3859  			}
  3860  			if iNdEx >= l {
  3861  				return io.ErrUnexpectedEOF
  3862  			}
  3863  			b := dAtA[iNdEx]
  3864  			iNdEx++
  3865  			wire |= uint64(b&0x7F) << shift
  3866  			if b < 0x80 {
  3867  				break
  3868  			}
  3869  		}
  3870  		fieldNum := int32(wire >> 3)
  3871  		wireType := int(wire & 0x7)
  3872  		if wireType == 4 {
  3873  			return fmt.Errorf("proto: SelectBy: wiretype end group for non-group")
  3874  		}
  3875  		if fieldNum <= 0 {
  3876  			return fmt.Errorf("proto: SelectBy: illegal tag %d (wire type %d)", fieldNum, wire)
  3877  		}
  3878  		switch fieldNum {
  3879  		case 1:
  3880  			if wireType != 2 {
  3881  				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  3882  			}
  3883  			var stringLen uint64
  3884  			for shift := uint(0); ; shift += 7 {
  3885  				if shift >= 64 {
  3886  					return ErrIntOverflowWatch
  3887  				}
  3888  				if iNdEx >= l {
  3889  					return io.ErrUnexpectedEOF
  3890  				}
  3891  				b := dAtA[iNdEx]
  3892  				iNdEx++
  3893  				stringLen |= uint64(b&0x7F) << shift
  3894  				if b < 0x80 {
  3895  					break
  3896  				}
  3897  			}
  3898  			intStringLen := int(stringLen)
  3899  			if intStringLen < 0 {
  3900  				return ErrInvalidLengthWatch
  3901  			}
  3902  			postIndex := iNdEx + intStringLen
  3903  			if postIndex < 0 {
  3904  				return ErrInvalidLengthWatch
  3905  			}
  3906  			if postIndex > l {
  3907  				return io.ErrUnexpectedEOF
  3908  			}
  3909  			m.By = &SelectBy_ID{string(dAtA[iNdEx:postIndex])}
  3910  			iNdEx = postIndex
  3911  		case 2:
  3912  			if wireType != 2 {
  3913  				return fmt.Errorf("proto: wrong wireType = %d for field IDPrefix", wireType)
  3914  			}
  3915  			var stringLen uint64
  3916  			for shift := uint(0); ; shift += 7 {
  3917  				if shift >= 64 {
  3918  					return ErrIntOverflowWatch
  3919  				}
  3920  				if iNdEx >= l {
  3921  					return io.ErrUnexpectedEOF
  3922  				}
  3923  				b := dAtA[iNdEx]
  3924  				iNdEx++
  3925  				stringLen |= uint64(b&0x7F) << shift
  3926  				if b < 0x80 {
  3927  					break
  3928  				}
  3929  			}
  3930  			intStringLen := int(stringLen)
  3931  			if intStringLen < 0 {
  3932  				return ErrInvalidLengthWatch
  3933  			}
  3934  			postIndex := iNdEx + intStringLen
  3935  			if postIndex < 0 {
  3936  				return ErrInvalidLengthWatch
  3937  			}
  3938  			if postIndex > l {
  3939  				return io.ErrUnexpectedEOF
  3940  			}
  3941  			m.By = &SelectBy_IDPrefix{string(dAtA[iNdEx:postIndex])}
  3942  			iNdEx = postIndex
  3943  		case 3:
  3944  			if wireType != 2 {
  3945  				return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  3946  			}
  3947  			var stringLen uint64
  3948  			for shift := uint(0); ; shift += 7 {
  3949  				if shift >= 64 {
  3950  					return ErrIntOverflowWatch
  3951  				}
  3952  				if iNdEx >= l {
  3953  					return io.ErrUnexpectedEOF
  3954  				}
  3955  				b := dAtA[iNdEx]
  3956  				iNdEx++
  3957  				stringLen |= uint64(b&0x7F) << shift
  3958  				if b < 0x80 {
  3959  					break
  3960  				}
  3961  			}
  3962  			intStringLen := int(stringLen)
  3963  			if intStringLen < 0 {
  3964  				return ErrInvalidLengthWatch
  3965  			}
  3966  			postIndex := iNdEx + intStringLen
  3967  			if postIndex < 0 {
  3968  				return ErrInvalidLengthWatch
  3969  			}
  3970  			if postIndex > l {
  3971  				return io.ErrUnexpectedEOF
  3972  			}
  3973  			m.By = &SelectBy_Name{string(dAtA[iNdEx:postIndex])}
  3974  			iNdEx = postIndex
  3975  		case 4:
  3976  			if wireType != 2 {
  3977  				return fmt.Errorf("proto: wrong wireType = %d for field NamePrefix", wireType)
  3978  			}
  3979  			var stringLen uint64
  3980  			for shift := uint(0); ; shift += 7 {
  3981  				if shift >= 64 {
  3982  					return ErrIntOverflowWatch
  3983  				}
  3984  				if iNdEx >= l {
  3985  					return io.ErrUnexpectedEOF
  3986  				}
  3987  				b := dAtA[iNdEx]
  3988  				iNdEx++
  3989  				stringLen |= uint64(b&0x7F) << shift
  3990  				if b < 0x80 {
  3991  					break
  3992  				}
  3993  			}
  3994  			intStringLen := int(stringLen)
  3995  			if intStringLen < 0 {
  3996  				return ErrInvalidLengthWatch
  3997  			}
  3998  			postIndex := iNdEx + intStringLen
  3999  			if postIndex < 0 {
  4000  				return ErrInvalidLengthWatch
  4001  			}
  4002  			if postIndex > l {
  4003  				return io.ErrUnexpectedEOF
  4004  			}
  4005  			m.By = &SelectBy_NamePrefix{string(dAtA[iNdEx:postIndex])}
  4006  			iNdEx = postIndex
  4007  		case 5:
  4008  			if wireType != 2 {
  4009  				return fmt.Errorf("proto: wrong wireType = %d for field Custom", wireType)
  4010  			}
  4011  			var msglen int
  4012  			for shift := uint(0); ; shift += 7 {
  4013  				if shift >= 64 {
  4014  					return ErrIntOverflowWatch
  4015  				}
  4016  				if iNdEx >= l {
  4017  					return io.ErrUnexpectedEOF
  4018  				}
  4019  				b := dAtA[iNdEx]
  4020  				iNdEx++
  4021  				msglen |= int(b&0x7F) << shift
  4022  				if b < 0x80 {
  4023  					break
  4024  				}
  4025  			}
  4026  			if msglen < 0 {
  4027  				return ErrInvalidLengthWatch
  4028  			}
  4029  			postIndex := iNdEx + msglen
  4030  			if postIndex < 0 {
  4031  				return ErrInvalidLengthWatch
  4032  			}
  4033  			if postIndex > l {
  4034  				return io.ErrUnexpectedEOF
  4035  			}
  4036  			v := &SelectByCustom{}
  4037  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4038  				return err
  4039  			}
  4040  			m.By = &SelectBy_Custom{v}
  4041  			iNdEx = postIndex
  4042  		case 6:
  4043  			if wireType != 2 {
  4044  				return fmt.Errorf("proto: wrong wireType = %d for field CustomPrefix", wireType)
  4045  			}
  4046  			var msglen int
  4047  			for shift := uint(0); ; shift += 7 {
  4048  				if shift >= 64 {
  4049  					return ErrIntOverflowWatch
  4050  				}
  4051  				if iNdEx >= l {
  4052  					return io.ErrUnexpectedEOF
  4053  				}
  4054  				b := dAtA[iNdEx]
  4055  				iNdEx++
  4056  				msglen |= int(b&0x7F) << shift
  4057  				if b < 0x80 {
  4058  					break
  4059  				}
  4060  			}
  4061  			if msglen < 0 {
  4062  				return ErrInvalidLengthWatch
  4063  			}
  4064  			postIndex := iNdEx + msglen
  4065  			if postIndex < 0 {
  4066  				return ErrInvalidLengthWatch
  4067  			}
  4068  			if postIndex > l {
  4069  				return io.ErrUnexpectedEOF
  4070  			}
  4071  			v := &SelectByCustom{}
  4072  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4073  				return err
  4074  			}
  4075  			m.By = &SelectBy_CustomPrefix{v}
  4076  			iNdEx = postIndex
  4077  		case 7:
  4078  			if wireType != 2 {
  4079  				return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType)
  4080  			}
  4081  			var stringLen uint64
  4082  			for shift := uint(0); ; shift += 7 {
  4083  				if shift >= 64 {
  4084  					return ErrIntOverflowWatch
  4085  				}
  4086  				if iNdEx >= l {
  4087  					return io.ErrUnexpectedEOF
  4088  				}
  4089  				b := dAtA[iNdEx]
  4090  				iNdEx++
  4091  				stringLen |= uint64(b&0x7F) << shift
  4092  				if b < 0x80 {
  4093  					break
  4094  				}
  4095  			}
  4096  			intStringLen := int(stringLen)
  4097  			if intStringLen < 0 {
  4098  				return ErrInvalidLengthWatch
  4099  			}
  4100  			postIndex := iNdEx + intStringLen
  4101  			if postIndex < 0 {
  4102  				return ErrInvalidLengthWatch
  4103  			}
  4104  			if postIndex > l {
  4105  				return io.ErrUnexpectedEOF
  4106  			}
  4107  			m.By = &SelectBy_ServiceID{string(dAtA[iNdEx:postIndex])}
  4108  			iNdEx = postIndex
  4109  		case 8:
  4110  			if wireType != 2 {
  4111  				return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
  4112  			}
  4113  			var stringLen uint64
  4114  			for shift := uint(0); ; shift += 7 {
  4115  				if shift >= 64 {
  4116  					return ErrIntOverflowWatch
  4117  				}
  4118  				if iNdEx >= l {
  4119  					return io.ErrUnexpectedEOF
  4120  				}
  4121  				b := dAtA[iNdEx]
  4122  				iNdEx++
  4123  				stringLen |= uint64(b&0x7F) << shift
  4124  				if b < 0x80 {
  4125  					break
  4126  				}
  4127  			}
  4128  			intStringLen := int(stringLen)
  4129  			if intStringLen < 0 {
  4130  				return ErrInvalidLengthWatch
  4131  			}
  4132  			postIndex := iNdEx + intStringLen
  4133  			if postIndex < 0 {
  4134  				return ErrInvalidLengthWatch
  4135  			}
  4136  			if postIndex > l {
  4137  				return io.ErrUnexpectedEOF
  4138  			}
  4139  			m.By = &SelectBy_NodeID{string(dAtA[iNdEx:postIndex])}
  4140  			iNdEx = postIndex
  4141  		case 9:
  4142  			if wireType != 2 {
  4143  				return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType)
  4144  			}
  4145  			var msglen int
  4146  			for shift := uint(0); ; shift += 7 {
  4147  				if shift >= 64 {
  4148  					return ErrIntOverflowWatch
  4149  				}
  4150  				if iNdEx >= l {
  4151  					return io.ErrUnexpectedEOF
  4152  				}
  4153  				b := dAtA[iNdEx]
  4154  				iNdEx++
  4155  				msglen |= int(b&0x7F) << shift
  4156  				if b < 0x80 {
  4157  					break
  4158  				}
  4159  			}
  4160  			if msglen < 0 {
  4161  				return ErrInvalidLengthWatch
  4162  			}
  4163  			postIndex := iNdEx + msglen
  4164  			if postIndex < 0 {
  4165  				return ErrInvalidLengthWatch
  4166  			}
  4167  			if postIndex > l {
  4168  				return io.ErrUnexpectedEOF
  4169  			}
  4170  			v := &SelectBySlot{}
  4171  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4172  				return err
  4173  			}
  4174  			m.By = &SelectBy_Slot{v}
  4175  			iNdEx = postIndex
  4176  		case 10:
  4177  			if wireType != 0 {
  4178  				return fmt.Errorf("proto: wrong wireType = %d for field DesiredState", wireType)
  4179  			}
  4180  			var v TaskState
  4181  			for shift := uint(0); ; shift += 7 {
  4182  				if shift >= 64 {
  4183  					return ErrIntOverflowWatch
  4184  				}
  4185  				if iNdEx >= l {
  4186  					return io.ErrUnexpectedEOF
  4187  				}
  4188  				b := dAtA[iNdEx]
  4189  				iNdEx++
  4190  				v |= TaskState(b&0x7F) << shift
  4191  				if b < 0x80 {
  4192  					break
  4193  				}
  4194  			}
  4195  			m.By = &SelectBy_DesiredState{v}
  4196  		case 11:
  4197  			if wireType != 0 {
  4198  				return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType)
  4199  			}
  4200  			var v NodeRole
  4201  			for shift := uint(0); ; shift += 7 {
  4202  				if shift >= 64 {
  4203  					return ErrIntOverflowWatch
  4204  				}
  4205  				if iNdEx >= l {
  4206  					return io.ErrUnexpectedEOF
  4207  				}
  4208  				b := dAtA[iNdEx]
  4209  				iNdEx++
  4210  				v |= NodeRole(b&0x7F) << shift
  4211  				if b < 0x80 {
  4212  					break
  4213  				}
  4214  			}
  4215  			m.By = &SelectBy_Role{v}
  4216  		case 12:
  4217  			if wireType != 0 {
  4218  				return fmt.Errorf("proto: wrong wireType = %d for field Membership", wireType)
  4219  			}
  4220  			var v NodeSpec_Membership
  4221  			for shift := uint(0); ; shift += 7 {
  4222  				if shift >= 64 {
  4223  					return ErrIntOverflowWatch
  4224  				}
  4225  				if iNdEx >= l {
  4226  					return io.ErrUnexpectedEOF
  4227  				}
  4228  				b := dAtA[iNdEx]
  4229  				iNdEx++
  4230  				v |= NodeSpec_Membership(b&0x7F) << shift
  4231  				if b < 0x80 {
  4232  					break
  4233  				}
  4234  			}
  4235  			m.By = &SelectBy_Membership{v}
  4236  		case 13:
  4237  			if wireType != 2 {
  4238  				return fmt.Errorf("proto: wrong wireType = %d for field ReferencedNetworkID", wireType)
  4239  			}
  4240  			var stringLen uint64
  4241  			for shift := uint(0); ; shift += 7 {
  4242  				if shift >= 64 {
  4243  					return ErrIntOverflowWatch
  4244  				}
  4245  				if iNdEx >= l {
  4246  					return io.ErrUnexpectedEOF
  4247  				}
  4248  				b := dAtA[iNdEx]
  4249  				iNdEx++
  4250  				stringLen |= uint64(b&0x7F) << shift
  4251  				if b < 0x80 {
  4252  					break
  4253  				}
  4254  			}
  4255  			intStringLen := int(stringLen)
  4256  			if intStringLen < 0 {
  4257  				return ErrInvalidLengthWatch
  4258  			}
  4259  			postIndex := iNdEx + intStringLen
  4260  			if postIndex < 0 {
  4261  				return ErrInvalidLengthWatch
  4262  			}
  4263  			if postIndex > l {
  4264  				return io.ErrUnexpectedEOF
  4265  			}
  4266  			m.By = &SelectBy_ReferencedNetworkID{string(dAtA[iNdEx:postIndex])}
  4267  			iNdEx = postIndex
  4268  		case 14:
  4269  			if wireType != 2 {
  4270  				return fmt.Errorf("proto: wrong wireType = %d for field ReferencedSecretID", wireType)
  4271  			}
  4272  			var stringLen uint64
  4273  			for shift := uint(0); ; shift += 7 {
  4274  				if shift >= 64 {
  4275  					return ErrIntOverflowWatch
  4276  				}
  4277  				if iNdEx >= l {
  4278  					return io.ErrUnexpectedEOF
  4279  				}
  4280  				b := dAtA[iNdEx]
  4281  				iNdEx++
  4282  				stringLen |= uint64(b&0x7F) << shift
  4283  				if b < 0x80 {
  4284  					break
  4285  				}
  4286  			}
  4287  			intStringLen := int(stringLen)
  4288  			if intStringLen < 0 {
  4289  				return ErrInvalidLengthWatch
  4290  			}
  4291  			postIndex := iNdEx + intStringLen
  4292  			if postIndex < 0 {
  4293  				return ErrInvalidLengthWatch
  4294  			}
  4295  			if postIndex > l {
  4296  				return io.ErrUnexpectedEOF
  4297  			}
  4298  			m.By = &SelectBy_ReferencedSecretID{string(dAtA[iNdEx:postIndex])}
  4299  			iNdEx = postIndex
  4300  		case 15:
  4301  			if wireType != 2 {
  4302  				return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
  4303  			}
  4304  			var stringLen uint64
  4305  			for shift := uint(0); ; shift += 7 {
  4306  				if shift >= 64 {
  4307  					return ErrIntOverflowWatch
  4308  				}
  4309  				if iNdEx >= l {
  4310  					return io.ErrUnexpectedEOF
  4311  				}
  4312  				b := dAtA[iNdEx]
  4313  				iNdEx++
  4314  				stringLen |= uint64(b&0x7F) << shift
  4315  				if b < 0x80 {
  4316  					break
  4317  				}
  4318  			}
  4319  			intStringLen := int(stringLen)
  4320  			if intStringLen < 0 {
  4321  				return ErrInvalidLengthWatch
  4322  			}
  4323  			postIndex := iNdEx + intStringLen
  4324  			if postIndex < 0 {
  4325  				return ErrInvalidLengthWatch
  4326  			}
  4327  			if postIndex > l {
  4328  				return io.ErrUnexpectedEOF
  4329  			}
  4330  			m.By = &SelectBy_Kind{string(dAtA[iNdEx:postIndex])}
  4331  			iNdEx = postIndex
  4332  		case 16:
  4333  			if wireType != 2 {
  4334  				return fmt.Errorf("proto: wrong wireType = %d for field ReferencedConfigID", wireType)
  4335  			}
  4336  			var stringLen uint64
  4337  			for shift := uint(0); ; shift += 7 {
  4338  				if shift >= 64 {
  4339  					return ErrIntOverflowWatch
  4340  				}
  4341  				if iNdEx >= l {
  4342  					return io.ErrUnexpectedEOF
  4343  				}
  4344  				b := dAtA[iNdEx]
  4345  				iNdEx++
  4346  				stringLen |= uint64(b&0x7F) << shift
  4347  				if b < 0x80 {
  4348  					break
  4349  				}
  4350  			}
  4351  			intStringLen := int(stringLen)
  4352  			if intStringLen < 0 {
  4353  				return ErrInvalidLengthWatch
  4354  			}
  4355  			postIndex := iNdEx + intStringLen
  4356  			if postIndex < 0 {
  4357  				return ErrInvalidLengthWatch
  4358  			}
  4359  			if postIndex > l {
  4360  				return io.ErrUnexpectedEOF
  4361  			}
  4362  			m.By = &SelectBy_ReferencedConfigID{string(dAtA[iNdEx:postIndex])}
  4363  			iNdEx = postIndex
  4364  		default:
  4365  			iNdEx = preIndex
  4366  			skippy, err := skipWatch(dAtA[iNdEx:])
  4367  			if err != nil {
  4368  				return err
  4369  			}
  4370  			if skippy < 0 {
  4371  				return ErrInvalidLengthWatch
  4372  			}
  4373  			if (iNdEx + skippy) < 0 {
  4374  				return ErrInvalidLengthWatch
  4375  			}
  4376  			if (iNdEx + skippy) > l {
  4377  				return io.ErrUnexpectedEOF
  4378  			}
  4379  			iNdEx += skippy
  4380  		}
  4381  	}
  4382  
  4383  	if iNdEx > l {
  4384  		return io.ErrUnexpectedEOF
  4385  	}
  4386  	return nil
  4387  }
  4388  func (m *WatchRequest) Unmarshal(dAtA []byte) error {
  4389  	l := len(dAtA)
  4390  	iNdEx := 0
  4391  	for iNdEx < l {
  4392  		preIndex := iNdEx
  4393  		var wire uint64
  4394  		for shift := uint(0); ; shift += 7 {
  4395  			if shift >= 64 {
  4396  				return ErrIntOverflowWatch
  4397  			}
  4398  			if iNdEx >= l {
  4399  				return io.ErrUnexpectedEOF
  4400  			}
  4401  			b := dAtA[iNdEx]
  4402  			iNdEx++
  4403  			wire |= uint64(b&0x7F) << shift
  4404  			if b < 0x80 {
  4405  				break
  4406  			}
  4407  		}
  4408  		fieldNum := int32(wire >> 3)
  4409  		wireType := int(wire & 0x7)
  4410  		if wireType == 4 {
  4411  			return fmt.Errorf("proto: WatchRequest: wiretype end group for non-group")
  4412  		}
  4413  		if fieldNum <= 0 {
  4414  			return fmt.Errorf("proto: WatchRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  4415  		}
  4416  		switch fieldNum {
  4417  		case 1:
  4418  			if wireType != 2 {
  4419  				return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType)
  4420  			}
  4421  			var msglen int
  4422  			for shift := uint(0); ; shift += 7 {
  4423  				if shift >= 64 {
  4424  					return ErrIntOverflowWatch
  4425  				}
  4426  				if iNdEx >= l {
  4427  					return io.ErrUnexpectedEOF
  4428  				}
  4429  				b := dAtA[iNdEx]
  4430  				iNdEx++
  4431  				msglen |= int(b&0x7F) << shift
  4432  				if b < 0x80 {
  4433  					break
  4434  				}
  4435  			}
  4436  			if msglen < 0 {
  4437  				return ErrInvalidLengthWatch
  4438  			}
  4439  			postIndex := iNdEx + msglen
  4440  			if postIndex < 0 {
  4441  				return ErrInvalidLengthWatch
  4442  			}
  4443  			if postIndex > l {
  4444  				return io.ErrUnexpectedEOF
  4445  			}
  4446  			m.Entries = append(m.Entries, &WatchRequest_WatchEntry{})
  4447  			if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4448  				return err
  4449  			}
  4450  			iNdEx = postIndex
  4451  		case 2:
  4452  			if wireType != 2 {
  4453  				return fmt.Errorf("proto: wrong wireType = %d for field ResumeFrom", wireType)
  4454  			}
  4455  			var msglen int
  4456  			for shift := uint(0); ; shift += 7 {
  4457  				if shift >= 64 {
  4458  					return ErrIntOverflowWatch
  4459  				}
  4460  				if iNdEx >= l {
  4461  					return io.ErrUnexpectedEOF
  4462  				}
  4463  				b := dAtA[iNdEx]
  4464  				iNdEx++
  4465  				msglen |= int(b&0x7F) << shift
  4466  				if b < 0x80 {
  4467  					break
  4468  				}
  4469  			}
  4470  			if msglen < 0 {
  4471  				return ErrInvalidLengthWatch
  4472  			}
  4473  			postIndex := iNdEx + msglen
  4474  			if postIndex < 0 {
  4475  				return ErrInvalidLengthWatch
  4476  			}
  4477  			if postIndex > l {
  4478  				return io.ErrUnexpectedEOF
  4479  			}
  4480  			if m.ResumeFrom == nil {
  4481  				m.ResumeFrom = &Version{}
  4482  			}
  4483  			if err := m.ResumeFrom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4484  				return err
  4485  			}
  4486  			iNdEx = postIndex
  4487  		case 3:
  4488  			if wireType != 0 {
  4489  				return fmt.Errorf("proto: wrong wireType = %d for field IncludeOldObject", wireType)
  4490  			}
  4491  			var v int
  4492  			for shift := uint(0); ; shift += 7 {
  4493  				if shift >= 64 {
  4494  					return ErrIntOverflowWatch
  4495  				}
  4496  				if iNdEx >= l {
  4497  					return io.ErrUnexpectedEOF
  4498  				}
  4499  				b := dAtA[iNdEx]
  4500  				iNdEx++
  4501  				v |= int(b&0x7F) << shift
  4502  				if b < 0x80 {
  4503  					break
  4504  				}
  4505  			}
  4506  			m.IncludeOldObject = bool(v != 0)
  4507  		default:
  4508  			iNdEx = preIndex
  4509  			skippy, err := skipWatch(dAtA[iNdEx:])
  4510  			if err != nil {
  4511  				return err
  4512  			}
  4513  			if skippy < 0 {
  4514  				return ErrInvalidLengthWatch
  4515  			}
  4516  			if (iNdEx + skippy) < 0 {
  4517  				return ErrInvalidLengthWatch
  4518  			}
  4519  			if (iNdEx + skippy) > l {
  4520  				return io.ErrUnexpectedEOF
  4521  			}
  4522  			iNdEx += skippy
  4523  		}
  4524  	}
  4525  
  4526  	if iNdEx > l {
  4527  		return io.ErrUnexpectedEOF
  4528  	}
  4529  	return nil
  4530  }
  4531  func (m *WatchRequest_WatchEntry) Unmarshal(dAtA []byte) error {
  4532  	l := len(dAtA)
  4533  	iNdEx := 0
  4534  	for iNdEx < l {
  4535  		preIndex := iNdEx
  4536  		var wire uint64
  4537  		for shift := uint(0); ; shift += 7 {
  4538  			if shift >= 64 {
  4539  				return ErrIntOverflowWatch
  4540  			}
  4541  			if iNdEx >= l {
  4542  				return io.ErrUnexpectedEOF
  4543  			}
  4544  			b := dAtA[iNdEx]
  4545  			iNdEx++
  4546  			wire |= uint64(b&0x7F) << shift
  4547  			if b < 0x80 {
  4548  				break
  4549  			}
  4550  		}
  4551  		fieldNum := int32(wire >> 3)
  4552  		wireType := int(wire & 0x7)
  4553  		if wireType == 4 {
  4554  			return fmt.Errorf("proto: WatchEntry: wiretype end group for non-group")
  4555  		}
  4556  		if fieldNum <= 0 {
  4557  			return fmt.Errorf("proto: WatchEntry: illegal tag %d (wire type %d)", fieldNum, wire)
  4558  		}
  4559  		switch fieldNum {
  4560  		case 1:
  4561  			if wireType != 2 {
  4562  				return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
  4563  			}
  4564  			var stringLen uint64
  4565  			for shift := uint(0); ; shift += 7 {
  4566  				if shift >= 64 {
  4567  					return ErrIntOverflowWatch
  4568  				}
  4569  				if iNdEx >= l {
  4570  					return io.ErrUnexpectedEOF
  4571  				}
  4572  				b := dAtA[iNdEx]
  4573  				iNdEx++
  4574  				stringLen |= uint64(b&0x7F) << shift
  4575  				if b < 0x80 {
  4576  					break
  4577  				}
  4578  			}
  4579  			intStringLen := int(stringLen)
  4580  			if intStringLen < 0 {
  4581  				return ErrInvalidLengthWatch
  4582  			}
  4583  			postIndex := iNdEx + intStringLen
  4584  			if postIndex < 0 {
  4585  				return ErrInvalidLengthWatch
  4586  			}
  4587  			if postIndex > l {
  4588  				return io.ErrUnexpectedEOF
  4589  			}
  4590  			m.Kind = string(dAtA[iNdEx:postIndex])
  4591  			iNdEx = postIndex
  4592  		case 2:
  4593  			if wireType != 0 {
  4594  				return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType)
  4595  			}
  4596  			m.Action = 0
  4597  			for shift := uint(0); ; shift += 7 {
  4598  				if shift >= 64 {
  4599  					return ErrIntOverflowWatch
  4600  				}
  4601  				if iNdEx >= l {
  4602  					return io.ErrUnexpectedEOF
  4603  				}
  4604  				b := dAtA[iNdEx]
  4605  				iNdEx++
  4606  				m.Action |= WatchActionKind(b&0x7F) << shift
  4607  				if b < 0x80 {
  4608  					break
  4609  				}
  4610  			}
  4611  		case 3:
  4612  			if wireType != 2 {
  4613  				return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType)
  4614  			}
  4615  			var msglen int
  4616  			for shift := uint(0); ; shift += 7 {
  4617  				if shift >= 64 {
  4618  					return ErrIntOverflowWatch
  4619  				}
  4620  				if iNdEx >= l {
  4621  					return io.ErrUnexpectedEOF
  4622  				}
  4623  				b := dAtA[iNdEx]
  4624  				iNdEx++
  4625  				msglen |= int(b&0x7F) << shift
  4626  				if b < 0x80 {
  4627  					break
  4628  				}
  4629  			}
  4630  			if msglen < 0 {
  4631  				return ErrInvalidLengthWatch
  4632  			}
  4633  			postIndex := iNdEx + msglen
  4634  			if postIndex < 0 {
  4635  				return ErrInvalidLengthWatch
  4636  			}
  4637  			if postIndex > l {
  4638  				return io.ErrUnexpectedEOF
  4639  			}
  4640  			m.Filters = append(m.Filters, &SelectBy{})
  4641  			if err := m.Filters[len(m.Filters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4642  				return err
  4643  			}
  4644  			iNdEx = postIndex
  4645  		default:
  4646  			iNdEx = preIndex
  4647  			skippy, err := skipWatch(dAtA[iNdEx:])
  4648  			if err != nil {
  4649  				return err
  4650  			}
  4651  			if skippy < 0 {
  4652  				return ErrInvalidLengthWatch
  4653  			}
  4654  			if (iNdEx + skippy) < 0 {
  4655  				return ErrInvalidLengthWatch
  4656  			}
  4657  			if (iNdEx + skippy) > l {
  4658  				return io.ErrUnexpectedEOF
  4659  			}
  4660  			iNdEx += skippy
  4661  		}
  4662  	}
  4663  
  4664  	if iNdEx > l {
  4665  		return io.ErrUnexpectedEOF
  4666  	}
  4667  	return nil
  4668  }
  4669  func (m *WatchMessage) Unmarshal(dAtA []byte) error {
  4670  	l := len(dAtA)
  4671  	iNdEx := 0
  4672  	for iNdEx < l {
  4673  		preIndex := iNdEx
  4674  		var wire uint64
  4675  		for shift := uint(0); ; shift += 7 {
  4676  			if shift >= 64 {
  4677  				return ErrIntOverflowWatch
  4678  			}
  4679  			if iNdEx >= l {
  4680  				return io.ErrUnexpectedEOF
  4681  			}
  4682  			b := dAtA[iNdEx]
  4683  			iNdEx++
  4684  			wire |= uint64(b&0x7F) << shift
  4685  			if b < 0x80 {
  4686  				break
  4687  			}
  4688  		}
  4689  		fieldNum := int32(wire >> 3)
  4690  		wireType := int(wire & 0x7)
  4691  		if wireType == 4 {
  4692  			return fmt.Errorf("proto: WatchMessage: wiretype end group for non-group")
  4693  		}
  4694  		if fieldNum <= 0 {
  4695  			return fmt.Errorf("proto: WatchMessage: illegal tag %d (wire type %d)", fieldNum, wire)
  4696  		}
  4697  		switch fieldNum {
  4698  		case 1:
  4699  			if wireType != 2 {
  4700  				return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType)
  4701  			}
  4702  			var msglen int
  4703  			for shift := uint(0); ; shift += 7 {
  4704  				if shift >= 64 {
  4705  					return ErrIntOverflowWatch
  4706  				}
  4707  				if iNdEx >= l {
  4708  					return io.ErrUnexpectedEOF
  4709  				}
  4710  				b := dAtA[iNdEx]
  4711  				iNdEx++
  4712  				msglen |= int(b&0x7F) << shift
  4713  				if b < 0x80 {
  4714  					break
  4715  				}
  4716  			}
  4717  			if msglen < 0 {
  4718  				return ErrInvalidLengthWatch
  4719  			}
  4720  			postIndex := iNdEx + msglen
  4721  			if postIndex < 0 {
  4722  				return ErrInvalidLengthWatch
  4723  			}
  4724  			if postIndex > l {
  4725  				return io.ErrUnexpectedEOF
  4726  			}
  4727  			m.Events = append(m.Events, &WatchMessage_Event{})
  4728  			if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4729  				return err
  4730  			}
  4731  			iNdEx = postIndex
  4732  		case 2:
  4733  			if wireType != 2 {
  4734  				return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  4735  			}
  4736  			var msglen int
  4737  			for shift := uint(0); ; shift += 7 {
  4738  				if shift >= 64 {
  4739  					return ErrIntOverflowWatch
  4740  				}
  4741  				if iNdEx >= l {
  4742  					return io.ErrUnexpectedEOF
  4743  				}
  4744  				b := dAtA[iNdEx]
  4745  				iNdEx++
  4746  				msglen |= int(b&0x7F) << shift
  4747  				if b < 0x80 {
  4748  					break
  4749  				}
  4750  			}
  4751  			if msglen < 0 {
  4752  				return ErrInvalidLengthWatch
  4753  			}
  4754  			postIndex := iNdEx + msglen
  4755  			if postIndex < 0 {
  4756  				return ErrInvalidLengthWatch
  4757  			}
  4758  			if postIndex > l {
  4759  				return io.ErrUnexpectedEOF
  4760  			}
  4761  			if m.Version == nil {
  4762  				m.Version = &Version{}
  4763  			}
  4764  			if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4765  				return err
  4766  			}
  4767  			iNdEx = postIndex
  4768  		default:
  4769  			iNdEx = preIndex
  4770  			skippy, err := skipWatch(dAtA[iNdEx:])
  4771  			if err != nil {
  4772  				return err
  4773  			}
  4774  			if skippy < 0 {
  4775  				return ErrInvalidLengthWatch
  4776  			}
  4777  			if (iNdEx + skippy) < 0 {
  4778  				return ErrInvalidLengthWatch
  4779  			}
  4780  			if (iNdEx + skippy) > l {
  4781  				return io.ErrUnexpectedEOF
  4782  			}
  4783  			iNdEx += skippy
  4784  		}
  4785  	}
  4786  
  4787  	if iNdEx > l {
  4788  		return io.ErrUnexpectedEOF
  4789  	}
  4790  	return nil
  4791  }
  4792  func (m *WatchMessage_Event) Unmarshal(dAtA []byte) error {
  4793  	l := len(dAtA)
  4794  	iNdEx := 0
  4795  	for iNdEx < l {
  4796  		preIndex := iNdEx
  4797  		var wire uint64
  4798  		for shift := uint(0); ; shift += 7 {
  4799  			if shift >= 64 {
  4800  				return ErrIntOverflowWatch
  4801  			}
  4802  			if iNdEx >= l {
  4803  				return io.ErrUnexpectedEOF
  4804  			}
  4805  			b := dAtA[iNdEx]
  4806  			iNdEx++
  4807  			wire |= uint64(b&0x7F) << shift
  4808  			if b < 0x80 {
  4809  				break
  4810  			}
  4811  		}
  4812  		fieldNum := int32(wire >> 3)
  4813  		wireType := int(wire & 0x7)
  4814  		if wireType == 4 {
  4815  			return fmt.Errorf("proto: Event: wiretype end group for non-group")
  4816  		}
  4817  		if fieldNum <= 0 {
  4818  			return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire)
  4819  		}
  4820  		switch fieldNum {
  4821  		case 1:
  4822  			if wireType != 0 {
  4823  				return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType)
  4824  			}
  4825  			m.Action = 0
  4826  			for shift := uint(0); ; shift += 7 {
  4827  				if shift >= 64 {
  4828  					return ErrIntOverflowWatch
  4829  				}
  4830  				if iNdEx >= l {
  4831  					return io.ErrUnexpectedEOF
  4832  				}
  4833  				b := dAtA[iNdEx]
  4834  				iNdEx++
  4835  				m.Action |= WatchActionKind(b&0x7F) << shift
  4836  				if b < 0x80 {
  4837  					break
  4838  				}
  4839  			}
  4840  		case 2:
  4841  			if wireType != 2 {
  4842  				return fmt.Errorf("proto: wrong wireType = %d for field Object", wireType)
  4843  			}
  4844  			var msglen int
  4845  			for shift := uint(0); ; shift += 7 {
  4846  				if shift >= 64 {
  4847  					return ErrIntOverflowWatch
  4848  				}
  4849  				if iNdEx >= l {
  4850  					return io.ErrUnexpectedEOF
  4851  				}
  4852  				b := dAtA[iNdEx]
  4853  				iNdEx++
  4854  				msglen |= int(b&0x7F) << shift
  4855  				if b < 0x80 {
  4856  					break
  4857  				}
  4858  			}
  4859  			if msglen < 0 {
  4860  				return ErrInvalidLengthWatch
  4861  			}
  4862  			postIndex := iNdEx + msglen
  4863  			if postIndex < 0 {
  4864  				return ErrInvalidLengthWatch
  4865  			}
  4866  			if postIndex > l {
  4867  				return io.ErrUnexpectedEOF
  4868  			}
  4869  			if m.Object == nil {
  4870  				m.Object = &Object{}
  4871  			}
  4872  			if err := m.Object.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4873  				return err
  4874  			}
  4875  			iNdEx = postIndex
  4876  		case 3:
  4877  			if wireType != 2 {
  4878  				return fmt.Errorf("proto: wrong wireType = %d for field OldObject", wireType)
  4879  			}
  4880  			var msglen int
  4881  			for shift := uint(0); ; shift += 7 {
  4882  				if shift >= 64 {
  4883  					return ErrIntOverflowWatch
  4884  				}
  4885  				if iNdEx >= l {
  4886  					return io.ErrUnexpectedEOF
  4887  				}
  4888  				b := dAtA[iNdEx]
  4889  				iNdEx++
  4890  				msglen |= int(b&0x7F) << shift
  4891  				if b < 0x80 {
  4892  					break
  4893  				}
  4894  			}
  4895  			if msglen < 0 {
  4896  				return ErrInvalidLengthWatch
  4897  			}
  4898  			postIndex := iNdEx + msglen
  4899  			if postIndex < 0 {
  4900  				return ErrInvalidLengthWatch
  4901  			}
  4902  			if postIndex > l {
  4903  				return io.ErrUnexpectedEOF
  4904  			}
  4905  			if m.OldObject == nil {
  4906  				m.OldObject = &Object{}
  4907  			}
  4908  			if err := m.OldObject.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  4909  				return err
  4910  			}
  4911  			iNdEx = postIndex
  4912  		default:
  4913  			iNdEx = preIndex
  4914  			skippy, err := skipWatch(dAtA[iNdEx:])
  4915  			if err != nil {
  4916  				return err
  4917  			}
  4918  			if skippy < 0 {
  4919  				return ErrInvalidLengthWatch
  4920  			}
  4921  			if (iNdEx + skippy) < 0 {
  4922  				return ErrInvalidLengthWatch
  4923  			}
  4924  			if (iNdEx + skippy) > l {
  4925  				return io.ErrUnexpectedEOF
  4926  			}
  4927  			iNdEx += skippy
  4928  		}
  4929  	}
  4930  
  4931  	if iNdEx > l {
  4932  		return io.ErrUnexpectedEOF
  4933  	}
  4934  	return nil
  4935  }
  4936  func skipWatch(dAtA []byte) (n int, err error) {
  4937  	l := len(dAtA)
  4938  	iNdEx := 0
  4939  	for iNdEx < l {
  4940  		var wire uint64
  4941  		for shift := uint(0); ; shift += 7 {
  4942  			if shift >= 64 {
  4943  				return 0, ErrIntOverflowWatch
  4944  			}
  4945  			if iNdEx >= l {
  4946  				return 0, io.ErrUnexpectedEOF
  4947  			}
  4948  			b := dAtA[iNdEx]
  4949  			iNdEx++
  4950  			wire |= (uint64(b) & 0x7F) << shift
  4951  			if b < 0x80 {
  4952  				break
  4953  			}
  4954  		}
  4955  		wireType := int(wire & 0x7)
  4956  		switch wireType {
  4957  		case 0:
  4958  			for shift := uint(0); ; shift += 7 {
  4959  				if shift >= 64 {
  4960  					return 0, ErrIntOverflowWatch
  4961  				}
  4962  				if iNdEx >= l {
  4963  					return 0, io.ErrUnexpectedEOF
  4964  				}
  4965  				iNdEx++
  4966  				if dAtA[iNdEx-1] < 0x80 {
  4967  					break
  4968  				}
  4969  			}
  4970  			return iNdEx, nil
  4971  		case 1:
  4972  			iNdEx += 8
  4973  			return iNdEx, nil
  4974  		case 2:
  4975  			var length int
  4976  			for shift := uint(0); ; shift += 7 {
  4977  				if shift >= 64 {
  4978  					return 0, ErrIntOverflowWatch
  4979  				}
  4980  				if iNdEx >= l {
  4981  					return 0, io.ErrUnexpectedEOF
  4982  				}
  4983  				b := dAtA[iNdEx]
  4984  				iNdEx++
  4985  				length |= (int(b) & 0x7F) << shift
  4986  				if b < 0x80 {
  4987  					break
  4988  				}
  4989  			}
  4990  			if length < 0 {
  4991  				return 0, ErrInvalidLengthWatch
  4992  			}
  4993  			iNdEx += length
  4994  			if iNdEx < 0 {
  4995  				return 0, ErrInvalidLengthWatch
  4996  			}
  4997  			return iNdEx, nil
  4998  		case 3:
  4999  			for {
  5000  				var innerWire uint64
  5001  				var start int = iNdEx
  5002  				for shift := uint(0); ; shift += 7 {
  5003  					if shift >= 64 {
  5004  						return 0, ErrIntOverflowWatch
  5005  					}
  5006  					if iNdEx >= l {
  5007  						return 0, io.ErrUnexpectedEOF
  5008  					}
  5009  					b := dAtA[iNdEx]
  5010  					iNdEx++
  5011  					innerWire |= (uint64(b) & 0x7F) << shift
  5012  					if b < 0x80 {
  5013  						break
  5014  					}
  5015  				}
  5016  				innerWireType := int(innerWire & 0x7)
  5017  				if innerWireType == 4 {
  5018  					break
  5019  				}
  5020  				next, err := skipWatch(dAtA[start:])
  5021  				if err != nil {
  5022  					return 0, err
  5023  				}
  5024  				iNdEx = start + next
  5025  				if iNdEx < 0 {
  5026  					return 0, ErrInvalidLengthWatch
  5027  				}
  5028  			}
  5029  			return iNdEx, nil
  5030  		case 4:
  5031  			return iNdEx, nil
  5032  		case 5:
  5033  			iNdEx += 4
  5034  			return iNdEx, nil
  5035  		default:
  5036  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  5037  		}
  5038  	}
  5039  	panic("unreachable")
  5040  }
  5041  
  5042  var (
  5043  	ErrInvalidLengthWatch = fmt.Errorf("proto: negative length found during unmarshaling")
  5044  	ErrIntOverflowWatch   = fmt.Errorf("proto: integer overflow")
  5045  )