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

package triggers

import (
	context "context"
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	grpc "google.golang.org/grpc"
	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

// FetchResourceRequest is the request to fetch trigger resource
type FetchResourceRequest struct {
	Resource             []byte   `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

var xxx_messageInfo_FetchResourceRequest proto.InternalMessageInfo

func (m *FetchResourceRequest) GetResource() []byte {
	if m != nil {
		return m.Resource
	}
	return nil
}

// FetchResourceRequest contains the fetched resource.
type FetchResourceResponse struct {
	Resource             []byte   `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

var xxx_messageInfo_FetchResourceResponse proto.InternalMessageInfo

func (m *FetchResourceResponse) GetResource() []byte {
	if m != nil {
		return m.Resource
	}
	return nil
}

// ExecuteRequest is a request to execute a trigger resource.
type ExecuteRequest struct {
	Resource             []byte   `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
	Payload              []byte   `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

var xxx_messageInfo_ExecuteRequest proto.InternalMessageInfo

func (m *ExecuteRequest) GetResource() []byte {
	if m != nil {
		return m.Resource
	}
	return nil
}

func (m *ExecuteRequest) GetPayload() []byte {
	if m != nil {
		return m.Payload
	}
	return nil
}

// ExecuteResponse is the response of the trigger execution
type ExecuteResponse struct {
	Response             []byte   `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

var xxx_messageInfo_ExecuteResponse proto.InternalMessageInfo

func (m *ExecuteResponse) GetResponse() []byte {
	if m != nil {
		return m.Response
	}
	return nil
}

// ApplyPolicyRequest is the request to apply policy on the trigger execution result.
type ApplyPolicyRequest struct {
	Request              []byte   `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

var xxx_messageInfo_ApplyPolicyRequest proto.InternalMessageInfo

func (m *ApplyPolicyRequest) GetRequest() []byte {
	if m != nil {
		return m.Request
	}
	return nil
}

// ApplyPolicyResponse is the response of the application of the trigger policy.
type ApplyPolicyResponse struct {
	Success              bool     `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	Message              string   `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *ApplyPolicyResponse) Reset()         { *m = ApplyPolicyResponse{} }
func (m *ApplyPolicyResponse) String() string { return proto.CompactTextString(m) }
func (*ApplyPolicyResponse) ProtoMessage()    {}
func (*ApplyPolicyResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_8c31e6d8b4368946, []int{5}
}

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

var xxx_messageInfo_ApplyPolicyResponse proto.InternalMessageInfo

func (m *ApplyPolicyResponse) GetSuccess() bool {
	if m != nil {
		return m.Success
	}
	return false
}

func (m *ApplyPolicyResponse) GetMessage() string {
	if m != nil {
		return m.Message
	}
	return ""
}

func init() {
	proto.RegisterType((*FetchResourceRequest)(nil), "triggers.FetchResourceRequest")
	proto.RegisterType((*FetchResourceResponse)(nil), "triggers.FetchResourceResponse")
	proto.RegisterType((*ExecuteRequest)(nil), "triggers.ExecuteRequest")
	proto.RegisterType((*ExecuteResponse)(nil), "triggers.ExecuteResponse")
	proto.RegisterType((*ApplyPolicyRequest)(nil), "triggers.ApplyPolicyRequest")
	proto.RegisterType((*ApplyPolicyResponse)(nil), "triggers.ApplyPolicyResponse")
}

func init() { proto.RegisterFile("trigger.proto", fileDescriptor_8c31e6d8b4368946) }

var fileDescriptor_8c31e6d8b4368946 = []byte{
	// 272 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x4d, 0x4b, 0x03, 0x31,
	0x10, 0x65, 0x3d, 0x98, 0x75, 0xb4, 0x0a, 0x51, 0x21, 0x2e, 0x7e, 0x91, 0x93, 0x17, 0xf7, 0xd0,
	0xde, 0x05, 0x0f, 0x16, 0xf4, 0x54, 0x82, 0x7f, 0x60, 0x8d, 0xc3, 0x5a, 0x58, 0x4d, 0xcc, 0x64,
	0xc1, 0xfd, 0xc5, 0xfe, 0x0d, 0x31, 0x9b, 0xb4, 0x5d, 0x6d, 0xc5, 0xdb, 0xbc, 0xbc, 0x79, 0xf3,
	0x26, 0x2f, 0x81, 0x91, 0x77, 0xf3, 0xba, 0x46, 0x57, 0x5a, 0x67, 0xbc, 0xe1, 0x79, 0x84, 0x24,
	0xc7, 0x70, 0x34, 0x45, 0xaf, 0x5f, 0x14, 0x92, 0x69, 0x9d, 0x46, 0x85, 0xef, 0x2d, 0x92, 0xe7,
	0x05, 0xe4, 0x2e, 0x1e, 0x89, 0xec, 0x32, 0xbb, 0xda, 0x53, 0x0b, 0x2c, 0x27, 0x70, 0xfc, 0x43,
	0x43, 0xd6, 0xbc, 0x11, 0xfe, 0x29, 0x9a, 0xc2, 0xfe, 0xdd, 0x07, 0xea, 0xd6, 0xff, 0xc7, 0x82,
	0x0b, 0x60, 0xb6, 0xea, 0x1a, 0x53, 0x3d, 0x8b, 0xad, 0x40, 0x25, 0x28, 0xaf, 0xe1, 0x60, 0x31,
	0x67, 0x60, 0x1b, 0xea, 0x95, 0x41, 0x01, 0xcb, 0x12, 0xf8, 0xad, 0xb5, 0x4d, 0x37, 0x33, 0xcd,
	0x5c, 0x77, 0xc9, 0x5a, 0x00, 0x73, 0x7d, 0x19, 0x05, 0x09, 0xca, 0x7b, 0x38, 0x1c, 0xf4, 0x47,
	0x0b, 0x01, 0x8c, 0x5a, 0xad, 0x91, 0x28, 0x08, 0x72, 0x95, 0xe0, 0x37, 0xf3, 0x8a, 0x44, 0x55,
	0x8d, 0x61, 0xd3, 0x1d, 0x95, 0xe0, 0xf8, 0x33, 0x03, 0xf6, 0xd8, 0xe7, 0xcc, 0x67, 0x30, 0x1a,
	0x44, 0xc6, 0xcf, 0xcb, 0xf4, 0x04, 0xe5, 0xba, 0xfc, 0x8b, 0x8b, 0x8d, 0x7c, 0xdc, 0xe8, 0x06,
	0x58, 0xcc, 0x81, 0x8b, 0x65, 0xef, 0x30, 0xe2, 0xe2, 0x64, 0x0d, 0x13, 0xf5, 0x0f, 0xb0, 0xbb,
	0x72, 0x51, 0x7e, 0xba, 0xec, 0xfc, 0x9d, 0x57, 0x71, 0xb6, 0x81, 0xed, 0x67, 0x3d, 0x6d, 0x87,
	0x5f, 0x35, 0xf9, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x4b, 0x24, 0xc7, 0x9f, 0x66, 0x02, 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

// TriggerClient is the client API for Trigger service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type TriggerClient interface {
	// FetchResource fetches the resource to be triggered.
	FetchResource(ctx context.Context, in *FetchResourceRequest, opts ...grpc.CallOption) (*FetchResourceResponse, error)
	// Execute executes the requested trigger resource.
	Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*ExecuteResponse, error)
	// ApplyPolicy applies policies on the trigger execution result.
	ApplyPolicy(ctx context.Context, in *ApplyPolicyRequest, opts ...grpc.CallOption) (*ApplyPolicyResponse, error)
}

type triggerClient struct {
	cc *grpc.ClientConn
}

func NewTriggerClient(cc *grpc.ClientConn) TriggerClient {
	return &triggerClient{cc}
}

func (c *triggerClient) FetchResource(ctx context.Context, in *FetchResourceRequest, opts ...grpc.CallOption) (*FetchResourceResponse, error) {
	out := new(FetchResourceResponse)
	err := c.cc.Invoke(ctx, "/triggers.Trigger/FetchResource", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *triggerClient) Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*ExecuteResponse, error) {
	out := new(ExecuteResponse)
	err := c.cc.Invoke(ctx, "/triggers.Trigger/Execute", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *triggerClient) ApplyPolicy(ctx context.Context, in *ApplyPolicyRequest, opts ...grpc.CallOption) (*ApplyPolicyResponse, error) {
	out := new(ApplyPolicyResponse)
	err := c.cc.Invoke(ctx, "/triggers.Trigger/ApplyPolicy", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// TriggerServer is the server API for Trigger service.
type TriggerServer interface {
	// FetchResource fetches the resource to be triggered.
	FetchResource(context.Context, *FetchResourceRequest) (*FetchResourceResponse, error)
	// Execute executes the requested trigger resource.
	Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error)
	// ApplyPolicy applies policies on the trigger execution result.
	ApplyPolicy(context.Context, *ApplyPolicyRequest) (*ApplyPolicyResponse, error)
}

func RegisterTriggerServer(s *grpc.Server, srv TriggerServer) {
	s.RegisterService(&_Trigger_serviceDesc, srv)
}

func _Trigger_FetchResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(FetchResourceRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TriggerServer).FetchResource(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/triggers.Trigger/FetchResource",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TriggerServer).FetchResource(ctx, req.(*FetchResourceRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Trigger_Execute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ExecuteRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TriggerServer).Execute(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/triggers.Trigger/Execute",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TriggerServer).Execute(ctx, req.(*ExecuteRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Trigger_ApplyPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ApplyPolicyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TriggerServer).ApplyPolicy(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/triggers.Trigger/ApplyPolicy",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TriggerServer).ApplyPolicy(ctx, req.(*ApplyPolicyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _Trigger_serviceDesc = grpc.ServiceDesc{
	ServiceName: "triggers.Trigger",
	HandlerType: (*TriggerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "FetchResource",
			Handler:    _Trigger_FetchResource_Handler,
		},
		{
			MethodName: "Execute",
			Handler:    _Trigger_Execute_Handler,
		},
		{
			MethodName: "ApplyPolicy",
			Handler:    _Trigger_ApplyPolicy_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "trigger.proto",
}
