openfeature-provider-flagd 0.1.5__py3-none-any.whl → 0.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. openfeature/.gitignore +2 -0
  2. openfeature/contrib/provider/flagd/config.py +214 -23
  3. openfeature/contrib/provider/flagd/provider.py +88 -12
  4. openfeature/contrib/provider/flagd/resolvers/__init__.py +1 -47
  5. openfeature/contrib/provider/flagd/resolvers/grpc.py +229 -17
  6. openfeature/contrib/provider/flagd/resolvers/in_process.py +40 -31
  7. openfeature/contrib/provider/flagd/resolvers/process/connector/__init__.py +11 -0
  8. openfeature/contrib/provider/flagd/resolvers/process/connector/file_watcher.py +107 -0
  9. openfeature/contrib/provider/flagd/resolvers/process/connector/grpc_watcher.py +218 -0
  10. openfeature/contrib/provider/flagd/resolvers/process/custom_ops.py +58 -19
  11. openfeature/contrib/provider/flagd/resolvers/process/flags.py +50 -6
  12. openfeature/contrib/provider/flagd/resolvers/process/targeting.py +35 -0
  13. openfeature/contrib/provider/flagd/resolvers/protocol.py +47 -0
  14. openfeature/contrib/provider/flagd/sync_metadata_hook.py +14 -0
  15. openfeature/schemas/protobuf/flagd/evaluation/v1/evaluation_pb2.py +72 -0
  16. openfeature/schemas/protobuf/flagd/evaluation/v1/evaluation_pb2.pyi +450 -0
  17. openfeature/schemas/protobuf/flagd/evaluation/v1/evaluation_pb2_grpc.py +358 -0
  18. openfeature/schemas/protobuf/flagd/evaluation/v1/evaluation_pb2_grpc.pyi +155 -0
  19. openfeature/schemas/protobuf/flagd/sync/v1/sync_pb2.py +50 -0
  20. openfeature/schemas/protobuf/flagd/sync/v1/sync_pb2.pyi +148 -0
  21. openfeature/schemas/protobuf/flagd/sync/v1/sync_pb2_grpc.py +186 -0
  22. openfeature/schemas/protobuf/flagd/sync/v1/sync_pb2_grpc.pyi +86 -0
  23. openfeature/schemas/protobuf/schema/v1/schema_pb2.py +72 -0
  24. openfeature/schemas/protobuf/schema/v1/schema_pb2.pyi +451 -0
  25. openfeature/schemas/protobuf/schema/v1/schema_pb2_grpc.py +358 -0
  26. openfeature/schemas/protobuf/schema/v1/schema_pb2_grpc.pyi +156 -0
  27. openfeature/schemas/protobuf/sync/v1/sync_service_pb2.py +47 -0
  28. openfeature/schemas/protobuf/sync/v1/sync_service_pb2.pyi +174 -0
  29. openfeature/schemas/protobuf/sync/v1/sync_service_pb2_grpc.py +143 -0
  30. openfeature/schemas/protobuf/sync/v1/sync_service_pb2_grpc.pyi +70 -0
  31. {openfeature_provider_flagd-0.1.5.dist-info → openfeature_provider_flagd-0.2.1.dist-info}/METADATA +116 -15
  32. openfeature_provider_flagd-0.2.1.dist-info/RECORD +36 -0
  33. {openfeature_provider_flagd-0.1.5.dist-info → openfeature_provider_flagd-0.2.1.dist-info}/WHEEL +1 -1
  34. {openfeature_provider_flagd-0.1.5.dist-info → openfeature_provider_flagd-0.2.1.dist-info}/licenses/LICENSE +1 -1
  35. openfeature/contrib/provider/flagd/proto/flagd/evaluation/v1/evaluation_pb2.py +0 -62
  36. openfeature/contrib/provider/flagd/proto/flagd/evaluation/v1/evaluation_pb2_grpc.py +0 -267
  37. openfeature/contrib/provider/flagd/proto/flagd/sync/v1/sync_pb2.py +0 -40
  38. openfeature/contrib/provider/flagd/proto/flagd/sync/v1/sync_pb2_grpc.py +0 -135
  39. openfeature/contrib/provider/flagd/proto/schema/v1/schema_pb2.py +0 -62
  40. openfeature/contrib/provider/flagd/proto/schema/v1/schema_pb2_grpc.py +0 -267
  41. openfeature/contrib/provider/flagd/proto/sync/v1/sync_service_pb2.py +0 -37
  42. openfeature/contrib/provider/flagd/proto/sync/v1/sync_service_pb2_grpc.py +0 -102
  43. openfeature/contrib/provider/flagd/resolvers/process/file_watcher.py +0 -89
  44. openfeature_provider_flagd-0.1.5.dist-info/RECORD +0 -22
