// Code generated by protoc-gen-go. DO NOT EDIT.
// source: istio/google/security/meshca/v1/meshca.proto

package google_security_meshca_v1

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

// Certificate request message.
type MeshCertificateRequest struct {
	// The request ID must be a valid UUID with the exception that zero UUID is
	// not supported (00000000-0000-0000-0000-000000000000).
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// PEM-encoded certificate request.
	Csr string `protobuf:"bytes,2,opt,name=csr,proto3" json:"csr,omitempty"`
	// Optional: requested certificate validity period.
	Validity             *duration.Duration `protobuf:"bytes,3,opt,name=validity,proto3" json:"validity,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

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

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

var xxx_messageInfo_MeshCertificateRequest proto.InternalMessageInfo

func (m *MeshCertificateRequest) GetRequestId() string {
	if m != nil {
		return m.RequestId
	}
	return ""
}

func (m *MeshCertificateRequest) GetCsr() string {
	if m != nil {
		return m.Csr
	}
	return ""
}

func (m *MeshCertificateRequest) GetValidity() *duration.Duration {
	if m != nil {
		return m.Validity
	}
	return nil
}

// Certificate response message.
type MeshCertificateResponse struct {
	// PEM-encoded certificate chain.
	// Leaf cert is element '0'. Root cert is element 'n'.
	CertChain            []string `protobuf:"bytes,1,rep,name=cert_chain,json=certChain,proto3" json:"cert_chain,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

var xxx_messageInfo_MeshCertificateResponse proto.InternalMessageInfo

func (m *MeshCertificateResponse) GetCertChain() []string {
	if m != nil {
		return m.CertChain
	}
	return nil
}

func init() {
	proto.RegisterType((*MeshCertificateRequest)(nil), "google.security.meshca.v1.MeshCertificateRequest")
	proto.RegisterType((*MeshCertificateResponse)(nil), "google.security.meshca.v1.MeshCertificateResponse")
}

func init() {
	proto.RegisterFile("istio/google/security/meshca/v1/meshca.proto", fileDescriptor_f72841047b94fe5e)
}

var fileDescriptor_f72841047b94fe5e = []byte{
	// 284 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x90, 0x41, 0x4b, 0xc3, 0x30,
	0x1c, 0xc5, 0x8d, 0x05, 0x71, 0xd9, 0x45, 0x73, 0xd0, 0x6e, 0x30, 0x29, 0x3d, 0xed, 0x20, 0x29,
	0xad, 0x08, 0x9e, 0x57, 0x2f, 0x1e, 0x84, 0x51, 0x3f, 0xc0, 0xc8, 0xd2, 0xff, 0xd6, 0x3f, 0x6c,
	0xcd, 0x4c, 0xd2, 0xc2, 0xc0, 0x83, 0x9f, 0xc2, 0xcf, 0x2b, 0x69, 0x33, 0x11, 0xe6, 0x0e, 0xde,
	0x1e, 0x2f, 0xef, 0xe5, 0xff, 0xe3, 0xd1, 0x7b, 0x34, 0x16, 0x55, 0xb2, 0x56, 0x6a, 0xbd, 0x81,
	0xc4, 0x80, 0x6c, 0x34, 0xda, 0x7d, 0xb2, 0x05, 0x53, 0x49, 0x91, 0xb4, 0xa9, 0x57, 0x7c, 0xa7,
	0x95, 0x55, 0x6c, 0xd4, 0xe7, 0xf8, 0x21, 0xc7, 0xfd, 0x6b, 0x9b, 0x8e, 0xef, 0xfc, 0x17, 0x5d,
	0x70, 0xd9, 0xac, 0x92, 0xb2, 0xd1, 0xc2, 0xa2, 0xaa, 0xfb, 0x6a, 0xfc, 0x49, 0xe8, 0xcd, 0x2b,
	0x98, 0x2a, 0x07, 0x6d, 0x71, 0x85, 0x52, 0x58, 0x28, 0xe0, 0xbd, 0x01, 0x63, 0xd9, 0x84, 0x52,
	0xdd, 0xcb, 0x05, 0x96, 0x21, 0x89, 0xc8, 0x74, 0x50, 0x0c, 0xbc, 0xf3, 0x52, 0xb2, 0x2b, 0x1a,
	0x48, 0xa3, 0xc3, 0xf3, 0xce, 0x77, 0x92, 0x3d, 0xd2, 0xcb, 0x56, 0x6c, 0xb0, 0x44, 0xbb, 0x0f,
	0x83, 0x88, 0x4c, 0x87, 0xd9, 0x88, 0x7b, 0xb2, 0xc3, 0x79, 0xfe, 0xec, 0xcf, 0x17, 0x3f, 0xd1,
	0xf8, 0x89, 0xde, 0x1e, 0x11, 0x98, 0x9d, 0xaa, 0x0d, 0x38, 0x04, 0x09, 0xda, 0x2e, 0x64, 0x25,
	0xb0, 0x0e, 0x49, 0x14, 0x38, 0x04, 0xe7, 0xe4, 0xce, 0xc8, 0xbe, 0x8e, 0xe1, 0xdf, 0x40, 0xb7,
	0x28, 0x81, 0x7d, 0xd0, 0xeb, 0x5c, 0x83, 0xb0, 0xf0, 0xeb, 0x8d, 0xa5, 0xfc, 0xe4, 0x50, 0xfc,
	0xef, 0x11, 0xc6, 0xd9, 0x7f, 0x2a, 0x3d, 0x75, 0x7c, 0x36, 0xe3, 0x74, 0x22, 0xd5, 0xf6, 0x74,
	0x75, 0x36, 0xec, 0xba, 0x62, 0xee, 0x66, 0x99, 0x93, 0xe5, 0x45, 0xb7, 0xcf, 0xc3, 0x77, 0x00,
	0x00, 0x00, 0xff, 0xff, 0xb7, 0x0d, 0xfd, 0xff, 0xf7, 0x01, 0x00, 0x00,
}

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

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

// MeshCertificateServiceClient is the client API for MeshCertificateService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type MeshCertificateServiceClient interface {
	// Using provided CSR, returns a signed certificate that represents a GCP
	// service account identity.
	CreateCertificate(ctx context.Context, in *MeshCertificateRequest, opts ...grpc.CallOption) (*MeshCertificateResponse, error)
}

type meshCertificateServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewMeshCertificateServiceClient(cc grpc.ClientConnInterface) MeshCertificateServiceClient {
	return &meshCertificateServiceClient{cc}
}

func (c *meshCertificateServiceClient) CreateCertificate(ctx context.Context, in *MeshCertificateRequest, opts ...grpc.CallOption) (*MeshCertificateResponse, error) {
	out := new(MeshCertificateResponse)
	err := c.cc.Invoke(ctx, "/google.security.meshca.v1.MeshCertificateService/CreateCertificate", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// MeshCertificateServiceServer is the server API for MeshCertificateService service.
type MeshCertificateServiceServer interface {
	// Using provided CSR, returns a signed certificate that represents a GCP
	// service account identity.
	CreateCertificate(context.Context, *MeshCertificateRequest) (*MeshCertificateResponse, error)
}

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

func (*UnimplementedMeshCertificateServiceServer) CreateCertificate(ctx context.Context, req *MeshCertificateRequest) (*MeshCertificateResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateCertificate not implemented")
}

func RegisterMeshCertificateServiceServer(s *grpc.Server, srv MeshCertificateServiceServer) {
	s.RegisterService(&_MeshCertificateService_serviceDesc, srv)
}

func _MeshCertificateService_CreateCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(MeshCertificateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MeshCertificateServiceServer).CreateCertificate(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/google.security.meshca.v1.MeshCertificateService/CreateCertificate",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MeshCertificateServiceServer).CreateCertificate(ctx, req.(*MeshCertificateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _MeshCertificateService_serviceDesc = grpc.ServiceDesc{
	ServiceName: "google.security.meshca.v1.MeshCertificateService",
	HandlerType: (*MeshCertificateServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateCertificate",
			Handler:    _MeshCertificateService_CreateCertificate_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "istio/google/security/meshca/v1/meshca.proto",
}
