// Code generated by protoc-gen-go. DO NOT EDIT.
// source: storagepb.proto

/*
Package storagepb is a generated protocol buffer package.

Package storagepb contains definitions for quota storage protos, which are recorded in etcd.

It is generated from these files:
	storagepb.proto

It has these top-level messages:
	Bucket
	Configs
	Config
	SequencingBasedStrategy
	TimeBasedStrategy
*/
package storagepb

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package

// Possible states of a quota configuration.
type Config_State int32

const (
	// Unknown quota state. Invalid.
	Config_UNKNOWN_CONFIG_STATE Config_State = 0
	// Quota is enabled.
	Config_ENABLED Config_State = 1
	// Quota is disabled (considered infinite).
	Config_DISABLED Config_State = 2
)

var Config_State_name = map[int32]string{
	0: "UNKNOWN_CONFIG_STATE",
	1: "ENABLED",
	2: "DISABLED",
}
var Config_State_value = map[string]int32{
	"UNKNOWN_CONFIG_STATE": 0,
	"ENABLED":              1,
	"DISABLED":             2,
}

func (x Config_State) String() string {
	return proto.EnumName(Config_State_name, int32(x))
}
func (Config_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} }

// Data contained in a quota bucket.
// Stored at each each quota's zero bucket. For example,
// quotas/global/read/0 or quotas/trees/$id/read/0.
type Bucket struct {
	// Number of tokens left in the bucket.
	Tokens int64 `protobuf:"varint,1,opt,name=tokens" json:"tokens,omitempty"`
	// Timestamp of the last time the bucket got replenished.
	LastReplenishMillisSinceEpoch int64 `protobuf:"varint,2,opt,name=last_replenish_millis_since_epoch,json=lastReplenishMillisSinceEpoch" json:"last_replenish_millis_since_epoch,omitempty"`
}

func (m *Bucket) Reset()                    { *m = Bucket{} }
func (m *Bucket) String() string            { return proto.CompactTextString(m) }
func (*Bucket) ProtoMessage()               {}
func (*Bucket) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }

func (m *Bucket) GetTokens() int64 {
	if m != nil {
		return m.Tokens
	}
	return 0
}

func (m *Bucket) GetLastReplenishMillisSinceEpoch() int64 {
	if m != nil {
		return m.LastReplenishMillisSinceEpoch
	}
	return 0
}

// Configuration for all quotas.
// Stored at quotas/configs.
type Configs struct {
	// Known quota configurations.
	Configs []*Config `protobuf:"bytes,1,rep,name=configs" json:"configs,omitempty"`
}

func (m *Configs) Reset()                    { *m = Configs{} }
func (m *Configs) String() string            { return proto.CompactTextString(m) }
func (*Configs) ProtoMessage()               {}
func (*Configs) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }

func (m *Configs) GetConfigs() []*Config {
	if m != nil {
		return m.Configs
	}
	return nil
}

// Configuration of a quota.
type Config struct {
	// Name of the config, eg, “quotas/trees/1234/read/config”.
	Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	// State of the config.
	State Config_State `protobuf:"varint,2,opt,name=state,enum=storagepb.Config_State" json:"state,omitempty"`
	// Max number of tokens available for the config.
	MaxTokens int64 `protobuf:"varint,3,opt,name=max_tokens,json=maxTokens" json:"max_tokens,omitempty"`
	// Replenishment strategy used by the config.
	//
	// Types that are valid to be assigned to ReplenishmentStrategy:
	//	*Config_SequencingBased
	//	*Config_TimeBased
	ReplenishmentStrategy isConfig_ReplenishmentStrategy `protobuf_oneof:"replenishment_strategy"`
}

func (m *Config) Reset()                    { *m = Config{} }
func (m *Config) String() string            { return proto.CompactTextString(m) }
func (*Config) ProtoMessage()               {}
func (*Config) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }

type isConfig_ReplenishmentStrategy interface {
	isConfig_ReplenishmentStrategy()
}

type Config_SequencingBased struct {
	SequencingBased *SequencingBasedStrategy `protobuf:"bytes,4,opt,name=sequencing_based,json=sequencingBased,oneof"`
}
type Config_TimeBased struct {
	TimeBased *TimeBasedStrategy `protobuf:"bytes,5,opt,name=time_based,json=timeBased,oneof"`
}

func (*Config_SequencingBased) isConfig_ReplenishmentStrategy() {}
func (*Config_TimeBased) isConfig_ReplenishmentStrategy()       {}

func (m *Config) GetReplenishmentStrategy() isConfig_ReplenishmentStrategy {
	if m != nil {
		return m.ReplenishmentStrategy
	}
	return nil
}

func (m *Config) GetName() string {
	if m != nil {
		return m.Name
	}
	return ""
}

func (m *Config) GetState() Config_State {
	if m != nil {
		return m.State
	}
	return Config_UNKNOWN_CONFIG_STATE
}

func (m *Config) GetMaxTokens() int64 {
	if m != nil {
		return m.MaxTokens
	}
	return 0
}

func (m *Config) GetSequencingBased() *SequencingBasedStrategy {
	if x, ok := m.GetReplenishmentStrategy().(*Config_SequencingBased); ok {
		return x.SequencingBased
	}
	return nil
}

func (m *Config) GetTimeBased() *TimeBasedStrategy {
	if x, ok := m.GetReplenishmentStrategy().(*Config_TimeBased); ok {
		return x.TimeBased
	}
	return nil
}

