// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: mixer/adapter/bypass/config/config.proto

// The `bypass` adapter makes it possible to connect to gRPC based remote adapters using the compiled-in adapter
// model.
//
// This adapter supports the following templates:
// [metric](https://istio.io/docs/reference/config/template/metric/).
// [checknothing](https://istio.io/docs/reference/config/template/checknothing/).
// [reportnothing](https://istio.io/docs/reference/config/template/reportnothing/).
// [quota](https://istio.io/docs/reference/config/template/quota/).
//
// Example configuration:
// ```
// # sessionBased indicates whether the client should use the Infrastructure API of the backend
// # to create sessions. If set to true, the bypass adapter will first create a session.
// sessionBased: false
//
// # backendAddress is the remote adapter service backend address.
// backendAddress: localhost:4567
//
// # params is base64 encoded Any proto that should be passed to the remote backend as
// # configuration.
// params: RGFuJ3MgVG9vbHMgYXJlIGNvb2wh...
// ```
//

package config

import (
	fmt "fmt"
	_ "github.com/gogo/protobuf/gogoproto"
	proto "github.com/gogo/protobuf/proto"
	types "github.com/gogo/protobuf/types"
	io "io"
	math "math"
	math_bits "math/bits"
	reflect "reflect"
	strings "strings"
)

// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package

// Configuration format for the Bypass adapter.
type Params struct {
	// The backend address for the remote policy backend.
	BackendAddress string `protobuf:"bytes,1,opt,name=backend_address,json=backendAddress,proto3" json:"backend_address,omitempty"`
	// The actual config parameters to send to the remote backend.
	Params *types.Any `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"`
	// Indicates whether the protocol is session based or not.
	SessionBased bool `protobuf:"varint,3,opt,name=session_based,json=sessionBased,proto3" json:"session_based,omitempty"`
}

func (m *Params) Reset()      { *m = Params{} }
func (*Params) ProtoMessage() {}
func (*Params) Descriptor() ([]byte, []int) {
	return fileDescriptor_f65603491c411b72, []int{0}
}
func (m *Params) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_Params.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *Params) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Params.Merge(m, src)
}
func (m *Params) XXX_Size() int {
	return m.Size()
}
func (m *Params) XXX_DiscardUnknown() {
	xxx_messageInfo_Params.DiscardUnknown(m)
}

var xxx_messageInfo_Params proto.InternalMessageInfo

func init() {
	proto.RegisterType((*Params)(nil), "adapter.bypass.config.Params")
}

func init() {
	proto.RegisterFile("mixer/adapter/bypass/config/config.proto", fileDescriptor_f65603491c411b72)
}

var fileDescriptor_f65603491c411b72 = []byte{
	// 271 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0x8f, 0x3f, 0x4e, 0xc3, 0x30,
	0x14, 0xc6, 0xfd, 0x40, 0x8a, 0x20, 0xfc, 0x93, 0xa2, 0x22, 0x95, 0x0e, 0x4f, 0x11, 0x0c, 0x64,
	0x40, 0xb6, 0x04, 0x17, 0xa0, 0x3d, 0x01, 0xca, 0xc8, 0x52, 0x39, 0x8d, 0x6b, 0x45, 0x50, 0x3b,
	0xb2, 0x8b, 0x44, 0x36, 0x06, 0x0e, 0xc0, 0x31, 0x38, 0x4a, 0xc7, 0x8c, 0x1d, 0x89, 0xb3, 0x30,
	0xf6, 0x08, 0xa8, 0xb1, 0x99, 0x6c, 0xff, 0xbe, 0x9f, 0xbf, 0xa7, 0x17, 0x67, 0xab, 0xea, 0x5d,
	0x18, 0xc6, 0x4b, 0x5e, 0xaf, 0x85, 0x61, 0x45, 0x53, 0x73, 0x6b, 0xd9, 0x42, 0xab, 0x65, 0x25,
	0xc3, 0x41, 0x6b, 0xa3, 0xd7, 0x3a, 0xb9, 0x0c, 0x0e, 0xf5, 0x0e, 0xf5, 0xe1, 0x64, 0x24, 0xb5,
	0xd4, 0x83, 0xc1, 0xf6, 0x37, 0x2f, 0x4f, 0xae, 0xa4, 0xd6, 0xf2, 0x55, 0xb0, 0xe1, 0x55, 0xbc,
	0x2d, 0x19, 0x57, 0x8d, 0x8f, 0xae, 0x3f, 0x21, 0x8e, 0x9e, 0xb8, 0xe1, 0x2b, 0x9b, 0xdc, 0xc6,
	0x17, 0x05, 0x5f, 0xbc, 0x08, 0x55, 0xce, 0x79, 0x59, 0x1a, 0x61, 0xed, 0x18, 0x52, 0xc8, 0x8e,
	0xf3, 0xf3, 0x80, 0xa7, 0x9e, 0x26, 0x77, 0x71, 0x54, 0x0f, 0x5f, 0xc6, 0x07, 0x29, 0x64, 0x27,
	0xf7, 0x23, 0xea, 0xfb, 0xe9, 0x7f, 0x3f, 0x9d, 0xaa, 0x26, 0x0f, 0x4e, 0x72, 0x13, 0x9f, 0x59,
	0x61, 0x6d, 0xa5, 0xd5, 0xbc, 0xe0, 0x56, 0x94, 0xe3, 0xc3, 0x14, 0xb2, 0xa3, 0xfc, 0x34, 0xc0,
	0xd9, 0x9e, 0xcd, 0x1e, 0x37, 0x1d, 0x92, 0xb6, 0x43, 0xb2, 0xed, 0x90, 0xec, 0x3a, 0x24, 0x1f,
	0x0e, 0xe1, 0xdb, 0x21, 0xd9, 0x38, 0x84, 0xd6, 0x21, 0xfc, 0x38, 0x84, 0x5f, 0x87, 0x64, 0xe7,
	0x10, 0xbe, 0x7a, 0x24, 0x6d, 0x8f, 0x64, 0xdb, 0x23, 0x79, 0x8e, 0xfc, 0xe6, 0x45, 0x34, 0x0c,
	0x7f, 0xf8, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x96, 0xf4, 0x21, 0x7d, 0x43, 0x01, 0x00, 0x00,
}

