package agent

import (
	context "context"
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	math "math"
)

var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

const _ = proto.ProtoPackageIsVersion3 

type AuthnRequest struct {
	Token                string   `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

func (m *AuthnRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_AuthnRequest.Unmarshal(m, b)
}
func (m *AuthnRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_AuthnRequest.Marshal(b, m, deterministic)
}
func (m *AuthnRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_AuthnRequest.Merge(m, src)
}
func (m *AuthnRequest) XXX_Size() int {
	return xxx_messageInfo_AuthnRequest.Size(m)
}
func (m *AuthnRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_AuthnRequest.DiscardUnknown(m)
}

var xxx_messageInfo_AuthnRequest proto.InternalMessageInfo

func (m *AuthnRequest) GetToken() string {
	if m != nil {
		return m.Token
	}
	return ""
}

type AuthnResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

func (m *AuthnResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_AuthnResponse.Unmarshal(m, b)
}
func (m *AuthnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_AuthnResponse.Marshal(b, m, deterministic)
}
func (m *AuthnResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_AuthnResponse.Merge(m, src)
}
func (m *AuthnResponse) XXX_Size() int {
	return xxx_messageInfo_AuthnResponse.Size(m)
}
func (m *AuthnResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_AuthnResponse.DiscardUnknown(m)
}

var xxx_messageInfo_AuthnResponse proto.InternalMessageInfo

func init() {
	proto.RegisterType((*AuthnRequest)(nil), "AuthnRequest")
	proto.RegisterType((*AuthnResponse)(nil), "AuthnResponse")
}

func init() { proto.RegisterFile("agent.proto", fileDescriptor_56ede974c0020f77) }

var fileDescriptor_56ede974c0020f77 = []byte{

	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4e, 0x4c, 0x4f, 0xcd,
	0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x57, 0x52, 0xe1, 0xe2, 0x71, 0x2c, 0x2d, 0xc9, 0xc8,
	0x0b, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x11, 0x12, 0xe1, 0x62, 0x2d, 0xc9, 0xcf, 0x4e, 0xcd,
	0x93, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x82, 0x70, 0x94, 0xf8, 0xb9, 0x78, 0xa1, 0xaa, 0x8a,
	0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x8d, 0xec, 0xb9, 0x78, 0x1c, 0x41, 0xa6, 0x04, 0xa7, 0x16, 0x95,
	0x65, 0x26, 0xa7, 0x0a, 0xe9, 0x43, 0x8c, 0x49, 0xcd, 0x2b, 0xc9, 0x4c, 0x4e, 0x2c, 0x49, 0x15,
	0xe2, 0xd5, 0x43, 0x36, 0x55, 0x8a, 0x4f, 0x0f, 0x45, 0xbb, 0x12, 0x43, 0x12, 0x1b, 0xd8, 0x7a,
	0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd3, 0xef, 0xc2, 0x9b, 0x8d, 0x00, 0x00, 0x00,
}

var _ context.Context
var _ grpc.ClientConn

const _ = grpc.SupportPackageIsVersion4

type AgentServiceClient interface {

	Authenticate(ctx context.Context, in *AuthnRequest, opts ...grpc.CallOption) (*AuthnResponse, error)
}

type agentServiceClient struct {
	cc *grpc.ClientConn
}

func NewAgentServiceClient(cc *grpc.ClientConn) AgentServiceClient {
	return &agentServiceClient{cc}
}

func (c *agentServiceClient) Authenticate(ctx context.Context, in *AuthnRequest, opts ...grpc.CallOption) (*AuthnResponse, error) {
	out := new(AuthnResponse)
	err := c.cc.Invoke(ctx, "/AgentService/Authenticate", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

type AgentServiceServer interface {

	Authenticate(context.Context, *AuthnRequest) (*AuthnResponse, error)
}

type UnimplementedAgentServiceServer struct {
}

func (*UnimplementedAgentServiceServer) Authenticate(ctx context.Context, req *AuthnRequest) (*AuthnResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented")
}

func RegisterAgentServiceServer(s *grpc.Server, srv AgentServiceServer) {
	s.RegisterService(&_AgentService_serviceDesc, srv)
}

func _AgentService_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AuthnRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AgentServiceServer).Authenticate(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/AgentService/Authenticate",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AgentServiceServer).Authenticate(ctx, req.(*AuthnRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _AgentService_serviceDesc = grpc.ServiceDesc{
	ServiceName: "AgentService",
	HandlerType: (*AgentServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Authenticate",
			Handler:    _AgentService_Authenticate_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "agent.proto",
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: agent.proto

package agent

import (
	context "context"
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	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.ProtoPackageIsVersion3 // please upgrade the proto package

type AuthnRequest struct {
	Token                string   `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

func (m *AuthnRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_AuthnRequest.Unmarshal(m, b)
}
func (m *AuthnRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_AuthnRequest.Marshal(b, m, deterministic)
}
func (m *AuthnRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_AuthnRequest.Merge(m, src)
}
func (m *AuthnRequest) XXX_Size() int {
	return xxx_messageInfo_AuthnRequest.Size(m)
}
func (m *AuthnRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_AuthnRequest.DiscardUnknown(m)
}

var xxx_messageInfo_AuthnRequest proto.InternalMessageInfo

func (m *AuthnRequest) GetToken() string {
	if m != nil {
		return m.Token
	}
	return ""
}

type AuthnResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

func (m *AuthnResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_AuthnResponse.Unmarshal(m, b)
}
func (m *AuthnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_AuthnResponse.Marshal(b, m, deterministic)
}
func (m *AuthnResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_AuthnResponse.Merge(m, src)
}
func (m *AuthnResponse) XXX_Size() int {
	return xxx_messageInfo_AuthnResponse.Size(m)
}
func (m *AuthnResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_AuthnResponse.DiscardUnknown(m)
}

var xxx_messageInfo_AuthnResponse proto.InternalMessageInfo

func init() {
	proto.RegisterType((*AuthnRequest)(nil), "AuthnRequest")
	proto.RegisterType((*AuthnResponse)(nil), "AuthnResponse")
}

func init() { proto.RegisterFile("agent.proto", fileDescriptor_56ede974c0020f77) }

var fileDescriptor_56ede974c0020f77 = []byte{
	// 127 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4e, 0x4c, 0x4f, 0xcd,
	0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x57, 0x52, 0xe1, 0xe2, 0x71, 0x2c, 0x2d, 0xc9, 0xc8,
	0x0b, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x11, 0x12, 0xe1, 0x62, 0x2d, 0xc9, 0xcf, 0x4e, 0xcd,
	0x93, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x82, 0x70, 0x94, 0xf8, 0xb9, 0x78, 0xa1, 0xaa, 0x8a,
	0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x8d, 0xec, 0xb9, 0x78, 0x1c, 0x41, 0xa6, 0x04, 0xa7, 0x16, 0x95,
	0x65, 0x26, 0xa7, 0x0a, 0xe9, 0x43, 0x8c, 0x49, 0xcd, 0x2b, 0xc9, 0x4c, 0x4e, 0x2c, 0x49, 0x15,
	0xe2, 0xd5, 0x43, 0x36, 0x55, 0x8a, 0x4f, 0x0f, 0x45, 0xbb, 0x12, 0x43, 0x12, 0x1b, 0xd8, 0x7a,
	0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd3, 0xef, 0xc2, 0x9b, 0x8d, 0x00, 0x00, 0x00,
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// AgentServiceClient is the client API for AgentService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type AgentServiceClient interface {
	// Give the agent an authn token with which it can retrieve a new cert
	Authenticate(ctx context.Context, in *AuthnRequest, opts ...grpc.CallOption) (*AuthnResponse, error)
}

type agentServiceClient struct {
	cc *grpc.ClientConn
}

func NewAgentServiceClient(cc *grpc.ClientConn) AgentServiceClient {
	return &agentServiceClient{cc}
}

func (c *agentServiceClient) Authenticate(ctx context.Context, in *AuthnRequest, opts ...grpc.CallOption) (*AuthnResponse, error) {
	out := new(AuthnResponse)
	err := c.cc.Invoke(ctx, "/AgentService/Authenticate", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// AgentServiceServer is the server API for AgentService service.
type AgentServiceServer interface {
	// Give the agent an authn token with which it can retrieve a new cert
	Authenticate(context.Context, *AuthnRequest) (*AuthnResponse, error)
}

// UnimplementedAgentServiceServer can be embedded to have forward compatible implementations.
type UnimplementedAgentServiceServer struct {
}

func (*UnimplementedAgentServiceServer) Authenticate(ctx context.Context, req *AuthnRequest) (*AuthnResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented")
}

func RegisterAgentServiceServer(s *grpc.Server, srv AgentServiceServer) {
	s.RegisterService(&_AgentService_serviceDesc, srv)
}

func _AgentService_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AuthnRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AgentServiceServer).Authenticate(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/AgentService/Authenticate",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AgentServiceServer).Authenticate(ctx, req.(*AuthnRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _AgentService_serviceDesc = grpc.ServiceDesc{
	ServiceName: "AgentService",
	HandlerType: (*AgentServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Authenticate",
			Handler:    _AgentService_Authenticate_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "agent.proto",
}
