// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.8
// 	protoc        v6.32.0
// source: token/v1/token.proto

package v1

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

type IssueReq struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	UserId        string                 `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	UserRole      uint32                 `protobuf:"varint,2,opt,name=user_role,json=userRole,proto3" json:"user_role,omitempty"`
	Type          uint32                 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"`
	Verified      bool                   `protobuf:"varint,4,opt,name=verified,proto3" json:"verified,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *IssueReq) Reset() {
	*x = IssueReq{}
	mi := &file_token_v1_token_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *IssueReq) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*IssueReq) ProtoMessage() {}

func (x *IssueReq) ProtoReflect() protoreflect.Message {
	mi := &file_token_v1_token_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use IssueReq.ProtoReflect.Descriptor instead.
func (*IssueReq) Descriptor() ([]byte, []int) {
	return file_token_v1_token_proto_rawDescGZIP(), []int{0}
}

func (x *IssueReq) GetUserId() string {
	if x != nil {
		return x.UserId
	}
	return ""
}

func (x *IssueReq) GetUserRole() uint32 {
	if x != nil {
		return x.UserRole
	}
	return 0
}

func (x *IssueReq) GetType() uint32 {
	if x != nil {
		return x.Type
	}
	return 0
}

func (x *IssueReq) GetVerified() bool {
	if x != nil {
		return x.Verified
	}
	return false
}

type RefreshReq struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	RefreshToken  string                 `protobuf:"bytes,1,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	Verified      bool                   `protobuf:"varint,2,opt,name=verified,proto3" json:"verified,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *RefreshReq) Reset() {
	*x = RefreshReq{}
	mi := &file_token_v1_token_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *RefreshReq) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*RefreshReq) ProtoMessage() {}

func (x *RefreshReq) ProtoReflect() protoreflect.Message {
	mi := &file_token_v1_token_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use RefreshReq.ProtoReflect.Descriptor instead.
func (*RefreshReq) Descriptor() ([]byte, []int) {
	return file_token_v1_token_proto_rawDescGZIP(), []int{1}
}

func (x *RefreshReq) GetRefreshToken() string {
	if x != nil {
		return x.RefreshToken
	}
	return ""
}

func (x *RefreshReq) GetVerified() bool {
	if x != nil {
		return x.Verified
	}
	return false
}

// If a token is not carrying any information itself, the type
// field can be used to determine how to validate the token.
// Also, different tokens can be encoded in different ways.
type Token struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	AccessToken   string                 `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	RefreshToken  *string                `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3,oneof" json:"refresh_token,omitempty"`
	AccessType    string                 `protobuf:"bytes,3,opt,name=access_type,json=accessType,proto3" json:"access_type,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *Token) Reset() {
	*x = Token{}
	mi := &file_token_v1_token_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *Token) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*Token) ProtoMessage() {}

func (x *Token) ProtoReflect() protoreflect.Message {
	mi := &file_token_v1_token_proto_msgTypes[2]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use Token.ProtoReflect.Descriptor instead.
func (*Token) Descriptor() ([]byte, []int) {
	return file_token_v1_token_proto_rawDescGZIP(), []int{2}
}

func (x *Token) GetAccessToken() string {
	if x != nil {
		return x.AccessToken
	}
	return ""
}

func (x *Token) GetRefreshToken() string {
	if x != nil && x.RefreshToken != nil {
		return *x.RefreshToken
	}
	return ""
}

func (x *Token) GetAccessType() string {
	if x != nil {
		return x.AccessType
	}
	return ""
}

var File_token_v1_token_proto protoreflect.FileDescriptor

const file_token_v1_token_proto_rawDesc = "" +
	"\n" +
	"\x14token/v1/token.proto\x12\btoken.v1\"p\n" +
	"\bIssueReq\x12\x17\n" +
	"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1b\n" +
	"\tuser_role\x18\x02 \x01(\rR\buserRole\x12\x12\n" +
	"\x04type\x18\x03 \x01(\rR\x04type\x12\x1a\n" +
	"\bverified\x18\x04 \x01(\bR\bverified\"M\n" +
	"\n" +
	"RefreshReq\x12#\n" +
	"\rrefresh_token\x18\x01 \x01(\tR\frefreshToken\x12\x1a\n" +
	"\bverified\x18\x02 \x01(\bR\bverified\"\x87\x01\n" +
	"\x05Token\x12!\n" +
	"\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12(\n" +
	"\rrefresh_token\x18\x02 \x01(\tH\x00R\frefreshToken\x88\x01\x01\x12\x1f\n" +
	"\vaccess_type\x18\x03 \x01(\tR\n" +
	"accessTypeB\x10\n" +
	"\x0e_refresh_token2r\n" +
	"\fTokenService\x12.\n" +
	"\x05Issue\x12\x12.token.v1.IssueReq\x1a\x0f.token.v1.Token\"\x00\x122\n" +
	"\aRefresh\x12\x14.token.v1.RefreshReq\x1a\x0f.token.v1.Token\"\x00B.Z,github.com/absmach/supermq/api/grpc/token/v1b\x06proto3"

var (
	file_token_v1_token_proto_rawDescOnce sync.Once
	file_token_v1_token_proto_rawDescData []byte
)

func file_token_v1_token_proto_rawDescGZIP() []byte {
	file_token_v1_token_proto_rawDescOnce.Do(func() {
		file_token_v1_token_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_token_v1_token_proto_rawDesc), len(file_token_v1_token_proto_rawDesc)))
	})
	return file_token_v1_token_proto_rawDescData
}

var file_token_v1_token_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_token_v1_token_proto_goTypes = []any{
	(*IssueReq)(nil),   // 0: token.v1.IssueReq
	(*RefreshReq)(nil), // 1: token.v1.RefreshReq
	(*Token)(nil),      // 2: token.v1.Token
}
var file_token_v1_token_proto_depIdxs = []int32{
	0, // 0: token.v1.TokenService.Issue:input_type -> token.v1.IssueReq
	1, // 1: token.v1.TokenService.Refresh:input_type -> token.v1.RefreshReq
	2, // 2: token.v1.TokenService.Issue:output_type -> token.v1.Token
	2, // 3: token.v1.TokenService.Refresh:output_type -> token.v1.Token
	2, // [2:4] is the sub-list for method output_type
	0, // [0:2] is the sub-list for method input_type
	0, // [0:0] is the sub-list for extension type_name
	0, // [0:0] is the sub-list for extension extendee
	0, // [0:0] is the sub-list for field type_name
}

func init() { file_token_v1_token_proto_init() }
func file_token_v1_token_proto_init() {
	if File_token_v1_token_proto != nil {
		return
	}
	file_token_v1_token_proto_msgTypes[2].OneofWrappers = []any{}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_token_v1_token_proto_rawDesc), len(file_token_v1_token_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_token_v1_token_proto_goTypes,
		DependencyIndexes: file_token_v1_token_proto_depIdxs,
		MessageInfos:      file_token_v1_token_proto_msgTypes,
	}.Build()
	File_token_v1_token_proto = out.File
	file_token_v1_token_proto_goTypes = nil
	file_token_v1_token_proto_depIdxs = nil
}
