-
Notifications
You must be signed in to change notification settings - Fork 305
/
oauth_services_grpc.pb.go
223 lines (203 loc) · 9.52 KB
/
oauth_services_grpc.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.5
// source: lorawan-stack/api/oauth_services.proto
package ttnpb
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
// OAuthAuthorizationRegistryClient is the client API for OAuthAuthorizationRegistry 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 OAuthAuthorizationRegistryClient interface {
// List OAuth clients that are authorized by the user.
List(ctx context.Context, in *ListOAuthClientAuthorizationsRequest, opts ...grpc.CallOption) (*OAuthClientAuthorizations, error)
// List OAuth access tokens issued to the OAuth client on behalf of the user.
ListTokens(ctx context.Context, in *ListOAuthAccessTokensRequest, opts ...grpc.CallOption) (*OAuthAccessTokens, error)
// Delete (de-authorize) an OAuth client for the user.
Delete(ctx context.Context, in *OAuthClientAuthorizationIdentifiers, opts ...grpc.CallOption) (*emptypb.Empty, error)
// Delete (invalidate) an OAuth access token.
DeleteToken(ctx context.Context, in *OAuthAccessTokenIdentifiers, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type oAuthAuthorizationRegistryClient struct {
cc grpc.ClientConnInterface
}
func NewOAuthAuthorizationRegistryClient(cc grpc.ClientConnInterface) OAuthAuthorizationRegistryClient {
return &oAuthAuthorizationRegistryClient{cc}
}
func (c *oAuthAuthorizationRegistryClient) List(ctx context.Context, in *ListOAuthClientAuthorizationsRequest, opts ...grpc.CallOption) (*OAuthClientAuthorizations, error) {
out := new(OAuthClientAuthorizations)
err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.OAuthAuthorizationRegistry/List", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *oAuthAuthorizationRegistryClient) ListTokens(ctx context.Context, in *ListOAuthAccessTokensRequest, opts ...grpc.CallOption) (*OAuthAccessTokens, error) {
out := new(OAuthAccessTokens)
err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.OAuthAuthorizationRegistry/ListTokens", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *oAuthAuthorizationRegistryClient) Delete(ctx context.Context, in *OAuthClientAuthorizationIdentifiers, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.OAuthAuthorizationRegistry/Delete", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *oAuthAuthorizationRegistryClient) DeleteToken(ctx context.Context, in *OAuthAccessTokenIdentifiers, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.OAuthAuthorizationRegistry/DeleteToken", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// OAuthAuthorizationRegistryServer is the server API for OAuthAuthorizationRegistry service.
// All implementations must embed UnimplementedOAuthAuthorizationRegistryServer
// for forward compatibility
type OAuthAuthorizationRegistryServer interface {
// List OAuth clients that are authorized by the user.
List(context.Context, *ListOAuthClientAuthorizationsRequest) (*OAuthClientAuthorizations, error)
// List OAuth access tokens issued to the OAuth client on behalf of the user.
ListTokens(context.Context, *ListOAuthAccessTokensRequest) (*OAuthAccessTokens, error)
// Delete (de-authorize) an OAuth client for the user.
Delete(context.Context, *OAuthClientAuthorizationIdentifiers) (*emptypb.Empty, error)
// Delete (invalidate) an OAuth access token.
DeleteToken(context.Context, *OAuthAccessTokenIdentifiers) (*emptypb.Empty, error)
mustEmbedUnimplementedOAuthAuthorizationRegistryServer()
}
// UnimplementedOAuthAuthorizationRegistryServer must be embedded to have forward compatible implementations.
type UnimplementedOAuthAuthorizationRegistryServer struct {
}
func (UnimplementedOAuthAuthorizationRegistryServer) List(context.Context, *ListOAuthClientAuthorizationsRequest) (*OAuthClientAuthorizations, error) {
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedOAuthAuthorizationRegistryServer) ListTokens(context.Context, *ListOAuthAccessTokensRequest) (*OAuthAccessTokens, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListTokens not implemented")
}
func (UnimplementedOAuthAuthorizationRegistryServer) Delete(context.Context, *OAuthClientAuthorizationIdentifiers) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedOAuthAuthorizationRegistryServer) DeleteToken(context.Context, *OAuthAccessTokenIdentifiers) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteToken not implemented")
}
func (UnimplementedOAuthAuthorizationRegistryServer) mustEmbedUnimplementedOAuthAuthorizationRegistryServer() {
}
// UnsafeOAuthAuthorizationRegistryServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to OAuthAuthorizationRegistryServer will
// result in compilation errors.
type UnsafeOAuthAuthorizationRegistryServer interface {
mustEmbedUnimplementedOAuthAuthorizationRegistryServer()
}
func RegisterOAuthAuthorizationRegistryServer(s grpc.ServiceRegistrar, srv OAuthAuthorizationRegistryServer) {
s.RegisterService(&OAuthAuthorizationRegistry_ServiceDesc, srv)
}
func _OAuthAuthorizationRegistry_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListOAuthClientAuthorizationsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OAuthAuthorizationRegistryServer).List(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ttn.lorawan.v3.OAuthAuthorizationRegistry/List",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OAuthAuthorizationRegistryServer).List(ctx, req.(*ListOAuthClientAuthorizationsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _OAuthAuthorizationRegistry_ListTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListOAuthAccessTokensRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OAuthAuthorizationRegistryServer).ListTokens(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ttn.lorawan.v3.OAuthAuthorizationRegistry/ListTokens",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OAuthAuthorizationRegistryServer).ListTokens(ctx, req.(*ListOAuthAccessTokensRequest))
}
return interceptor(ctx, in, info, handler)
}
func _OAuthAuthorizationRegistry_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(OAuthClientAuthorizationIdentifiers)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OAuthAuthorizationRegistryServer).Delete(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ttn.lorawan.v3.OAuthAuthorizationRegistry/Delete",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OAuthAuthorizationRegistryServer).Delete(ctx, req.(*OAuthClientAuthorizationIdentifiers))
}
return interceptor(ctx, in, info, handler)
}
func _OAuthAuthorizationRegistry_DeleteToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(OAuthAccessTokenIdentifiers)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OAuthAuthorizationRegistryServer).DeleteToken(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ttn.lorawan.v3.OAuthAuthorizationRegistry/DeleteToken",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OAuthAuthorizationRegistryServer).DeleteToken(ctx, req.(*OAuthAccessTokenIdentifiers))
}
return interceptor(ctx, in, info, handler)
}
// OAuthAuthorizationRegistry_ServiceDesc is the grpc.ServiceDesc for OAuthAuthorizationRegistry service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var OAuthAuthorizationRegistry_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ttn.lorawan.v3.OAuthAuthorizationRegistry",
HandlerType: (*OAuthAuthorizationRegistryServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "List",
Handler: _OAuthAuthorizationRegistry_List_Handler,
},
{
MethodName: "ListTokens",
Handler: _OAuthAuthorizationRegistry_ListTokens_Handler,
},
{
MethodName: "Delete",
Handler: _OAuthAuthorizationRegistry_Delete_Handler,
},
{
MethodName: "DeleteToken",
Handler: _OAuthAuthorizationRegistry_DeleteToken_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "lorawan-stack/api/oauth_services.proto",
}