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

package trillian

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import keyspb "github.com/google/trillian/crypto/keyspb"
import _ "google.golang.org/genproto/googleapis/api/annotations"
import google_protobuf4 "google.golang.org/genproto/protobuf/field_mask"
import google_protobuf5 "github.com/golang/protobuf/ptypes/empty"

import (
	context "golang.org/x/net/context"
	grpc "google.golang.org/grpc"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// ListTrees request.
// No filters or pagination options are provided.
type ListTreesRequest struct {
}

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

// ListTrees response.
// No pagination is provided, all trees the requester has access to are
// returned.
type ListTreesResponse struct {
	// Trees matching the list request filters.
	Tree []*Tree `protobuf:"bytes,1,rep,name=tree" json:"tree,omitempty"`
}

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

func (m *ListTreesResponse) GetTree() []*Tree {
	if m != nil {
		return m.Tree
	}
	return nil
}

// GetTree request.
type GetTreeRequest struct {
	// ID of the tree to retrieve.
	TreeId int64 `protobuf:"varint,1,opt,name=tree_id,json=treeId" json:"tree_id,omitempty"`
}

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

func (m *GetTreeRequest) GetTreeId() int64 {
	if m != nil {
		return m.TreeId
	}
	return 0
}

// CreateTree request.
type CreateTreeRequest struct {
	// Tree to be created. See Tree and CreateTree for more details.
	Tree *Tree `protobuf:"bytes,1,opt,name=tree" json:"tree,omitempty"`
	// Describes how the tree's private key should be generated.
	// Only needs to be set if tree.private_key is not set.
	KeySpec *keyspb.Specification `protobuf:"bytes,2,opt,name=key_spec,json=keySpec" json:"key_spec,omitempty"`
}

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

func (m *CreateTreeRequest) GetTree() *Tree {
	if m != nil {
		return m.Tree
	}
	return nil
}

func (m *CreateTreeRequest) GetKeySpec() *keyspb.Specification {
	if m != nil {
		return m.KeySpec
	}
	return nil
}

// UpdateTree request.
type UpdateTreeRequest struct {
	// Tree to be updated.
	Tree *Tree `protobuf:"bytes,1,opt,name=tree" json:"tree,omitempty"`
	// Fields modified by the update request.
	// For example: "tree_state", "display_name", "description".
	UpdateMask *google_protobuf4.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"`
}

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

func (m *UpdateTreeRequest) GetTree() *Tree {
	if m != nil {
		return m.Tree
	}
	return nil
}

func (m *UpdateTreeRequest) GetUpdateMask() *google_protobuf4.FieldMask {
	if m != nil {
		return m.UpdateMask
	}
	return nil
}

// DeleteTree request.
type DeleteTreeRequest struct {
	// ID of the tree to delete.
	TreeId int64 `protobuf:"varint,1,opt,name=tree_id,json=treeId" json:"tree_id,omitempty"`
}

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

func (m *DeleteTreeRequest) GetTreeId() int64 {
	if m != nil {
		return m.TreeId
	}
	return 0
}

func init() {
	proto.RegisterType((*ListTreesRequest)(nil), "trillian.ListTreesRequest")
	proto.RegisterType((*ListTreesResponse)(nil), "trillian.ListTreesResponse")
	proto.RegisterType((*GetTreeRequest)(nil), "trillian.GetTreeRequest")
	proto.RegisterType((*CreateTreeRequest)(nil), "trillian.CreateTreeRequest")
	proto.RegisterType((*UpdateTreeRequest)(nil), "trillian.UpdateTreeRequest")
	proto.RegisterType((*DeleteTreeRequest)(nil), "trillian.DeleteTreeRequest")
}

// 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

// Client API for TrillianAdmin service

type TrillianAdminClient interface {
	// Lists all trees the requester has access to.
	ListTrees(ctx context.Context, in *ListTreesRequest, opts ...grpc.CallOption) (*ListTreesResponse, error)
	// Retrieves a tree by ID.
	GetTree(ctx context.Context, in *GetTreeRequest, opts ...grpc.CallOption) (*Tree, error)
	// Creates a new tree.
	// System-generated fields are not required and will be ignored if present,
	// e.g.: tree_id, create_time and update_time.
	// Returns the created tree, with all system-generated fields assigned.
	CreateTree(ctx context.Context, in *CreateTreeRequest, opts ...grpc.CallOption) (*Tree, error)
	// Updates a tree.
	// See Tree for details. Readonly fields cannot be updated.
	UpdateTree(ctx context.Context, in *UpdateTreeRequest, opts ...grpc.CallOption) (*Tree, error)
	// Soft-deletes a tree.
	// A soft-deleted tree may be undeleted for a certain period, after which
	// it'll be permanently deleted.
	// TODO(codingllama): Provide an undelete RPC.
	DeleteTree(ctx context.Context, in *DeleteTreeRequest, opts ...grpc.CallOption) (*google_protobuf5.Empty, error)
}

type trillianAdminClient struct {
	cc *grpc.ClientConn
}

func NewTrillianAdminClient(cc *grpc.ClientConn) TrillianAdminClient {
	return &trillianAdminClient{cc}
}

func (c *trillianAdminClient) ListTrees(ctx context.Context, in *ListTreesRequest, opts ...grpc.CallOption) (*ListTreesResponse, error) {
	out := new(ListTreesResponse)
	err := grpc.Invoke(ctx, "/trillian.TrillianAdmin/ListTrees", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *trillianAdminClient) GetTree(ctx context.Context, in *GetTreeRequest, opts ...grpc.CallOption) (*Tree, error) {
	out := new(Tree)
	err := grpc.Invoke(ctx, "/trillian.TrillianAdmin/GetTree", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *trillianAdminClient) CreateTree(ctx context.Context, in *CreateTreeRequest, opts ...grpc.CallOption) (*Tree, error) {
	out := new(Tree)
	err := grpc.Invoke(ctx, "/trillian.TrillianAdmin/CreateTree", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *trillianAdminClient) UpdateTree(ctx context.Context, in *UpdateTreeRequest, opts ...grpc.CallOption) (*Tree, error) {
	out := new(Tree)
	err := grpc.Invoke(ctx, "/trillian.TrillianAdmin/UpdateTree", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *trillianAdminClient) DeleteTree(ctx context.Context, in *DeleteTreeRequest, opts ...grpc.CallOption) (*google_protobuf5.Empty, error) {
	out := new(google_protobuf5.Empty)
	err := grpc.Invoke(ctx, "/trillian.TrillianAdmin/DeleteTree", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for TrillianAdmin service

type TrillianAdminServer interface {
	// Lists all trees the requester has access to.
	ListTrees(context.Context, *ListTreesRequest) (*ListTreesResponse, error)
	// Retrieves a tree by ID.
	GetTree(context.Context, *GetTreeRequest) (*Tree, error)
	// Creates a new tree.
	// System-generated fields are not required and will be ignored if present,
	// e.g.: tree_id, create_time and update_time.
	// Returns the created tree, with all system-generated fields assigned.
	CreateTree(context.Context, *CreateTreeRequest) (*Tree, error)
	// Updates a tree.
	// See Tree for details. Readonly fields cannot be updated.
	UpdateTree(context.Context, *UpdateTreeRequest) (*Tree, error)
	// Soft-deletes a tree.
	// A soft-deleted tree may be undeleted for a certain period, after which
	// it'll be permanently deleted.
	// TODO(codingllama): Provide an undelete RPC.
	DeleteTree(context.Context, *DeleteTreeRequest) (*google_protobuf5.Empty, error)
}

func RegisterTrillianAdminServer(s *grpc.Server, srv TrillianAdminServer) {
	s.RegisterService(&_TrillianAdmin_serviceDesc, srv)
}

func _TrillianAdmin_ListTrees_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListTreesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TrillianAdminServer).ListTrees(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/trillian.TrillianAdmin/ListTrees",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TrillianAdminServer).ListTrees(ctx, req.(*ListTreesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TrillianAdmin_GetTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetTreeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TrillianAdminServer).GetTree(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/trillian.TrillianAdmin/GetTree",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TrillianAdminServer).GetTree(ctx, req.(*GetTreeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TrillianAdmin_CreateTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateTreeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TrillianAdminServer).CreateTree(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/trillian.TrillianAdmin/CreateTree",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TrillianAdminServer).CreateTree(ctx, req.(*CreateTreeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TrillianAdmin_UpdateTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UpdateTreeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TrillianAdminServer).UpdateTree(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/trillian.TrillianAdmin/UpdateTree",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TrillianAdminServer).UpdateTree(ctx, req.(*UpdateTreeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TrillianAdmin_DeleteTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteTreeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TrillianAdminServer).DeleteTree(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/trillian.TrillianAdmin/DeleteTree",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TrillianAdminServer).DeleteTree(ctx, req.(*DeleteTreeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _TrillianAdmin_serviceDesc = grpc.ServiceDesc{
	ServiceName: "trillian.TrillianAdmin",
	HandlerType: (*TrillianAdminServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListTrees",
			Handler:    _TrillianAdmin_ListTrees_Handler,
		},
		{
			MethodName: "GetTree",
			Handler:    _TrillianAdmin_GetTree_Handler,
		},
		{
			MethodName: "CreateTree",
			Handler:    _TrillianAdmin_CreateTree_Handler,
		},
		{
			MethodName: "UpdateTree",
			Handler:    _TrillianAdmin_UpdateTree_Handler,
		},
		{
			MethodName: "DeleteTree",
			Handler:    _TrillianAdmin_DeleteTree_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "trillian_admin_api.proto",
}

func init() { proto.RegisterFile("trillian_admin_api.proto", fileDescriptor2) }

var fileDescriptor2 = []byte{
	// 505 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xd1, 0x6e, 0xd3, 0x30,
	0x14, 0x25, 0x1b, 0x5a, 0xc7, 0x9d, 0xa8, 0xa8, 0xd1, 0xa0, 0xf3, 0x26, 0x51, 0x59, 0x3c, 0x8c,
	0x0a, 0x25, 0xac, 0x3c, 0x20, 0x81, 0x78, 0xd8, 0x80, 0x21, 0x24, 0x90, 0xaa, 0x52, 0x84, 0xc4,
	0x4b, 0xe5, 0xa6, 0xb7, 0xc5, 0x6a, 0x1b, 0x9b, 0xd8, 0x45, 0xaa, 0x10, 0x2f, 0xfc, 0x02, 0x9f,
	0x06, 0x9f, 0xc0, 0x87, 0x20, 0x3b, 0xce, 0x92, 0x34, 0x1b, 0x0f, 0x3c, 0xc5, 0xf6, 0xb9, 0xf7,
	0xdc, 0xe3, 0x73, 0x62, 0x68, 0x9b, 0x54, 0x2c, 0x16, 0x82, 0x27, 0x23, 0x3e, 0x59, 0x8a, 0x64,
	0xc4, 0x95, 0x08, 0x55, 0x2a, 0x8d, 0x24, 0xbb, 0x39, 0x42, 0x9b, 0xf9, 0x2a, 0x43, 0x28, 0x8d,
	0xd3, 0xb5, 0x32, 0x32, 0x9a, 0xe3, 0x5a, 0xab, 0xb1, 0xff, 0x78, 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