Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.OnInvoke = channel.unary_unary(
'/dapr.proto.runtime.v1.AppCallback/OnInvoke',
request_serializer=dapr_dot_proto_dot_common_dot_v1_dot_common__pb2.InvokeRequest.SerializeToString,
response_deserializer=dapr_dot_proto_dot_common_dot_v1_dot_common__pb2.InvokeResponse.FromString,
)
self.ListTopicSubscriptions = channel.unary_unary(
'/dapr.proto.runtime.v1.AppCallback/ListTopicSubscriptions',
request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
response_deserializer=dapr_dot_proto_dot_runtime_dot_v1_dot_appcallback__pb2.ListTopicSubscriptionsResponse.FromString,
)
self.OnTopicEvent = channel.unary_unary(
'/dapr.proto.runtime.v1.AppCallback/OnTopicEvent',
request_serializer=dapr_dot_proto_dot_runtime_dot_v1_dot_appcallback__pb2.TopicEventRequest.SerializeToString,
response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
)
self.ListInputBindings = channel.unary_unary(
'/dapr.proto.runtime.v1.AppCallback/ListInputBindings',
request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
response_deserializer=dapr_dot_proto_dot_runtime_dot_v1_dot_appcallback__pb2.ListInputBindingsResponse.FromString,
)
def add_DaprServicer_to_server(servicer, server):
rpc_method_handlers = {
'PublishEvent': grpc.unary_unary_rpc_method_handler(
servicer.PublishEvent,
request_deserializer=dapr_dot_proto_dot_dapr_dot_v1_dot_dapr__pb2.PublishEventEnvelope.FromString,
response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
),
'InvokeService': grpc.unary_unary_rpc_method_handler(
servicer.InvokeService,
request_deserializer=dapr_dot_proto_dot_dapr_dot_v1_dot_dapr__pb2.InvokeServiceRequest.FromString,
response_serializer=dapr_dot_proto_dot_common_dot_v1_dot_common__pb2.InvokeResponse.SerializeToString,
),
'InvokeBinding': grpc.unary_unary_rpc_method_handler(
servicer.InvokeBinding,
request_deserializer=dapr_dot_proto_dot_dapr_dot_v1_dot_dapr__pb2.InvokeBindingEnvelope.FromString,
response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
),
'GetState': grpc.unary_unary_rpc_method_handler(
servicer.GetState,
request_deserializer=dapr_dot_proto_dot_dapr_dot_v1_dot_dapr__pb2.GetStateEnvelope.FromString,
response_serializer=dapr_dot_proto_dot_dapr_dot_v1_dot_dapr__pb2.GetStateResponseEnvelope.SerializeToString,
),
'GetSecret': grpc.unary_unary_rpc_method_handler(
servicer.GetSecret,
request_deserializer=dapr_dot_proto_dot_dapr_dot_v1_dot_dapr__pb2.GetSecretEnvelope.FromString,
response_serializer=dapr_dot_proto_dot_dapr_dot_v1_dot_dapr__pb2.GetSecretResponseEnvelope.SerializeToString,
),
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.PublishEvent = channel.unary_unary(
'/dapr.proto.dapr.v1.Dapr/PublishEvent',
request_serializer=dapr_dot_proto_dot_dapr_dot_v1_dot_dapr__pb2.PublishEventEnvelope.SerializeToString,
response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
)
self.InvokeService = channel.unary_unary(
'/dapr.proto.dapr.v1.Dapr/InvokeService',
request_serializer=dapr_dot_proto_dot_dapr_dot_v1_dot_dapr__pb2.InvokeServiceRequest.SerializeToString,
response_deserializer=dapr_dot_proto_dot_common_dot_v1_dot_common__pb2.InvokeResponse.FromString,
)
self.InvokeBinding = channel.unary_unary(
'/dapr.proto.dapr.v1.Dapr/InvokeBinding',
request_serializer=dapr_dot_proto_dot_dapr_dot_v1_dot_dapr__pb2.InvokeBindingEnvelope.SerializeToString,
response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
)
self.GetState = channel.unary_unary(
'/dapr.proto.dapr.v1.Dapr/GetState',
request_serializer=dapr_dot_proto_dot_dapr_dot_v1_dot_dapr__pb2.GetStateEnvelope.SerializeToString,
response_deserializer=dapr_dot_proto_dot_dapr_dot_v1_dot_dapr__pb2.GetStateResponseEnvelope.FromString,
)
self.GetSecret = channel.unary_unary(
'/dapr.proto.dapr.v1.Dapr/GetSecret',
request_serializer=dapr_dot_proto_dot_dapr_dot_v1_dot_dapr__pb2.GetSecretEnvelope.SerializeToString,
response_deserializer=dapr_dot_proto_dot_dapr_dot_v1_dot_dapr__pb2.GetSecretResponseEnvelope.FromString,
)
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.OnInvoke = channel.unary_unary(
'/dapr.proto.runtime.v1.AppCallback/OnInvoke',
request_serializer=dapr_dot_proto_dot_common_dot_v1_dot_common__pb2.InvokeRequest.SerializeToString,
response_deserializer=dapr_dot_proto_dot_common_dot_v1_dot_common__pb2.InvokeResponse.FromString,
)
self.ListTopicSubscriptions = channel.unary_unary(
'/dapr.proto.runtime.v1.AppCallback/ListTopicSubscriptions',
request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
response_deserializer=dapr_dot_proto_dot_runtime_dot_v1_dot_appcallback__pb2.ListTopicSubscriptionsResponse.FromString,
)
self.OnTopicEvent = channel.unary_unary(
'/dapr.proto.runtime.v1.AppCallback/OnTopicEvent',
request_serializer=dapr_dot_proto_dot_runtime_dot_v1_dot_appcallback__pb2.TopicEventRequest.SerializeToString,
response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
)
self.ListInputBindings = channel.unary_unary(
'/dapr.proto.runtime.v1.AppCallback/ListInputBindings',
request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
response_deserializer=dapr_dot_proto_dot_runtime_dot_v1_dot_appcallback__pb2.ListInputBindingsResponse.FromString,
from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2
from dapr.proto.common.v1 import common_pb2 as dapr_dot_proto_dot_common_dot_v1_dot_common__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='dapr/proto/dapr/v1/dapr.proto',
package='dapr.proto.dapr.v1',
syntax='proto3',
serialized_options=_b('\n\nio.dapr.v1B\nDaprProtosZ&github.com/dapr/dapr/pkg/proto/dapr/v1\252\002\033Dapr.Client.Autogen.Grpc.v1'),
serialized_pb=_b('\n\x1d\x64\x61pr/proto/dapr/v1/dapr.proto\x12\x12\x64\x61pr.proto.dapr.v1\x1a\x19google/protobuf/any.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1egoogle/protobuf/duration.proto\x1a!dapr/proto/common/v1/common.proto\"X\n\x14InvokeServiceRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x34\n\x07message\x18\x03 \x01(\x0b\x32#.dapr.proto.common.v1.InvokeRequest\"w\n\x13\x44\x65leteStateEnvelope\x12\x12\n\nstore_name\x18\x01 \x01(\t\x12\x0b\n\x03key\x18\x02 \x01(\t\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\x12\x31\n\x07options\x18\x04 \x01(\x0b\x32 .dapr.proto.dapr.v1.StateOptions\"[\n\x11SaveStateEnvelope\x12\x12\n\nstore_name\x18\x01 \x01(\t\x12\x32\n\x08requests\x18\x02 \x03(\x0b\x32 .dapr.proto.dapr.v1.StateRequest\"H\n\x10GetStateEnvelope\x12\x12\n\nstore_name\x18\x01 \x01(\t\x12\x0b\n\x03key\x18\x02 \x01(\t\x12\x13\n\x0b\x63onsistency\x18\x03 \x01(\t\"L\n\x18GetStateResponseEnvelope\x12\"\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x14.google.protobuf.Any\x12\x0c\n\x04\x65tag\x18\x02 \x01(\t\"\xac\x01\n\x11GetSecretEnvelope\x12\x12\n\nstore_name\x18\x01 \x01(\t\x12\x0b\n\x03key\x18\x02 \x01(\t\x12\x45\n\x08metadata\x18\x03 \x03(\x0b\x32\x33.dapr.proto.dapr.v1.GetSecretEnvelope.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8f\x01\n\x19GetSecretResponseEnvelope\x12\x45\n\x04\x64\x61ta\x18\x01 \x03(\x0b\x32\x37.dapr.proto.dapr.v1.GetSecretResponseEnvelope.DataEntry\x1a+\n\tDataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xc5\x01\n\x15InvokeBindingEnvelope\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\"\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any\x12I\n\x08metadata\x18\x03 \x03(\x0b\x32\x37.dapr.proto.dapr.v1.InvokeBindingEnvelope.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"I\n\x14PublishEventEnvelope\x12\r\n\x05topic\x18\x01 \x01(\t\x12\"\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any\"\xe6\x01\n\x05State\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\x12\x39\n\x08metadata\x18\x04 \x03(\x0b\x32\'.dapr.proto.dapr.v1.State.MetadataEntry\x12\x31\n\x07options\x18\x05 \x01(\x0b\x32 .dapr.proto.dapr.v1.StateOptions\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"o\n\x0cStateOptions\x12\x13\n\x0b\x63oncurrency\x18\x01 \x01(\t\x12\x13\n\x0b\x63onsistency\x18\x02 \x01(\t\x12\x35\n\x0cretry_policy\x18\x03 \x01(\x0b\x32\x1f.dapr.proto.dapr.v1.RetryPolicy\"^\n\x0bRetryPolicy\x12\x11\n\tthreshold\x18\x01 \x01(\x05\x12\x0f\n\x07pattern\x18\x02 \x01(\t\x12+\n\x08interval\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xf4\x01\n\x0cStateRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\x12@\n\x08metadata\x18\x04 \x03(\x0b\x32..dapr.proto.dapr.v1.StateRequest.MetadataEntry\x12\x31\n\x07options\x18\x05 \x01(\x0b\x32 .dapr.proto.dapr.v1.StateOptions\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x32\xfa\x04\n\x04\x44\x61pr\x12R\n\x0cPublishEvent\x12(.dapr.proto.dapr.v1.PublishEventEnvelope\x1a\x16.google.protobuf.Empty\"\x00\x12\x61\n\rInvokeService\x12(.dapr.proto.dapr.v1.InvokeServiceRequest\x1a$.dapr.proto.common.v1.InvokeResponse\"\x00\x12T\n\rInvokeBinding\x12).dapr.proto.dapr.v1.InvokeBindingEnvelope\x1a\x16.google.protobuf.Empty\"\x00\x12`\n\x08GetState\x12$.dapr.proto.dapr.v1.GetStateEnvelope\x1a,.dapr.proto.dapr.v1.GetStateResponseEnvelope\"\x00\x12\x63\n\tGetSecret\x12%.dapr.proto.dapr.v1.GetSecretEnvelope\x1a-.dapr.proto.dapr.v1.GetSecretResponseEnvelope\"\x00\x12L\n\tSaveState\x12%.dapr.proto.dapr.v1.SaveStateEnvelope\x1a\x16.google.protobuf.Empty\"\x00\x12P\n\x0b\x44\x65leteState\x12\'.dapr.proto.dapr.v1.DeleteStateEnvelope\x1a\x16.google.protobuf.Empty\"\x00\x42^\n\nio.dapr.v1B\nDaprProtosZ&github.com/dapr/dapr/pkg/proto/dapr/v1\xaa\x02\x1b\x44\x61pr.Client.Autogen.Grpc.v1b\x06proto3')
,
dependencies=[google_dot_protobuf_dot_any__pb2.DESCRIPTOR,google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,google_dot_protobuf_dot_duration__pb2.DESCRIPTOR,dapr_dot_proto_dot_common_dot_v1_dot_common__pb2.DESCRIPTOR,])
_INVOKESERVICEREQUEST = _descriptor.Descriptor(
name='InvokeServiceRequest',
full_name='dapr.proto.dapr.v1.InvokeServiceRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='id', full_name='dapr.proto.dapr.v1.InvokeServiceRequest.id', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
_descriptor.MethodDescriptor(
name='PublishEvent',
full_name='dapr.proto.dapr.v1.Dapr.PublishEvent',
index=0,
containing_service=None,
input_type=_PUBLISHEVENTENVELOPE,
output_type=google_dot_protobuf_dot_empty__pb2._EMPTY,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='InvokeService',
full_name='dapr.proto.dapr.v1.Dapr.InvokeService',
index=1,
containing_service=None,
input_type=_INVOKESERVICEREQUEST,
output_type=dapr_dot_proto_dot_common_dot_v1_dot_common__pb2._INVOKERESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='InvokeBinding',
full_name='dapr.proto.dapr.v1.Dapr.InvokeBinding',
index=2,
containing_service=None,
input_type=_INVOKEBINDINGENVELOPE,
output_type=google_dot_protobuf_dot_empty__pb2._EMPTY,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetState',
full_name='dapr.proto.dapr.v1.Dapr.GetState',
index=3,
containing_service=None,
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=975,
serialized_end=1020,
)
_BINDINGEVENTREQUEST_METADATAENTRY.containing_type = _BINDINGEVENTREQUEST
_BINDINGEVENTREQUEST.fields_by_name['metadata'].message_type = _BINDINGEVENTREQUEST_METADATAENTRY
_BINDINGEVENTRESPONSE.fields_by_name['states'].message_type = dapr_dot_proto_dot_common_dot_v1_dot_common__pb2._STATEITEM
_BINDINGEVENTRESPONSE.fields_by_name['concurrency'].enum_type = _BINDINGEVENTRESPONSE_BINDINGEVENTCONCURRENCY
_BINDINGEVENTRESPONSE_BINDINGEVENTCONCURRENCY.containing_type = _BINDINGEVENTRESPONSE
_LISTTOPICSUBSCRIPTIONSRESPONSE.fields_by_name['subscriptions'].message_type = _TOPICSUBSCRIPTION
_TOPICSUBSCRIPTION_METADATAENTRY.containing_type = _TOPICSUBSCRIPTION
_TOPICSUBSCRIPTION.fields_by_name['metadata'].message_type = _TOPICSUBSCRIPTION_METADATAENTRY
DESCRIPTOR.message_types_by_name['TopicEventRequest'] = _TOPICEVENTREQUEST
DESCRIPTOR.message_types_by_name['BindingEventRequest'] = _BINDINGEVENTREQUEST
DESCRIPTOR.message_types_by_name['BindingEventResponse'] = _BINDINGEVENTRESPONSE
DESCRIPTOR.message_types_by_name['ListTopicSubscriptionsResponse'] = _LISTTOPICSUBSCRIPTIONSRESPONSE
DESCRIPTOR.message_types_by_name['TopicSubscription'] = _TOPICSUBSCRIPTION
DESCRIPTOR.message_types_by_name['ListInputBindingsResponse'] = _LISTINPUTBINDINGSRESPONSE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
TopicEventRequest = _reflection.GeneratedProtocolMessageType('TopicEventRequest', (_message.Message,), {
'DESCRIPTOR' : _TOPICEVENTREQUEST,
'__module__' : 'dapr.proto.runtime.v1.appcallback_pb2'
_sym_db = _symbol_database.Default()
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from dapr.proto.common.v1 import common_pb2 as dapr_dot_proto_dot_common_dot_v1_dot_common__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='dapr/proto/runtime/v1/appcallback.proto',
package='dapr.proto.runtime.v1',
syntax='proto3',
serialized_options=_b('\n\nio.dapr.v1B\025DaprAppCallbackProtosZ1github.com/dapr/dapr/pkg/proto/runtime/v1;runtime\252\002 Dapr.AppCallback.Autogen.Grpc.v1'),
serialized_pb=_b('\n\'dapr/proto/runtime/v1/appcallback.proto\x12\x15\x64\x61pr.proto.runtime.v1\x1a\x1bgoogle/protobuf/empty.proto\x1a!dapr/proto/common/v1/common.proto\"\x8b\x01\n\x11TopicEventRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06source\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x14\n\x0cspec_version\x18\x04 \x01(\t\x12\x19\n\x11\x64\x61ta_content_type\x18\x05 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x07 \x01(\x0c\x12\r\n\x05topic\x18\x06 \x01(\t\"\xae\x01\n\x13\x42indingEventRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12J\n\x08metadata\x18\x03 \x03(\x0b\x32\x38.dapr.proto.runtime.v1.BindingEventRequest.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x88\x02\n\x14\x42indingEventResponse\x12\x12\n\nstore_name\x18\x01 \x01(\t\x12/\n\x06states\x18\x02 \x03(\x0b\x32\x1f.dapr.proto.common.v1.StateItem\x12\n\n\x02to\x18\x03 \x03(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\x12X\n\x0b\x63oncurrency\x18\x05 \x01(\x0e\x32\x43.dapr.proto.runtime.v1.BindingEventResponse.BindingEventConcurrency\"7\n\x17\x42indingEventConcurrency\x12\x0e\n\nSEQUENTIAL\x10\x00\x12\x0c\n\x08PARALLEL\x10\x01\"a\n\x1eListTopicSubscriptionsResponse\x12?\n\rsubscriptions\x18\x01 \x03(\x0b\x32(.dapr.proto.runtime.v1.TopicSubscription\"\x9d\x01\n\x11TopicSubscription\x12\r\n\x05topic\x18\x01 \x01(\t\x12H\n\x08metadata\x18\x02 \x03(\x0b\x32\x36.dapr.proto.runtime.v1.TopicSubscription.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"-\n\x19ListInputBindingsResponse\x12\x10\n\x08\x62indings\x18\x01 \x03(\t2\xf3\x03\n\x0b\x41ppCallback\x12W\n\x08OnInvoke\x12#.dapr.proto.common.v1.InvokeRequest\x1a$.dapr.proto.common.v1.InvokeResponse\"\x00\x12i\n\x16ListTopicSubscriptions\x12\x16.google.protobuf.Empty\x1a\x35.dapr.proto.runtime.v1.ListTopicSubscriptionsResponse\"\x00\x12R\n\x0cOnTopicEvent\x12(.dapr.proto.runtime.v1.TopicEventRequest\x1a\x16.google.protobuf.Empty\"\x00\x12_\n\x11ListInputBindings\x12\x16.google.protobuf.Empty\x1a\x30.dapr.proto.runtime.v1.ListInputBindingsResponse\"\x00\x12k\n\x0eOnBindingEvent\x12*.dapr.proto.runtime.v1.BindingEventRequest\x1a+.dapr.proto.runtime.v1.BindingEventResponse\"\x00\x42y\n\nio.dapr.v1B\x15\x44\x61prAppCallbackProtosZ1github.com/dapr/dapr/pkg/proto/runtime/v1;runtime\xaa\x02 Dapr.AppCallback.Autogen.Grpc.v1b\x06proto3')
,
dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,dapr_dot_proto_dot_common_dot_v1_dot_common__pb2.DESCRIPTOR,])
_BINDINGEVENTRESPONSE_BINDINGEVENTCONCURRENCY = _descriptor.EnumDescriptor(
name='BindingEventConcurrency',
full_name='dapr.proto.runtime.v1.BindingEventResponse.BindingEventConcurrency',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='SEQUENTIAL', index=0, number=0,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='PARALLEL', index=1, number=1,
serialized_options=None,