@@ -27,6 +27,7 @@ private constructor(
2727 private val currency: JsonField <String >,
2828 private val customExpiration: JsonField <CustomExpiration >,
2929 private val filters: JsonField <List <Filter >>,
30+ private val licenseTypeId: JsonField <String >,
3031 private val additionalProperties: MutableMap <String , JsonValue >,
3132) {
3233
@@ -39,8 +40,13 @@ private constructor(
3940 @JsonProperty(" custom_expiration" )
4041 @ExcludeMissing
4142 customExpiration: JsonField <CustomExpiration > = JsonMissing .of(),
42- @JsonProperty(" filters" ) @ExcludeMissing filters: JsonField <List <Filter >> = JsonMissing .of(),
43- ) : this (allowsRollover, currency, customExpiration, filters, mutableMapOf ())
43+ @JsonProperty(" filters" )
44+ @ExcludeMissing
45+ filters: JsonField <List <Filter >> = JsonMissing .of(),
46+ @JsonProperty(" license_type_id" )
47+ @ExcludeMissing
48+ licenseTypeId: JsonField <String > = JsonMissing .of(),
49+ ) : this (allowsRollover, currency, customExpiration, filters, licenseTypeId, mutableMapOf ())
4450
4551 /* *
4652 * @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly
@@ -67,6 +73,12 @@ private constructor(
6773 */
6874 fun filters (): Optional <List <Filter >> = filters.getOptional(" filters" )
6975
76+ /* *
77+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
78+ * responded with an unexpected value).
79+ */
80+ fun licenseTypeId (): Optional <String > = licenseTypeId.getOptional(" license_type_id" )
81+
7082 /* *
7183 * Returns the raw JSON value of [allowsRollover].
7284 *
@@ -100,6 +112,15 @@ private constructor(
100112 */
101113 @JsonProperty(" filters" ) @ExcludeMissing fun _filters (): JsonField <List <Filter >> = filters
102114
115+ /* *
116+ * Returns the raw JSON value of [licenseTypeId].
117+ *
118+ * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type.
119+ */
120+ @JsonProperty(" license_type_id" )
121+ @ExcludeMissing
122+ fun _licenseTypeId (): JsonField <String > = licenseTypeId
123+
103124 @JsonAnySetter
104125 private fun putAdditionalProperty (key : String , value : JsonValue ) {
105126 additionalProperties.put(key, value)
@@ -134,6 +155,7 @@ private constructor(
134155 private var currency: JsonField <String >? = null
135156 private var customExpiration: JsonField <CustomExpiration >? = null
136157 private var filters: JsonField <MutableList <Filter >>? = null
158+ private var licenseTypeId: JsonField <String > = JsonMissing .of()
137159 private var additionalProperties: MutableMap <String , JsonValue > = mutableMapOf ()
138160
139161 @JvmSynthetic
@@ -142,6 +164,7 @@ private constructor(
142164 currency = allocation.currency
143165 customExpiration = allocation.customExpiration
144166 filters = allocation.filters.map { it.toMutableList() }
167+ licenseTypeId = allocation.licenseTypeId
145168 additionalProperties = allocation.additionalProperties.toMutableMap()
146169 }
147170
@@ -211,6 +234,24 @@ private constructor(
211234 }
212235 }
213236
237+ fun licenseTypeId (licenseTypeId : String? ) =
238+ licenseTypeId(JsonField .ofNullable(licenseTypeId))
239+
240+ /* * Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */
241+ fun licenseTypeId (licenseTypeId : Optional <String >) =
242+ licenseTypeId(licenseTypeId.getOrNull())
243+
244+ /* *
245+ * Sets [Builder.licenseTypeId] to an arbitrary JSON value.
246+ *
247+ * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead.
248+ * This method is primarily for setting the field to an undocumented or not yet supported
249+ * value.
250+ */
251+ fun licenseTypeId (licenseTypeId : JsonField <String >) = apply {
252+ this .licenseTypeId = licenseTypeId
253+ }
254+
214255 fun additionalProperties (additionalProperties : Map <String , JsonValue >) = apply {
215256 this .additionalProperties.clear()
216257 putAllAdditionalProperties(additionalProperties)
@@ -250,6 +291,7 @@ private constructor(
250291 checkRequired(" currency" , currency),
251292 checkRequired(" customExpiration" , customExpiration),
252293 (filters ? : JsonMissing .of()).map { it.toImmutable() },
294+ licenseTypeId,
253295 additionalProperties.toMutableMap(),
254296 )
255297 }
@@ -265,6 +307,7 @@ private constructor(
265307 currency()
266308 customExpiration().ifPresent { it.validate() }
267309 filters().ifPresent { it.forEach { it.validate() } }
310+ licenseTypeId()
268311 validated = true
269312 }
270313
@@ -286,7 +329,8 @@ private constructor(
286329 (if (allowsRollover.asKnown().isPresent) 1 else 0 ) +
287330 (if (currency.asKnown().isPresent) 1 else 0 ) +
288331 (customExpiration.asKnown().getOrNull()?.validity() ? : 0 ) +
289- (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ? : 0 )
332+ (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ? : 0 ) +
333+ (if (licenseTypeId.asKnown().isPresent) 1 else 0 )
290334
291335 class Filter
292336 @JsonCreator(mode = JsonCreator .Mode .DISABLED )
@@ -828,15 +872,23 @@ private constructor(
828872 currency == other.currency &&
829873 customExpiration == other.customExpiration &&
830874 filters == other.filters &&
875+ licenseTypeId == other.licenseTypeId &&
831876 additionalProperties == other.additionalProperties
832877 }
833878
834879 private val hashCode: Int by lazy {
835- Objects .hash(allowsRollover, currency, customExpiration, filters, additionalProperties)
880+ Objects .hash(
881+ allowsRollover,
882+ currency,
883+ customExpiration,
884+ filters,
885+ licenseTypeId,
886+ additionalProperties,
887+ )
836888 }
837889
838890 override fun hashCode (): Int = hashCode
839891
840892 override fun toString () =
841- " Allocation{allowsRollover=$allowsRollover , currency=$currency , customExpiration=$customExpiration , filters=$filters , additionalProperties=$additionalProperties }"
893+ " Allocation{allowsRollover=$allowsRollover , currency=$currency , customExpiration=$customExpiration , filters=$filters , licenseTypeId= $licenseTypeId , additionalProperties=$additionalProperties }"
842894}
0 commit comments