Debian Codegraph @

policytroubleshooter/apiv1/policytroubleshooterpb/checker_grpc.pb.go

raw
1 // Copyright 2025 Google LLC
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 v4.25.7
19 // source: google/cloud/policytroubleshooter/v1/checker.proto
20
21 package policytroubleshooterpb
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 )
29
30 // This is a compile-time assertion to ensure that this generated file
31 // is compatible with the grpc package it is being compiled against.
32 // Requires gRPC-Go v1.32.0 or later.
33 const _ = grpc.SupportPackageIsVersion7
34
35 const (
36 IamChecker_TroubleshootIamPolicy_FullMethodName = "/google.cloud.policytroubleshooter.v1.IamChecker/TroubleshootIamPolicy"
37 )
38
39 // IamCheckerClient is the client API for IamChecker service.
40 //
41 // 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.
42 type IamCheckerClient interface {
43 // Checks whether a principal has a specific permission for a specific
44 // resource, and explains why the principal does or does not have that
45 // permission.
46 TroubleshootIamPolicy(ctx context.Context, in *TroubleshootIamPolicyRequest, opts ...grpc.CallOption) (*TroubleshootIamPolicyResponse, error)
47 }
48
49 type iamCheckerClient struct {
50 cc grpc.ClientConnInterface
51 }
52
53 func NewIamCheckerClient(cc grpc.ClientConnInterface) IamCheckerClient {
54 return &iamCheckerClient{cc}
55 }
56
57 func (c *iamCheckerClient) TroubleshootIamPolicy(ctx context.Context, in *TroubleshootIamPolicyRequest, opts ...grpc.CallOption) (*TroubleshootIamPolicyResponse, error) {
58 out := new(TroubleshootIamPolicyResponse)
59 err := c.cc.Invoke(ctx, IamChecker_TroubleshootIamPolicy_FullMethodName, in, out, opts...)
60 if err != nil {
61 return nil, err
62 }
63 return out, nil
64 }
65
66 // IamCheckerServer is the server API for IamChecker service.
67 // All implementations should embed UnimplementedIamCheckerServer
68 // for forward compatibility
69 type IamCheckerServer interface {
70 // Checks whether a principal has a specific permission for a specific
71 // resource, and explains why the principal does or does not have that
72 // permission.
73 TroubleshootIamPolicy(context.Context, *TroubleshootIamPolicyRequest) (*TroubleshootIamPolicyResponse, error)
74 }
75
76 // UnimplementedIamCheckerServer should be embedded to have forward compatible implementations.
77 type UnimplementedIamCheckerServer struct {
78 }
79
80 func (UnimplementedIamCheckerServer) TroubleshootIamPolicy(context.Context, *TroubleshootIamPolicyRequest) (*TroubleshootIamPolicyResponse, error) {
81 return nil, status.Errorf(codes.Unimplemented, "method TroubleshootIamPolicy not implemented")
82 }
83
84 // UnsafeIamCheckerServer may be embedded to opt out of forward compatibility for this service.
85 // Use of this interface is not recommended, as added methods to IamCheckerServer will
86 // result in compilation errors.
87 type UnsafeIamCheckerServer interface {
88 mustEmbedUnimplementedIamCheckerServer()
89 }
90
91 func RegisterIamCheckerServer(s grpc.ServiceRegistrar, srv IamCheckerServer) {
92 s.RegisterService(&IamChecker_ServiceDesc, srv)
93 }
94
95 func _IamChecker_TroubleshootIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
96 in := new(TroubleshootIamPolicyRequest)
97 if err := dec(in); err != nil {
98 return nil, err
99 }
100 if interceptor == nil {
101 return srv.(IamCheckerServer).TroubleshootIamPolicy(ctx, in)
102 }
103 info := &grpc.UnaryServerInfo{
104 Server: srv,
105 FullMethod: IamChecker_TroubleshootIamPolicy_FullMethodName,
106 }
107 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
108 return srv.(IamCheckerServer).TroubleshootIamPolicy(ctx, req.(*TroubleshootIamPolicyRequest))
109 }
110 return interceptor(ctx, in, info, handler)
111 }
112
113 // IamChecker_ServiceDesc is the grpc.ServiceDesc for IamChecker service.
114 // It's only intended for direct use with grpc.RegisterService,
115 // and not to be introspected or modified (even as a copy)
116 var IamChecker_ServiceDesc = grpc.ServiceDesc{
117 ServiceName: "google.cloud.policytroubleshooter.v1.IamChecker",
118 HandlerType: (*IamCheckerServer)(nil),
119 Methods: []grpc.MethodDesc{
120 {
121 MethodName: "TroubleshootIamPolicy",
122 Handler: _IamChecker_TroubleshootIamPolicy_Handler,
123 },
124 },
125 Streams: []grpc.StreamDesc{},
126 Metadata: "google/cloud/policytroubleshooter/v1/checker.proto",
127 }