mattermost/python-sdk/build/lib/mattermost_plugin/grpc/hooks_pb2_grpc.py
Nick Misasi 01643af641 debug: add extensive logging to trace hook registration flow
Go side:
- Log hooks returned by Implemented()
- Log each hook name -> ID mapping
- Log OnActivate implementation status
- Log OnActivate call flow

Python side:
- Log Implemented() return value
- Log OnActivate gRPC receipt and handler invocation

This is temporary debug logging to diagnose why OnActivate
isn't being called for Python plugins.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 09:12:22 -05:00

2236 lines
97 KiB
Python

# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings
from . import hooks_command_pb2 as hooks__command__pb2
from . import hooks_http_pb2 as hooks__http__pb2
from . import hooks_lifecycle_pb2 as hooks__lifecycle__pb2
from . import hooks_message_pb2 as hooks__message__pb2
from . import hooks_user_channel_pb2 as hooks__user__channel__pb2
GRPC_GENERATED_VERSION = '1.76.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False
try:
from grpc._utilities import first_version_is_lower
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
_version_not_supported = True
if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ ' but the generated code in hooks_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
)
class PluginHooksStub(object):
"""==============================================================================
PLUGIN HOOKS SERVICE
==============================================================================
This service defines the gRPC interface for invoking plugin hooks.
The Go server implements this service's client to call into Python plugins.
Python plugins implement this service's server to receive hook invocations.
Direction: Server -> Plugin (server calls plugin hooks)
ERROR HANDLING CONVENTION:
--------------------------
For hooks whose Go signature returns `error`:
- Errors are encoded in the response message's `error` field (AppError)
- gRPC status codes are reserved for transport-level failures only
For hooks whose Go signature returns nothing (void):
- Response message has no `error` field
- Hook failures are logged server-side but do not propagate
HOOK GROUPS:
------------
This file imports and exposes RPCs for different hook categories:
- hooks_lifecycle.proto: Lifecycle and system hooks (this plan: 03-01)
- hooks_message.proto: Message hooks (planned: 03-02)
- hooks_user_channel.proto: User and channel hooks (03-03)
- hooks_command.proto: Command, WebSocket, cluster, shared channels hooks (03-04)
==============================================================================
PluginHooks is the gRPC service for invoking plugin hooks.
The server acts as the gRPC client, calling into the plugin process.
The plugin acts as the gRPC server, implementing the hook handlers.
===========================================================================
LIFECYCLE HOOKS
===========================================================================
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Implemented = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/Implemented',
request_serializer=hooks__lifecycle__pb2.ImplementedRequest.SerializeToString,
response_deserializer=hooks__lifecycle__pb2.ImplementedResponse.FromString,
_registered_method=True)
self.OnActivate = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/OnActivate',
request_serializer=hooks__lifecycle__pb2.OnActivateRequest.SerializeToString,
response_deserializer=hooks__lifecycle__pb2.OnActivateResponse.FromString,
_registered_method=True)
self.OnDeactivate = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/OnDeactivate',
request_serializer=hooks__lifecycle__pb2.OnDeactivateRequest.SerializeToString,
response_deserializer=hooks__lifecycle__pb2.OnDeactivateResponse.FromString,
_registered_method=True)
self.OnConfigurationChange = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/OnConfigurationChange',
request_serializer=hooks__lifecycle__pb2.OnConfigurationChangeRequest.SerializeToString,
response_deserializer=hooks__lifecycle__pb2.OnConfigurationChangeResponse.FromString,
_registered_method=True)
self.OnInstall = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/OnInstall',
request_serializer=hooks__lifecycle__pb2.OnInstallRequest.SerializeToString,
response_deserializer=hooks__lifecycle__pb2.OnInstallResponse.FromString,
_registered_method=True)
self.OnSendDailyTelemetry = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/OnSendDailyTelemetry',
request_serializer=hooks__lifecycle__pb2.OnSendDailyTelemetryRequest.SerializeToString,
response_deserializer=hooks__lifecycle__pb2.OnSendDailyTelemetryResponse.FromString,
_registered_method=True)
self.RunDataRetention = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/RunDataRetention',
request_serializer=hooks__lifecycle__pb2.RunDataRetentionRequest.SerializeToString,
response_deserializer=hooks__lifecycle__pb2.RunDataRetentionResponse.FromString,
_registered_method=True)
self.OnCloudLimitsUpdated = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/OnCloudLimitsUpdated',
request_serializer=hooks__lifecycle__pb2.OnCloudLimitsUpdatedRequest.SerializeToString,
response_deserializer=hooks__lifecycle__pb2.OnCloudLimitsUpdatedResponse.FromString,
_registered_method=True)
self.ConfigurationWillBeSaved = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/ConfigurationWillBeSaved',
request_serializer=hooks__lifecycle__pb2.ConfigurationWillBeSavedRequest.SerializeToString,
response_deserializer=hooks__lifecycle__pb2.ConfigurationWillBeSavedResponse.FromString,
_registered_method=True)
self.MessageWillBePosted = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/MessageWillBePosted',
request_serializer=hooks__message__pb2.MessageWillBePostedRequest.SerializeToString,
response_deserializer=hooks__message__pb2.MessageWillBePostedResponse.FromString,
_registered_method=True)
self.MessageWillBeUpdated = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/MessageWillBeUpdated',
request_serializer=hooks__message__pb2.MessageWillBeUpdatedRequest.SerializeToString,
response_deserializer=hooks__message__pb2.MessageWillBeUpdatedResponse.FromString,
_registered_method=True)
self.MessageHasBeenPosted = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/MessageHasBeenPosted',
request_serializer=hooks__message__pb2.MessageHasBeenPostedRequest.SerializeToString,
response_deserializer=hooks__message__pb2.MessageHasBeenPostedResponse.FromString,
_registered_method=True)
self.MessageHasBeenUpdated = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/MessageHasBeenUpdated',
request_serializer=hooks__message__pb2.MessageHasBeenUpdatedRequest.SerializeToString,
response_deserializer=hooks__message__pb2.MessageHasBeenUpdatedResponse.FromString,
_registered_method=True)
self.MessagesWillBeConsumed = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/MessagesWillBeConsumed',
request_serializer=hooks__message__pb2.MessagesWillBeConsumedRequest.SerializeToString,
response_deserializer=hooks__message__pb2.MessagesWillBeConsumedResponse.FromString,
_registered_method=True)
self.MessageHasBeenDeleted = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/MessageHasBeenDeleted',
request_serializer=hooks__message__pb2.MessageHasBeenDeletedRequest.SerializeToString,
response_deserializer=hooks__message__pb2.MessageHasBeenDeletedResponse.FromString,
_registered_method=True)
self.FileWillBeUploaded = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/FileWillBeUploaded',
request_serializer=hooks__message__pb2.FileWillBeUploadedRequest.SerializeToString,
response_deserializer=hooks__message__pb2.FileWillBeUploadedResponse.FromString,
_registered_method=True)
self.ReactionHasBeenAdded = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/ReactionHasBeenAdded',
request_serializer=hooks__message__pb2.ReactionHasBeenAddedRequest.SerializeToString,
response_deserializer=hooks__message__pb2.ReactionHasBeenAddedResponse.FromString,
_registered_method=True)
self.ReactionHasBeenRemoved = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/ReactionHasBeenRemoved',
request_serializer=hooks__message__pb2.ReactionHasBeenRemovedRequest.SerializeToString,
response_deserializer=hooks__message__pb2.ReactionHasBeenRemovedResponse.FromString,
_registered_method=True)
self.NotificationWillBePushed = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/NotificationWillBePushed',
request_serializer=hooks__message__pb2.NotificationWillBePushedRequest.SerializeToString,
response_deserializer=hooks__message__pb2.NotificationWillBePushedResponse.FromString,
_registered_method=True)
self.EmailNotificationWillBeSent = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/EmailNotificationWillBeSent',
request_serializer=hooks__message__pb2.EmailNotificationWillBeSentRequest.SerializeToString,
response_deserializer=hooks__message__pb2.EmailNotificationWillBeSentResponse.FromString,
_registered_method=True)
self.PreferencesHaveChanged = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/PreferencesHaveChanged',
request_serializer=hooks__message__pb2.PreferencesHaveChangedRequest.SerializeToString,
response_deserializer=hooks__message__pb2.PreferencesHaveChangedResponse.FromString,
_registered_method=True)
self.UserHasBeenCreated = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/UserHasBeenCreated',
request_serializer=hooks__user__channel__pb2.UserHasBeenCreatedRequest.SerializeToString,
response_deserializer=hooks__user__channel__pb2.UserHasBeenCreatedResponse.FromString,
_registered_method=True)
self.UserWillLogIn = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/UserWillLogIn',
request_serializer=hooks__user__channel__pb2.UserWillLogInRequest.SerializeToString,
response_deserializer=hooks__user__channel__pb2.UserWillLogInResponse.FromString,
_registered_method=True)
self.UserHasLoggedIn = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/UserHasLoggedIn',
request_serializer=hooks__user__channel__pb2.UserHasLoggedInRequest.SerializeToString,
response_deserializer=hooks__user__channel__pb2.UserHasLoggedInResponse.FromString,
_registered_method=True)
self.UserHasBeenDeactivated = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/UserHasBeenDeactivated',
request_serializer=hooks__user__channel__pb2.UserHasBeenDeactivatedRequest.SerializeToString,
response_deserializer=hooks__user__channel__pb2.UserHasBeenDeactivatedResponse.FromString,
_registered_method=True)
self.OnSAMLLogin = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/OnSAMLLogin',
request_serializer=hooks__user__channel__pb2.OnSAMLLoginRequest.SerializeToString,
response_deserializer=hooks__user__channel__pb2.OnSAMLLoginResponse.FromString,
_registered_method=True)
self.ChannelHasBeenCreated = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/ChannelHasBeenCreated',
request_serializer=hooks__user__channel__pb2.ChannelHasBeenCreatedRequest.SerializeToString,
response_deserializer=hooks__user__channel__pb2.ChannelHasBeenCreatedResponse.FromString,
_registered_method=True)
self.UserHasJoinedChannel = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/UserHasJoinedChannel',
request_serializer=hooks__user__channel__pb2.UserHasJoinedChannelRequest.SerializeToString,
response_deserializer=hooks__user__channel__pb2.UserHasJoinedChannelResponse.FromString,
_registered_method=True)
self.UserHasLeftChannel = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/UserHasLeftChannel',
request_serializer=hooks__user__channel__pb2.UserHasLeftChannelRequest.SerializeToString,
response_deserializer=hooks__user__channel__pb2.UserHasLeftChannelResponse.FromString,
_registered_method=True)
self.UserHasJoinedTeam = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/UserHasJoinedTeam',
request_serializer=hooks__user__channel__pb2.UserHasJoinedTeamRequest.SerializeToString,
response_deserializer=hooks__user__channel__pb2.UserHasJoinedTeamResponse.FromString,
_registered_method=True)
self.UserHasLeftTeam = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/UserHasLeftTeam',
request_serializer=hooks__user__channel__pb2.UserHasLeftTeamRequest.SerializeToString,
response_deserializer=hooks__user__channel__pb2.UserHasLeftTeamResponse.FromString,
_registered_method=True)
self.ExecuteCommand = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/ExecuteCommand',
request_serializer=hooks__command__pb2.ExecuteCommandRequest.SerializeToString,
response_deserializer=hooks__command__pb2.ExecuteCommandResponse.FromString,
_registered_method=True)
self.OnWebSocketConnect = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/OnWebSocketConnect',
request_serializer=hooks__command__pb2.OnWebSocketConnectRequest.SerializeToString,
response_deserializer=hooks__command__pb2.OnWebSocketConnectResponse.FromString,
_registered_method=True)
self.OnWebSocketDisconnect = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/OnWebSocketDisconnect',
request_serializer=hooks__command__pb2.OnWebSocketDisconnectRequest.SerializeToString,
response_deserializer=hooks__command__pb2.OnWebSocketDisconnectResponse.FromString,
_registered_method=True)
self.WebSocketMessageHasBeenPosted = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/WebSocketMessageHasBeenPosted',
request_serializer=hooks__command__pb2.WebSocketMessageHasBeenPostedRequest.SerializeToString,
response_deserializer=hooks__command__pb2.WebSocketMessageHasBeenPostedResponse.FromString,
_registered_method=True)
self.OnPluginClusterEvent = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/OnPluginClusterEvent',
request_serializer=hooks__command__pb2.OnPluginClusterEventRequest.SerializeToString,
response_deserializer=hooks__command__pb2.OnPluginClusterEventResponse.FromString,
_registered_method=True)
self.OnSharedChannelsSyncMsg = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/OnSharedChannelsSyncMsg',
request_serializer=hooks__command__pb2.OnSharedChannelsSyncMsgRequest.SerializeToString,
response_deserializer=hooks__command__pb2.OnSharedChannelsSyncMsgResponse.FromString,
_registered_method=True)
self.OnSharedChannelsPing = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/OnSharedChannelsPing',
request_serializer=hooks__command__pb2.OnSharedChannelsPingRequest.SerializeToString,
response_deserializer=hooks__command__pb2.OnSharedChannelsPingResponse.FromString,
_registered_method=True)
self.OnSharedChannelsAttachmentSyncMsg = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/OnSharedChannelsAttachmentSyncMsg',
request_serializer=hooks__command__pb2.OnSharedChannelsAttachmentSyncMsgRequest.SerializeToString,
response_deserializer=hooks__command__pb2.OnSharedChannelsAttachmentSyncMsgResponse.FromString,
_registered_method=True)
self.OnSharedChannelsProfileImageSyncMsg = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/OnSharedChannelsProfileImageSyncMsg',
request_serializer=hooks__command__pb2.OnSharedChannelsProfileImageSyncMsgRequest.SerializeToString,
response_deserializer=hooks__command__pb2.OnSharedChannelsProfileImageSyncMsgResponse.FromString,
_registered_method=True)
self.GenerateSupportData = channel.unary_unary(
'/mattermost.pluginapi.v1.PluginHooks/GenerateSupportData',
request_serializer=hooks__command__pb2.GenerateSupportDataRequest.SerializeToString,
response_deserializer=hooks__command__pb2.GenerateSupportDataResponse.FromString,
_registered_method=True)
self.ServeHTTP = channel.stream_stream(
'/mattermost.pluginapi.v1.PluginHooks/ServeHTTP',
request_serializer=hooks__http__pb2.ServeHTTPRequest.SerializeToString,
response_deserializer=hooks__http__pb2.ServeHTTPResponse.FromString,
_registered_method=True)
class PluginHooksServicer(object):
"""==============================================================================
PLUGIN HOOKS SERVICE
==============================================================================
This service defines the gRPC interface for invoking plugin hooks.
The Go server implements this service's client to call into Python plugins.
Python plugins implement this service's server to receive hook invocations.
Direction: Server -> Plugin (server calls plugin hooks)
ERROR HANDLING CONVENTION:
--------------------------
For hooks whose Go signature returns `error`:
- Errors are encoded in the response message's `error` field (AppError)
- gRPC status codes are reserved for transport-level failures only
For hooks whose Go signature returns nothing (void):
- Response message has no `error` field
- Hook failures are logged server-side but do not propagate
HOOK GROUPS:
------------
This file imports and exposes RPCs for different hook categories:
- hooks_lifecycle.proto: Lifecycle and system hooks (this plan: 03-01)
- hooks_message.proto: Message hooks (planned: 03-02)
- hooks_user_channel.proto: User and channel hooks (03-03)
- hooks_command.proto: Command, WebSocket, cluster, shared channels hooks (03-04)
==============================================================================
PluginHooks is the gRPC service for invoking plugin hooks.
The server acts as the gRPC client, calling into the plugin process.
The plugin acts as the gRPC server, implementing the hook handlers.
===========================================================================
LIFECYCLE HOOKS
===========================================================================
"""
def Implemented(self, request, context):
"""Implemented returns the list of hooks that the plugin implements.
Called during plugin startup to optimize hook dispatch.
Plugins that don't implement this are assumed to implement all hooks.
Go signature: Implemented() ([]string, error)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OnActivate(self, request, context):
"""OnActivate is invoked when the plugin is activated.
If an error is returned, the plugin will be terminated.
The plugin will not receive hooks until after OnActivate returns without error.
OnConfigurationChange will be called once before OnActivate.
Go signature: OnActivate() error
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OnDeactivate(self, request, context):
"""OnDeactivate is invoked when the plugin is deactivated.
This is the plugin's last chance to use the API.
The plugin will be terminated shortly after this invocation.
Go signature: OnDeactivate() error
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OnConfigurationChange(self, request, context):
"""OnConfigurationChange is invoked when configuration changes may have been made.
Any returned error is logged but does not stop the plugin.
It is called once before OnActivate.
Go signature: OnConfigurationChange() error
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OnInstall(self, request, context):
"""===========================================================================
SYSTEM HOOKS
===========================================================================
OnInstall is invoked after the installation of a plugin as part of onboarding.
It's called on every installation, not only once.
Go signature: OnInstall(c *Context, event model.OnInstallEvent) error
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OnSendDailyTelemetry(self, request, context):
"""OnSendDailyTelemetry is invoked when the server sends daily telemetry data.
Plugins can use this to send their own telemetry metrics.
Go signature: OnSendDailyTelemetry()
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def RunDataRetention(self, request, context):
"""RunDataRetention is invoked during a DataRetentionJob.
Plugins should delete data older than their retention policy.
Go signature: RunDataRetention(nowTime, batchSize int64) (int64, error)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OnCloudLimitsUpdated(self, request, context):
"""OnCloudLimitsUpdated is invoked when cloud product limits change.
For example, when plan tiers change affecting storage or message limits.
Go signature: OnCloudLimitsUpdated(limits *model.ProductLimits)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ConfigurationWillBeSaved(self, request, context):
"""ConfigurationWillBeSaved is invoked before saving configuration to the backing store.
An error can be returned to reject the operation.
Additionally, a new config object can be returned to be stored in place of the provided one.
Go signature: ConfigurationWillBeSaved(newCfg *model.Config) (*model.Config, error)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MessageWillBePosted(self, request, context):
"""===========================================================================
MESSAGE HOOKS
===========================================================================
MessageWillBePosted is invoked when a message is posted before it is committed
to the database. Use this to modify or reject posts before they are saved.
Return values:
- To allow unchanged: return nil post and empty string
- To modify: return modified post and empty string
- To reject: return nil post and rejection reason string
- To dismiss silently: return nil post and "plugin.message_will_be_posted.dismiss_post"
Go signature: MessageWillBePosted(c *Context, post *model.Post) (*model.Post, string)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MessageWillBeUpdated(self, request, context):
"""MessageWillBeUpdated is invoked when a message is updated before it is committed
to the database. Use this to modify or reject post updates.
Return values:
- To allow unchanged: return nil post and empty string
- To modify: return modified post and empty string
- To reject: return nil post and rejection reason (post stays unchanged)
Go signature: MessageWillBeUpdated(c *Context, newPost, oldPost *model.Post) (*model.Post, string)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MessageHasBeenPosted(self, request, context):
"""MessageHasBeenPosted is invoked after the message has been committed to the database.
This is a notification hook - you cannot modify or reject the post.
Use MessageWillBePosted if you need to modify or reject.
Go signature: MessageHasBeenPosted(c *Context, post *model.Post)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MessageHasBeenUpdated(self, request, context):
"""MessageHasBeenUpdated is invoked after a message update has been committed to the database.
This is a notification hook - you cannot modify or reject the update.
Use MessageWillBeUpdated if you need to modify or reject.
Go signature: MessageHasBeenUpdated(c *Context, newPost, oldPost *model.Post)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MessagesWillBeConsumed(self, request, context):
"""MessagesWillBeConsumed is invoked when messages are requested by a client
before they are returned. Use this to filter or modify posts before delivery.
Note: This hook has no Context parameter and no error return.
Go signature: MessagesWillBeConsumed(posts []*model.Post) []*model.Post
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MessageHasBeenDeleted(self, request, context):
"""MessageHasBeenDeleted is invoked after a message has been deleted from the database.
This is a notification hook - you cannot undo the deletion.
Go signature: MessageHasBeenDeleted(c *Context, post *model.Post)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def FileWillBeUploaded(self, request, context):
"""FileWillBeUploaded is invoked when a file is uploaded before it is committed
to storage. Use this to modify or reject file uploads.
Note: Phase 8 will add streaming support. Currently uses bytes for file content.
Return values:
- To allow unchanged: return nil FileInfo, empty bytes, empty string
- To modify: return modified FileInfo and/or content, empty string
- To reject: return nil FileInfo, empty bytes, and rejection reason
Go signature: FileWillBeUploaded(c *Context, info *model.FileInfo, file io.Reader, output io.Writer) (*model.FileInfo, string)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ReactionHasBeenAdded(self, request, context):
"""ReactionHasBeenAdded is invoked after a reaction has been committed to the database.
This is a notification hook.
Go signature: ReactionHasBeenAdded(c *Context, reaction *model.Reaction)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ReactionHasBeenRemoved(self, request, context):
"""ReactionHasBeenRemoved is invoked after a reaction has been removed from the database.
This is a notification hook.
Go signature: ReactionHasBeenRemoved(c *Context, reaction *model.Reaction)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def NotificationWillBePushed(self, request, context):
"""NotificationWillBePushed is invoked before a push notification is sent to
the push notification server. Use this to modify or reject push notifications.
Note: This hook has no Context parameter.
Return values:
- To allow unchanged: return nil notification and empty string
- To modify: return modified notification and empty string
- To reject: return nil notification and rejection reason
Go signature: NotificationWillBePushed(pushNotification *model.PushNotification, userID string) (*model.PushNotification, string)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def EmailNotificationWillBeSent(self, request, context):
"""EmailNotificationWillBeSent is invoked before an email notification is sent.
Use this to customize email content or reject the notification.
Note: Core identifiers (PostId, ChannelId, etc.) are immutable.
Only content fields (subject, title, message, etc.) can be modified.
Note: This hook has no Context parameter.
Return values:
- To allow unchanged: return nil content and empty string
- To modify: return modified EmailNotificationContent and empty string
- To reject: return nil content and rejection reason
Go signature: EmailNotificationWillBeSent(emailNotification *model.EmailNotification) (*model.EmailNotificationContent, string)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def PreferencesHaveChanged(self, request, context):
"""PreferencesHaveChanged is invoked after one or more of a user's preferences
have changed. This is a notification hook.
Go signature: PreferencesHaveChanged(c *Context, preferences []model.Preference)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def UserHasBeenCreated(self, request, context):
"""===========================================================================
USER HOOKS
===========================================================================
UserHasBeenCreated is invoked after a user was created.
This is a notification hook - you cannot modify or reject the creation.
Go signature: UserHasBeenCreated(c *Context, user *model.User)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def UserWillLogIn(self, request, context):
"""UserWillLogIn is invoked before the login of the user is returned.
Return a non-empty string to reject the login.
If you don't need to reject the login event, see UserHasLoggedIn.
Go signature: UserWillLogIn(c *Context, user *model.User) string
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def UserHasLoggedIn(self, request, context):
"""UserHasLoggedIn is invoked after a user has logged in.
This is a notification hook - you cannot modify or reject the login.
Go signature: UserHasLoggedIn(c *Context, user *model.User)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def UserHasBeenDeactivated(self, request, context):
"""UserHasBeenDeactivated is invoked when a user is deactivated.
This is a notification hook.
Go signature: UserHasBeenDeactivated(c *Context, user *model.User)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OnSAMLLogin(self, request, context):
"""OnSAMLLogin is invoked after a successful SAML login.
Return an error to reject the login.
Go signature: OnSAMLLogin(c *Context, user *model.User, assertion *saml2.AssertionInfo) error
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ChannelHasBeenCreated(self, request, context):
"""===========================================================================
CHANNEL AND TEAM HOOKS
===========================================================================
ChannelHasBeenCreated is invoked after a channel has been created.
This is a notification hook - you cannot modify or reject the creation.
Go signature: ChannelHasBeenCreated(c *Context, channel *model.Channel)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def UserHasJoinedChannel(self, request, context):
"""UserHasJoinedChannel is invoked after a user has joined a channel.
This is a notification hook. The actor is optional (nil if self-join).
Go signature: UserHasJoinedChannel(c *Context, channelMember *model.ChannelMember, actor *model.User)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def UserHasLeftChannel(self, request, context):
"""UserHasLeftChannel is invoked after a user has left a channel.
This is a notification hook. The actor is optional (nil if self-removal).
Go signature: UserHasLeftChannel(c *Context, channelMember *model.ChannelMember, actor *model.User)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def UserHasJoinedTeam(self, request, context):
"""UserHasJoinedTeam is invoked after a user has joined a team.
This is a notification hook. The actor is optional (nil if self-join).
Go signature: UserHasJoinedTeam(c *Context, teamMember *model.TeamMember, actor *model.User)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def UserHasLeftTeam(self, request, context):
"""UserHasLeftTeam is invoked after a user has left a team.
This is a notification hook. The actor is optional (nil if self-removal).
Go signature: UserHasLeftTeam(c *Context, teamMember *model.TeamMember, actor *model.User)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ExecuteCommand(self, request, context):
"""===========================================================================
COMMAND HOOKS
===========================================================================
ExecuteCommand executes a registered slash command.
Go signature: ExecuteCommand(c *Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OnWebSocketConnect(self, request, context):
"""===========================================================================
WEBSOCKET HOOKS
===========================================================================
OnWebSocketConnect is invoked when a new WebSocket connection is opened.
This is a notification hook with no Context parameter.
Go signature: OnWebSocketConnect(webConnID, userID string)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OnWebSocketDisconnect(self, request, context):
"""OnWebSocketDisconnect is invoked when a WebSocket connection is closed.
This is a notification hook with no Context parameter.
Go signature: OnWebSocketDisconnect(webConnID, userID string)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def WebSocketMessageHasBeenPosted(self, request, context):
"""WebSocketMessageHasBeenPosted is invoked when a WebSocket message is received.
This is a notification hook with no Context parameter.
Go signature: WebSocketMessageHasBeenPosted(webConnID, userID string, req *model.WebSocketRequest)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OnPluginClusterEvent(self, request, context):
"""===========================================================================
CLUSTER HOOKS
===========================================================================
OnPluginClusterEvent is invoked when an intra-cluster plugin event is received.
Used for communication between plugin instances in a High-Availability cluster.
This is a notification hook.
Go signature: OnPluginClusterEvent(c *Context, ev model.PluginClusterEvent)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OnSharedChannelsSyncMsg(self, request, context):
"""===========================================================================
SHARED CHANNELS HOOKS
===========================================================================
OnSharedChannelsSyncMsg is invoked when a shared channels sync message is received.
Plugins can use this to synchronize data with remote clusters.
Go signature: OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OnSharedChannelsPing(self, request, context):
"""OnSharedChannelsPing is invoked to check the health of the shared channels plugin.
Return true if the plugin and upstream connections are healthy.
Go signature: OnSharedChannelsPing(rc *model.RemoteCluster) bool
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OnSharedChannelsAttachmentSyncMsg(self, request, context):
"""OnSharedChannelsAttachmentSyncMsg is invoked when a file attachment sync message is received.
Used to synchronize file attachments between shared channel participants.
Go signature: OnSharedChannelsAttachmentSyncMsg(fi *model.FileInfo, post *model.Post, rc *model.RemoteCluster) error
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OnSharedChannelsProfileImageSyncMsg(self, request, context):
"""OnSharedChannelsProfileImageSyncMsg is invoked when a profile image sync message is received.
Used to synchronize user profile images between shared channel participants.
Go signature: OnSharedChannelsProfileImageSyncMsg(user *model.User, rc *model.RemoteCluster) error
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GenerateSupportData(self, request, context):
"""===========================================================================
SUPPORT HOOKS
===========================================================================
GenerateSupportData is invoked when a Support Packet is generated.
Plugins can include their own diagnostic data in the support packet.
Go signature: GenerateSupportData(c *Context) ([]*model.FileData, error)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ServeHTTP(self, request_iterator, context):
"""===========================================================================
HTTP STREAMING HOOKS (Phase 8)
===========================================================================
ServeHTTP handles HTTP requests to /plugins/{plugin_id}.
Uses bidirectional streaming for efficient large body transfer.
Request flow (Go -> Python):
- First message: init metadata (method, URL, headers) + optional first body chunk
- Subsequent messages: body chunks until body_complete=true
Response flow (Python -> Go):
- First message: init metadata (status, headers) + optional first body chunk
- Subsequent messages: body chunks until body_complete=true
Cancellation: HTTP client disconnect propagates via gRPC context.
Body chunks are 64KB by default (configurable).
Go signature: ServeHTTP(c *Context, w http.ResponseWriter, r *http.Request)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_PluginHooksServicer_to_server(servicer, server):
rpc_method_handlers = {
'Implemented': grpc.unary_unary_rpc_method_handler(
servicer.Implemented,
request_deserializer=hooks__lifecycle__pb2.ImplementedRequest.FromString,
response_serializer=hooks__lifecycle__pb2.ImplementedResponse.SerializeToString,
),
'OnActivate': grpc.unary_unary_rpc_method_handler(
servicer.OnActivate,
request_deserializer=hooks__lifecycle__pb2.OnActivateRequest.FromString,
response_serializer=hooks__lifecycle__pb2.OnActivateResponse.SerializeToString,
),
'OnDeactivate': grpc.unary_unary_rpc_method_handler(
servicer.OnDeactivate,
request_deserializer=hooks__lifecycle__pb2.OnDeactivateRequest.FromString,
response_serializer=hooks__lifecycle__pb2.OnDeactivateResponse.SerializeToString,
),
'OnConfigurationChange': grpc.unary_unary_rpc_method_handler(
servicer.OnConfigurationChange,
request_deserializer=hooks__lifecycle__pb2.OnConfigurationChangeRequest.FromString,
response_serializer=hooks__lifecycle__pb2.OnConfigurationChangeResponse.SerializeToString,
),
'OnInstall': grpc.unary_unary_rpc_method_handler(
servicer.OnInstall,
request_deserializer=hooks__lifecycle__pb2.OnInstallRequest.FromString,
response_serializer=hooks__lifecycle__pb2.OnInstallResponse.SerializeToString,
),
'OnSendDailyTelemetry': grpc.unary_unary_rpc_method_handler(
servicer.OnSendDailyTelemetry,
request_deserializer=hooks__lifecycle__pb2.OnSendDailyTelemetryRequest.FromString,
response_serializer=hooks__lifecycle__pb2.OnSendDailyTelemetryResponse.SerializeToString,
),
'RunDataRetention': grpc.unary_unary_rpc_method_handler(
servicer.RunDataRetention,
request_deserializer=hooks__lifecycle__pb2.RunDataRetentionRequest.FromString,
response_serializer=hooks__lifecycle__pb2.RunDataRetentionResponse.SerializeToString,
),
'OnCloudLimitsUpdated': grpc.unary_unary_rpc_method_handler(
servicer.OnCloudLimitsUpdated,
request_deserializer=hooks__lifecycle__pb2.OnCloudLimitsUpdatedRequest.FromString,
response_serializer=hooks__lifecycle__pb2.OnCloudLimitsUpdatedResponse.SerializeToString,
),
'ConfigurationWillBeSaved': grpc.unary_unary_rpc_method_handler(
servicer.ConfigurationWillBeSaved,
request_deserializer=hooks__lifecycle__pb2.ConfigurationWillBeSavedRequest.FromString,
response_serializer=hooks__lifecycle__pb2.ConfigurationWillBeSavedResponse.SerializeToString,
),
'MessageWillBePosted': grpc.unary_unary_rpc_method_handler(
servicer.MessageWillBePosted,
request_deserializer=hooks__message__pb2.MessageWillBePostedRequest.FromString,
response_serializer=hooks__message__pb2.MessageWillBePostedResponse.SerializeToString,
),
'MessageWillBeUpdated': grpc.unary_unary_rpc_method_handler(
servicer.MessageWillBeUpdated,
request_deserializer=hooks__message__pb2.MessageWillBeUpdatedRequest.FromString,
response_serializer=hooks__message__pb2.MessageWillBeUpdatedResponse.SerializeToString,
),
'MessageHasBeenPosted': grpc.unary_unary_rpc_method_handler(
servicer.MessageHasBeenPosted,
request_deserializer=hooks__message__pb2.MessageHasBeenPostedRequest.FromString,
response_serializer=hooks__message__pb2.MessageHasBeenPostedResponse.SerializeToString,
),
'MessageHasBeenUpdated': grpc.unary_unary_rpc_method_handler(
servicer.MessageHasBeenUpdated,
request_deserializer=hooks__message__pb2.MessageHasBeenUpdatedRequest.FromString,
response_serializer=hooks__message__pb2.MessageHasBeenUpdatedResponse.SerializeToString,
),
'MessagesWillBeConsumed': grpc.unary_unary_rpc_method_handler(
servicer.MessagesWillBeConsumed,
request_deserializer=hooks__message__pb2.MessagesWillBeConsumedRequest.FromString,
response_serializer=hooks__message__pb2.MessagesWillBeConsumedResponse.SerializeToString,
),
'MessageHasBeenDeleted': grpc.unary_unary_rpc_method_handler(
servicer.MessageHasBeenDeleted,
request_deserializer=hooks__message__pb2.MessageHasBeenDeletedRequest.FromString,
response_serializer=hooks__message__pb2.MessageHasBeenDeletedResponse.SerializeToString,
),
'FileWillBeUploaded': grpc.unary_unary_rpc_method_handler(
servicer.FileWillBeUploaded,
request_deserializer=hooks__message__pb2.FileWillBeUploadedRequest.FromString,
response_serializer=hooks__message__pb2.FileWillBeUploadedResponse.SerializeToString,
),
'ReactionHasBeenAdded': grpc.unary_unary_rpc_method_handler(
servicer.ReactionHasBeenAdded,
request_deserializer=hooks__message__pb2.ReactionHasBeenAddedRequest.FromString,
response_serializer=hooks__message__pb2.ReactionHasBeenAddedResponse.SerializeToString,
),
'ReactionHasBeenRemoved': grpc.unary_unary_rpc_method_handler(
servicer.ReactionHasBeenRemoved,
request_deserializer=hooks__message__pb2.ReactionHasBeenRemovedRequest.FromString,
response_serializer=hooks__message__pb2.ReactionHasBeenRemovedResponse.SerializeToString,
),
'NotificationWillBePushed': grpc.unary_unary_rpc_method_handler(
servicer.NotificationWillBePushed,
request_deserializer=hooks__message__pb2.NotificationWillBePushedRequest.FromString,
response_serializer=hooks__message__pb2.NotificationWillBePushedResponse.SerializeToString,
),
'EmailNotificationWillBeSent': grpc.unary_unary_rpc_method_handler(
servicer.EmailNotificationWillBeSent,
request_deserializer=hooks__message__pb2.EmailNotificationWillBeSentRequest.FromString,
response_serializer=hooks__message__pb2.EmailNotificationWillBeSentResponse.SerializeToString,
),
'PreferencesHaveChanged': grpc.unary_unary_rpc_method_handler(
servicer.PreferencesHaveChanged,
request_deserializer=hooks__message__pb2.PreferencesHaveChangedRequest.FromString,
response_serializer=hooks__message__pb2.PreferencesHaveChangedResponse.SerializeToString,
),
'UserHasBeenCreated': grpc.unary_unary_rpc_method_handler(
servicer.UserHasBeenCreated,
request_deserializer=hooks__user__channel__pb2.UserHasBeenCreatedRequest.FromString,
response_serializer=hooks__user__channel__pb2.UserHasBeenCreatedResponse.SerializeToString,
),
'UserWillLogIn': grpc.unary_unary_rpc_method_handler(
servicer.UserWillLogIn,
request_deserializer=hooks__user__channel__pb2.UserWillLogInRequest.FromString,
response_serializer=hooks__user__channel__pb2.UserWillLogInResponse.SerializeToString,
),
'UserHasLoggedIn': grpc.unary_unary_rpc_method_handler(
servicer.UserHasLoggedIn,
request_deserializer=hooks__user__channel__pb2.UserHasLoggedInRequest.FromString,
response_serializer=hooks__user__channel__pb2.UserHasLoggedInResponse.SerializeToString,
),
'UserHasBeenDeactivated': grpc.unary_unary_rpc_method_handler(
servicer.UserHasBeenDeactivated,
request_deserializer=hooks__user__channel__pb2.UserHasBeenDeactivatedRequest.FromString,
response_serializer=hooks__user__channel__pb2.UserHasBeenDeactivatedResponse.SerializeToString,
),
'OnSAMLLogin': grpc.unary_unary_rpc_method_handler(
servicer.OnSAMLLogin,
request_deserializer=hooks__user__channel__pb2.OnSAMLLoginRequest.FromString,
response_serializer=hooks__user__channel__pb2.OnSAMLLoginResponse.SerializeToString,
),
'ChannelHasBeenCreated': grpc.unary_unary_rpc_method_handler(
servicer.ChannelHasBeenCreated,
request_deserializer=hooks__user__channel__pb2.ChannelHasBeenCreatedRequest.FromString,
response_serializer=hooks__user__channel__pb2.ChannelHasBeenCreatedResponse.SerializeToString,
),
'UserHasJoinedChannel': grpc.unary_unary_rpc_method_handler(
servicer.UserHasJoinedChannel,
request_deserializer=hooks__user__channel__pb2.UserHasJoinedChannelRequest.FromString,
response_serializer=hooks__user__channel__pb2.UserHasJoinedChannelResponse.SerializeToString,
),
'UserHasLeftChannel': grpc.unary_unary_rpc_method_handler(
servicer.UserHasLeftChannel,
request_deserializer=hooks__user__channel__pb2.UserHasLeftChannelRequest.FromString,
response_serializer=hooks__user__channel__pb2.UserHasLeftChannelResponse.SerializeToString,
),
'UserHasJoinedTeam': grpc.unary_unary_rpc_method_handler(
servicer.UserHasJoinedTeam,
request_deserializer=hooks__user__channel__pb2.UserHasJoinedTeamRequest.FromString,
response_serializer=hooks__user__channel__pb2.UserHasJoinedTeamResponse.SerializeToString,
),
'UserHasLeftTeam': grpc.unary_unary_rpc_method_handler(
servicer.UserHasLeftTeam,
request_deserializer=hooks__user__channel__pb2.UserHasLeftTeamRequest.FromString,
response_serializer=hooks__user__channel__pb2.UserHasLeftTeamResponse.SerializeToString,
),
'ExecuteCommand': grpc.unary_unary_rpc_method_handler(
servicer.ExecuteCommand,
request_deserializer=hooks__command__pb2.ExecuteCommandRequest.FromString,
response_serializer=hooks__command__pb2.ExecuteCommandResponse.SerializeToString,
),
'OnWebSocketConnect': grpc.unary_unary_rpc_method_handler(
servicer.OnWebSocketConnect,
request_deserializer=hooks__command__pb2.OnWebSocketConnectRequest.FromString,
response_serializer=hooks__command__pb2.OnWebSocketConnectResponse.SerializeToString,
),
'OnWebSocketDisconnect': grpc.unary_unary_rpc_method_handler(
servicer.OnWebSocketDisconnect,
request_deserializer=hooks__command__pb2.OnWebSocketDisconnectRequest.FromString,
response_serializer=hooks__command__pb2.OnWebSocketDisconnectResponse.SerializeToString,
),
'WebSocketMessageHasBeenPosted': grpc.unary_unary_rpc_method_handler(
servicer.WebSocketMessageHasBeenPosted,
request_deserializer=hooks__command__pb2.WebSocketMessageHasBeenPostedRequest.FromString,
response_serializer=hooks__command__pb2.WebSocketMessageHasBeenPostedResponse.SerializeToString,
),
'OnPluginClusterEvent': grpc.unary_unary_rpc_method_handler(
servicer.OnPluginClusterEvent,
request_deserializer=hooks__command__pb2.OnPluginClusterEventRequest.FromString,
response_serializer=hooks__command__pb2.OnPluginClusterEventResponse.SerializeToString,
),
'OnSharedChannelsSyncMsg': grpc.unary_unary_rpc_method_handler(
servicer.OnSharedChannelsSyncMsg,
request_deserializer=hooks__command__pb2.OnSharedChannelsSyncMsgRequest.FromString,
response_serializer=hooks__command__pb2.OnSharedChannelsSyncMsgResponse.SerializeToString,
),
'OnSharedChannelsPing': grpc.unary_unary_rpc_method_handler(
servicer.OnSharedChannelsPing,
request_deserializer=hooks__command__pb2.OnSharedChannelsPingRequest.FromString,
response_serializer=hooks__command__pb2.OnSharedChannelsPingResponse.SerializeToString,
),
'OnSharedChannelsAttachmentSyncMsg': grpc.unary_unary_rpc_method_handler(
servicer.OnSharedChannelsAttachmentSyncMsg,
request_deserializer=hooks__command__pb2.OnSharedChannelsAttachmentSyncMsgRequest.FromString,
response_serializer=hooks__command__pb2.OnSharedChannelsAttachmentSyncMsgResponse.SerializeToString,
),
'OnSharedChannelsProfileImageSyncMsg': grpc.unary_unary_rpc_method_handler(
servicer.OnSharedChannelsProfileImageSyncMsg,
request_deserializer=hooks__command__pb2.OnSharedChannelsProfileImageSyncMsgRequest.FromString,
response_serializer=hooks__command__pb2.OnSharedChannelsProfileImageSyncMsgResponse.SerializeToString,
),
'GenerateSupportData': grpc.unary_unary_rpc_method_handler(
servicer.GenerateSupportData,
request_deserializer=hooks__command__pb2.GenerateSupportDataRequest.FromString,
response_serializer=hooks__command__pb2.GenerateSupportDataResponse.SerializeToString,
),
'ServeHTTP': grpc.stream_stream_rpc_method_handler(
servicer.ServeHTTP,
request_deserializer=hooks__http__pb2.ServeHTTPRequest.FromString,
response_serializer=hooks__http__pb2.ServeHTTPResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'mattermost.pluginapi.v1.PluginHooks', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('mattermost.pluginapi.v1.PluginHooks', rpc_method_handlers)
# This class is part of an EXPERIMENTAL API.
class PluginHooks(object):
"""==============================================================================
PLUGIN HOOKS SERVICE
==============================================================================
This service defines the gRPC interface for invoking plugin hooks.
The Go server implements this service's client to call into Python plugins.
Python plugins implement this service's server to receive hook invocations.
Direction: Server -> Plugin (server calls plugin hooks)
ERROR HANDLING CONVENTION:
--------------------------
For hooks whose Go signature returns `error`:
- Errors are encoded in the response message's `error` field (AppError)
- gRPC status codes are reserved for transport-level failures only
For hooks whose Go signature returns nothing (void):
- Response message has no `error` field
- Hook failures are logged server-side but do not propagate
HOOK GROUPS:
------------
This file imports and exposes RPCs for different hook categories:
- hooks_lifecycle.proto: Lifecycle and system hooks (this plan: 03-01)
- hooks_message.proto: Message hooks (planned: 03-02)
- hooks_user_channel.proto: User and channel hooks (03-03)
- hooks_command.proto: Command, WebSocket, cluster, shared channels hooks (03-04)
==============================================================================
PluginHooks is the gRPC service for invoking plugin hooks.
The server acts as the gRPC client, calling into the plugin process.
The plugin acts as the gRPC server, implementing the hook handlers.
===========================================================================
LIFECYCLE HOOKS
===========================================================================
"""
@staticmethod
def Implemented(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/Implemented',
hooks__lifecycle__pb2.ImplementedRequest.SerializeToString,
hooks__lifecycle__pb2.ImplementedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def OnActivate(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/OnActivate',
hooks__lifecycle__pb2.OnActivateRequest.SerializeToString,
hooks__lifecycle__pb2.OnActivateResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def OnDeactivate(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/OnDeactivate',
hooks__lifecycle__pb2.OnDeactivateRequest.SerializeToString,
hooks__lifecycle__pb2.OnDeactivateResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def OnConfigurationChange(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/OnConfigurationChange',
hooks__lifecycle__pb2.OnConfigurationChangeRequest.SerializeToString,
hooks__lifecycle__pb2.OnConfigurationChangeResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def OnInstall(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/OnInstall',
hooks__lifecycle__pb2.OnInstallRequest.SerializeToString,
hooks__lifecycle__pb2.OnInstallResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def OnSendDailyTelemetry(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/OnSendDailyTelemetry',
hooks__lifecycle__pb2.OnSendDailyTelemetryRequest.SerializeToString,
hooks__lifecycle__pb2.OnSendDailyTelemetryResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def RunDataRetention(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/RunDataRetention',
hooks__lifecycle__pb2.RunDataRetentionRequest.SerializeToString,
hooks__lifecycle__pb2.RunDataRetentionResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def OnCloudLimitsUpdated(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/OnCloudLimitsUpdated',
hooks__lifecycle__pb2.OnCloudLimitsUpdatedRequest.SerializeToString,
hooks__lifecycle__pb2.OnCloudLimitsUpdatedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def ConfigurationWillBeSaved(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/ConfigurationWillBeSaved',
hooks__lifecycle__pb2.ConfigurationWillBeSavedRequest.SerializeToString,
hooks__lifecycle__pb2.ConfigurationWillBeSavedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def MessageWillBePosted(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/MessageWillBePosted',
hooks__message__pb2.MessageWillBePostedRequest.SerializeToString,
hooks__message__pb2.MessageWillBePostedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def MessageWillBeUpdated(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/MessageWillBeUpdated',
hooks__message__pb2.MessageWillBeUpdatedRequest.SerializeToString,
hooks__message__pb2.MessageWillBeUpdatedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def MessageHasBeenPosted(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/MessageHasBeenPosted',
hooks__message__pb2.MessageHasBeenPostedRequest.SerializeToString,
hooks__message__pb2.MessageHasBeenPostedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def MessageHasBeenUpdated(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/MessageHasBeenUpdated',
hooks__message__pb2.MessageHasBeenUpdatedRequest.SerializeToString,
hooks__message__pb2.MessageHasBeenUpdatedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def MessagesWillBeConsumed(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/MessagesWillBeConsumed',
hooks__message__pb2.MessagesWillBeConsumedRequest.SerializeToString,
hooks__message__pb2.MessagesWillBeConsumedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def MessageHasBeenDeleted(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/MessageHasBeenDeleted',
hooks__message__pb2.MessageHasBeenDeletedRequest.SerializeToString,
hooks__message__pb2.MessageHasBeenDeletedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def FileWillBeUploaded(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/FileWillBeUploaded',
hooks__message__pb2.FileWillBeUploadedRequest.SerializeToString,
hooks__message__pb2.FileWillBeUploadedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def ReactionHasBeenAdded(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/ReactionHasBeenAdded',
hooks__message__pb2.ReactionHasBeenAddedRequest.SerializeToString,
hooks__message__pb2.ReactionHasBeenAddedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def ReactionHasBeenRemoved(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/ReactionHasBeenRemoved',
hooks__message__pb2.ReactionHasBeenRemovedRequest.SerializeToString,
hooks__message__pb2.ReactionHasBeenRemovedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def NotificationWillBePushed(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/NotificationWillBePushed',
hooks__message__pb2.NotificationWillBePushedRequest.SerializeToString,
hooks__message__pb2.NotificationWillBePushedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def EmailNotificationWillBeSent(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/EmailNotificationWillBeSent',
hooks__message__pb2.EmailNotificationWillBeSentRequest.SerializeToString,
hooks__message__pb2.EmailNotificationWillBeSentResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def PreferencesHaveChanged(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/PreferencesHaveChanged',
hooks__message__pb2.PreferencesHaveChangedRequest.SerializeToString,
hooks__message__pb2.PreferencesHaveChangedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def UserHasBeenCreated(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/UserHasBeenCreated',
hooks__user__channel__pb2.UserHasBeenCreatedRequest.SerializeToString,
hooks__user__channel__pb2.UserHasBeenCreatedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def UserWillLogIn(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/UserWillLogIn',
hooks__user__channel__pb2.UserWillLogInRequest.SerializeToString,
hooks__user__channel__pb2.UserWillLogInResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def UserHasLoggedIn(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/UserHasLoggedIn',
hooks__user__channel__pb2.UserHasLoggedInRequest.SerializeToString,
hooks__user__channel__pb2.UserHasLoggedInResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def UserHasBeenDeactivated(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/UserHasBeenDeactivated',
hooks__user__channel__pb2.UserHasBeenDeactivatedRequest.SerializeToString,
hooks__user__channel__pb2.UserHasBeenDeactivatedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def OnSAMLLogin(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/OnSAMLLogin',
hooks__user__channel__pb2.OnSAMLLoginRequest.SerializeToString,
hooks__user__channel__pb2.OnSAMLLoginResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def ChannelHasBeenCreated(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/ChannelHasBeenCreated',
hooks__user__channel__pb2.ChannelHasBeenCreatedRequest.SerializeToString,
hooks__user__channel__pb2.ChannelHasBeenCreatedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def UserHasJoinedChannel(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/UserHasJoinedChannel',
hooks__user__channel__pb2.UserHasJoinedChannelRequest.SerializeToString,
hooks__user__channel__pb2.UserHasJoinedChannelResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def UserHasLeftChannel(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/UserHasLeftChannel',
hooks__user__channel__pb2.UserHasLeftChannelRequest.SerializeToString,
hooks__user__channel__pb2.UserHasLeftChannelResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def UserHasJoinedTeam(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/UserHasJoinedTeam',
hooks__user__channel__pb2.UserHasJoinedTeamRequest.SerializeToString,
hooks__user__channel__pb2.UserHasJoinedTeamResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def UserHasLeftTeam(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/UserHasLeftTeam',
hooks__user__channel__pb2.UserHasLeftTeamRequest.SerializeToString,
hooks__user__channel__pb2.UserHasLeftTeamResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def ExecuteCommand(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/ExecuteCommand',
hooks__command__pb2.ExecuteCommandRequest.SerializeToString,
hooks__command__pb2.ExecuteCommandResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def OnWebSocketConnect(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/OnWebSocketConnect',
hooks__command__pb2.OnWebSocketConnectRequest.SerializeToString,
hooks__command__pb2.OnWebSocketConnectResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def OnWebSocketDisconnect(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/OnWebSocketDisconnect',
hooks__command__pb2.OnWebSocketDisconnectRequest.SerializeToString,
hooks__command__pb2.OnWebSocketDisconnectResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def WebSocketMessageHasBeenPosted(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/WebSocketMessageHasBeenPosted',
hooks__command__pb2.WebSocketMessageHasBeenPostedRequest.SerializeToString,
hooks__command__pb2.WebSocketMessageHasBeenPostedResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def OnPluginClusterEvent(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/OnPluginClusterEvent',
hooks__command__pb2.OnPluginClusterEventRequest.SerializeToString,
hooks__command__pb2.OnPluginClusterEventResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def OnSharedChannelsSyncMsg(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/OnSharedChannelsSyncMsg',
hooks__command__pb2.OnSharedChannelsSyncMsgRequest.SerializeToString,
hooks__command__pb2.OnSharedChannelsSyncMsgResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def OnSharedChannelsPing(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/OnSharedChannelsPing',
hooks__command__pb2.OnSharedChannelsPingRequest.SerializeToString,
hooks__command__pb2.OnSharedChannelsPingResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def OnSharedChannelsAttachmentSyncMsg(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/OnSharedChannelsAttachmentSyncMsg',
hooks__command__pb2.OnSharedChannelsAttachmentSyncMsgRequest.SerializeToString,
hooks__command__pb2.OnSharedChannelsAttachmentSyncMsgResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def OnSharedChannelsProfileImageSyncMsg(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/OnSharedChannelsProfileImageSyncMsg',
hooks__command__pb2.OnSharedChannelsProfileImageSyncMsgRequest.SerializeToString,
hooks__command__pb2.OnSharedChannelsProfileImageSyncMsgResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def GenerateSupportData(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/mattermost.pluginapi.v1.PluginHooks/GenerateSupportData',
hooks__command__pb2.GenerateSupportDataRequest.SerializeToString,
hooks__command__pb2.GenerateSupportDataResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def ServeHTTP(request_iterator,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.stream_stream(
request_iterator,
target,
'/mattermost.pluginapi.v1.PluginHooks/ServeHTTP',
hooks__http__pb2.ServeHTTPRequest.SerializeToString,
hooks__http__pb2.ServeHTTPResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)