github.com/gravitational/teleport/api@v0.0.0-20240507183017-3110591cbafc/gen/proto/go/userpreferences/v1/userpreferences_grpc.pb.go (about)

     1  // Copyright 2023 Gravitational, Inc
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
    16  // versions:
    17  // - protoc-gen-go-grpc v1.3.0
    18  // - protoc             (unknown)
    19  // source: teleport/userpreferences/v1/userpreferences.proto
    20  
    21  package userpreferencesv1
    22  
    23  import (
    24  	context "context"
    25  	grpc "google.golang.org/grpc"
    26  	codes "google.golang.org/grpc/codes"
    27  	status "google.golang.org/grpc/status"
    28  	emptypb "google.golang.org/protobuf/types/known/emptypb"
    29  )
    30  
    31  // This is a compile-time assertion to ensure that this generated file
    32  // is compatible with the grpc package it is being compiled against.
    33  // Requires gRPC-Go v1.32.0 or later.
    34  const _ = grpc.SupportPackageIsVersion7
    35  
    36  const (
    37  	UserPreferencesService_GetUserPreferences_FullMethodName    = "/teleport.userpreferences.v1.UserPreferencesService/GetUserPreferences"
    38  	UserPreferencesService_UpsertUserPreferences_FullMethodName = "/teleport.userpreferences.v1.UserPreferencesService/UpsertUserPreferences"
    39  )
    40  
    41  // UserPreferencesServiceClient is the client API for UserPreferencesService service.
    42  //
    43  // 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.
    44  type UserPreferencesServiceClient interface {
    45  	// GetUserPreferences returns the user preferences for a given user.
    46  	GetUserPreferences(ctx context.Context, in *GetUserPreferencesRequest, opts ...grpc.CallOption) (*GetUserPreferencesResponse, error)
    47  	// UpsertUserPreferences creates or updates user preferences for a given username.
    48  	UpsertUserPreferences(ctx context.Context, in *UpsertUserPreferencesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
    49  }
    50  
    51  type userPreferencesServiceClient struct {
    52  	cc grpc.ClientConnInterface
    53  }
    54  
    55  func NewUserPreferencesServiceClient(cc grpc.ClientConnInterface) UserPreferencesServiceClient {
    56  	return &userPreferencesServiceClient{cc}
    57  }
    58  
    59  func (c *userPreferencesServiceClient) GetUserPreferences(ctx context.Context, in *GetUserPreferencesRequest, opts ...grpc.CallOption) (*GetUserPreferencesResponse, error) {
    60  	out := new(GetUserPreferencesResponse)
    61  	err := c.cc.Invoke(ctx, UserPreferencesService_GetUserPreferences_FullMethodName, in, out, opts...)
    62  	if err != nil {
    63  		return nil, err
    64  	}
    65  	return out, nil
    66  }
    67  
    68  func (c *userPreferencesServiceClient) UpsertUserPreferences(ctx context.Context, in *UpsertUserPreferencesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
    69  	out := new(emptypb.Empty)
    70  	err := c.cc.Invoke(ctx, UserPreferencesService_UpsertUserPreferences_FullMethodName, in, out, opts...)
    71  	if err != nil {
    72  		return nil, err
    73  	}
    74  	return out, nil
    75  }
    76  
    77  // UserPreferencesServiceServer is the server API for UserPreferencesService service.
    78  // All implementations must embed UnimplementedUserPreferencesServiceServer
    79  // for forward compatibility
    80  type UserPreferencesServiceServer interface {
    81  	// GetUserPreferences returns the user preferences for a given user.
    82  	GetUserPreferences(context.Context, *GetUserPreferencesRequest) (*GetUserPreferencesResponse, error)
    83  	// UpsertUserPreferences creates or updates user preferences for a given username.
    84  	UpsertUserPreferences(context.Context, *UpsertUserPreferencesRequest) (*emptypb.Empty, error)
    85  	mustEmbedUnimplementedUserPreferencesServiceServer()
    86  }
    87  
    88  // UnimplementedUserPreferencesServiceServer must be embedded to have forward compatible implementations.
    89  type UnimplementedUserPreferencesServiceServer struct {
    90  }
    91  
    92  func (UnimplementedUserPreferencesServiceServer) GetUserPreferences(context.Context, *GetUserPreferencesRequest) (*GetUserPreferencesResponse, error) {
    93  	return nil, status.Errorf(codes.Unimplemented, "method GetUserPreferences not implemented")
    94  }
    95  func (UnimplementedUserPreferencesServiceServer) UpsertUserPreferences(context.Context, *UpsertUserPreferencesRequest) (*emptypb.Empty, error) {
    96  	return nil, status.Errorf(codes.Unimplemented, "method UpsertUserPreferences not implemented")
    97  }
    98  func (UnimplementedUserPreferencesServiceServer) mustEmbedUnimplementedUserPreferencesServiceServer() {
    99  }
   100  
   101  // UnsafeUserPreferencesServiceServer may be embedded to opt out of forward compatibility for this service.
   102  // Use of this interface is not recommended, as added methods to UserPreferencesServiceServer will
   103  // result in compilation errors.
   104  type UnsafeUserPreferencesServiceServer interface {
   105  	mustEmbedUnimplementedUserPreferencesServiceServer()
   106  }
   107  
   108  func RegisterUserPreferencesServiceServer(s grpc.ServiceRegistrar, srv UserPreferencesServiceServer) {
   109  	s.RegisterService(&UserPreferencesService_ServiceDesc, srv)
   110  }
   111  
   112  func _UserPreferencesService_GetUserPreferences_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   113  	in := new(GetUserPreferencesRequest)
   114  	if err := dec(in); err != nil {
   115  		return nil, err
   116  	}
   117  	if interceptor == nil {
   118  		return srv.(UserPreferencesServiceServer).GetUserPreferences(ctx, in)
   119  	}
   120  	info := &grpc.UnaryServerInfo{
   121  		Server:     srv,
   122  		FullMethod: UserPreferencesService_GetUserPreferences_FullMethodName,
   123  	}
   124  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   125  		return srv.(UserPreferencesServiceServer).GetUserPreferences(ctx, req.(*GetUserPreferencesRequest))
   126  	}
   127  	return interceptor(ctx, in, info, handler)
   128  }
   129  
   130  func _UserPreferencesService_UpsertUserPreferences_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   131  	in := new(UpsertUserPreferencesRequest)
   132  	if err := dec(in); err != nil {
   133  		return nil, err
   134  	}
   135  	if interceptor == nil {
   136  		return srv.(UserPreferencesServiceServer).UpsertUserPreferences(ctx, in)
   137  	}
   138  	info := &grpc.UnaryServerInfo{
   139  		Server:     srv,
   140  		FullMethod: UserPreferencesService_UpsertUserPreferences_FullMethodName,
   141  	}
   142  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   143  		return srv.(UserPreferencesServiceServer).UpsertUserPreferences(ctx, req.(*UpsertUserPreferencesRequest))
   144  	}
   145  	return interceptor(ctx, in, info, handler)
   146  }
   147  
   148  // UserPreferencesService_ServiceDesc is the grpc.ServiceDesc for UserPreferencesService service.
   149  // It's only intended for direct use with grpc.RegisterService,
   150  // and not to be introspected or modified (even as a copy)
   151  var UserPreferencesService_ServiceDesc = grpc.ServiceDesc{
   152  	ServiceName: "teleport.userpreferences.v1.UserPreferencesService",
   153  	HandlerType: (*UserPreferencesServiceServer)(nil),
   154  	Methods: []grpc.MethodDesc{
   155  		{
   156  			MethodName: "GetUserPreferences",
   157  			Handler:    _UserPreferencesService_GetUserPreferences_Handler,
   158  		},
   159  		{
   160  			MethodName: "UpsertUserPreferences",
   161  			Handler:    _UserPreferencesService_UpsertUserPreferences_Handler,
   162  		},
   163  	},
   164  	Streams:  []grpc.StreamDesc{},
   165  	Metadata: "teleport/userpreferences/v1/userpreferences.proto",
   166  }