//
// Copyright 2018 - present the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";

option go_package = "github.com/opencord/voltha-protos/v5/go/omci";
option java_package = "org.opencord.voltha.omci";

package omci;


message AlarmAttributeData {
    string name        = 1;
    string value       = 2;
}

message AlarmInstanceData {
    uint32 instance_id      = 1;
    string created          = 2;
    string modified         = 3;

    repeated AlarmAttributeData attributes = 4;
}

message AlarmClassData {
    uint32 class_id         = 1;

    repeated AlarmInstanceData instances= 2;
}

message AlarmManagedEntity {
    uint32 class_id  = 1;
    string name      = 2;
}

message AlarmMessageType {
    uint32 message_type = 1;
}

message AlarmDeviceData {
    string device_id             = 1;
    string created               = 2;
    uint32 last_alarm_sequence   = 3;
    string last_sync_time        = 4;
    uint32 version               = 5;


    repeated AlarmClassData classes = 6;

    repeated AlarmManagedEntity managed_entities = 7;
    repeated AlarmMessageType message_types = 8;
}

message AlarmOpenOmciEventType {
    enum OpenOmciEventType {
        state_change = 0; // A state machine has transitioned to a new state
    }
}

message AlarmOpenOmciEvent {
    AlarmOpenOmciEventType.OpenOmciEventType type = 1;

    string data = 2; // associated data, in json format
}