// XXX_OneofFuncs is for the internal use of the proto package.
func (*Config) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
	return _Config_OneofMarshaler, _Config_OneofUnmarshaler, _Config_OneofSizer, []interface{}{
		(*Config_SequencingBased)(nil),
		(*Config_TimeBased)(nil),
	}
}

func _Config_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
	m := msg.(*Config)
	// replenishment_strategy
	switch x := m.ReplenishmentStrategy.(type) {
	case *Config_SequencingBased:
		b.EncodeVarint(4<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.SequencingBased); err != nil {
			return err
		}
	case *Config_TimeBased:
		b.EncodeVarint(5<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.TimeBased); err != nil {
			return err
		}
	case nil:
	default:
		return fmt.Errorf("Config.ReplenishmentStrategy has unexpected type %T", x)
	}
	return nil
}

func _Config_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
	m := msg.(*Config)
	switch tag {
	case 4: // replenishment_strategy.sequencing_based
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(SequencingBasedStrategy)
		err := b.DecodeMessage(msg)
		m.ReplenishmentStrategy = &Config_SequencingBased{msg}
		return true, err
	case 5: // replenishment_strategy.time_based
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(TimeBasedStrategy)
		err := b.DecodeMessage(msg)
		m.ReplenishmentStrategy = &Config_TimeBased{msg}
		return true, err
	default:
		return false, nil
	}
}

func _Config_OneofSizer(msg proto.Message) (n int) {
	m := msg.(*Config)
	// replenishment_strategy
	switch x := m.ReplenishmentStrategy.(type) {
	case *Config_SequencingBased:
		s := proto.Size(x.SequencingBased)
		n += proto.SizeVarint(4<<3 | proto.WireBytes)
		n += proto.SizeVarint(uint64(s))
		n += s
	case *Config_TimeBased:
		s := proto.Size(x.TimeBased)
		n += proto.SizeVarint(5<<3 | proto.WireBytes)
		n += proto.SizeVarint(uint64(s))
		n += s
	case nil:
	default:
		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
	}
	return n
}

// Sequencing-based replenishment strategy settings.
type SequencingBasedStrategy struct {
}

func (m *SequencingBasedStrategy) Reset()                    { *m = SequencingBasedStrategy{} }
func (m *SequencingBasedStrategy) String() string            { return proto.CompactTextString(m) }
func (*SequencingBasedStrategy) ProtoMessage()               {}
func (*SequencingBasedStrategy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }

// Time-based replenishment strategy settings.
type TimeBasedStrategy struct {
	// Number of tokens to replenish at every replenish_interval_seconds.
	TokensToReplenish int64 `protobuf:"varint,1,opt,name=tokens_to_replenish,json=tokensToReplenish" json:"tokens_to_replenish,omitempty"`
	// Interval at which tokens_to_replenish get replenished.
	ReplenishIntervalSeconds int64 `protobuf:"varint,2,opt,name=replenish_interval_seconds,json=replenishIntervalSeconds" json:"replenish_interval_seconds,omitempty"`
}

func (m *TimeBasedStrategy) Reset()                    { *m = TimeBasedStrategy{} }
func (m *TimeBasedStrategy) String() string            { return proto.CompactTextString(m) }
func (*TimeBasedStrategy) ProtoMessage()               {}
func (*TimeBasedStrategy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }

func (m *TimeBasedStrategy) GetTokensToReplenish() int64 {
	if m != nil {
		return m.TokensToReplenish
	}
	return 0
}

func (m *TimeBasedStrategy) GetReplenishIntervalSeconds() int64 {
	if m != nil {
		return m.ReplenishIntervalSeconds
	}
	return 0
}

func init() {
	proto.RegisterType((*Bucket)(nil), "storagepb.Bucket")
	proto.RegisterType((*Configs)(nil), "storagepb.Configs")
	proto.RegisterType((*Config)(nil), "storagepb.Config")
	proto.RegisterType((*SequencingBasedStrategy)(nil), "storagepb.SequencingBasedStrategy")
	proto.RegisterType((*TimeBasedStrategy)(nil), "storagepb.TimeBasedStrategy")
	proto.RegisterEnum("storagepb.Config_State", Config_State_name, Config_State_value)
}

func init() { proto.RegisterFile("storagepb.proto", fileDescriptor0) }

var fileDescriptor0 = []byte{
	// 422 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xc1, 0x6f, 0xd3, 0x30,
	0x14, 0xc6, 0x97, 0x76, 0x6d, 0xe9, 0x2b, 0x62, 0xad, 0x41, 0x5b, 0x40, 0x4c, 0x2a, 0x39, 0x55,
	0x42, 0xe4, 0x50, 0x24, 0x4e, 0xe3, 0xb0, 0x6c, 0x81, 0x55, 0x40, 0x2a, 0x25, 0x41, 0x1c, 0x2d,
	0x37, 0x7b, 0x64, 0x66, 0x89, 0x1d, 0x62, 0x0f, 0x8d, 0x23, 0xff, 0x22, 0x7f, 0x11, 0x8a, 0x9d,
	0xa6, 0x83, 0x89, 0x9b, 0xfd, 0xde, 0x2f, 0x5f, 0xbe, 0xe7, 0xf7, 0xc1, 0x81, 0xd2, 0xb2, 0x66,
	0x39, 0x56, 0x1b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