All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hp.jipp.model.PowerStateMonitorCol.kt Maven / Gradle / Ivy

There is a newer version: 0.7.16
Show newest version
// Copyright 2018 HP Development Company, L.P.
// SPDX-License-Identifier: MIT
//
// DO NOT MODIFY. Code is auto-generated by genTypes.py. Content taken from registry at
// https://www.iana.org/assignments/ipp-registrations/ipp-registrations.xml, updated on 2021-05-04
@file:Suppress("MaxLineLength", "WildcardImport")

package com.hp.jipp.model

import com.hp.jipp.encoding.* // ktlint-disable no-wildcard-imports

/**
 * Data object corresponding to a "power-state-monitor-col" collection as defined in:
 * [PWG5100.22](https://ftp.pwg.org/pub/pwg/candidates/cs-ippsystem10-20191122-5100.22.pdf).
 */
@Suppress("RedundantCompanionReference", "unused")
data class PowerStateMonitorCol
constructor(
    var currentMonthKwh: Int? = null,
    var currentWatts: Int? = null,
    var lifetimeKwh: Int? = null,
    var metersAreActual: Boolean? = null,
    var powerState: String? = null,
    var powerStateMessage: String? = null,
    var powerUsageIsRmsWatts: Boolean? = null,
) : AttributeCollection {

    /** Construct an empty [PowerStateMonitorCol]. */
    constructor() : this(null)

    /** Produce an attribute list from members. */
    override val attributes: List>
        get() = listOfNotNull(
            currentMonthKwh?.let { PowerStateMonitorCol.currentMonthKwh.of(it) },
            currentWatts?.let { PowerStateMonitorCol.currentWatts.of(it) },
            lifetimeKwh?.let { PowerStateMonitorCol.lifetimeKwh.of(it) },
            metersAreActual?.let { PowerStateMonitorCol.metersAreActual.of(it) },
            powerState?.let { PowerStateMonitorCol.powerState.of(it) },
            powerStateMessage?.let { PowerStateMonitorCol.powerStateMessage.of(it) },
            powerUsageIsRmsWatts?.let { PowerStateMonitorCol.powerUsageIsRmsWatts.of(it) },
        )

    /** Defines types for each member of [PowerStateMonitorCol]. */
    companion object : AttributeCollection.Converter {
        override fun convert(attributes: List>): PowerStateMonitorCol =
            PowerStateMonitorCol(
                extractOne(attributes, currentMonthKwh),
                extractOne(attributes, currentWatts),
                extractOne(attributes, lifetimeKwh),
                extractOne(attributes, metersAreActual),
                extractOne(attributes, powerState),
                extractOne(attributes, powerStateMessage)?.value,
                extractOne(attributes, powerUsageIsRmsWatts),
            )
        override val cls = PowerStateMonitorCol::class.java
        @Deprecated("Remove this symbol")
        @JvmField val Types = this
        @JvmField val currentMonthKwh = IntType("current-month-kwh")
        @JvmField val currentWatts = IntType("current-watts")
        @JvmField val lifetimeKwh = IntType("lifetime-kwh")
        @JvmField val metersAreActual = BooleanType("meters-are-actual")
        @JvmField val powerState = KeywordType("power-state")
        @JvmField val powerStateMessage = TextType("power-state-message")
        @JvmField val powerUsageIsRmsWatts = BooleanType("power-usage-is-rms-watts")
    }
    override fun toString() = "PowerStateMonitorCol(${attributes.joinToString()})"
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy