go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/auth_service/api/rpcpb/groups_grpc.pb.go (about)

     1  // Copyright 2021 The LUCI Authors.
     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             v3.21.7
    19  // source: go.chromium.org/luci/auth_service/api/rpcpb/groups.proto
    20  
    21  package rpcpb
    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  	Groups_ListGroups_FullMethodName  = "/auth.service.Groups/ListGroups"
    38  	Groups_GetGroup_FullMethodName    = "/auth.service.Groups/GetGroup"
    39  	Groups_CreateGroup_FullMethodName = "/auth.service.Groups/CreateGroup"
    40  	Groups_UpdateGroup_FullMethodName = "/auth.service.Groups/UpdateGroup"
    41  	Groups_DeleteGroup_FullMethodName = "/auth.service.Groups/DeleteGroup"
    42  	Groups_GetSubgraph_FullMethodName = "/auth.service.Groups/GetSubgraph"
    43  )
    44  
    45  // GroupsClient is the client API for Groups service.
    46  //
    47  // 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.
    48  type GroupsClient interface {
    49  	// ListGroups returns all the groups currently stored in LUCI Auth service
    50  	// datastore. The groups will be returned in alphabetical order based on their
    51  	// ID.
    52  	ListGroups(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListGroupsResponse, error)
    53  	// GetGroup returns information about an individual group, given the name.
    54  	GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*AuthGroup, error)
    55  	// CreateGroup creates a new group.
    56  	CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*AuthGroup, error)
    57  	// UpdateGroup updates an existing group.
    58  	UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*AuthGroup, error)
    59  	// DeleteGroup deletes a group.
    60  	DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
    61  	// GetSubgraph returns a Subgraph without information about groups that
    62  	// include a principal (perhaps indirectly or via globs). Here a principal is
    63  	// either an identity, a group or a glob (see PrincipalKind enum).
    64  	GetSubgraph(ctx context.Context, in *GetSubgraphRequest, opts ...grpc.CallOption) (*Subgraph, error)
    65  }
    66  
    67  type groupsClient struct {
    68  	cc grpc.ClientConnInterface
    69  }
    70  
    71  func NewGroupsClient(cc grpc.ClientConnInterface) GroupsClient {
    72  	return &groupsClient{cc}
    73  }
    74  
    75  func (c *groupsClient) ListGroups(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListGroupsResponse, error) {
    76  	out := new(ListGroupsResponse)
    77  	err := c.cc.Invoke(ctx, Groups_ListGroups_FullMethodName, in, out, opts...)
    78  	if err != nil {
    79  		return nil, err
    80  	}
    81  	return out, nil
    82  }
    83  
    84  func (c *groupsClient) GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*AuthGroup, error) {
    85  	out := new(AuthGroup)
    86  	err := c.cc.Invoke(ctx, Groups_GetGroup_FullMethodName, in, out, opts...)
    87  	if err != nil {
    88  		return nil, err
    89  	}
    90  	return out, nil
    91  }
    92  
    93  func (c *groupsClient) CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*AuthGroup, error) {
    94  	out := new(AuthGroup)
    95  	err := c.cc.Invoke(ctx, Groups_CreateGroup_FullMethodName, in, out, opts...)
    96  	if err != nil {
    97  		return nil, err
    98  	}
    99  	return out, nil
   100  }
   101  
   102  func (c *groupsClient) UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*AuthGroup, error) {
   103  	out := new(AuthGroup)
   104  	err := c.cc.Invoke(ctx, Groups_UpdateGroup_FullMethodName, in, out, opts...)
   105  	if err != nil {
   106  		return nil, err
   107  	}
   108  	return out, nil
   109  }
   110  
   111  func (c *groupsClient) DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
   112  	out := new(emptypb.Empty)
   113  	err := c.cc.Invoke(ctx, Groups_DeleteGroup_FullMethodName, in, out, opts...)
   114  	if err != nil {
   115  		return nil, err
   116  	}
   117  	return out, nil
   118  }
   119  
   120  func (c *groupsClient) GetSubgraph(ctx context.Context, in *GetSubgraphRequest, opts ...grpc.CallOption) (*Subgraph, error) {
   121  	out := new(Subgraph)
   122  	err := c.cc.Invoke(ctx, Groups_GetSubgraph_FullMethodName, in, out, opts...)
   123  	if err != nil {
   124  		return nil, err
   125  	}
   126  	return out, nil
   127  }
   128  
   129  // GroupsServer is the server API for Groups service.
   130  // All implementations must embed UnimplementedGroupsServer
   131  // for forward compatibility
   132  type GroupsServer interface {
   133  	// ListGroups returns all the groups currently stored in LUCI Auth service
   134  	// datastore. The groups will be returned in alphabetical order based on their
   135  	// ID.
   136  	ListGroups(context.Context, *emptypb.Empty) (*ListGroupsResponse, error)
   137  	// GetGroup returns information about an individual group, given the name.
   138  	GetGroup(context.Context, *GetGroupRequest) (*AuthGroup, error)
   139  	// CreateGroup creates a new group.
   140  	CreateGroup(context.Context, *CreateGroupRequest) (*AuthGroup, error)
   141  	// UpdateGroup updates an existing group.
   142  	UpdateGroup(context.Context, *UpdateGroupRequest) (*AuthGroup, error)
   143  	// DeleteGroup deletes a group.
   144  	DeleteGroup(context.Context, *DeleteGroupRequest) (*emptypb.Empty, error)
   145  	// GetSubgraph returns a Subgraph without information about groups that
   146  	// include a principal (perhaps indirectly or via globs). Here a principal is
   147  	// either an identity, a group or a glob (see PrincipalKind enum).
   148  	GetSubgraph(context.Context, *GetSubgraphRequest) (*Subgraph, error)
   149  	mustEmbedUnimplementedGroupsServer()
   150  }
   151  
   152  // UnimplementedGroupsServer must be embedded to have forward compatible implementations.
   153  type UnimplementedGroupsServer struct {
   154  }
   155  
   156  func (UnimplementedGroupsServer) ListGroups(context.Context, *emptypb.Empty) (*ListGroupsResponse, error) {
   157  	return nil, status.Errorf(codes.Unimplemented, "method ListGroups not implemented")
   158  }
   159  func (UnimplementedGroupsServer) GetGroup(context.Context, *GetGroupRequest) (*AuthGroup, error) {
   160  	return nil, status.Errorf(codes.Unimplemented, "method GetGroup not implemented")
   161  }
   162  func (UnimplementedGroupsServer) CreateGroup(context.Context, *CreateGroupRequest) (*AuthGroup, error) {
   163  	return nil, status.Errorf(codes.Unimplemented, "method CreateGroup not implemented")
   164  }
   165  func (UnimplementedGroupsServer) UpdateGroup(context.Context, *UpdateGroupRequest) (*AuthGroup, error) {
   166  	return nil, status.Errorf(codes.Unimplemented, "method UpdateGroup not implemented")
   167  }
   168  func (UnimplementedGroupsServer) DeleteGroup(context.Context, *DeleteGroupRequest) (*emptypb.Empty, error) {
   169  	return nil, status.Errorf(codes.Unimplemented, "method DeleteGroup not implemented")
   170  }
   171  func (UnimplementedGroupsServer) GetSubgraph(context.Context, *GetSubgraphRequest) (*Subgraph, error) {
   172  	return nil, status.Errorf(codes.Unimplemented, "method GetSubgraph not implemented")
   173  }
   174  func (UnimplementedGroupsServer) mustEmbedUnimplementedGroupsServer() {}
   175  
   176  // UnsafeGroupsServer may be embedded to opt out of forward compatibility for this service.
   177  // Use of this interface is not recommended, as added methods to GroupsServer will
   178  // result in compilation errors.
   179  type UnsafeGroupsServer interface {
   180  	mustEmbedUnimplementedGroupsServer()
   181  }
   182  
   183  func RegisterGroupsServer(s grpc.ServiceRegistrar, srv GroupsServer) {
   184  	s.RegisterService(&Groups_ServiceDesc, srv)
   185  }
   186  
   187  func _Groups_ListGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   188  	in := new(emptypb.Empty)
   189  	if err := dec(in); err != nil {
   190  		return nil, err
   191  	}
   192  	if interceptor == nil {
   193  		return srv.(GroupsServer).ListGroups(ctx, in)
   194  	}
   195  	info := &grpc.UnaryServerInfo{
   196  		Server:     srv,
   197  		FullMethod: Groups_ListGroups_FullMethodName,
   198  	}
   199  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   200  		return srv.(GroupsServer).ListGroups(ctx, req.(*emptypb.Empty))
   201  	}
   202  	return interceptor(ctx, in, info, handler)
   203  }
   204  
   205  func _Groups_GetGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   206  	in := new(GetGroupRequest)
   207  	if err := dec(in); err != nil {
   208  		return nil, err
   209  	}
   210  	if interceptor == nil {
   211  		return srv.(GroupsServer).GetGroup(ctx, in)
   212  	}
   213  	info := &grpc.UnaryServerInfo{
   214  		Server:     srv,
   215  		FullMethod: Groups_GetGroup_FullMethodName,
   216  	}
   217  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   218  		return srv.(GroupsServer).GetGroup(ctx, req.(*GetGroupRequest))
   219  	}
   220  	return interceptor(ctx, in, info, handler)
   221  }
   222  
   223  func _Groups_CreateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   224  	in := new(CreateGroupRequest)
   225  	if err := dec(in); err != nil {
   226  		return nil, err
   227  	}
   228  	if interceptor == nil {
   229  		return srv.(GroupsServer).CreateGroup(ctx, in)
   230  	}
   231  	info := &grpc.UnaryServerInfo{
   232  		Server:     srv,
   233  		FullMethod: Groups_CreateGroup_FullMethodName,
   234  	}
   235  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   236  		return srv.(GroupsServer).CreateGroup(ctx, req.(*CreateGroupRequest))
   237  	}
   238  	return interceptor(ctx, in, info, handler)
   239  }
   240  
   241  func _Groups_UpdateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   242  	in := new(UpdateGroupRequest)
   243  	if err := dec(in); err != nil {
   244  		return nil, err
   245  	}
   246  	if interceptor == nil {
   247  		return srv.(GroupsServer).UpdateGroup(ctx, in)
   248  	}
   249  	info := &grpc.UnaryServerInfo{
   250  		Server:     srv,
   251  		FullMethod: Groups_UpdateGroup_FullMethodName,
   252  	}
   253  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   254  		return srv.(GroupsServer).UpdateGroup(ctx, req.(*UpdateGroupRequest))
   255  	}
   256  	return interceptor(ctx, in, info, handler)
   257  }
   258  
   259  func _Groups_DeleteGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   260  	in := new(DeleteGroupRequest)
   261  	if err := dec(in); err != nil {
   262  		return nil, err
   263  	}
   264  	if interceptor == nil {
   265  		return srv.(GroupsServer).DeleteGroup(ctx, in)
   266  	}
   267  	info := &grpc.UnaryServerInfo{
   268  		Server:     srv,
   269  		FullMethod: Groups_DeleteGroup_FullMethodName,
   270  	}
   271  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   272  		return srv.(GroupsServer).DeleteGroup(ctx, req.(*DeleteGroupRequest))
   273  	}
   274  	return interceptor(ctx, in, info, handler)
   275  }
   276  
   277  func _Groups_GetSubgraph_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   278  	in := new(GetSubgraphRequest)
   279  	if err := dec(in); err != nil {
   280  		return nil, err
   281  	}
   282  	if interceptor == nil {
   283  		return srv.(GroupsServer).GetSubgraph(ctx, in)
   284  	}
   285  	info := &grpc.UnaryServerInfo{
   286  		Server:     srv,
   287  		FullMethod: Groups_GetSubgraph_FullMethodName,
   288  	}
   289  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   290  		return srv.(GroupsServer).GetSubgraph(ctx, req.(*GetSubgraphRequest))
   291  	}
   292  	return interceptor(ctx, in, info, handler)
   293  }
   294  
   295  // Groups_ServiceDesc is the grpc.ServiceDesc for Groups service.
   296  // It's only intended for direct use with grpc.RegisterService,
   297  // and not to be introspected or modified (even as a copy)
   298  var Groups_ServiceDesc = grpc.ServiceDesc{
   299  	ServiceName: "auth.service.Groups",
   300  	HandlerType: (*GroupsServer)(nil),
   301  	Methods: []grpc.MethodDesc{
   302  		{
   303  			MethodName: "ListGroups",
   304  			Handler:    _Groups_ListGroups_Handler,
   305  		},
   306  		{
   307  			MethodName: "GetGroup",
   308  			Handler:    _Groups_GetGroup_Handler,
   309  		},
   310  		{
   311  			MethodName: "CreateGroup",
   312  			Handler:    _Groups_CreateGroup_Handler,
   313  		},
   314  		{
   315  			MethodName: "UpdateGroup",
   316  			Handler:    _Groups_UpdateGroup_Handler,
   317  		},
   318  		{
   319  			MethodName: "DeleteGroup",
   320  			Handler:    _Groups_DeleteGroup_Handler,
   321  		},
   322  		{
   323  			MethodName: "GetSubgraph",
   324  			Handler:    _Groups_GetSubgraph_Handler,
   325  		},
   326  	},
   327  	Streams:  []grpc.StreamDesc{},
   328  	Metadata: "go.chromium.org/luci/auth_service/api/rpcpb/groups.proto",
   329  }