toProto method

Message toProto()

Implementation

presets_pb.Message toProto() {
  return switch (this) {
    PresetsMessageInitialise() =>
      presets_pb.Message(initialise: presets_pb.Initialise()),
    PresetsMessageNotify(:final id, :final preset) => presets_pb.Message(
        notify: presets_pb.Notify(
          preset: presets_pb.PresetRecord(
            id: id,
            preset: preset.toProto(),
          ),
        ),
      ),
    PresetsMessageCreate(:final preset) => presets_pb.Message(
        create_3: presets_pb.Create(
          preset: preset.toProto(),
        ),
      ),
    PresetsMessageUpdate(:final id, :final preset) => presets_pb.Message(
        update: presets_pb.Update(
          preset: presets_pb.PresetRecord(
            id: id,
            preset: preset.toProto(),
          ),
        ),
      ),
    PresetsMessageDelete(:final id) =>
      presets_pb.Message(remove: presets_pb.Remove(id: id)),
  };
}