# Do NOT edit this file!
# It was generated by IdlC class idl.json.python.ProxyAsnVisitor.

#
# Section generated from "/home/nb/builds/MEGA/px2-3.0.0-3.0.9-branch-20140613-none-release-none-pdu-raritan/fwcomponents/mkdist/tmp/px2_final/libisys/src/idl/BulkConfiguration.idl"
#

import raritan.rpc
from raritan.rpc import (
    Interface,
    Structure,
    ValueObject,
    Enumeration,
    typecheck,
    DecodeException,
)
import raritan.rpc.bulkcfg


# interface
class BulkConfiguration(Interface):
    idlType = "bulkcfg.BulkConfiguration:1.0.0"

    # enumeration
    class Status(Enumeration):
        idlType = "bulkcfg.BulkConfiguration.Status:1.0.0"
        values = [
            "UNKNOWN",
            "UPLOAD_FAILED",
            "RESTORE_PENDING",
            "RESTORE_OK",
            "RESTORE_FAILED",
        ]

    Status.UNKNOWN = Status(0)
    Status.UPLOAD_FAILED = Status(1)
    Status.RESTORE_PENDING = Status(2)
    Status.RESTORE_OK = Status(3)
    Status.RESTORE_FAILED = Status(4)

    def getStatus(self):
        agent = self.agent
        args = {}
        rsp = agent.json_rpc(self.target, "getStatus", args)
        status = raritan.rpc.bulkcfg.BulkConfiguration.Status.decode(rsp["status"])
        timeStamp = raritan.rpc.Time.decode(rsp["timeStamp"])
        typecheck.is_enum(
            status, raritan.rpc.bulkcfg.BulkConfiguration.Status, DecodeException
        )
        typecheck.is_time(timeStamp, DecodeException)
        return (status, timeStamp)
