// Code generated by protoc-gen-go-grpc. DO NOT EDIT. package environments import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" emptypb "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // EnvironmentsClient is the client API for Environments service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type EnvironmentsClient interface { Create(ctx context.Context, in *EnvironmentData, opts ...grpc.CallOption) (*EnvironmentFull, error) Update(ctx context.Context, in *EnvironmentFull, opts ...grpc.CallOption) (*EnvironmentFull, error) Delete(ctx context.Context, in *EnvironmentFull, opts ...grpc.CallOption) (*emptypb.Empty, error) Get(ctx context.Context, in *EnvironmentId, opts ...grpc.CallOption) (*EnvironmentFull, error) List(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Environments_ListClient, error) } type environmentsClient struct { cc grpc.ClientConnInterface } func NewEnvironmentsClient(cc grpc.ClientConnInterface) EnvironmentsClient { return &environmentsClient{cc} } func (c *environmentsClient) Create(ctx context.Context, in *EnvironmentData, opts ...grpc.CallOption) (*EnvironmentFull, error) { out := new(EnvironmentFull) err := c.cc.Invoke(ctx, "/environments.Environments/Create", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *environmentsClient) Update(ctx context.Context, in *EnvironmentFull, opts ...grpc.CallOption) (*EnvironmentFull, error) { out := new(EnvironmentFull) err := c.cc.Invoke(ctx, "/environments.Environments/Update", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *environmentsClient) Delete(ctx context.Context, in *EnvironmentFull, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/environments.Environments/Delete", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *environmentsClient) Get(ctx context.Context, in *EnvironmentId, opts ...grpc.CallOption) (*EnvironmentFull, error) { out := new(EnvironmentFull) err := c.cc.Invoke(ctx, "/environments.Environments/Get", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *environmentsClient) List(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Environments_ListClient, error) { stream, err := c.cc.NewStream(ctx, &Environments_ServiceDesc.Streams[0], "/environments.Environments/List", opts...) if err != nil { return nil, err } x := &environmentsListClient{stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } if err := x.ClientStream.CloseSend(); err != nil { return nil, err } return x, nil } type Environments_ListClient interface { Recv() (*EnvironmentFull, error) grpc.ClientStream } type environmentsListClient struct { grpc.ClientStream } func (x *environmentsListClient) Recv() (*EnvironmentFull, error) { m := new(EnvironmentFull) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } // EnvironmentsServer is the server API for Environments service. // All implementations must embed UnimplementedEnvironmentsServer // for forward compatibility type EnvironmentsServer interface { Create(context.Context, *EnvironmentData) (*EnvironmentFull, error) Update(context.Context, *EnvironmentFull) (*EnvironmentFull, error) Delete(context.Context, *EnvironmentFull) (*emptypb.Empty, error) Get(context.Context, *EnvironmentId) (*EnvironmentFull, error) List(*emptypb.Empty, Environments_ListServer) error mustEmbedUnimplementedEnvironmentsServer() } // UnimplementedEnvironmentsServer must be embedded to have forward compatible implementations. type UnimplementedEnvironmentsServer struct { } func (UnimplementedEnvironmentsServer) Create(context.Context, *EnvironmentData) (*EnvironmentFull, error) { return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") } func (UnimplementedEnvironmentsServer) Update(context.Context, *EnvironmentFull) (*EnvironmentFull, error) { return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") } func (UnimplementedEnvironmentsServer) Delete(context.Context, *EnvironmentFull) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") } func (UnimplementedEnvironmentsServer) Get(context.Context, *EnvironmentId) (*EnvironmentFull, error) { return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") } func (UnimplementedEnvironmentsServer) List(*emptypb.Empty, Environments_ListServer) error { return status.Errorf(codes.Unimplemented, "method List not implemented") } func (UnimplementedEnvironmentsServer) mustEmbedUnimplementedEnvironmentsServer() {} // UnsafeEnvironmentsServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to EnvironmentsServer will // result in compilation errors. type UnsafeEnvironmentsServer interface { mustEmbedUnimplementedEnvironmentsServer() } func RegisterEnvironmentsServer(s grpc.ServiceRegistrar, srv EnvironmentsServer) { s.RegisterService(&Environments_ServiceDesc, srv) } func _Environments_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(EnvironmentData) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(EnvironmentsServer).Create(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/environments.Environments/Create", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnvironmentsServer).Create(ctx, req.(*EnvironmentData)) } return interceptor(ctx, in, info, handler) } func _Environments_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(EnvironmentFull) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(EnvironmentsServer).Update(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/environments.Environments/Update", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnvironmentsServer).Update(ctx, req.(*EnvironmentFull)) } return interceptor(ctx, in, info, handler) } func _Environments_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(EnvironmentFull) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(EnvironmentsServer).Delete(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/environments.Environments/Delete", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnvironmentsServer).Delete(ctx, req.(*EnvironmentFull)) } return interceptor(ctx, in, info, handler) } func _Environments_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(EnvironmentId) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(EnvironmentsServer).Get(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/environments.Environments/Get", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnvironmentsServer).Get(ctx, req.(*EnvironmentId)) } return interceptor(ctx, in, info, handler) } func _Environments_List_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(emptypb.Empty) if err := stream.RecvMsg(m); err != nil { return err } return srv.(EnvironmentsServer).List(m, &environmentsListServer{stream}) } type Environments_ListServer interface { Send(*EnvironmentFull) error grpc.ServerStream } type environmentsListServer struct { grpc.ServerStream } func (x *environmentsListServer) Send(m *EnvironmentFull) error { return x.ServerStream.SendMsg(m) } // Environments_ServiceDesc is the grpc.ServiceDesc for Environments service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Environments_ServiceDesc = grpc.ServiceDesc{ ServiceName: "environments.Environments", HandlerType: (*EnvironmentsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Create", Handler: _Environments_Create_Handler, }, { MethodName: "Update", Handler: _Environments_Update_Handler, }, { MethodName: "Delete", Handler: _Environments_Delete_Handler, }, { MethodName: "Get", Handler: _Environments_Get_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "List", Handler: _Environments_List_Handler, ServerStreams: true, }, }, Metadata: "proto/environments_v1.proto", }