Files
softplayer-go-proto/pkg/environments/v1/environments_v1_grpc.pb.go

285 lines
11 KiB
Go

/// This file has messages for describing environments
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc (unknown)
// source: environments/v1/environments_v1.proto
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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
Environments_Create_FullMethodName = "/environments.Environments/Create"
Environments_Update_FullMethodName = "/environments.Environments/Update"
Environments_Delete_FullMethodName = "/environments.Environments/Delete"
Environments_Get_FullMethodName = "/environments.Environments/Get"
Environments_List_FullMethodName = "/environments.Environments/List"
)
// 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.
//
// *
// Service for handling environments
type EnvironmentsClient interface {
Create(ctx context.Context, in *CreateOptions, opts ...grpc.CallOption) (*EnvironmentFull, error)
Update(ctx context.Context, in *UpdateOptions, opts ...grpc.CallOption) (*EnvironmentFull, error)
Delete(ctx context.Context, in *DeleteOptions, opts ...grpc.CallOption) (*emptypb.Empty, error)
Get(ctx context.Context, in *GetOptions, opts ...grpc.CallOption) (*EnvironmentFull, error)
List(ctx context.Context, in *ListOptions, opts ...grpc.CallOption) (grpc.ServerStreamingClient[EnvironmentFull], error)
}
type environmentsClient struct {
cc grpc.ClientConnInterface
}
func NewEnvironmentsClient(cc grpc.ClientConnInterface) EnvironmentsClient {
return &environmentsClient{cc}
}
func (c *environmentsClient) Create(ctx context.Context, in *CreateOptions, opts ...grpc.CallOption) (*EnvironmentFull, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(EnvironmentFull)
err := c.cc.Invoke(ctx, Environments_Create_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *environmentsClient) Update(ctx context.Context, in *UpdateOptions, opts ...grpc.CallOption) (*EnvironmentFull, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(EnvironmentFull)
err := c.cc.Invoke(ctx, Environments_Update_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *environmentsClient) Delete(ctx context.Context, in *DeleteOptions, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, Environments_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *environmentsClient) Get(ctx context.Context, in *GetOptions, opts ...grpc.CallOption) (*EnvironmentFull, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(EnvironmentFull)
err := c.cc.Invoke(ctx, Environments_Get_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *environmentsClient) List(ctx context.Context, in *ListOptions, opts ...grpc.CallOption) (grpc.ServerStreamingClient[EnvironmentFull], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &Environments_ServiceDesc.Streams[0], Environments_List_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[ListOptions, EnvironmentFull]{ClientStream: 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
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Environments_ListClient = grpc.ServerStreamingClient[EnvironmentFull]
// EnvironmentsServer is the server API for Environments service.
// All implementations should embed UnimplementedEnvironmentsServer
// for forward compatibility.
//
// *
// Service for handling environments
type EnvironmentsServer interface {
Create(context.Context, *CreateOptions) (*EnvironmentFull, error)
Update(context.Context, *UpdateOptions) (*EnvironmentFull, error)
Delete(context.Context, *DeleteOptions) (*emptypb.Empty, error)
Get(context.Context, *GetOptions) (*EnvironmentFull, error)
List(*ListOptions, grpc.ServerStreamingServer[EnvironmentFull]) error
}
// UnimplementedEnvironmentsServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedEnvironmentsServer struct{}
func (UnimplementedEnvironmentsServer) Create(context.Context, *CreateOptions) (*EnvironmentFull, error) {
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedEnvironmentsServer) Update(context.Context, *UpdateOptions) (*EnvironmentFull, error) {
return nil, status.Error(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedEnvironmentsServer) Delete(context.Context, *DeleteOptions) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedEnvironmentsServer) Get(context.Context, *GetOptions) (*EnvironmentFull, error) {
return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedEnvironmentsServer) List(*ListOptions, grpc.ServerStreamingServer[EnvironmentFull]) error {
return status.Error(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedEnvironmentsServer) testEmbeddedByValue() {}
// 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) {
// If the following call panics, it indicates UnimplementedEnvironmentsServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
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(CreateOptions)
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_Create_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EnvironmentsServer).Create(ctx, req.(*CreateOptions))
}
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(UpdateOptions)
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_Update_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EnvironmentsServer).Update(ctx, req.(*UpdateOptions))
}
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(DeleteOptions)
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_Delete_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EnvironmentsServer).Delete(ctx, req.(*DeleteOptions))
}
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(GetOptions)
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_Get_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EnvironmentsServer).Get(ctx, req.(*GetOptions))
}
return interceptor(ctx, in, info, handler)
}
func _Environments_List_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(ListOptions)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(EnvironmentsServer).List(m, &grpc.GenericServerStream[ListOptions, EnvironmentFull]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Environments_ListServer = grpc.ServerStreamingServer[EnvironmentFull]
// 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: "environments/v1/environments_v1.proto",
}