@@ -0,0 +1,358 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+ import warnings
5
+
6
+ from openfeature.schemas.protobuf.flagd.evaluation.v1 import evaluation_pb2 as openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2
7
+
8
+ GRPC_GENERATED_VERSION = '1.70.0'
9
+ GRPC_VERSION = grpc.__version__
10
+ _version_not_supported = False
11
+
12
+ try:
13
+ from grpc._utilities import first_version_is_lower
14
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
15
+ except ImportError:
16
+ _version_not_supported = True
17
+
18
+ if _version_not_supported:
19
+ raise RuntimeError(
20
+ f'The grpc package installed is at version {GRPC_VERSION},'
21
+ + f' but the generated code in openfeature/schemas/protobuf/flagd/evaluation/v1/evaluation_pb2_grpc.py depends on'
22
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
23
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
24
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
25
+ )
26
+
27
+
28
+ class ServiceStub(object):
29
+ """Service defines the exposed rpcs of flagd
30
+ """
31
+
32
+ def __init__(self, channel):
33
+ """Constructor.
34
+
35
+ Args:
36
+ channel: A grpc.Channel.
37
+ """
38
+ self.ResolveAll = channel.unary_unary(
39
+ '/flagd.evaluation.v1.Service/ResolveAll',
40
+ request_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllRequest.SerializeToString,
41
+ response_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllResponse.FromString,
42
+ _registered_method=True)
43
+ self.ResolveBoolean = channel.unary_unary(
44
+ '/flagd.evaluation.v1.Service/ResolveBoolean',
45
+ request_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanRequest.SerializeToString,
46
+ response_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanResponse.FromString,
47
+ _registered_method=True)
48
+ self.ResolveString = channel.unary_unary(
49
+ '/flagd.evaluation.v1.Service/ResolveString',
50
+ request_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringRequest.SerializeToString,
51
+ response_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringResponse.FromString,
52
+ _registered_method=True)
53
+ self.ResolveFloat = channel.unary_unary(
54
+ '/flagd.evaluation.v1.Service/ResolveFloat',
55
+ request_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatRequest.SerializeToString,
56
+ response_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatResponse.FromString,
57
+ _registered_method=True)
58
+ self.ResolveInt = channel.unary_unary(
59
+ '/flagd.evaluation.v1.Service/ResolveInt',
60
+ request_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntRequest.SerializeToString,
61
+ response_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntResponse.FromString,
62
+ _registered_method=True)
63
+ self.ResolveObject = channel.unary_unary(
64
+ '/flagd.evaluation.v1.Service/ResolveObject',
65
+ request_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectRequest.SerializeToString,
66
+ response_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectResponse.FromString,
67
+ _registered_method=True)
68
+ self.EventStream = channel.unary_stream(
69
+ '/flagd.evaluation.v1.Service/EventStream',
70
+ request_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamRequest.SerializeToString,
71
+ response_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamResponse.FromString,
72
+ _registered_method=True)
73
+
74
+
75
+ class ServiceServicer(object):
76
+ """Service defines the exposed rpcs of flagd
77
+ """
78
+
79
+ def ResolveAll(self, request, context):
80
+ """Missing associated documentation comment in .proto file."""
81
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
82
+ context.set_details('Method not implemented!')
83
+ raise NotImplementedError('Method not implemented!')
84
+
85
+ def ResolveBoolean(self, request, context):
86
+ """Missing associated documentation comment in .proto file."""
87
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
88
+ context.set_details('Method not implemented!')
89
+ raise NotImplementedError('Method not implemented!')
90
+
91
+ def ResolveString(self, request, context):
92
+ """Missing associated documentation comment in .proto file."""
93
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
94
+ context.set_details('Method not implemented!')
95
+ raise NotImplementedError('Method not implemented!')
96
+
97
+ def ResolveFloat(self, request, context):
98
+ """Missing associated documentation comment in .proto file."""
99
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
100
+ context.set_details('Method not implemented!')
101
+ raise NotImplementedError('Method not implemented!')
102
+
103
+ def ResolveInt(self, request, context):
104
+ """Missing associated documentation comment in .proto file."""
105
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
106
+ context.set_details('Method not implemented!')
107
+ raise NotImplementedError('Method not implemented!')
108
+
109
+ def ResolveObject(self, request, context):
110
+ """Missing associated documentation comment in .proto file."""
111
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
112
+ context.set_details('Method not implemented!')
113
+ raise NotImplementedError('Method not implemented!')
114
+
115
+ def EventStream(self, request, context):
116
+ """Missing associated documentation comment in .proto file."""
117
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
118
+ context.set_details('Method not implemented!')
119
+ raise NotImplementedError('Method not implemented!')
120
+
121
+
122
+ def add_ServiceServicer_to_server(servicer, server):
123
+ rpc_method_handlers = {
124
+ 'ResolveAll': grpc.unary_unary_rpc_method_handler(
125
+ servicer.ResolveAll,
126
+ request_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllRequest.FromString,
127
+ response_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllResponse.SerializeToString,
128
+ ),
129
+ 'ResolveBoolean': grpc.unary_unary_rpc_method_handler(
130
+ servicer.ResolveBoolean,
131
+ request_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanRequest.FromString,
132
+ response_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanResponse.SerializeToString,
133
+ ),
134
+ 'ResolveString': grpc.unary_unary_rpc_method_handler(
135
+ servicer.ResolveString,
136
+ request_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringRequest.FromString,
137
+ response_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringResponse.SerializeToString,
138
+ ),
139
+ 'ResolveFloat': grpc.unary_unary_rpc_method_handler(
140
+ servicer.ResolveFloat,
141
+ request_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatRequest.FromString,
142
+ response_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatResponse.SerializeToString,
143
+ ),
144
+ 'ResolveInt': grpc.unary_unary_rpc_method_handler(
145
+ servicer.ResolveInt,
146
+ request_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntRequest.FromString,
147
+ response_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntResponse.SerializeToString,
148
+ ),
149
+ 'ResolveObject': grpc.unary_unary_rpc_method_handler(
150
+ servicer.ResolveObject,
151
+ request_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectRequest.FromString,
152
+ response_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectResponse.SerializeToString,
153
+ ),
154
+ 'EventStream': grpc.unary_stream_rpc_method_handler(
155
+ servicer.EventStream,
156
+ request_deserializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamRequest.FromString,
157
+ response_serializer=openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamResponse.SerializeToString,
158
+ ),
159
+ }
160
+ generic_handler = grpc.method_handlers_generic_handler(
161
+ 'flagd.evaluation.v1.Service', rpc_method_handlers)
162
+ server.add_generic_rpc_handlers((generic_handler,))
163
+ server.add_registered_method_handlers('flagd.evaluation.v1.Service', rpc_method_handlers)
164
+
165
+
166
+ # This class is part of an EXPERIMENTAL API.
167
+ class Service(object):
168
+ """Service defines the exposed rpcs of flagd
169
+ """
170
+
171
+ @staticmethod
172
+ def ResolveAll(request,
173
+ target,
174
+ options=(),
175
+ channel_credentials=None,
176
+ call_credentials=None,
177
+ insecure=False,
178
+ compression=None,
179
+ wait_for_ready=None,
180
+ timeout=None,
181
+ metadata=None):
182
+ return grpc.experimental.unary_unary(
183
+ request,
184
+ target,
185
+ '/flagd.evaluation.v1.Service/ResolveAll',
186
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllRequest.SerializeToString,
187
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllResponse.FromString,
188
+ options,
189
+ channel_credentials,
190
+ insecure,
191
+ call_credentials,
192
+ compression,
193
+ wait_for_ready,
194
+ timeout,
195
+ metadata,
196
+ _registered_method=True)
197
+
198
+ @staticmethod
199
+ def ResolveBoolean(request,
200
+ target,
201
+ options=(),
202
+ channel_credentials=None,
203
+ call_credentials=None,
204
+ insecure=False,
205
+ compression=None,
206
+ wait_for_ready=None,
207
+ timeout=None,
208
+ metadata=None):
209
+ return grpc.experimental.unary_unary(
210
+ request,
211
+ target,
212
+ '/flagd.evaluation.v1.Service/ResolveBoolean',
213
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanRequest.SerializeToString,
214
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanResponse.FromString,
215
+ options,
216
+ channel_credentials,
217
+ insecure,
218
+ call_credentials,
219
+ compression,
220
+ wait_for_ready,
221
+ timeout,
222
+ metadata,
223
+ _registered_method=True)
224
+
225
+ @staticmethod
226
+ def ResolveString(request,
227
+ target,
228
+ options=(),
229
+ channel_credentials=None,
230
+ call_credentials=None,
231
+ insecure=False,
232
+ compression=None,
233
+ wait_for_ready=None,
234
+ timeout=None,
235
+ metadata=None):
236
+ return grpc.experimental.unary_unary(
237
+ request,
238
+ target,
239
+ '/flagd.evaluation.v1.Service/ResolveString',
240
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringRequest.SerializeToString,
241
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringResponse.FromString,
242
+ options,
243
+ channel_credentials,
244
+ insecure,
245
+ call_credentials,
246
+ compression,
247
+ wait_for_ready,
248
+ timeout,
249
+ metadata,
250
+ _registered_method=True)
251
+
252
+ @staticmethod
253
+ def ResolveFloat(request,
254
+ target,
255
+ options=(),
256
+ channel_credentials=None,
257
+ call_credentials=None,
258
+ insecure=False,
259
+ compression=None,
260
+ wait_for_ready=None,
261
+ timeout=None,
262
+ metadata=None):
263
+ return grpc.experimental.unary_unary(
264
+ request,
265
+ target,
266
+ '/flagd.evaluation.v1.Service/ResolveFloat',
267
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatRequest.SerializeToString,
268
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatResponse.FromString,
269
+ options,
270
+ channel_credentials,
271
+ insecure,
272
+ call_credentials,
273
+ compression,
274
+ wait_for_ready,
275
+ timeout,
276
+ metadata,
277
+ _registered_method=True)
278
+
279
+ @staticmethod
280
+ def ResolveInt(request,
281
+ target,
282
+ options=(),
283
+ channel_credentials=None,
284
+ call_credentials=None,
285
+ insecure=False,
286
+ compression=None,
287
+ wait_for_ready=None,
288
+ timeout=None,
289
+ metadata=None):
290
+ return grpc.experimental.unary_unary(
291
+ request,
292
+ target,
293
+ '/flagd.evaluation.v1.Service/ResolveInt',
294
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntRequest.SerializeToString,
295
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntResponse.FromString,
296
+ options,
297
+ channel_credentials,
298
+ insecure,
299
+ call_credentials,
300
+ compression,
301
+ wait_for_ready,
302
+ timeout,
303
+ metadata,
304
+ _registered_method=True)
305
+
306
+ @staticmethod
307
+ def ResolveObject(request,
308
+ target,
309
+ options=(),
310
+ channel_credentials=None,
311
+ call_credentials=None,
312
+ insecure=False,
313
+ compression=None,
314
+ wait_for_ready=None,
315
+ timeout=None,
316
+ metadata=None):
317
+ return grpc.experimental.unary_unary(
318
+ request,
319
+ target,
320
+ '/flagd.evaluation.v1.Service/ResolveObject',
321
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectRequest.SerializeToString,
322
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectResponse.FromString,
323
+ options,
324
+ channel_credentials,
325
+ insecure,
326
+ call_credentials,
327
+ compression,
328
+ wait_for_ready,
329
+ timeout,
330
+ metadata,
331
+ _registered_method=True)
332
+
333
+ @staticmethod
334
+ def EventStream(request,
335
+ target,
336
+ options=(),
337
+ channel_credentials=None,
338
+ call_credentials=None,
339
+ insecure=False,
340
+ compression=None,
341
+ wait_for_ready=None,
342
+ timeout=None,
343
+ metadata=None):
344
+ return grpc.experimental.unary_stream(
345
+ request,
346
+ target,
347
+ '/flagd.evaluation.v1.Service/EventStream',
348
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamRequest.SerializeToString,
349
+ openfeature_dot_schemas_dot_protobuf_dot_flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamResponse.FromString,
350
+ options,
351
+ channel_credentials,
352
+ insecure,
353
+ call_credentials,
354
+ compression,
355
+ wait_for_ready,
356
+ timeout,
357
+ metadata,
358
+ _registered_method=True)
@@ -0,0 +1,155 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ *
5
+ Flag evaluation API
6
+
7
+ This proto forms the basis of a flag-evaluation API.
8
+ It supports single and bulk evaluation RPCs, and flags of various types, as well as establishing a stream for getting notifications about changes in a flag definition.
9
+ It supports the inclusion of a "context" with each evaluation, which may contain arbitrary attributes relevant to flag evaluation.
10
+ """
11
+
12
+ import abc
13
+ import collections.abc
14
+ import grpc
15
+ import grpc.aio
16
+ import openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2
17
+ import typing
18
+
19
+ _T = typing.TypeVar("_T")
20
+
21
+ class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ...
22
+
23
+ class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore[misc, type-arg]
24
+ ...
25
+
26
+ class ServiceStub:
27
+ """Service defines the exposed rpcs of flagd"""
28
+
29
+ def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ...
30
+ ResolveAll: grpc.UnaryUnaryMultiCallable[
31
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveAllRequest,
32
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveAllResponse,
33
+ ]
34
+
35
+ ResolveBoolean: grpc.UnaryUnaryMultiCallable[
36
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveBooleanRequest,
37
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveBooleanResponse,
38
+ ]
39
+
40
+ ResolveString: grpc.UnaryUnaryMultiCallable[
41
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveStringRequest,
42
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveStringResponse,
43
+ ]
44
+
45
+ ResolveFloat: grpc.UnaryUnaryMultiCallable[
46
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveFloatRequest,
47
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveFloatResponse,
48
+ ]
49
+
50
+ ResolveInt: grpc.UnaryUnaryMultiCallable[
51
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveIntRequest,
52
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveIntResponse,
53
+ ]
54
+
55
+ ResolveObject: grpc.UnaryUnaryMultiCallable[
56
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveObjectRequest,
57
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveObjectResponse,
58
+ ]
59
+
60
+ EventStream: grpc.UnaryStreamMultiCallable[
61
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.EventStreamRequest,
62
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.EventStreamResponse,
63
+ ]
64
+
65
+ class ServiceAsyncStub:
66
+ """Service defines the exposed rpcs of flagd"""
67
+
68
+ ResolveAll: grpc.aio.UnaryUnaryMultiCallable[
69
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveAllRequest,
70
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveAllResponse,
71
+ ]
72
+
73
+ ResolveBoolean: grpc.aio.UnaryUnaryMultiCallable[
74
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveBooleanRequest,
75
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveBooleanResponse,
76
+ ]
77
+
78
+ ResolveString: grpc.aio.UnaryUnaryMultiCallable[
79
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveStringRequest,
80
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveStringResponse,
81
+ ]
82
+
83
+ ResolveFloat: grpc.aio.UnaryUnaryMultiCallable[
84
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveFloatRequest,
85
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveFloatResponse,
86
+ ]
87
+
88
+ ResolveInt: grpc.aio.UnaryUnaryMultiCallable[
89
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveIntRequest,
90
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveIntResponse,
91
+ ]
92
+
93
+ ResolveObject: grpc.aio.UnaryUnaryMultiCallable[
94
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveObjectRequest,
95
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveObjectResponse,
96
+ ]
97
+
98
+ EventStream: grpc.aio.UnaryStreamMultiCallable[
99
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.EventStreamRequest,
100
+ openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.EventStreamResponse,
101
+ ]
102
+
103
+ class ServiceServicer(metaclass=abc.ABCMeta):
104
+ """Service defines the exposed rpcs of flagd"""
105
+
106
+ @abc.abstractmethod
107
+ def ResolveAll(
108
+ self,
109
+ request: openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveAllRequest,
110
+ context: _ServicerContext,
111
+ ) -> typing.Union[openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveAllResponse, collections.abc.Awaitable[openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveAllResponse]]: ...
112
+
113
+ @abc.abstractmethod
114
+ def ResolveBoolean(
115
+ self,
116
+ request: openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveBooleanRequest,
117
+ context: _ServicerContext,
118
+ ) -> typing.Union[openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveBooleanResponse, collections.abc.Awaitable[openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveBooleanResponse]]: ...
119
+
120
+ @abc.abstractmethod
121
+ def ResolveString(
122
+ self,
123
+ request: openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveStringRequest,
124
+ context: _ServicerContext,
125
+ ) -> typing.Union[openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveStringResponse, collections.abc.Awaitable[openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveStringResponse]]: ...
126
+
127
+ @abc.abstractmethod
128
+ def ResolveFloat(
129
+ self,
130
+ request: openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveFloatRequest,
131
+ context: _ServicerContext,
132
+ ) -> typing.Union[openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveFloatResponse, collections.abc.Awaitable[openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveFloatResponse]]: ...
133
+
134
+ @abc.abstractmethod
135
+ def ResolveInt(
136
+ self,
137
+ request: openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveIntRequest,
138
+ context: _ServicerContext,
139
+ ) -> typing.Union[openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveIntResponse, collections.abc.Awaitable[openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveIntResponse]]: ...
140
+
141
+ @abc.abstractmethod
142
+ def ResolveObject(
143
+ self,
144
+ request: openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveObjectRequest,
145
+ context: _ServicerContext,
146
+ ) -> typing.Union[openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveObjectResponse, collections.abc.Awaitable[openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.ResolveObjectResponse]]: ...
147
+
148
+ @abc.abstractmethod
149
+ def EventStream(
150
+ self,
151
+ request: openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.EventStreamRequest,
152
+ context: _ServicerContext,
153
+ ) -> typing.Union[collections.abc.Iterator[openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.EventStreamResponse], collections.abc.AsyncIterator[openfeature.schemas.protobuf.flagd.evaluation.v1.evaluation_pb2.EventStreamResponse]]: ...
154
+
155
+ def add_ServiceServicer_to_server(servicer: ServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ...
@@ -0,0 +1,50 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: openfeature/schemas/protobuf/flagd/sync/v1/sync.proto
5
+ # Protobuf Python Version: 5.29.0
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 5,
15
+ 29,
16
+ 0,
17
+ '',
18
+ 'openfeature/schemas/protobuf/flagd/sync/v1/sync.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+ from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
26
+
27
+
28
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n5openfeature/schemas/protobuf/flagd/sync/v1/sync.proto\x12\rflagd.sync.v1\x1a\x1cgoogle/protobuf/struct.proto\"9\n\x10SyncFlagsRequest\x12\x13\n\x0bprovider_id\x18\x01 \x01(\t\x12\x10\n\x08selector\x18\x02 \x01(\t\"/\n\x11SyncFlagsResponse\x12\x1a\n\x12\x66lag_configuration\x18\x01 \x01(\t\"=\n\x14\x46\x65tchAllFlagsRequest\x12\x13\n\x0bprovider_id\x18\x01 \x01(\t\x12\x10\n\x08selector\x18\x02 \x01(\t\"3\n\x15\x46\x65tchAllFlagsResponse\x12\x1a\n\x12\x66lag_configuration\x18\x01 \x01(\t\"\x14\n\x12GetMetadataRequest\"F\n\x13GetMetadataResponse\x12)\n\x08metadata\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructJ\x04\x08\x01\x10\x02\x32\x9b\x02\n\x0f\x46lagSyncService\x12R\n\tSyncFlags\x12\x1f.flagd.sync.v1.SyncFlagsRequest\x1a .flagd.sync.v1.SyncFlagsResponse\"\x00\x30\x01\x12\\\n\rFetchAllFlags\x12#.flagd.sync.v1.FetchAllFlagsRequest\x1a$.flagd.sync.v1.FetchAllFlagsResponse\"\x00\x12V\n\x0bGetMetadata\x12!.flagd.sync.v1.GetMetadataRequest\x1a\".flagd.sync.v1.GetMetadataResponse\"\x00\x42\xa8\x01\n\x1f\x64\x65v.openfeature.flagd.grpc.syncZ\rflagd/sync/v1\xaa\x02\x1bOpenFeature.Flagd.Grpc.Sync\xca\x02,OpenFeature\\Providers\\Flagd\\Schema\\Grpc\\Sync\xea\x02(OpenFeature::Flagd::Provider::Grpc::Syncb\x06proto3')
29
+
30
+ _globals = globals()
31
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
32
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'openfeature.schemas.protobuf.flagd.sync.v1.sync_pb2', _globals)
33
+ if not _descriptor._USE_C_DESCRIPTORS:
34
+ _globals['DESCRIPTOR']._loaded_options = None
35
+ _globals['DESCRIPTOR']._serialized_options = b'\n\037dev.openfeature.flagd.grpc.syncZ\rflagd/sync/v1\252\002\033OpenFeature.Flagd.Grpc.Sync\312\002,OpenFeature\\Providers\\Flagd\\Schema\\Grpc\\Sync\352\002(OpenFeature::Flagd::Provider::Grpc::Sync'
36
+ _globals['_SYNCFLAGSREQUEST']._serialized_start=102
37
+ _globals['_SYNCFLAGSREQUEST']._serialized_end=159
38
+ _globals['_SYNCFLAGSRESPONSE']._serialized_start=161
39
+ _globals['_SYNCFLAGSRESPONSE']._serialized_end=208
40
+ _globals['_FETCHALLFLAGSREQUEST']._serialized_start=210
41
+ _globals['_FETCHALLFLAGSREQUEST']._serialized_end=271
42
+ _globals['_FETCHALLFLAGSRESPONSE']._serialized_start=273
43
+ _globals['_FETCHALLFLAGSRESPONSE']._serialized_end=324
44
+ _globals['_GETMETADATAREQUEST']._serialized_start=326
45
+ _globals['_GETMETADATAREQUEST']._serialized_end=346
46
+ _globals['_GETMETADATARESPONSE']._serialized_start=348
47
+ _globals['_GETMETADATARESPONSE']._serialized_end=418
48
+ _globals['_FLAGSYNCSERVICE']._serialized_start=421
49
+ _globals['_FLAGSYNCSERVICE']._serialized_end=704
50
+ # @@protoc_insertion_point(module_scope)