func (m *Params) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *Params) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.SessionBased {
		i--
		if m.SessionBased {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i--
		dAtA[i] = 0x18
	}
	if m.Params != nil {
		{
			size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintConfig(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x12
	}
	if len(m.BackendAddress) > 0 {
		i -= len(m.BackendAddress)
		copy(dAtA[i:], m.BackendAddress)
		i = encodeVarintConfig(dAtA, i, uint64(len(m.BackendAddress)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func encodeVarintConfig(dAtA []byte, offset int, v uint64) int {
	offset -= sovConfig(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *Params) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.BackendAddress)
	if l > 0 {
		n += 1 + l + sovConfig(uint64(l))
	}
	if m.Params != nil {
		l = m.Params.Size()
		n += 1 + l + sovConfig(uint64(l))
	}
	if m.SessionBased {
		n += 2
	}
	return n
}

func sovConfig(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozConfig(x uint64) (n int) {
	return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *Params) String() string {
	if this == nil {
		return "nil"
	}
	s := strings.Join([]string{`&Params{`,
		`BackendAddress:` + fmt.Sprintf("%v", this.BackendAddress) + `,`,
		`Params:` + strings.Replace(fmt.Sprintf("%v", this.Params), "Any", "types.Any", 1) + `,`,
		`SessionBased:` + fmt.Sprintf("%v", this.SessionBased) + `,`,
		`}`,
	}, "")
	return s
}
func valueToStringConfig(v interface{}) string {
	rv := reflect.ValueOf(v)
	if rv.IsNil() {
		return "nil"
	}
	pv := reflect.Indirect(rv).Interface()
	return fmt.Sprintf("*%v", pv)
}
func (m *Params) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowConfig
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: Params: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field BackendAddress", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowConfig
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthConfig
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthConfig
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.BackendAddress = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowConfig
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthConfig
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthConfig
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Params == nil {
				m.Params = &types.Any{}
			}
			if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field SessionBased", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowConfig
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.SessionBased = bool(v != 0)
		default:
			iNdEx = preIndex
			skippy, err := skipConfig(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthConfig
			}
			if (iNdEx + skippy) < 0 {
				return ErrInvalidLengthConfig
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipConfig(dAtA []byte) (n int, err error) {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return 0, ErrIntOverflowConfig
			}
			if iNdEx >= l {
				return 0, io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		wireType := int(wire & 0x7)
		switch wireType {
		case 0:
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowConfig
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				iNdEx++
				if dAtA[iNdEx-1] < 0x80 {
					break
				}
			}
			return iNdEx, nil
		case 1:
			iNdEx += 8
			return iNdEx, nil
		case 2:
			var length int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowConfig
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				length |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if length < 0 {
				return 0, ErrInvalidLengthConfig
			}
			iNdEx += length
			if iNdEx < 0 {
				return 0, ErrInvalidLengthConfig
			}
			return iNdEx, nil
		case 3:
			for {
				var innerWire uint64
				var start int = iNdEx
				for shift := uint(0); ; shift += 7 {
					if shift >= 64 {
						return 0, ErrIntOverflowConfig
					}
					if iNdEx >= l {
						return 0, io.ErrUnexpectedEOF
					}
					b := dAtA[iNdEx]
					iNdEx++
					innerWire |= (uint64(b) & 0x7F) << shift
					if b < 0x80 {
						break
					}
				}
				innerWireType := int(innerWire & 0x7)
				if innerWireType == 4 {
					break
				}
				next, err := skipConfig(dAtA[start:])
				if err != nil {
					return 0, err
				}
				iNdEx = start + next
				if iNdEx < 0 {
					return 0, ErrInvalidLengthConfig
				}
			}
			return iNdEx, nil
		case 4:
			return iNdEx, nil
		case 5:
			iNdEx += 4
			return iNdEx, nil
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
	}
	panic("unreachable")
}

var (
	ErrInvalidLengthConfig = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowConfig   = fmt.Errorf("proto: integer overflow")
)
