com.hp.jipp.model.DestinationStatuses.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 "destination-statuses" collection as defined in:
* [PWG5100.15](https://ftp.pwg.org/pub/pwg/candidates/cs-ippfaxout10-20131115-5100.15.pdf).
*/
@Suppress("RedundantCompanionReference", "unused")
data class DestinationStatuses
constructor(
var destinationUri: java.net.URI? = null,
var imagesCompleted: Int? = null,
var transmissionStatus: TransmissionStatus? = null
) : AttributeCollection {
/** Construct an empty [DestinationStatuses]. */
constructor() : this(null, null, null)
/** Produce an attribute list from members. */
override val attributes: List> by lazy {
listOfNotNull(
destinationUri?.let { Types.destinationUri.of(it) },
imagesCompleted?.let { Types.imagesCompleted.of(it) },
transmissionStatus?.let { Types.transmissionStatus.of(it) }
)
}
/** Type for attributes of this collection */
class Type(override val name: String) : AttributeCollection.Type(DestinationStatuses)
/** All member names as strings. */
object Name {
/** "destination-uri" member name */
const val destinationUri = "destination-uri"
/** "images-completed" member name */
const val imagesCompleted = "images-completed"
/** "transmission-status" member name */
const val transmissionStatus = "transmission-status"
}
/** Types for each member attribute. */
object Types {
val destinationUri = UriType(Name.destinationUri)
val imagesCompleted = IntType(Name.imagesCompleted)
/**
* "transmission-status" member type.
*/
val transmissionStatus = TransmissionStatus.Type(Name.transmissionStatus)
}
/** Defines types for each member of [DestinationStatuses] */
companion object : AttributeCollection.Converter {
override fun convert(attributes: List>): DestinationStatuses =
DestinationStatuses(
extractOne(attributes, Types.destinationUri),
extractOne(attributes, Types.imagesCompleted),
extractOne(attributes, Types.transmissionStatus)
)
}
}