com.hp.jipp.model.JobPagesCol.kt Maven / Gradle / Ivy
// 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 2019-05-28
@file:Suppress("MaxLineLength", "WildcardImport")
package com.hp.jipp.model
import com.hp.jipp.encoding.* // ktlint-disable no-wildcard-imports
/**
* Data object corresponding to a "job-pages-col" collection as defined in:
* [APRIL2015F2F](https://ftp.pwg.org/pub/pwg/ipp/minutes/ippv2-f2f-minutes-20150429.pdf).
*/
@Suppress("RedundantCompanionReference", "unused")
data class JobPagesCol
constructor(
var fullColor: Int? = null,
var monochrome: Int? = null
) : AttributeCollection {
/** Construct an empty [JobPagesCol]. */
constructor() : this(null, null)
/** Produce an attribute list from members. */
override val attributes: List> by lazy {
listOfNotNull(
fullColor?.let { Types.fullColor.of(it) },
monochrome?.let { Types.monochrome.of(it) }
)
}
/** Type for attributes of this collection */
class Type(override val name: String) : AttributeCollection.Type(JobPagesCol)
/** All member names as strings. */
object Name {
/** "full-color" member name */
const val fullColor = "full-color"
/** "monochrome" member name */
const val monochrome = "monochrome"
}
/** Types for each member attribute. */
object Types {
val fullColor = IntType(Name.fullColor)
val monochrome = IntType(Name.monochrome)
}
/** Defines types for each member of [JobPagesCol] */
companion object : AttributeCollection.Converter {
override fun convert(attributes: List>): JobPagesCol =
JobPagesCol(
extractOne(attributes, Types.fullColor),
extractOne(attributes, Types.monochrome)
)
}
}