1// Code generated by protoc-gen-gogo. DO NOT EDIT.
2// source: authentication.proto
3
4package v2
5
6import proto "github.com/golang/protobuf/proto"
7import fmt "fmt"
8import math "math"
9import _ "github.com/gogo/protobuf/gogoproto"
10
11import bytes "bytes"
12
13import io "io"
14
15// Reference imports to suppress errors if they are not otherwise used.
16var _ = proto.Marshal
17var _ = fmt.Errorf
18var _ = math.Inf
19
20// This is a compile-time assertion to ensure that this generated file
21// is compatible with the proto package it is being compiled against.
22// A compilation error at this line likely means your copy of the
23// proto package needs to be updated.
24const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
25
26// Tokens contains the structure for exchanging tokens with the API
27type Tokens struct {
28	// Access token is used by client to make request
29	Access string `protobuf:"bytes,1,opt,name=access,proto3" json:"access_token"`
30	// ExpiresAt unix timestamp describing when the access token is no longer valid
31	ExpiresAt int64 `protobuf:"varint,2,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at"`
32	// Refresh token is used by client to request a new access token
33	Refresh              string   `protobuf:"bytes,3,opt,name=refresh,proto3" json:"refresh_token"`
34	XXX_NoUnkeyedLiteral struct{} `json:"-"`
35	XXX_unrecognized     []byte   `json:"-"`
36	XXX_sizecache        int32    `json:"-"`
37}
38
39func (m *Tokens) Reset()         { *m = Tokens{} }
40func (m *Tokens) String() string { return proto.CompactTextString(m) }
41func (*Tokens) ProtoMessage()    {}
42func (*Tokens) Descriptor() ([]byte, []int) {
43	return fileDescriptor_authentication_73795aa4aa9c9e2d, []int{0}
44}
45func (m *Tokens) XXX_Unmarshal(b []byte) error {
46	return m.Unmarshal(b)
47}
48func (m *Tokens) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
49	if deterministic {
50		return xxx_messageInfo_Tokens.Marshal(b, m, deterministic)
51	} else {
52		b = b[:cap(b)]
53		n, err := m.MarshalTo(b)
54		if err != nil {
55			return nil, err
56		}
57		return b[:n], nil
58	}
59}
60func (dst *Tokens) XXX_Merge(src proto.Message) {
61	xxx_messageInfo_Tokens.Merge(dst, src)
62}
63func (m *Tokens) XXX_Size() int {
64	return m.Size()
65}
66func (m *Tokens) XXX_DiscardUnknown() {
67	xxx_messageInfo_Tokens.DiscardUnknown(m)
68}
69
70var xxx_messageInfo_Tokens proto.InternalMessageInfo
71
72func (m *Tokens) GetAccess() string {
73	if m != nil {
74		return m.Access
75	}
76	return ""
77}
78
79func (m *Tokens) GetExpiresAt() int64 {
80	if m != nil {
81		return m.ExpiresAt
82	}
83	return 0
84}
85
86func (m *Tokens) GetRefresh() string {
87	if m != nil {
88		return m.Refresh
89	}
90	return ""
91}
92
93func init() {
94	proto.RegisterType((*Tokens)(nil), "sensu.core.v2.Tokens")
95}
96func (this *Tokens) Equal(that interface{}) bool {
97	if that == nil {
98		return this == nil
99	}
100
101	that1, ok := that.(*Tokens)
102	if !ok {
103		that2, ok := that.(Tokens)
104		if ok {
105			that1 = &that2
106		} else {
107			return false
108		}
109	}
110	if that1 == nil {
111		return this == nil
112	} else if this == nil {
113		return false
114	}
115	if this.Access != that1.Access {
116		return false
117	}
118	if this.ExpiresAt != that1.ExpiresAt {
119		return false
120	}
121	if this.Refresh != that1.Refresh {
122		return false
123	}
124	if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
125		return false
126	}
127	return true
128}
129func (m *Tokens) Marshal() (dAtA []byte, err error) {
130	size := m.Size()
131	dAtA = make([]byte, size)
132	n, err := m.MarshalTo(dAtA)
133	if err != nil {
134		return nil, err
135	}
136	return dAtA[:n], nil
137}
138
139func (m *Tokens) MarshalTo(dAtA []byte) (int, error) {
140	var i int
141	_ = i
142	var l int
143	_ = l
144	if len(m.Access) > 0 {
145		dAtA[i] = 0xa
146		i++
147		i = encodeVarintAuthentication(dAtA, i, uint64(len(m.Access)))
148		i += copy(dAtA[i:], m.Access)
149	}
150	if m.ExpiresAt != 0 {
151		dAtA[i] = 0x10
152		i++
153		i = encodeVarintAuthentication(dAtA, i, uint64(m.ExpiresAt))
154	}
155	if len(m.Refresh) > 0 {
156		dAtA[i] = 0x1a
157		i++
158		i = encodeVarintAuthentication(dAtA, i, uint64(len(m.Refresh)))
159		i += copy(dAtA[i:], m.Refresh)
160	}
161	if m.XXX_unrecognized != nil {
162		i += copy(dAtA[i:], m.XXX_unrecognized)
163	}
164	return i, nil
165}
166
167func encodeVarintAuthentication(dAtA []byte, offset int, v uint64) int {
168	for v >= 1<<7 {
169		dAtA[offset] = uint8(v&0x7f | 0x80)
170		v >>= 7
171		offset++
172	}
173	dAtA[offset] = uint8(v)
174	return offset + 1
175}
176func NewPopulatedTokens(r randyAuthentication, easy bool) *Tokens {
177	this := &Tokens{}
178	this.Access = string(randStringAuthentication(r))
179	this.ExpiresAt = int64(r.Int63())
180	if r.Intn(2) == 0 {
181		this.ExpiresAt *= -1
182	}
183	this.Refresh = string(randStringAuthentication(r))
184	if !easy && r.Intn(10) != 0 {
185		this.XXX_unrecognized = randUnrecognizedAuthentication(r, 4)
186	}
187	return this
188}
189
190type randyAuthentication interface {
191	Float32() float32
192	Float64() float64
193	Int63() int64
194	Int31() int32
195	Uint32() uint32
196	Intn(n int) int
197}
198
199func randUTF8RuneAuthentication(r randyAuthentication) rune {
200	ru := r.Intn(62)
201	if ru < 10 {
202		return rune(ru + 48)
203	} else if ru < 36 {
204		return rune(ru + 55)
205	}
206	return rune(ru + 61)
207}
208func randStringAuthentication(r randyAuthentication) string {
209	v1 := r.Intn(100)
210	tmps := make([]rune, v1)
211	for i := 0; i < v1; i++ {
212		tmps[i] = randUTF8RuneAuthentication(r)
213	}
214	return string(tmps)
215}
216func randUnrecognizedAuthentication(r randyAuthentication, maxFieldNumber int) (dAtA []byte) {
217	l := r.Intn(5)
218	for i := 0; i < l; i++ {
219		wire := r.Intn(4)
220		if wire == 3 {
221			wire = 5
222		}
223		fieldNumber := maxFieldNumber + r.Intn(100)
224		dAtA = randFieldAuthentication(dAtA, r, fieldNumber, wire)
225	}
226	return dAtA
227}
228func randFieldAuthentication(dAtA []byte, r randyAuthentication, fieldNumber int, wire int) []byte {
229	key := uint32(fieldNumber)<<3 | uint32(wire)
230	switch wire {
231	case 0:
232		dAtA = encodeVarintPopulateAuthentication(dAtA, uint64(key))
233		v2 := r.Int63()
234		if r.Intn(2) == 0 {
235			v2 *= -1
236		}
237		dAtA = encodeVarintPopulateAuthentication(dAtA, uint64(v2))
238	case 1:
239		dAtA = encodeVarintPopulateAuthentication(dAtA, uint64(key))
240		dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
241	case 2:
242		dAtA = encodeVarintPopulateAuthentication(dAtA, uint64(key))
243		ll := r.Intn(100)
244		dAtA = encodeVarintPopulateAuthentication(dAtA, uint64(ll))
245		for j := 0; j < ll; j++ {
246			dAtA = append(dAtA, byte(r.Intn(256)))
247		}
248	default:
249		dAtA = encodeVarintPopulateAuthentication(dAtA, uint64(key))
250		dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
251	}
252	return dAtA
253}
254func encodeVarintPopulateAuthentication(dAtA []byte, v uint64) []byte {
255	for v >= 1<<7 {
256		dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
257		v >>= 7
258	}
259	dAtA = append(dAtA, uint8(v))
260	return dAtA
261}
262func (m *Tokens) Size() (n int) {
263	var l int
264	_ = l
265	l = len(m.Access)
266	if l > 0 {
267		n += 1 + l + sovAuthentication(uint64(l))
268	}
269	if m.ExpiresAt != 0 {
270		n += 1 + sovAuthentication(uint64(m.ExpiresAt))
271	}
272	l = len(m.Refresh)
273	if l > 0 {
274		n += 1 + l + sovAuthentication(uint64(l))
275	}
276	if m.XXX_unrecognized != nil {
277		n += len(m.XXX_unrecognized)
278	}
279	return n
280}
281
282func sovAuthentication(x uint64) (n int) {
283	for {
284		n++
285		x >>= 7
286		if x == 0 {
287			break
288		}
289	}
290	return n
291}
292func sozAuthentication(x uint64) (n int) {
293	return sovAuthentication(uint64((x << 1) ^ uint64((int64(x) >> 63))))
294}
295func (m *Tokens) Unmarshal(dAtA []byte) error {
296	l := len(dAtA)
297	iNdEx := 0
298	for iNdEx < l {
299		preIndex := iNdEx
300		var wire uint64
301		for shift := uint(0); ; shift += 7 {
302			if shift >= 64 {
303				return ErrIntOverflowAuthentication
304			}
305			if iNdEx >= l {
306				return io.ErrUnexpectedEOF
307			}
308			b := dAtA[iNdEx]
309			iNdEx++
310			wire |= (uint64(b) & 0x7F) << shift
311			if b < 0x80 {
312				break
313			}
314		}
315		fieldNum := int32(wire >> 3)
316		wireType := int(wire & 0x7)
317		if wireType == 4 {
318			return fmt.Errorf("proto: Tokens: wiretype end group for non-group")
319		}
320		if fieldNum <= 0 {
321			return fmt.Errorf("proto: Tokens: illegal tag %d (wire type %d)", fieldNum, wire)
322		}
323		switch fieldNum {
324		case 1:
325			if wireType != 2 {
326				return fmt.Errorf("proto: wrong wireType = %d for field Access", wireType)
327			}
328			var stringLen uint64
329			for shift := uint(0); ; shift += 7 {
330				if shift >= 64 {
331					return ErrIntOverflowAuthentication
332				}
333				if iNdEx >= l {
334					return io.ErrUnexpectedEOF
335				}
336				b := dAtA[iNdEx]
337				iNdEx++
338				stringLen |= (uint64(b) & 0x7F) << shift
339				if b < 0x80 {
340					break
341				}
342			}
343			intStringLen := int(stringLen)
344			if intStringLen < 0 {
345				return ErrInvalidLengthAuthentication
346			}
347			postIndex := iNdEx + intStringLen
348			if postIndex > l {
349				return io.ErrUnexpectedEOF
350			}
351			m.Access = string(dAtA[iNdEx:postIndex])
352			iNdEx = postIndex
353		case 2:
354			if wireType != 0 {
355				return fmt.Errorf("proto: wrong wireType = %d for field ExpiresAt", wireType)
356			}
357			m.ExpiresAt = 0
358			for shift := uint(0); ; shift += 7 {
359				if shift >= 64 {
360					return ErrIntOverflowAuthentication
361				}
362				if iNdEx >= l {
363					return io.ErrUnexpectedEOF
364				}
365				b := dAtA[iNdEx]
366				iNdEx++
367				m.ExpiresAt |= (int64(b) & 0x7F) << shift
368				if b < 0x80 {
369					break
370				}
371			}
372		case 3:
373			if wireType != 2 {
374				return fmt.Errorf("proto: wrong wireType = %d for field Refresh", wireType)
375			}
376			var stringLen uint64
377			for shift := uint(0); ; shift += 7 {
378				if shift >= 64 {
379					return ErrIntOverflowAuthentication
380				}
381				if iNdEx >= l {
382					return io.ErrUnexpectedEOF
383				}
384				b := dAtA[iNdEx]
385				iNdEx++
386				stringLen |= (uint64(b) & 0x7F) << shift
387				if b < 0x80 {
388					break
389				}
390			}
391			intStringLen := int(stringLen)
392			if intStringLen < 0 {
393				return ErrInvalidLengthAuthentication
394			}
395			postIndex := iNdEx + intStringLen
396			if postIndex > l {
397				return io.ErrUnexpectedEOF
398			}
399			m.Refresh = string(dAtA[iNdEx:postIndex])
400			iNdEx = postIndex
401		default:
402			iNdEx = preIndex
403			skippy, err := skipAuthentication(dAtA[iNdEx:])
404			if err != nil {
405				return err
406			}
407			if skippy < 0 {
408				return ErrInvalidLengthAuthentication
409			}
410			if (iNdEx + skippy) > l {
411				return io.ErrUnexpectedEOF
412			}
413			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
414			iNdEx += skippy
415		}
416	}
417
418	if iNdEx > l {
419		return io.ErrUnexpectedEOF
420	}
421	return nil
422}
423func skipAuthentication(dAtA []byte) (n int, err error) {
424	l := len(dAtA)
425	iNdEx := 0
426	for iNdEx < l {
427		var wire uint64
428		for shift := uint(0); ; shift += 7 {
429			if shift >= 64 {
430				return 0, ErrIntOverflowAuthentication
431			}
432			if iNdEx >= l {
433				return 0, io.ErrUnexpectedEOF
434			}
435			b := dAtA[iNdEx]
436			iNdEx++
437			wire |= (uint64(b) & 0x7F) << shift
438			if b < 0x80 {
439				break
440			}
441		}
442		wireType := int(wire & 0x7)
443		switch wireType {
444		case 0:
445			for shift := uint(0); ; shift += 7 {
446				if shift >= 64 {
447					return 0, ErrIntOverflowAuthentication
448				}
449				if iNdEx >= l {
450					return 0, io.ErrUnexpectedEOF
451				}
452				iNdEx++
453				if dAtA[iNdEx-1] < 0x80 {
454					break
455				}
456			}
457			return iNdEx, nil
458		case 1:
459			iNdEx += 8
460			return iNdEx, nil
461		case 2:
462			var length int
463			for shift := uint(0); ; shift += 7 {
464				if shift >= 64 {
465					return 0, ErrIntOverflowAuthentication
466				}
467				if iNdEx >= l {
468					return 0, io.ErrUnexpectedEOF
469				}
470				b := dAtA[iNdEx]
471				iNdEx++
472				length |= (int(b) & 0x7F) << shift
473				if b < 0x80 {
474					break
475				}
476			}
477			iNdEx += length
478			if length < 0 {
479				return 0, ErrInvalidLengthAuthentication
480			}
481			return iNdEx, nil
482		case 3:
483			for {
484				var innerWire uint64
485				var start int = iNdEx
486				for shift := uint(0); ; shift += 7 {
487					if shift >= 64 {
488						return 0, ErrIntOverflowAuthentication
489					}
490					if iNdEx >= l {
491						return 0, io.ErrUnexpectedEOF
492					}
493					b := dAtA[iNdEx]
494					iNdEx++
495					innerWire |= (uint64(b) & 0x7F) << shift
496					if b < 0x80 {
497						break
498					}
499				}
500				innerWireType := int(innerWire & 0x7)
501				if innerWireType == 4 {
502					break
503				}
504				next, err := skipAuthentication(dAtA[start:])
505				if err != nil {
506					return 0, err
507				}
508				iNdEx = start + next
509			}
510			return iNdEx, nil
511		case 4:
512			return iNdEx, nil
513		case 5:
514			iNdEx += 4
515			return iNdEx, nil
516		default:
517			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
518		}
519	}
520	panic("unreachable")
521}
522
523var (
524	ErrInvalidLengthAuthentication = fmt.Errorf("proto: negative length found during unmarshaling")
525	ErrIntOverflowAuthentication   = fmt.Errorf("proto: integer overflow")
526)
527
528func init() {
529	proto.RegisterFile("authentication.proto", fileDescriptor_authentication_73795aa4aa9c9e2d)
530}
531
532var fileDescriptor_authentication_73795aa4aa9c9e2d = []byte{
533	// 234 bytes of a gzipped FileDescriptorProto
534	0x1f, 0x8b, 0x08, 0x00,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 0x31, 0xae, 0x78, 0x24, 0xc7, 0xb8, 0xe3, 0x91,
546	0x1c, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe3,
547	0xb1, 0x1c, 0x43, 0x14, 0x53, 0x99, 0x51, 0x12, 0x1b, 0xd8, 0xe5, 0xc6, 0x80, 0x00, 0x00, 0x00,
548	0xff, 0xff, 0x32, 0x4a, 0x23, 0x17, 0x0f, 0x01, 0x00, 0x00,
549}
550