From 9490bc8b93e568c210d041210d527b193219a502 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 28 May 2026 12:51:46 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 6 +- .../kotlin/com/hubspot/sdk/models/Property.kt | 232 ++- .../com/hubspot/sdk/models/PropertyCreate.kt | 220 ++- .../sdk/models/SubscriptionUpsertRequest.kt | 144 +- .../activity/HydratedCriticalAction.kt | 6 + .../auth/oauth/TokenInfoResponseBaseIf.kt | 132 +- .../sdk/models/auth/oauth/TokenResponseIf.kt | 121 +- .../actions/CallbackCompletionBatchRequest.kt | 128 +- .../actions/CallbackCompletionRequest.kt | 128 +- .../automation/actions/FieldTypeDefinition.kt | 345 ++--- .../actions/PublicActionDefinition.kt | 143 +- .../actions/PublicActionDefinitionEgg.kt | 143 +- .../actions/PublicActionDefinitionPatch.kt | 143 +- .../cms/AttachToLangPrimaryRequestVNext.kt | 576 ++++++++ .../models/cms/blogs/authors/BlogAuthor.kt | 288 ++++ .../sdk/models/cms/blogs/posts/BlogPost.kt | 288 ++++ .../sdk/models/cms/blogs/settings/Blog.kt | 288 ++++ .../hubspot/sdk/models/cms/blogs/tags/Tag.kt | 288 ++++ ...ionResponseWithTotalBaseHubDbTableRowV3.kt | 194 +-- .../mediabridge/MediaBridgePropertyUpdate.kt | 218 ++- .../sdk/models/cms/mediabridge/Property1.kt | 218 ++- .../hubspot/sdk/models/cms/pages/PagesPage.kt | 288 ++++ .../ChannelIntegrationMessageEgg.kt | 199 ++- .../customchannels/PreResolvedContact.kt | 10 + .../PublicConversationsMessage.kt | 477 +++--- .../models/crm/exports/PublicExportRequest.kt | 36 +- .../CompletedThirdPartyCallResponse.kt | 147 +- .../cardsdev/IntegratorObjectResult.kt | 110 +- .../extensions/cardsdev/TopLevelActions.kt | 243 ++- .../ListUpdateScheduleConversionParams.kt | 6 +- .../models/crm/lists/PublicAdsTimeFilter.kt | 582 ++++---- .../models/crm/lists/PublicAndFilterBranch.kt | 87 +- .../lists/PublicAssociationFilterBranch.kt | 87 +- .../lists/PublicAssociationInListFilter.kt | 592 ++++---- .../crm/lists/PublicCtaAnalyticsFilter.kt | 1173 +++++++-------- .../crm/lists/PublicEmailEventFilter.kt | 582 ++++---- .../crm/lists/PublicEventAnalyticsFilter.kt | 1173 +++++++-------- .../crm/lists/PublicEventFilterMetadata.kt | 1076 ++++++-------- .../crm/lists/PublicFormSubmissionFilter.kt | 1173 +++++++-------- .../lists/PublicFormSubmissionOnPageFilter.kt | 1173 +++++++-------- .../crm/lists/PublicIndexedTimePoint.kt | 426 +++--- .../crm/lists/PublicListConversionResponse.kt | 157 +- .../crm/lists/PublicListConversionTime.kt | 72 +- .../crm/lists/PublicNotAllFilterBranch.kt | 87 +- .../crm/lists/PublicNotAnyFilterBranch.kt | 87 +- .../models/crm/lists/PublicOrFilterBranch.kt | 87 +- .../lists/PublicPageViewAnalyticsFilter.kt | 1173 +++++++-------- .../crm/lists/PublicRangedTimeOperation.kt | 363 ++--- .../crm/lists/PublicRestrictedFilterBranch.kt | 87 +- .../lists/PublicSurveyMonkeyValueFilter.kt | 1313 ++++++----------- .../crm/lists/PublicTimePointOperation.kt | 168 +-- .../crm/lists/PublicUnifiedEventsFilter.kt | 1173 +++++++-------- .../lists/PublicUnifiedEventsFilterBranch.kt | 1260 +++++++--------- .../models/crm/properties/PropertyUpdate.kt | 218 ++- .../definitions/AllPropertyTypesOperation.kt | 120 +- .../events/definitions/IndexedTimePoint.kt | 121 +- .../MultiStringPropertyOperation.kt | 120 +- .../events/definitions/PropertyFilter.kt | 1125 +++++++------- .../events/definitions/RangedTimeOperation.kt | 193 ++- .../events/definitions/TimePointOperation.kt | 95 +- .../marketing/emails/EmailCreateRequest.kt | 288 ++++ .../marketing/emails/EmailUpdateRequest.kt | 288 ++++ .../models/marketing/emails/PublicEmail.kt | 288 ++++ .../WebhookCreateJournalSubscriptionParams.kt | 12 +- .../subscriptions/SubscriptionCreateParams.kt | 12 +- .../sdk/services/async/WebhookServiceAsync.kt | 26 +- .../SubscriptionServiceAsync.kt | 27 +- .../sdk/services/blocking/WebhookService.kt | 27 +- .../webhooksjournal/SubscriptionService.kt | 28 +- .../models/BatchInputPropertyCreateTest.kt | 3 + .../hubspot/sdk/models/PropertyCreateTest.kt | 4 + .../com/hubspot/sdk/models/PropertyTest.kt | 3 + .../models/SubscriptionUpsertRequestTest.kt | 24 +- .../auth/oauth/TokenInfoResponseBaseIfTest.kt | 32 +- .../models/auth/oauth/TokenResponseIfTest.kt | 30 +- .../actions/FieldTypeDefinitionTest.kt | 2 +- .../actions/PublicActionDefinitionEggTest.kt | 2 +- .../PublicActionDefinitionPatchTest.kt | 2 +- .../actions/PublicActionDefinitionTest.kt | 2 +- ...esponseWithTotalBaseHubDbTableRowV3Test.kt | 99 +- ...lectionResponseObjectSchemaNoPagingTest.kt | 3 + .../CollectionResponsePropertyNoPagingTest.kt | 3 + .../MediaBridgeCreatePropertyParamsTest.kt | 3 + .../MediaBridgePropertyUpdateTest.kt | 4 + .../MediaBridgeUpdatePropertyParamsTest.kt | 3 + .../cms/mediabridge/ObjectSchemaTest.kt | 3 + .../models/cms/mediabridge/Property1Test.kt | 3 + .../batch/BatchCreateParamsTest.kt | 3 + .../PublicConversationsMessageTest.kt | 2 +- .../messages/MessageCreateParamsTest.kt | 21 +- .../CompletedThirdPartyCallResponseTest.kt | 2 +- .../cardsdev/IntegratorObjectResultTest.kt | 2 +- .../cardsdev/TopLevelActionsTest.kt | 4 +- .../ListUpdateScheduleConversionParamsTest.kt | 2 +- .../crm/lists/PublicAdsTimeFilterTest.kt | 2 +- .../PublicAssociationInListFilterTest.kt | 2 +- .../crm/lists/PublicCtaAnalyticsFilterTest.kt | 4 +- .../crm/lists/PublicEmailEventFilterTest.kt | 2 +- .../lists/PublicEventAnalyticsFilterTest.kt | 4 +- .../lists/PublicEventFilterMetadataTest.kt | 2 +- .../lists/PublicFormSubmissionFilterTest.kt | 4 +- .../PublicFormSubmissionOnPageFilterTest.kt | 4 +- .../crm/lists/PublicIndexedTimePointTest.kt | 2 +- .../lists/PublicListConversionResponseTest.kt | 2 +- .../crm/lists/PublicListConversionTimeTest.kt | 14 +- .../PublicPageViewAnalyticsFilterTest.kt | 4 +- .../lists/PublicRangedTimeOperationTest.kt | 4 +- .../PublicSurveyMonkeyValueFilterTest.kt | 2 +- .../crm/lists/PublicTimePointOperationTest.kt | 2 +- .../PublicUnifiedEventsFilterBranchTest.kt | 4 +- .../lists/PublicUnifiedEventsFilterTest.kt | 4 +- ...lectionResponseObjectSchemaNoPagingTest.kt | 3 + .../crm/objectschemas/ObjectSchemaTest.kt | 3 + .../properties/BatchResponsePropertyTest.kt | 3 + .../BatchResponsePropertyWithErrorsTest.kt | 3 + .../CollectionResponsePropertyNoPagingTest.kt | 3 + .../properties/PropertyCreateParamsTest.kt | 3 + .../properties/PropertyUpdateParamsTest.kt | 3 + .../crm/properties/PropertyUpdateTest.kt | 4 + .../properties/batch/BatchCreateParamsTest.kt | 3 + ...ternalBehavioralEventTypeDefinitionTest.kt | 3 + ...ternalBehavioralEventTypeDefinitionTest.kt | 3 + .../events/definitions/PropertyFilterTest.kt | 2 +- ...hookCreateJournalSubscriptionParamsTest.kt | 2 +- .../SubscriptionCreateParamsTest.kt | 2 +- .../async/cms/MediaBridgeServiceAsyncTest.kt | 2 + .../cms/mediabridge/BatchServiceAsyncTest.kt | 1 + .../async/crm/PropertyServiceAsyncTest.kt | 2 + .../crm/properties/BatchServiceAsyncTest.kt | 1 + .../blocking/cms/MediaBridgeServiceTest.kt | 2 + .../cms/mediabridge/BatchServiceTest.kt | 1 + .../blocking/crm/PropertyServiceTest.kt | 2 + .../crm/properties/BatchServiceTest.kt | 1 + .../sdk/proguard/ProGuardCompatibilityTest.kt | 2 +- 134 files changed, 12620 insertions(+), 10661 deletions(-) diff --git a/.stats.yml b/.stats.yml index 65bc8df1..b3afad4e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 959 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hubspot/hubspot-sdk-3260c0cfb88ce2653c37c4c97e1dd39b965df4f2c14177677bc46d95b104525d.yml -openapi_spec_hash: 93b8671a542b331e067319184c943fdd -config_hash: 0bcc56e67986936da66e382674e17c79 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hubspot/hubspot-sdk-5488ead22cc650288f5a0fb6a37104332901d820ab6106ec38f2526e75f30b77.yml +openapi_spec_hash: 02e722f05e34ead6d3a47c66162f9875 +config_hash: 0d211891335b71bbcacf213fab8a70fe diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/Property.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/Property.kt index fc315b82..e8773feb 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/Property.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/Property.kt @@ -52,6 +52,7 @@ private constructor( private val referencedObjectType: JsonField, private val sensitiveDataCategories: JsonField>, private val showCurrencySymbol: JsonField, + private val textDisplayHint: JsonField, private val updatedAt: JsonField, private val updatedUserId: JsonField, private val additionalProperties: MutableMap, @@ -124,6 +125,9 @@ private constructor( @JsonProperty("showCurrencySymbol") @ExcludeMissing showCurrencySymbol: JsonField = JsonMissing.of(), + @JsonProperty("textDisplayHint") + @ExcludeMissing + textDisplayHint: JsonField = JsonMissing.of(), @JsonProperty("updatedAt") @ExcludeMissing updatedAt: JsonField = JsonMissing.of(), @@ -158,6 +162,7 @@ private constructor( referencedObjectType, sensitiveDataCategories, showCurrencySymbol, + textDisplayHint, updatedAt, updatedUserId, mutableMapOf(), @@ -397,6 +402,17 @@ private constructor( fun showCurrencySymbol(): Optional = showCurrencySymbol.getOptional("showCurrencySymbol") + /** + * Hint for how the text is displayed and validated in HubSpot's UI. Can be: + * "unformatted_single_line", "multi_line", "email", "phone_number", "domain_name", + * "ip_address", "physical_address", or "postal_code". + * + * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun textDisplayHint(): Optional = + textDisplayHint.getOptional("textDisplayHint") + /** * When the object type was last updated. * @@ -640,6 +656,15 @@ private constructor( @ExcludeMissing fun _showCurrencySymbol(): JsonField = showCurrencySymbol + /** + * Returns the raw JSON value of [textDisplayHint]. + * + * Unlike [textDisplayHint], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("textDisplayHint") + @ExcludeMissing + fun _textDisplayHint(): JsonField = textDisplayHint + /** * Returns the raw JSON value of [updatedAt]. * @@ -719,6 +744,7 @@ private constructor( private var referencedObjectType: JsonField = JsonMissing.of() private var sensitiveDataCategories: JsonField>? = null private var showCurrencySymbol: JsonField = JsonMissing.of() + private var textDisplayHint: JsonField = JsonMissing.of() private var updatedAt: JsonField = JsonMissing.of() private var updatedUserId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -752,6 +778,7 @@ private constructor( referencedObjectType = property.referencedObjectType sensitiveDataCategories = property.sensitiveDataCategories.map { it.toMutableList() } showCurrencySymbol = property.showCurrencySymbol + textDisplayHint = property.textDisplayHint updatedAt = property.updatedAt updatedUserId = property.updatedUserId additionalProperties = property.additionalProperties.toMutableMap() @@ -1172,6 +1199,25 @@ private constructor( this.showCurrencySymbol = showCurrencySymbol } + /** + * Hint for how the text is displayed and validated in HubSpot's UI. Can be: + * "unformatted_single_line", "multi_line", "email", "phone_number", "domain_name", + * "ip_address", "physical_address", or "postal_code". + */ + fun textDisplayHint(textDisplayHint: TextDisplayHint) = + textDisplayHint(JsonField.of(textDisplayHint)) + + /** + * Sets [Builder.textDisplayHint] to an arbitrary JSON value. + * + * You should usually call [Builder.textDisplayHint] with a well-typed [TextDisplayHint] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun textDisplayHint(textDisplayHint: JsonField) = apply { + this.textDisplayHint = textDisplayHint + } + /** When the object type was last updated. */ fun updatedAt(updatedAt: OffsetDateTime) = updatedAt(JsonField.of(updatedAt)) @@ -1267,6 +1313,7 @@ private constructor( referencedObjectType, (sensitiveDataCategories ?: JsonMissing.of()).map { it.toImmutable() }, showCurrencySymbol, + textDisplayHint, updatedAt, updatedUserId, additionalProperties.toMutableMap(), @@ -1315,6 +1362,7 @@ private constructor( referencedObjectType() sensitiveDataCategories() showCurrencySymbol() + textDisplayHint().ifPresent { it.validate() } updatedAt() updatedUserId() validated = true @@ -1362,6 +1410,7 @@ private constructor( (if (referencedObjectType.asKnown().isPresent) 1 else 0) + (sensitiveDataCategories.asKnown().getOrNull()?.size ?: 0) + (if (showCurrencySymbol.asKnown().isPresent) 1 else 0) + + (textDisplayHint.asKnown().getOrNull()?.validity() ?: 0) + (if (updatedAt.asKnown().isPresent) 1 else 0) + (if (updatedUserId.asKnown().isPresent) 1 else 0) @@ -1833,6 +1882,185 @@ private constructor( override fun toString() = value.toString() } + /** + * Hint for how the text is displayed and validated in HubSpot's UI. Can be: + * "unformatted_single_line", "multi_line", "email", "phone_number", "domain_name", + * "ip_address", "physical_address", or "postal_code". + */ + class TextDisplayHint @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val DOMAIN_NAME = of("domain_name") + + @JvmField val EMAIL = of("email") + + @JvmField val IP_ADDRESS = of("ip_address") + + @JvmField val MULTI_LINE = of("multi_line") + + @JvmField val PHONE_NUMBER = of("phone_number") + + @JvmField val PHYSICAL_ADDRESS = of("physical_address") + + @JvmField val POSTAL_CODE = of("postal_code") + + @JvmField val UNFORMATTED_SINGLE_LINE = of("unformatted_single_line") + + @JvmStatic fun of(value: String) = TextDisplayHint(JsonField.of(value)) + } + + /** An enum containing [TextDisplayHint]'s known values. */ + enum class Known { + DOMAIN_NAME, + EMAIL, + IP_ADDRESS, + MULTI_LINE, + PHONE_NUMBER, + PHYSICAL_ADDRESS, + POSTAL_CODE, + UNFORMATTED_SINGLE_LINE, + } + + /** + * An enum containing [TextDisplayHint]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [TextDisplayHint] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DOMAIN_NAME, + EMAIL, + IP_ADDRESS, + MULTI_LINE, + PHONE_NUMBER, + PHYSICAL_ADDRESS, + POSTAL_CODE, + UNFORMATTED_SINGLE_LINE, + /** + * An enum member indicating that [TextDisplayHint] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DOMAIN_NAME -> Value.DOMAIN_NAME + EMAIL -> Value.EMAIL + IP_ADDRESS -> Value.IP_ADDRESS + MULTI_LINE -> Value.MULTI_LINE + PHONE_NUMBER -> Value.PHONE_NUMBER + PHYSICAL_ADDRESS -> Value.PHYSICAL_ADDRESS + POSTAL_CODE -> Value.POSTAL_CODE + UNFORMATTED_SINGLE_LINE -> Value.UNFORMATTED_SINGLE_LINE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws HubSpotInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + DOMAIN_NAME -> Known.DOMAIN_NAME + EMAIL -> Known.EMAIL + IP_ADDRESS -> Known.IP_ADDRESS + MULTI_LINE -> Known.MULTI_LINE + PHONE_NUMBER -> Known.PHONE_NUMBER + PHYSICAL_ADDRESS -> Known.PHYSICAL_ADDRESS + POSTAL_CODE -> Known.POSTAL_CODE + UNFORMATTED_SINGLE_LINE -> Known.UNFORMATTED_SINGLE_LINE + else -> throw HubSpotInvalidDataException("Unknown TextDisplayHint: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws HubSpotInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { HubSpotInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws HubSpotInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): TextDisplayHint = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: HubSpotInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TextDisplayHint && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -1866,6 +2094,7 @@ private constructor( referencedObjectType == other.referencedObjectType && sensitiveDataCategories == other.sensitiveDataCategories && showCurrencySymbol == other.showCurrencySymbol && + textDisplayHint == other.textDisplayHint && updatedAt == other.updatedAt && updatedUserId == other.updatedUserId && additionalProperties == other.additionalProperties @@ -1900,6 +2129,7 @@ private constructor( referencedObjectType, sensitiveDataCategories, showCurrencySymbol, + textDisplayHint, updatedAt, updatedUserId, additionalProperties, @@ -1909,5 +2139,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Property{description=$description, fieldType=$fieldType, groupName=$groupName, label=$label, name=$name, options=$options, type=$type, archived=$archived, archivedAt=$archivedAt, calculated=$calculated, calculationFormula=$calculationFormula, createdAt=$createdAt, createdUserId=$createdUserId, currencyPropertyName=$currencyPropertyName, dataSensitivity=$dataSensitivity, dateDisplayHint=$dateDisplayHint, displayOrder=$displayOrder, externalOptions=$externalOptions, formField=$formField, hasUniqueValue=$hasUniqueValue, hidden=$hidden, hubSpotDefined=$hubSpotDefined, modificationMetadata=$modificationMetadata, numberDisplayHint=$numberDisplayHint, referencedObjectType=$referencedObjectType, sensitiveDataCategories=$sensitiveDataCategories, showCurrencySymbol=$showCurrencySymbol, updatedAt=$updatedAt, updatedUserId=$updatedUserId, additionalProperties=$additionalProperties}" + "Property{description=$description, fieldType=$fieldType, groupName=$groupName, label=$label, name=$name, options=$options, type=$type, archived=$archived, archivedAt=$archivedAt, calculated=$calculated, calculationFormula=$calculationFormula, createdAt=$createdAt, createdUserId=$createdUserId, currencyPropertyName=$currencyPropertyName, dataSensitivity=$dataSensitivity, dateDisplayHint=$dateDisplayHint, displayOrder=$displayOrder, externalOptions=$externalOptions, formField=$formField, hasUniqueValue=$hasUniqueValue, hidden=$hidden, hubSpotDefined=$hubSpotDefined, modificationMetadata=$modificationMetadata, numberDisplayHint=$numberDisplayHint, referencedObjectType=$referencedObjectType, sensitiveDataCategories=$sensitiveDataCategories, showCurrencySymbol=$showCurrencySymbol, textDisplayHint=$textDisplayHint, updatedAt=$updatedAt, updatedUserId=$updatedUserId, additionalProperties=$additionalProperties}" } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/PropertyCreate.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/PropertyCreate.kt index 477fd94b..b46b7bb0 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/PropertyCreate.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/PropertyCreate.kt @@ -41,6 +41,7 @@ private constructor( private val options: JsonField>, private val referencedObjectType: JsonField, private val showCurrencySymbol: JsonField, + private val textDisplayHint: JsonField, private val additionalProperties: MutableMap, ) { @@ -88,6 +89,9 @@ private constructor( @JsonProperty("showCurrencySymbol") @ExcludeMissing showCurrencySymbol: JsonField = JsonMissing.of(), + @JsonProperty("textDisplayHint") + @ExcludeMissing + textDisplayHint: JsonField = JsonMissing.of(), ) : this( fieldType, groupName, @@ -107,6 +111,7 @@ private constructor( options, referencedObjectType, showCurrencySymbol, + textDisplayHint, mutableMapOf(), ) @@ -224,6 +229,13 @@ private constructor( fun showCurrencySymbol(): Optional = showCurrencySymbol.getOptional("showCurrencySymbol") + /** + * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun textDisplayHint(): Optional = + textDisplayHint.getOptional("textDisplayHint") + /** * Returns the raw JSON value of [fieldType]. * @@ -371,6 +383,15 @@ private constructor( @ExcludeMissing fun _showCurrencySymbol(): JsonField = showCurrencySymbol + /** + * Returns the raw JSON value of [textDisplayHint]. + * + * Unlike [textDisplayHint], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("textDisplayHint") + @ExcludeMissing + fun _textDisplayHint(): JsonField = textDisplayHint + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -421,6 +442,7 @@ private constructor( private var options: JsonField>? = null private var referencedObjectType: JsonField = JsonMissing.of() private var showCurrencySymbol: JsonField = JsonMissing.of() + private var textDisplayHint: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -443,6 +465,7 @@ private constructor( options = propertyCreate.options.map { it.toMutableList() } referencedObjectType = propertyCreate.referencedObjectType showCurrencySymbol = propertyCreate.showCurrencySymbol + textDisplayHint = propertyCreate.textDisplayHint additionalProperties = propertyCreate.additionalProperties.toMutableMap() } @@ -677,6 +700,20 @@ private constructor( this.showCurrencySymbol = showCurrencySymbol } + fun textDisplayHint(textDisplayHint: TextDisplayHint) = + textDisplayHint(JsonField.of(textDisplayHint)) + + /** + * Sets [Builder.textDisplayHint] to an arbitrary JSON value. + * + * You should usually call [Builder.textDisplayHint] with a well-typed [TextDisplayHint] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun textDisplayHint(textDisplayHint: JsonField) = apply { + this.textDisplayHint = textDisplayHint + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -732,6 +769,7 @@ private constructor( (options ?: JsonMissing.of()).map { it.toImmutable() }, referencedObjectType, showCurrencySymbol, + textDisplayHint, additionalProperties.toMutableMap(), ) } @@ -769,6 +807,7 @@ private constructor( options().ifPresent { it.forEach { it.validate() } } referencedObjectType() showCurrencySymbol() + textDisplayHint().ifPresent { it.validate() } validated = true } @@ -804,7 +843,8 @@ private constructor( (numberDisplayHint.asKnown().getOrNull()?.validity() ?: 0) + (options.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (referencedObjectType.asKnown().isPresent) 1 else 0) + - (if (showCurrencySymbol.asKnown().isPresent) 1 else 0) + (if (showCurrencySymbol.asKnown().isPresent) 1 else 0) + + (textDisplayHint.asKnown().getOrNull()?.validity() ?: 0) class FieldType @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -1472,6 +1512,180 @@ private constructor( override fun toString() = value.toString() } + class TextDisplayHint @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val DOMAIN_NAME = of("domain_name") + + @JvmField val EMAIL = of("email") + + @JvmField val IP_ADDRESS = of("ip_address") + + @JvmField val MULTI_LINE = of("multi_line") + + @JvmField val PHONE_NUMBER = of("phone_number") + + @JvmField val PHYSICAL_ADDRESS = of("physical_address") + + @JvmField val POSTAL_CODE = of("postal_code") + + @JvmField val UNFORMATTED_SINGLE_LINE = of("unformatted_single_line") + + @JvmStatic fun of(value: String) = TextDisplayHint(JsonField.of(value)) + } + + /** An enum containing [TextDisplayHint]'s known values. */ + enum class Known { + DOMAIN_NAME, + EMAIL, + IP_ADDRESS, + MULTI_LINE, + PHONE_NUMBER, + PHYSICAL_ADDRESS, + POSTAL_CODE, + UNFORMATTED_SINGLE_LINE, + } + + /** + * An enum containing [TextDisplayHint]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [TextDisplayHint] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DOMAIN_NAME, + EMAIL, + IP_ADDRESS, + MULTI_LINE, + PHONE_NUMBER, + PHYSICAL_ADDRESS, + POSTAL_CODE, + UNFORMATTED_SINGLE_LINE, + /** + * An enum member indicating that [TextDisplayHint] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DOMAIN_NAME -> Value.DOMAIN_NAME + EMAIL -> Value.EMAIL + IP_ADDRESS -> Value.IP_ADDRESS + MULTI_LINE -> Value.MULTI_LINE + PHONE_NUMBER -> Value.PHONE_NUMBER + PHYSICAL_ADDRESS -> Value.PHYSICAL_ADDRESS + POSTAL_CODE -> Value.POSTAL_CODE + UNFORMATTED_SINGLE_LINE -> Value.UNFORMATTED_SINGLE_LINE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws HubSpotInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + DOMAIN_NAME -> Known.DOMAIN_NAME + EMAIL -> Known.EMAIL + IP_ADDRESS -> Known.IP_ADDRESS + MULTI_LINE -> Known.MULTI_LINE + PHONE_NUMBER -> Known.PHONE_NUMBER + PHYSICAL_ADDRESS -> Known.PHYSICAL_ADDRESS + POSTAL_CODE -> Known.POSTAL_CODE + UNFORMATTED_SINGLE_LINE -> Known.UNFORMATTED_SINGLE_LINE + else -> throw HubSpotInvalidDataException("Unknown TextDisplayHint: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws HubSpotInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { HubSpotInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws HubSpotInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): TextDisplayHint = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: HubSpotInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TextDisplayHint && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -1496,6 +1710,7 @@ private constructor( options == other.options && referencedObjectType == other.referencedObjectType && showCurrencySymbol == other.showCurrencySymbol && + textDisplayHint == other.textDisplayHint && additionalProperties == other.additionalProperties } @@ -1519,6 +1734,7 @@ private constructor( options, referencedObjectType, showCurrencySymbol, + textDisplayHint, additionalProperties, ) } @@ -1526,5 +1742,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PropertyCreate{fieldType=$fieldType, groupName=$groupName, label=$label, name=$name, type=$type, calculationFormula=$calculationFormula, currencyPropertyName=$currencyPropertyName, dataSensitivity=$dataSensitivity, description=$description, displayOrder=$displayOrder, externalOptions=$externalOptions, formField=$formField, hasUniqueValue=$hasUniqueValue, hidden=$hidden, numberDisplayHint=$numberDisplayHint, options=$options, referencedObjectType=$referencedObjectType, showCurrencySymbol=$showCurrencySymbol, additionalProperties=$additionalProperties}" + "PropertyCreate{fieldType=$fieldType, groupName=$groupName, label=$label, name=$name, type=$type, calculationFormula=$calculationFormula, currencyPropertyName=$currencyPropertyName, dataSensitivity=$dataSensitivity, description=$description, displayOrder=$displayOrder, externalOptions=$externalOptions, formField=$formField, hasUniqueValue=$hasUniqueValue, hidden=$hidden, numberDisplayHint=$numberDisplayHint, options=$options, referencedObjectType=$referencedObjectType, showCurrencySymbol=$showCurrencySymbol, textDisplayHint=$textDisplayHint, additionalProperties=$additionalProperties}" } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/SubscriptionUpsertRequest.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/SubscriptionUpsertRequest.kt index 91d3946f..cd14a24f 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/SubscriptionUpsertRequest.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/SubscriptionUpsertRequest.kt @@ -12,17 +12,17 @@ import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import com.hubspot.sdk.core.BaseDeserializer import com.hubspot.sdk.core.BaseSerializer import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @JsonDeserialize(using = SubscriptionUpsertRequest.Deserializer::class) @JsonSerialize(using = SubscriptionUpsertRequest.Serializer::class) class SubscriptionUpsertRequest private constructor( - private val objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest? = null, + private val object_: ObjectSubscriptionUpsertRequest? = null, private val association: AssociationSubscriptionUpsertRequest? = null, private val appLifecycleEvent: AppLifecycleEventSubscriptionUpsertRequest? = null, private val listMembership: ListMembershipSubscriptionUpsertRequest? = null, @@ -30,8 +30,7 @@ private constructor( private val _json: JsonValue? = null, ) { - fun objectSubscriptionUpsertRequest(): Optional = - Optional.ofNullable(objectSubscriptionUpsertRequest) + fun object_(): Optional = Optional.ofNullable(object_) fun association(): Optional = Optional.ofNullable(association) @@ -45,7 +44,7 @@ private constructor( fun gdprPrivacyDeletion(): Optional = Optional.ofNullable(gdprPrivacyDeletion) - fun isObjectSubscriptionUpsertRequest(): Boolean = objectSubscriptionUpsertRequest != null + fun isObject(): Boolean = object_ != null fun isAssociation(): Boolean = association != null @@ -55,8 +54,7 @@ private constructor( fun isGdprPrivacyDeletion(): Boolean = gdprPrivacyDeletion != null - fun asObjectSubscriptionUpsertRequest(): ObjectSubscriptionUpsertRequest = - objectSubscriptionUpsertRequest.getOrThrow("objectSubscriptionUpsertRequest") + fun asObject(): ObjectSubscriptionUpsertRequest = object_.getOrThrow("object_") fun asAssociation(): AssociationSubscriptionUpsertRequest = association.getOrThrow("association") @@ -84,8 +82,8 @@ private constructor( * * Optional result = subscriptionUpsertRequest.accept(new SubscriptionUpsertRequest.Visitor>() { * @Override - * public Optional visitObjectSubscriptionUpsertRequest(ObjectSubscriptionUpsertRequest objectSubscriptionUpsertRequest) { - * return Optional.of(objectSubscriptionUpsertRequest.toString()); + * public Optional visitObject(ObjectSubscriptionUpsertRequest object_) { + * return Optional.of(object_.toString()); * } * * // ... @@ -103,8 +101,7 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - objectSubscriptionUpsertRequest != null -> - visitor.visitObjectSubscriptionUpsertRequest(objectSubscriptionUpsertRequest) + object_ != null -> visitor.visitObject(object_) association != null -> visitor.visitAssociation(association) appLifecycleEvent != null -> visitor.visitAppLifecycleEvent(appLifecycleEvent) listMembership != null -> visitor.visitListMembership(listMembership) @@ -129,10 +126,8 @@ private constructor( accept( object : Visitor { - override fun visitObjectSubscriptionUpsertRequest( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest - ) { - objectSubscriptionUpsertRequest.validate() + override fun visitObject(object_: ObjectSubscriptionUpsertRequest) { + object_.validate() } override fun visitAssociation(association: AssociationSubscriptionUpsertRequest) { @@ -178,9 +173,8 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitObjectSubscriptionUpsertRequest( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest - ) = objectSubscriptionUpsertRequest.validity() + override fun visitObject(object_: ObjectSubscriptionUpsertRequest) = + object_.validity() override fun visitAssociation(association: AssociationSubscriptionUpsertRequest) = association.validity() @@ -207,7 +201,7 @@ private constructor( } return other is SubscriptionUpsertRequest && - objectSubscriptionUpsertRequest == other.objectSubscriptionUpsertRequest && + object_ == other.object_ && association == other.association && appLifecycleEvent == other.appLifecycleEvent && listMembership == other.listMembership && @@ -215,18 +209,11 @@ private constructor( } override fun hashCode(): Int = - Objects.hash( - objectSubscriptionUpsertRequest, - association, - appLifecycleEvent, - listMembership, - gdprPrivacyDeletion, - ) + Objects.hash(object_, association, appLifecycleEvent, listMembership, gdprPrivacyDeletion) override fun toString(): String = when { - objectSubscriptionUpsertRequest != null -> - "SubscriptionUpsertRequest{objectSubscriptionUpsertRequest=$objectSubscriptionUpsertRequest}" + object_ != null -> "SubscriptionUpsertRequest{object_=$object_}" association != null -> "SubscriptionUpsertRequest{association=$association}" appLifecycleEvent != null -> "SubscriptionUpsertRequest{appLifecycleEvent=$appLifecycleEvent}" @@ -240,12 +227,8 @@ private constructor( companion object { @JvmStatic - fun ofObjectSubscriptionUpsertRequest( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest - ) = - SubscriptionUpsertRequest( - objectSubscriptionUpsertRequest = objectSubscriptionUpsertRequest - ) + fun ofObject(object_: ObjectSubscriptionUpsertRequest) = + SubscriptionUpsertRequest(object_ = object_) @JvmStatic fun ofAssociation(association: AssociationSubscriptionUpsertRequest) = @@ -271,9 +254,7 @@ private constructor( */ interface Visitor { - fun visitObjectSubscriptionUpsertRequest( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest - ): T + fun visitObject(object_: ObjectSubscriptionUpsertRequest): T fun visitAssociation(association: AssociationSubscriptionUpsertRequest): T @@ -305,50 +286,50 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): SubscriptionUpsertRequest { val json = JsonValue.fromJsonNode(node) - - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { - SubscriptionUpsertRequest( - objectSubscriptionUpsertRequest = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { SubscriptionUpsertRequest(association = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - SubscriptionUpsertRequest(appLifecycleEvent = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { SubscriptionUpsertRequest(listMembership = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - SubscriptionUpsertRequest(gdprPrivacyDeletion = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with all - // the possible variants (e.g. deserializing from boolean). - 0 -> SubscriptionUpsertRequest(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + val subscriptionType = + json.asObject().getOrNull()?.get("subscriptionType")?.asString()?.getOrNull() + + when (subscriptionType) { + "OBJECT" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { SubscriptionUpsertRequest(object_ = it, _json = json) } + ?: SubscriptionUpsertRequest(_json = json) + } + "ASSOCIATION" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { SubscriptionUpsertRequest(association = it, _json = json) } + ?: SubscriptionUpsertRequest(_json = json) + } + "APP_LIFECYCLE_EVENT" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { SubscriptionUpsertRequest(appLifecycleEvent = it, _json = json) } + ?: SubscriptionUpsertRequest(_json = json) + } + "LIST_MEMBERSHIP" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { SubscriptionUpsertRequest(listMembership = it, _json = json) } + ?: SubscriptionUpsertRequest(_json = json) + } + "GDPR_PRIVACY_DELETION" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { SubscriptionUpsertRequest(gdprPrivacyDeletion = it, _json = json) } + ?: SubscriptionUpsertRequest(_json = json) + } } + + return SubscriptionUpsertRequest(_json = json) } } @@ -361,8 +342,7 @@ private constructor( provider: SerializerProvider, ) { when { - value.objectSubscriptionUpsertRequest != null -> - generator.writeObject(value.objectSubscriptionUpsertRequest) + value.object_ != null -> generator.writeObject(value.object_) value.association != null -> generator.writeObject(value.association) value.appLifecycleEvent != null -> generator.writeObject(value.appLifecycleEvent) value.listMembership != null -> generator.writeObject(value.listMembership) diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/account/activity/HydratedCriticalAction.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/account/activity/HydratedCriticalAction.kt index 2ce30a55..b434335b 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/account/activity/HydratedCriticalAction.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/account/activity/HydratedCriticalAction.kt @@ -832,6 +832,8 @@ private constructor( @JvmField val TEAM_USER_DELETED = of("TEAM_USER_DELETED") + @JvmField val TEMPLATE_DELETED = of("TEMPLATE_DELETED") + @JvmField val TEMPLATE_MODIFIED = of("TEMPLATE_MODIFIED") @JvmField val TOUCHLESS_PURCHASE = of("TOUCHLESS_PURCHASE") @@ -984,6 +986,7 @@ private constructor( TEAM_DELETED, TEAM_USER_ADDED, TEAM_USER_DELETED, + TEMPLATE_DELETED, TEMPLATE_MODIFIED, TOUCHLESS_PURCHASE, UNIFIED_RESTORE_UNDO_EXECUTION, @@ -1135,6 +1138,7 @@ private constructor( TEAM_DELETED, TEAM_USER_ADDED, TEAM_USER_DELETED, + TEMPLATE_DELETED, TEMPLATE_MODIFIED, TOUCHLESS_PURCHASE, UNIFIED_RESTORE_UNDO_EXECUTION, @@ -1297,6 +1301,7 @@ private constructor( TEAM_DELETED -> Value.TEAM_DELETED TEAM_USER_ADDED -> Value.TEAM_USER_ADDED TEAM_USER_DELETED -> Value.TEAM_USER_DELETED + TEMPLATE_DELETED -> Value.TEMPLATE_DELETED TEMPLATE_MODIFIED -> Value.TEMPLATE_MODIFIED TOUCHLESS_PURCHASE -> Value.TOUCHLESS_PURCHASE UNIFIED_RESTORE_UNDO_EXECUTION -> Value.UNIFIED_RESTORE_UNDO_EXECUTION @@ -1460,6 +1465,7 @@ private constructor( TEAM_DELETED -> Known.TEAM_DELETED TEAM_USER_ADDED -> Known.TEAM_USER_ADDED TEAM_USER_DELETED -> Known.TEAM_USER_DELETED + TEMPLATE_DELETED -> Known.TEMPLATE_DELETED TEMPLATE_MODIFIED -> Known.TEMPLATE_MODIFIED TOUCHLESS_PURCHASE -> Known.TOUCHLESS_PURCHASE UNIFIED_RESTORE_UNDO_EXECUTION -> Known.UNIFIED_RESTORE_UNDO_EXECUTION diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/TokenInfoResponseBaseIf.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/TokenInfoResponseBaseIf.kt index 22aa0001..87144165 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/TokenInfoResponseBaseIf.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/TokenInfoResponseBaseIf.kt @@ -12,36 +12,32 @@ import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import com.hubspot.sdk.core.BaseDeserializer import com.hubspot.sdk.core.BaseSerializer import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @JsonDeserialize(using = TokenInfoResponseBaseIf.Deserializer::class) @JsonSerialize(using = TokenInfoResponseBaseIf.Serializer::class) class TokenInfoResponseBaseIf private constructor( - private val publicAccessTokenInfoResponse: PublicAccessTokenInfoResponse? = null, - private val publicRefreshTokenInfoResponse: PublicRefreshTokenInfoResponse? = null, + private val accessToken: PublicAccessTokenInfoResponse? = null, + private val refreshToken: PublicRefreshTokenInfoResponse? = null, private val _json: JsonValue? = null, ) { - fun publicAccessTokenInfoResponse(): Optional = - Optional.ofNullable(publicAccessTokenInfoResponse) + fun accessToken(): Optional = Optional.ofNullable(accessToken) - fun publicRefreshTokenInfoResponse(): Optional = - Optional.ofNullable(publicRefreshTokenInfoResponse) + fun refreshToken(): Optional = Optional.ofNullable(refreshToken) - fun isPublicAccessTokenInfoResponse(): Boolean = publicAccessTokenInfoResponse != null + fun isAccessToken(): Boolean = accessToken != null - fun isPublicRefreshTokenInfoResponse(): Boolean = publicRefreshTokenInfoResponse != null + fun isRefreshToken(): Boolean = refreshToken != null - fun asPublicAccessTokenInfoResponse(): PublicAccessTokenInfoResponse = - publicAccessTokenInfoResponse.getOrThrow("publicAccessTokenInfoResponse") + fun asAccessToken(): PublicAccessTokenInfoResponse = accessToken.getOrThrow("accessToken") - fun asPublicRefreshTokenInfoResponse(): PublicRefreshTokenInfoResponse = - publicRefreshTokenInfoResponse.getOrThrow("publicRefreshTokenInfoResponse") + fun asRefreshToken(): PublicRefreshTokenInfoResponse = refreshToken.getOrThrow("refreshToken") fun _json(): Optional = Optional.ofNullable(_json) @@ -57,8 +53,8 @@ private constructor( * * Optional result = tokenInfoResponseBaseIf.accept(new TokenInfoResponseBaseIf.Visitor>() { * @Override - * public Optional visitPublicAccessTokenInfoResponse(PublicAccessTokenInfoResponse publicAccessTokenInfoResponse) { - * return Optional.of(publicAccessTokenInfoResponse.toString()); + * public Optional visitAccessToken(PublicAccessTokenInfoResponse accessToken) { + * return Optional.of(accessToken.toString()); * } * * // ... @@ -76,10 +72,8 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicAccessTokenInfoResponse != null -> - visitor.visitPublicAccessTokenInfoResponse(publicAccessTokenInfoResponse) - publicRefreshTokenInfoResponse != null -> - visitor.visitPublicRefreshTokenInfoResponse(publicRefreshTokenInfoResponse) + accessToken != null -> visitor.visitAccessToken(accessToken) + refreshToken != null -> visitor.visitRefreshToken(refreshToken) else -> visitor.unknown(_json) } @@ -100,16 +94,12 @@ private constructor( accept( object : Visitor { - override fun visitPublicAccessTokenInfoResponse( - publicAccessTokenInfoResponse: PublicAccessTokenInfoResponse - ) { - publicAccessTokenInfoResponse.validate() + override fun visitAccessToken(accessToken: PublicAccessTokenInfoResponse) { + accessToken.validate() } - override fun visitPublicRefreshTokenInfoResponse( - publicRefreshTokenInfoResponse: PublicRefreshTokenInfoResponse - ) { - publicRefreshTokenInfoResponse.validate() + override fun visitRefreshToken(refreshToken: PublicRefreshTokenInfoResponse) { + refreshToken.validate() } } ) @@ -133,13 +123,11 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicAccessTokenInfoResponse( - publicAccessTokenInfoResponse: PublicAccessTokenInfoResponse - ) = publicAccessTokenInfoResponse.validity() + override fun visitAccessToken(accessToken: PublicAccessTokenInfoResponse) = + accessToken.validity() - override fun visitPublicRefreshTokenInfoResponse( - publicRefreshTokenInfoResponse: PublicRefreshTokenInfoResponse - ) = publicRefreshTokenInfoResponse.validity() + override fun visitRefreshToken(refreshToken: PublicRefreshTokenInfoResponse) = + refreshToken.validity() override fun unknown(json: JsonValue?) = 0 } @@ -151,19 +139,16 @@ private constructor( } return other is TokenInfoResponseBaseIf && - publicAccessTokenInfoResponse == other.publicAccessTokenInfoResponse && - publicRefreshTokenInfoResponse == other.publicRefreshTokenInfoResponse + accessToken == other.accessToken && + refreshToken == other.refreshToken } - override fun hashCode(): Int = - Objects.hash(publicAccessTokenInfoResponse, publicRefreshTokenInfoResponse) + override fun hashCode(): Int = Objects.hash(accessToken, refreshToken) override fun toString(): String = when { - publicAccessTokenInfoResponse != null -> - "TokenInfoResponseBaseIf{publicAccessTokenInfoResponse=$publicAccessTokenInfoResponse}" - publicRefreshTokenInfoResponse != null -> - "TokenInfoResponseBaseIf{publicRefreshTokenInfoResponse=$publicRefreshTokenInfoResponse}" + accessToken != null -> "TokenInfoResponseBaseIf{accessToken=$accessToken}" + refreshToken != null -> "TokenInfoResponseBaseIf{refreshToken=$refreshToken}" _json != null -> "TokenInfoResponseBaseIf{_unknown=$_json}" else -> throw IllegalStateException("Invalid TokenInfoResponseBaseIf") } @@ -171,14 +156,12 @@ private constructor( companion object { @JvmStatic - fun ofPublicAccessTokenInfoResponse( - publicAccessTokenInfoResponse: PublicAccessTokenInfoResponse - ) = TokenInfoResponseBaseIf(publicAccessTokenInfoResponse = publicAccessTokenInfoResponse) + fun ofAccessToken(accessToken: PublicAccessTokenInfoResponse) = + TokenInfoResponseBaseIf(accessToken = accessToken) @JvmStatic - fun ofPublicRefreshTokenInfoResponse( - publicRefreshTokenInfoResponse: PublicRefreshTokenInfoResponse - ) = TokenInfoResponseBaseIf(publicRefreshTokenInfoResponse = publicRefreshTokenInfoResponse) + fun ofRefreshToken(refreshToken: PublicRefreshTokenInfoResponse) = + TokenInfoResponseBaseIf(refreshToken = refreshToken) } /** @@ -187,13 +170,9 @@ private constructor( */ interface Visitor { - fun visitPublicAccessTokenInfoResponse( - publicAccessTokenInfoResponse: PublicAccessTokenInfoResponse - ): T + fun visitAccessToken(accessToken: PublicAccessTokenInfoResponse): T - fun visitPublicRefreshTokenInfoResponse( - publicRefreshTokenInfoResponse: PublicRefreshTokenInfoResponse - ): T + fun visitRefreshToken(refreshToken: PublicRefreshTokenInfoResponse): T /** * Maps an unknown variant of [TokenInfoResponseBaseIf] to a value of type [T]. @@ -215,35 +194,22 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): TokenInfoResponseBaseIf { val json = JsonValue.fromJsonNode(node) + val tokenUse = json.asObject().getOrNull()?.get("token_use")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - TokenInfoResponseBaseIf( - publicAccessTokenInfoResponse = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - TokenInfoResponseBaseIf( - publicRefreshTokenInfoResponse = it, - _json = json, - ) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with all - // the possible variants (e.g. deserializing from boolean). - 0 -> TokenInfoResponseBaseIf(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (tokenUse) { + "access_token" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { TokenInfoResponseBaseIf(accessToken = it, _json = json) } + ?: TokenInfoResponseBaseIf(_json = json) + } + "refresh_token" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { TokenInfoResponseBaseIf(refreshToken = it, _json = json) } + ?: TokenInfoResponseBaseIf(_json = json) + } } + + return TokenInfoResponseBaseIf(_json = json) } } @@ -256,10 +222,8 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicAccessTokenInfoResponse != null -> - generator.writeObject(value.publicAccessTokenInfoResponse) - value.publicRefreshTokenInfoResponse != null -> - generator.writeObject(value.publicRefreshTokenInfoResponse) + value.accessToken != null -> generator.writeObject(value.accessToken) + value.refreshToken != null -> generator.writeObject(value.refreshToken) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid TokenInfoResponseBaseIf") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/TokenResponseIf.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/TokenResponseIf.kt index 39dee786..c5bdb9f3 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/TokenResponseIf.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/TokenResponseIf.kt @@ -12,36 +12,34 @@ import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import com.hubspot.sdk.core.BaseDeserializer import com.hubspot.sdk.core.BaseSerializer import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @JsonDeserialize(using = TokenResponseIf.Deserializer::class) @JsonSerialize(using = TokenResponseIf.Serializer::class) class TokenResponseIf private constructor( - private val accessTokenResponse: AccessTokenResponse? = null, - private val clientCredentialsTokenResponse: ClientCredentialsTokenResponse? = null, + private val accessToken: AccessTokenResponse? = null, + private val clientCredentials: ClientCredentialsTokenResponse? = null, private val _json: JsonValue? = null, ) { - fun accessTokenResponse(): Optional = - Optional.ofNullable(accessTokenResponse) + fun accessToken(): Optional = Optional.ofNullable(accessToken) - fun clientCredentialsTokenResponse(): Optional = - Optional.ofNullable(clientCredentialsTokenResponse) + fun clientCredentials(): Optional = + Optional.ofNullable(clientCredentials) - fun isAccessTokenResponse(): Boolean = accessTokenResponse != null + fun isAccessToken(): Boolean = accessToken != null - fun isClientCredentialsTokenResponse(): Boolean = clientCredentialsTokenResponse != null + fun isClientCredentials(): Boolean = clientCredentials != null - fun asAccessTokenResponse(): AccessTokenResponse = - accessTokenResponse.getOrThrow("accessTokenResponse") + fun asAccessToken(): AccessTokenResponse = accessToken.getOrThrow("accessToken") - fun asClientCredentialsTokenResponse(): ClientCredentialsTokenResponse = - clientCredentialsTokenResponse.getOrThrow("clientCredentialsTokenResponse") + fun asClientCredentials(): ClientCredentialsTokenResponse = + clientCredentials.getOrThrow("clientCredentials") fun _json(): Optional = Optional.ofNullable(_json) @@ -57,8 +55,8 @@ private constructor( * * Optional result = tokenResponseIf.accept(new TokenResponseIf.Visitor>() { * @Override - * public Optional visitAccessTokenResponse(AccessTokenResponse accessTokenResponse) { - * return Optional.of(accessTokenResponse.toString()); + * public Optional visitAccessToken(AccessTokenResponse accessToken) { + * return Optional.of(accessToken.toString()); * } * * // ... @@ -76,9 +74,8 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - accessTokenResponse != null -> visitor.visitAccessTokenResponse(accessTokenResponse) - clientCredentialsTokenResponse != null -> - visitor.visitClientCredentialsTokenResponse(clientCredentialsTokenResponse) + accessToken != null -> visitor.visitAccessToken(accessToken) + clientCredentials != null -> visitor.visitClientCredentials(clientCredentials) else -> visitor.unknown(_json) } @@ -99,14 +96,14 @@ private constructor( accept( object : Visitor { - override fun visitAccessTokenResponse(accessTokenResponse: AccessTokenResponse) { - accessTokenResponse.validate() + override fun visitAccessToken(accessToken: AccessTokenResponse) { + accessToken.validate() } - override fun visitClientCredentialsTokenResponse( - clientCredentialsTokenResponse: ClientCredentialsTokenResponse + override fun visitClientCredentials( + clientCredentials: ClientCredentialsTokenResponse ) { - clientCredentialsTokenResponse.validate() + clientCredentials.validate() } } ) @@ -130,12 +127,12 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitAccessTokenResponse(accessTokenResponse: AccessTokenResponse) = - accessTokenResponse.validity() + override fun visitAccessToken(accessToken: AccessTokenResponse) = + accessToken.validity() - override fun visitClientCredentialsTokenResponse( - clientCredentialsTokenResponse: ClientCredentialsTokenResponse - ) = clientCredentialsTokenResponse.validity() + override fun visitClientCredentials( + clientCredentials: ClientCredentialsTokenResponse + ) = clientCredentials.validity() override fun unknown(json: JsonValue?) = 0 } @@ -147,18 +144,16 @@ private constructor( } return other is TokenResponseIf && - accessTokenResponse == other.accessTokenResponse && - clientCredentialsTokenResponse == other.clientCredentialsTokenResponse + accessToken == other.accessToken && + clientCredentials == other.clientCredentials } - override fun hashCode(): Int = Objects.hash(accessTokenResponse, clientCredentialsTokenResponse) + override fun hashCode(): Int = Objects.hash(accessToken, clientCredentials) override fun toString(): String = when { - accessTokenResponse != null -> - "TokenResponseIf{accessTokenResponse=$accessTokenResponse}" - clientCredentialsTokenResponse != null -> - "TokenResponseIf{clientCredentialsTokenResponse=$clientCredentialsTokenResponse}" + accessToken != null -> "TokenResponseIf{accessToken=$accessToken}" + clientCredentials != null -> "TokenResponseIf{clientCredentials=$clientCredentials}" _json != null -> "TokenResponseIf{_unknown=$_json}" else -> throw IllegalStateException("Invalid TokenResponseIf") } @@ -166,13 +161,12 @@ private constructor( companion object { @JvmStatic - fun ofAccessTokenResponse(accessTokenResponse: AccessTokenResponse) = - TokenResponseIf(accessTokenResponse = accessTokenResponse) + fun ofAccessToken(accessToken: AccessTokenResponse) = + TokenResponseIf(accessToken = accessToken) @JvmStatic - fun ofClientCredentialsTokenResponse( - clientCredentialsTokenResponse: ClientCredentialsTokenResponse - ) = TokenResponseIf(clientCredentialsTokenResponse = clientCredentialsTokenResponse) + fun ofClientCredentials(clientCredentials: ClientCredentialsTokenResponse) = + TokenResponseIf(clientCredentials = clientCredentials) } /** @@ -181,11 +175,9 @@ private constructor( */ interface Visitor { - fun visitAccessTokenResponse(accessTokenResponse: AccessTokenResponse): T + fun visitAccessToken(accessToken: AccessTokenResponse): T - fun visitClientCredentialsTokenResponse( - clientCredentialsTokenResponse: ClientCredentialsTokenResponse - ): T + fun visitClientCredentials(clientCredentials: ClientCredentialsTokenResponse): T /** * Maps an unknown variant of [TokenResponseIf] to a value of type [T]. @@ -206,29 +198,22 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): TokenResponseIf { val json = JsonValue.fromJsonNode(node) + val tokenUse = json.asObject().getOrNull()?.get("token_use")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - TokenResponseIf(accessTokenResponse = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - TokenResponseIf(clientCredentialsTokenResponse = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with all - // the possible variants (e.g. deserializing from boolean). - 0 -> TokenResponseIf(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (tokenUse) { + "access_token" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + TokenResponseIf(accessToken = it, _json = json) + } ?: TokenResponseIf(_json = json) + } + "client_credentials" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { TokenResponseIf(clientCredentials = it, _json = json) } + ?: TokenResponseIf(_json = json) + } } + + return TokenResponseIf(_json = json) } } @@ -240,10 +225,8 @@ private constructor( provider: SerializerProvider, ) { when { - value.accessTokenResponse != null -> - generator.writeObject(value.accessTokenResponse) - value.clientCredentialsTokenResponse != null -> - generator.writeObject(value.clientCredentialsTokenResponse) + value.accessToken != null -> generator.writeObject(value.accessToken) + value.clientCredentials != null -> generator.writeObject(value.clientCredentials) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid TokenResponseIf") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/CallbackCompletionBatchRequest.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/CallbackCompletionBatchRequest.kt index 26718cee..54c01ff3 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/CallbackCompletionBatchRequest.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/CallbackCompletionBatchRequest.kt @@ -19,7 +19,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.core.toImmutable @@ -253,9 +252,26 @@ private constructor( fun requestContext(workflows: WorkflowsRequestContext) = requestContext(RequestContext.ofWorkflows(workflows)) - /** Alias for calling [requestContext] with `RequestContext.ofAgent(agent)`. */ - fun requestContext(agent: AgentRequestContext) = - requestContext(RequestContext.ofAgent(agent)) + /** + * Alias for calling [requestContext] with the following: + * ```java + * WorkflowsRequestContext.builder() + * .source(WorkflowsRequestContext.Source.WORKFLOWS) + * .workflowId(workflowId) + * .build() + * ``` + */ + fun workflowsRequestContext(workflowId: Long) = + requestContext( + WorkflowsRequestContext.builder() + .source(WorkflowsRequestContext.Source.WORKFLOWS) + .workflowId(workflowId) + .build() + ) + + /** Alias for calling [requestContext] with `RequestContext.ofAgents(agents)`. */ + fun requestContext(agents: AgentRequestContext) = + requestContext(RequestContext.ofAgents(agents)) /** Alias for calling [requestContext] with `RequestContext.ofCopilot(copilot)`. */ fun requestContext(copilot: CopilotRequestContext) = @@ -265,6 +281,23 @@ private constructor( fun requestContext(standalone: StandaloneRequestContext) = requestContext(RequestContext.ofStandalone(standalone)) + /** + * Alias for calling [requestContext] with the following: + * ```java + * StandaloneRequestContext.builder() + * .source(StandaloneRequestContext.Source.STANDALONE) + * .chirpAiContextObject(chirpAiContextObject) + * .build() + * ``` + */ + fun standaloneRequestContext(chirpAiContextObject: ChirpAiContextObject) = + requestContext( + StandaloneRequestContext.builder() + .source(StandaloneRequestContext.Source.STANDALONE) + .chirpAiContextObject(chirpAiContextObject) + .build() + ) + /** Alias for calling [requestContext] with `RequestContext.ofTest(test)`. */ fun requestContext(test: TestRequestContext) = requestContext(RequestContext.ofTest(test)) @@ -469,7 +502,7 @@ private constructor( class RequestContext private constructor( private val workflows: WorkflowsRequestContext? = null, - private val agent: AgentRequestContext? = null, + private val agents: AgentRequestContext? = null, private val copilot: CopilotRequestContext? = null, private val standalone: StandaloneRequestContext? = null, private val test: TestRequestContext? = null, @@ -478,7 +511,7 @@ private constructor( fun workflows(): Optional = Optional.ofNullable(workflows) - fun agent(): Optional = Optional.ofNullable(agent) + fun agents(): Optional = Optional.ofNullable(agents) fun copilot(): Optional = Optional.ofNullable(copilot) @@ -488,7 +521,7 @@ private constructor( fun isWorkflows(): Boolean = workflows != null - fun isAgent(): Boolean = agent != null + fun isAgents(): Boolean = agents != null fun isCopilot(): Boolean = copilot != null @@ -498,7 +531,7 @@ private constructor( fun asWorkflows(): WorkflowsRequestContext = workflows.getOrThrow("workflows") - fun asAgent(): AgentRequestContext = agent.getOrThrow("agent") + fun asAgents(): AgentRequestContext = agents.getOrThrow("agents") fun asCopilot(): CopilotRequestContext = copilot.getOrThrow("copilot") @@ -540,7 +573,7 @@ private constructor( fun accept(visitor: Visitor): T = when { workflows != null -> visitor.visitWorkflows(workflows) - agent != null -> visitor.visitAgent(agent) + agents != null -> visitor.visitAgents(agents) copilot != null -> visitor.visitCopilot(copilot) standalone != null -> visitor.visitStandalone(standalone) test != null -> visitor.visitTest(test) @@ -569,8 +602,8 @@ private constructor( workflows.validate() } - override fun visitAgent(agent: AgentRequestContext) { - agent.validate() + override fun visitAgents(agents: AgentRequestContext) { + agents.validate() } override fun visitCopilot(copilot: CopilotRequestContext) { @@ -610,7 +643,7 @@ private constructor( override fun visitWorkflows(workflows: WorkflowsRequestContext) = workflows.validity() - override fun visitAgent(agent: AgentRequestContext) = agent.validity() + override fun visitAgents(agents: AgentRequestContext) = agents.validity() override fun visitCopilot(copilot: CopilotRequestContext) = copilot.validity() @@ -630,18 +663,18 @@ private constructor( return other is RequestContext && workflows == other.workflows && - agent == other.agent && + agents == other.agents && copilot == other.copilot && standalone == other.standalone && test == other.test } - override fun hashCode(): Int = Objects.hash(workflows, agent, copilot, standalone, test) + override fun hashCode(): Int = Objects.hash(workflows, agents, copilot, standalone, test) override fun toString(): String = when { workflows != null -> "RequestContext{workflows=$workflows}" - agent != null -> "RequestContext{agent=$agent}" + agents != null -> "RequestContext{agents=$agents}" copilot != null -> "RequestContext{copilot=$copilot}" standalone != null -> "RequestContext{standalone=$standalone}" test != null -> "RequestContext{test=$test}" @@ -655,7 +688,7 @@ private constructor( fun ofWorkflows(workflows: WorkflowsRequestContext) = RequestContext(workflows = workflows) - @JvmStatic fun ofAgent(agent: AgentRequestContext) = RequestContext(agent = agent) + @JvmStatic fun ofAgents(agents: AgentRequestContext) = RequestContext(agents = agents) @JvmStatic fun ofCopilot(copilot: CopilotRequestContext) = RequestContext(copilot = copilot) @@ -675,7 +708,7 @@ private constructor( fun visitWorkflows(workflows: WorkflowsRequestContext): T - fun visitAgent(agent: AgentRequestContext): T + fun visitAgents(agents: AgentRequestContext): T fun visitCopilot(copilot: CopilotRequestContext): T @@ -702,38 +735,37 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): RequestContext { val json = JsonValue.fromJsonNode(node) + val source = json.asObject().getOrNull()?.get("source")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - RequestContext(workflows = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - RequestContext(agent = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - RequestContext(copilot = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - RequestContext(standalone = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - RequestContext(test = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> RequestContext(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (source) { + "WORKFLOWS" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { RequestContext(workflows = it, _json = json) } + ?: RequestContext(_json = json) + } + "AGENTS" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + RequestContext(agents = it, _json = json) + } ?: RequestContext(_json = json) + } + "COPILOT" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + RequestContext(copilot = it, _json = json) + } ?: RequestContext(_json = json) + } + "STANDALONE" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { RequestContext(standalone = it, _json = json) } + ?: RequestContext(_json = json) + } + "TEST" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + RequestContext(test = it, _json = json) + } ?: RequestContext(_json = json) + } } + + return RequestContext(_json = json) } } @@ -746,7 +778,7 @@ private constructor( ) { when { value.workflows != null -> generator.writeObject(value.workflows) - value.agent != null -> generator.writeObject(value.agent) + value.agents != null -> generator.writeObject(value.agents) value.copilot != null -> generator.writeObject(value.copilot) value.standalone != null -> generator.writeObject(value.standalone) value.test != null -> generator.writeObject(value.test) diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/CallbackCompletionRequest.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/CallbackCompletionRequest.kt index a0ee2ed9..428647a1 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/CallbackCompletionRequest.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/CallbackCompletionRequest.kt @@ -19,7 +19,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.core.toImmutable @@ -218,9 +217,26 @@ private constructor( fun requestContext(workflows: WorkflowsRequestContext) = requestContext(RequestContext.ofWorkflows(workflows)) - /** Alias for calling [requestContext] with `RequestContext.ofAgent(agent)`. */ - fun requestContext(agent: AgentRequestContext) = - requestContext(RequestContext.ofAgent(agent)) + /** + * Alias for calling [requestContext] with the following: + * ```java + * WorkflowsRequestContext.builder() + * .source(WorkflowsRequestContext.Source.WORKFLOWS) + * .workflowId(workflowId) + * .build() + * ``` + */ + fun workflowsRequestContext(workflowId: Long) = + requestContext( + WorkflowsRequestContext.builder() + .source(WorkflowsRequestContext.Source.WORKFLOWS) + .workflowId(workflowId) + .build() + ) + + /** Alias for calling [requestContext] with `RequestContext.ofAgents(agents)`. */ + fun requestContext(agents: AgentRequestContext) = + requestContext(RequestContext.ofAgents(agents)) /** Alias for calling [requestContext] with `RequestContext.ofCopilot(copilot)`. */ fun requestContext(copilot: CopilotRequestContext) = @@ -230,6 +246,23 @@ private constructor( fun requestContext(standalone: StandaloneRequestContext) = requestContext(RequestContext.ofStandalone(standalone)) + /** + * Alias for calling [requestContext] with the following: + * ```java + * StandaloneRequestContext.builder() + * .source(StandaloneRequestContext.Source.STANDALONE) + * .chirpAiContextObject(chirpAiContextObject) + * .build() + * ``` + */ + fun standaloneRequestContext(chirpAiContextObject: ChirpAiContextObject) = + requestContext( + StandaloneRequestContext.builder() + .source(StandaloneRequestContext.Source.STANDALONE) + .chirpAiContextObject(chirpAiContextObject) + .build() + ) + /** Alias for calling [requestContext] with `RequestContext.ofTest(test)`. */ fun requestContext(test: TestRequestContext) = requestContext(RequestContext.ofTest(test)) @@ -436,7 +469,7 @@ private constructor( class RequestContext private constructor( private val workflows: WorkflowsRequestContext? = null, - private val agent: AgentRequestContext? = null, + private val agents: AgentRequestContext? = null, private val copilot: CopilotRequestContext? = null, private val standalone: StandaloneRequestContext? = null, private val test: TestRequestContext? = null, @@ -445,7 +478,7 @@ private constructor( fun workflows(): Optional = Optional.ofNullable(workflows) - fun agent(): Optional = Optional.ofNullable(agent) + fun agents(): Optional = Optional.ofNullable(agents) fun copilot(): Optional = Optional.ofNullable(copilot) @@ -455,7 +488,7 @@ private constructor( fun isWorkflows(): Boolean = workflows != null - fun isAgent(): Boolean = agent != null + fun isAgents(): Boolean = agents != null fun isCopilot(): Boolean = copilot != null @@ -465,7 +498,7 @@ private constructor( fun asWorkflows(): WorkflowsRequestContext = workflows.getOrThrow("workflows") - fun asAgent(): AgentRequestContext = agent.getOrThrow("agent") + fun asAgents(): AgentRequestContext = agents.getOrThrow("agents") fun asCopilot(): CopilotRequestContext = copilot.getOrThrow("copilot") @@ -507,7 +540,7 @@ private constructor( fun accept(visitor: Visitor): T = when { workflows != null -> visitor.visitWorkflows(workflows) - agent != null -> visitor.visitAgent(agent) + agents != null -> visitor.visitAgents(agents) copilot != null -> visitor.visitCopilot(copilot) standalone != null -> visitor.visitStandalone(standalone) test != null -> visitor.visitTest(test) @@ -536,8 +569,8 @@ private constructor( workflows.validate() } - override fun visitAgent(agent: AgentRequestContext) { - agent.validate() + override fun visitAgents(agents: AgentRequestContext) { + agents.validate() } override fun visitCopilot(copilot: CopilotRequestContext) { @@ -577,7 +610,7 @@ private constructor( override fun visitWorkflows(workflows: WorkflowsRequestContext) = workflows.validity() - override fun visitAgent(agent: AgentRequestContext) = agent.validity() + override fun visitAgents(agents: AgentRequestContext) = agents.validity() override fun visitCopilot(copilot: CopilotRequestContext) = copilot.validity() @@ -597,18 +630,18 @@ private constructor( return other is RequestContext && workflows == other.workflows && - agent == other.agent && + agents == other.agents && copilot == other.copilot && standalone == other.standalone && test == other.test } - override fun hashCode(): Int = Objects.hash(workflows, agent, copilot, standalone, test) + override fun hashCode(): Int = Objects.hash(workflows, agents, copilot, standalone, test) override fun toString(): String = when { workflows != null -> "RequestContext{workflows=$workflows}" - agent != null -> "RequestContext{agent=$agent}" + agents != null -> "RequestContext{agents=$agents}" copilot != null -> "RequestContext{copilot=$copilot}" standalone != null -> "RequestContext{standalone=$standalone}" test != null -> "RequestContext{test=$test}" @@ -622,7 +655,7 @@ private constructor( fun ofWorkflows(workflows: WorkflowsRequestContext) = RequestContext(workflows = workflows) - @JvmStatic fun ofAgent(agent: AgentRequestContext) = RequestContext(agent = agent) + @JvmStatic fun ofAgents(agents: AgentRequestContext) = RequestContext(agents = agents) @JvmStatic fun ofCopilot(copilot: CopilotRequestContext) = RequestContext(copilot = copilot) @@ -642,7 +675,7 @@ private constructor( fun visitWorkflows(workflows: WorkflowsRequestContext): T - fun visitAgent(agent: AgentRequestContext): T + fun visitAgents(agents: AgentRequestContext): T fun visitCopilot(copilot: CopilotRequestContext): T @@ -669,38 +702,37 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): RequestContext { val json = JsonValue.fromJsonNode(node) + val source = json.asObject().getOrNull()?.get("source")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - RequestContext(workflows = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - RequestContext(agent = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - RequestContext(copilot = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - RequestContext(standalone = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - RequestContext(test = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> RequestContext(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (source) { + "WORKFLOWS" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { RequestContext(workflows = it, _json = json) } + ?: RequestContext(_json = json) + } + "AGENTS" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + RequestContext(agents = it, _json = json) + } ?: RequestContext(_json = json) + } + "COPILOT" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + RequestContext(copilot = it, _json = json) + } ?: RequestContext(_json = json) + } + "STANDALONE" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { RequestContext(standalone = it, _json = json) } + ?: RequestContext(_json = json) + } + "TEST" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + RequestContext(test = it, _json = json) + } ?: RequestContext(_json = json) + } } + + return RequestContext(_json = json) } } @@ -713,7 +745,7 @@ private constructor( ) { when { value.workflows != null -> generator.writeObject(value.workflows) - value.agent != null -> generator.writeObject(value.agent) + value.agents != null -> generator.writeObject(value.agents) value.copilot != null -> generator.writeObject(value.copilot) value.standalone != null -> generator.writeObject(value.standalone) value.test != null -> generator.writeObject(value.test) diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/FieldTypeDefinition.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/FieldTypeDefinition.kt index d9daa8c0..5ef431dc 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/FieldTypeDefinition.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/FieldTypeDefinition.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkKnown import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow @@ -433,26 +432,57 @@ private constructor( */ fun schema(schema: JsonField) = apply { this.schema = schema } - /** Alias for calling [schema] with `Schema.ofIntegerField(integerField)`. */ - fun schema(integerField: IntegerFieldSchema) = schema(Schema.ofIntegerField(integerField)) + /** Alias for calling [schema] with `Schema.ofInteger(integer)`. */ + fun schema(integer: IntegerFieldSchema) = schema(Schema.ofInteger(integer)) - /** Alias for calling [schema] with `Schema.ofLongField(longField)`. */ - fun schema(longField: LongFieldSchema) = schema(Schema.ofLongField(longField)) + /** Alias for calling [schema] with `Schema.ofLong(long_)`. */ + fun schema(long_: LongFieldSchema) = schema(Schema.ofLong(long_)) - /** Alias for calling [schema] with `Schema.ofDoubleField(doubleField)`. */ - fun schema(doubleField: DoubleFieldSchema) = schema(Schema.ofDoubleField(doubleField)) + /** Alias for calling [schema] with `Schema.ofDouble(double_)`. */ + fun schema(double_: DoubleFieldSchema) = schema(Schema.ofDouble(double_)) - /** Alias for calling [schema] with `Schema.ofStringField(stringField)`. */ - fun schema(stringField: StringFieldSchema) = schema(Schema.ofStringField(stringField)) + /** Alias for calling [schema] with `Schema.ofString(string)`. */ + fun schema(string: StringFieldSchema) = schema(Schema.ofString(string)) - /** Alias for calling [schema] with `Schema.ofBooleanField(booleanField)`. */ - fun schema(booleanField: BooleanFieldSchema) = schema(Schema.ofBooleanField(booleanField)) + /** Alias for calling [schema] with `Schema.ofBoolean(boolean_)`. */ + fun schema(boolean_: BooleanFieldSchema) = schema(Schema.ofBoolean(boolean_)) - /** Alias for calling [schema] with `Schema.ofArrayField(arrayField)`. */ - fun schema(arrayField: ArrayFieldSchema) = schema(Schema.ofArrayField(arrayField)) + /** Alias for calling [schema] with `Schema.ofArray(array)`. */ + fun schema(array: ArrayFieldSchema) = schema(Schema.ofArray(array)) - /** Alias for calling [schema] with `Schema.ofObjectField(objectField)`. */ - fun schema(objectField: ObjectFieldSchema) = schema(Schema.ofObjectField(objectField)) + /** + * Alias for calling [schema] with the following: + * ```java + * ArrayFieldSchema.builder() + * .type(ArrayFieldSchema.Type.ARRAY) + * .items(items) + * .build() + * ``` + */ + fun arraySchema(items: JsonValue) = + schema( + ArrayFieldSchema.builder().type(ArrayFieldSchema.Type.ARRAY).items(items).build() + ) + + /** Alias for calling [schema] with `Schema.ofObject(object_)`. */ + fun schema(object_: ObjectFieldSchema) = schema(Schema.ofObject(object_)) + + /** + * Alias for calling [schema] with the following: + * ```java + * ObjectFieldSchema.builder() + * .type(ObjectFieldSchema.Type.OBJECT) + * .properties(properties) + * .build() + * ``` + */ + fun objectSchema(properties: JsonValue) = + schema( + ObjectFieldSchema.builder() + .type(ObjectFieldSchema.Type.OBJECT) + .properties(properties) + .build() + ) /** * Specifies the data type of the field, with accepted values like bool, date, datetime, @@ -694,57 +724,57 @@ private constructor( @JsonSerialize(using = Schema.Serializer::class) class Schema private constructor( - private val integerField: IntegerFieldSchema? = null, - private val longField: LongFieldSchema? = null, - private val doubleField: DoubleFieldSchema? = null, - private val stringField: StringFieldSchema? = null, - private val booleanField: BooleanFieldSchema? = null, - private val arrayField: ArrayFieldSchema? = null, - private val objectField: ObjectFieldSchema? = null, + private val integer: IntegerFieldSchema? = null, + private val long_: LongFieldSchema? = null, + private val double_: DoubleFieldSchema? = null, + private val string: StringFieldSchema? = null, + private val boolean_: BooleanFieldSchema? = null, + private val array: ArrayFieldSchema? = null, + private val object_: ObjectFieldSchema? = null, private val _json: JsonValue? = null, ) { - fun integerField(): Optional = Optional.ofNullable(integerField) + fun integer(): Optional = Optional.ofNullable(integer) - fun longField(): Optional = Optional.ofNullable(longField) + fun long_(): Optional = Optional.ofNullable(long_) - fun doubleField(): Optional = Optional.ofNullable(doubleField) + fun double_(): Optional = Optional.ofNullable(double_) - fun stringField(): Optional = Optional.ofNullable(stringField) + fun string(): Optional = Optional.ofNullable(string) - fun booleanField(): Optional = Optional.ofNullable(booleanField) + fun boolean_(): Optional = Optional.ofNullable(boolean_) - fun arrayField(): Optional = Optional.ofNullable(arrayField) + fun array(): Optional = Optional.ofNullable(array) - fun objectField(): Optional = Optional.ofNullable(objectField) + fun object_(): Optional = Optional.ofNullable(object_) - fun isIntegerField(): Boolean = integerField != null + fun isInteger(): Boolean = integer != null - fun isLongField(): Boolean = longField != null + fun isLong(): Boolean = long_ != null - fun isDoubleField(): Boolean = doubleField != null + fun isDouble(): Boolean = double_ != null - fun isStringField(): Boolean = stringField != null + fun isString(): Boolean = string != null - fun isBooleanField(): Boolean = booleanField != null + fun isBoolean(): Boolean = boolean_ != null - fun isArrayField(): Boolean = arrayField != null + fun isArray(): Boolean = array != null - fun isObjectField(): Boolean = objectField != null + fun isObject(): Boolean = object_ != null - fun asIntegerField(): IntegerFieldSchema = integerField.getOrThrow("integerField") + fun asInteger(): IntegerFieldSchema = integer.getOrThrow("integer") - fun asLongField(): LongFieldSchema = longField.getOrThrow("longField") + fun asLong(): LongFieldSchema = long_.getOrThrow("long_") - fun asDoubleField(): DoubleFieldSchema = doubleField.getOrThrow("doubleField") + fun asDouble(): DoubleFieldSchema = double_.getOrThrow("double_") - fun asStringField(): StringFieldSchema = stringField.getOrThrow("stringField") + fun asString(): StringFieldSchema = string.getOrThrow("string") - fun asBooleanField(): BooleanFieldSchema = booleanField.getOrThrow("booleanField") + fun asBoolean(): BooleanFieldSchema = boolean_.getOrThrow("boolean_") - fun asArrayField(): ArrayFieldSchema = arrayField.getOrThrow("arrayField") + fun asArray(): ArrayFieldSchema = array.getOrThrow("array") - fun asObjectField(): ObjectFieldSchema = objectField.getOrThrow("objectField") + fun asObject(): ObjectFieldSchema = object_.getOrThrow("object_") fun _json(): Optional = Optional.ofNullable(_json) @@ -760,8 +790,8 @@ private constructor( * * Optional result = schema.accept(new Schema.Visitor>() { * @Override - * public Optional visitIntegerField(IntegerFieldSchema integerField) { - * return Optional.of(integerField.toString()); + * public Optional visitInteger(IntegerFieldSchema integer) { + * return Optional.of(integer.toString()); * } * * // ... @@ -779,13 +809,13 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - integerField != null -> visitor.visitIntegerField(integerField) - longField != null -> visitor.visitLongField(longField) - doubleField != null -> visitor.visitDoubleField(doubleField) - stringField != null -> visitor.visitStringField(stringField) - booleanField != null -> visitor.visitBooleanField(booleanField) - arrayField != null -> visitor.visitArrayField(arrayField) - objectField != null -> visitor.visitObjectField(objectField) + integer != null -> visitor.visitInteger(integer) + long_ != null -> visitor.visitLong(long_) + double_ != null -> visitor.visitDouble(double_) + string != null -> visitor.visitString(string) + boolean_ != null -> visitor.visitBoolean(boolean_) + array != null -> visitor.visitArray(array) + object_ != null -> visitor.visitObject(object_) else -> visitor.unknown(_json) } @@ -807,32 +837,32 @@ private constructor( accept( object : Visitor { - override fun visitIntegerField(integerField: IntegerFieldSchema) { - integerField.validate() + override fun visitInteger(integer: IntegerFieldSchema) { + integer.validate() } - override fun visitLongField(longField: LongFieldSchema) { - longField.validate() + override fun visitLong(long_: LongFieldSchema) { + long_.validate() } - override fun visitDoubleField(doubleField: DoubleFieldSchema) { - doubleField.validate() + override fun visitDouble(double_: DoubleFieldSchema) { + double_.validate() } - override fun visitStringField(stringField: StringFieldSchema) { - stringField.validate() + override fun visitString(string: StringFieldSchema) { + string.validate() } - override fun visitBooleanField(booleanField: BooleanFieldSchema) { - booleanField.validate() + override fun visitBoolean(boolean_: BooleanFieldSchema) { + boolean_.validate() } - override fun visitArrayField(arrayField: ArrayFieldSchema) { - arrayField.validate() + override fun visitArray(array: ArrayFieldSchema) { + array.validate() } - override fun visitObjectField(objectField: ObjectFieldSchema) { - objectField.validate() + override fun visitObject(object_: ObjectFieldSchema) { + object_.validate() } } ) @@ -857,25 +887,19 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitIntegerField(integerField: IntegerFieldSchema) = - integerField.validity() + override fun visitInteger(integer: IntegerFieldSchema) = integer.validity() - override fun visitLongField(longField: LongFieldSchema) = longField.validity() + override fun visitLong(long_: LongFieldSchema) = long_.validity() - override fun visitDoubleField(doubleField: DoubleFieldSchema) = - doubleField.validity() + override fun visitDouble(double_: DoubleFieldSchema) = double_.validity() - override fun visitStringField(stringField: StringFieldSchema) = - stringField.validity() + override fun visitString(string: StringFieldSchema) = string.validity() - override fun visitBooleanField(booleanField: BooleanFieldSchema) = - booleanField.validity() + override fun visitBoolean(boolean_: BooleanFieldSchema) = boolean_.validity() - override fun visitArrayField(arrayField: ArrayFieldSchema) = - arrayField.validity() + override fun visitArray(array: ArrayFieldSchema) = array.validity() - override fun visitObjectField(objectField: ObjectFieldSchema) = - objectField.validity() + override fun visitObject(object_: ObjectFieldSchema) = object_.validity() override fun unknown(json: JsonValue?) = 0 } @@ -887,80 +911,64 @@ private constructor( } return other is Schema && - integerField == other.integerField && - longField == other.longField && - doubleField == other.doubleField && - stringField == other.stringField && - booleanField == other.booleanField && - arrayField == other.arrayField && - objectField == other.objectField + integer == other.integer && + long_ == other.long_ && + double_ == other.double_ && + string == other.string && + boolean_ == other.boolean_ && + array == other.array && + object_ == other.object_ } override fun hashCode(): Int = - Objects.hash( - integerField, - longField, - doubleField, - stringField, - booleanField, - arrayField, - objectField, - ) + Objects.hash(integer, long_, double_, string, boolean_, array, object_) override fun toString(): String = when { - integerField != null -> "Schema{integerField=$integerField}" - longField != null -> "Schema{longField=$longField}" - doubleField != null -> "Schema{doubleField=$doubleField}" - stringField != null -> "Schema{stringField=$stringField}" - booleanField != null -> "Schema{booleanField=$booleanField}" - arrayField != null -> "Schema{arrayField=$arrayField}" - objectField != null -> "Schema{objectField=$objectField}" + integer != null -> "Schema{integer=$integer}" + long_ != null -> "Schema{long_=$long_}" + double_ != null -> "Schema{double_=$double_}" + string != null -> "Schema{string=$string}" + boolean_ != null -> "Schema{boolean_=$boolean_}" + array != null -> "Schema{array=$array}" + object_ != null -> "Schema{object_=$object_}" _json != null -> "Schema{_unknown=$_json}" else -> throw IllegalStateException("Invalid Schema") } companion object { - @JvmStatic - fun ofIntegerField(integerField: IntegerFieldSchema) = - Schema(integerField = integerField) + @JvmStatic fun ofInteger(integer: IntegerFieldSchema) = Schema(integer = integer) - @JvmStatic fun ofLongField(longField: LongFieldSchema) = Schema(longField = longField) + @JvmStatic fun ofLong(long_: LongFieldSchema) = Schema(long_ = long_) - @JvmStatic - fun ofDoubleField(doubleField: DoubleFieldSchema) = Schema(doubleField = doubleField) + @JvmStatic fun ofDouble(double_: DoubleFieldSchema) = Schema(double_ = double_) - @JvmStatic - fun ofStringField(stringField: StringFieldSchema) = Schema(stringField = stringField) + @JvmStatic fun ofString(string: StringFieldSchema) = Schema(string = string) - @JvmStatic - fun ofBooleanField(booleanField: BooleanFieldSchema) = - Schema(booleanField = booleanField) + @JvmStatic fun ofBoolean(boolean_: BooleanFieldSchema) = Schema(boolean_ = boolean_) - @JvmStatic - fun ofArrayField(arrayField: ArrayFieldSchema) = Schema(arrayField = arrayField) + @JvmStatic fun ofArray(array: ArrayFieldSchema) = Schema(array = array) - @JvmStatic - fun ofObjectField(objectField: ObjectFieldSchema) = Schema(objectField = objectField) + @JvmStatic fun ofObject(object_: ObjectFieldSchema) = Schema(object_ = object_) } /** An interface that defines how to map each variant of [Schema] to a value of type [T]. */ interface Visitor { - fun visitIntegerField(integerField: IntegerFieldSchema): T + fun visitInteger(integer: IntegerFieldSchema): T - fun visitLongField(longField: LongFieldSchema): T + fun visitLong(long_: LongFieldSchema): T - fun visitDoubleField(doubleField: DoubleFieldSchema): T + fun visitDouble(double_: DoubleFieldSchema): T - fun visitStringField(stringField: StringFieldSchema): T + fun visitString(string: StringFieldSchema): T - fun visitBooleanField(booleanField: BooleanFieldSchema): T + fun visitBoolean(boolean_: BooleanFieldSchema): T - fun visitArrayField(arrayField: ArrayFieldSchema): T + fun visitArray(array: ArrayFieldSchema): T - fun visitObjectField(objectField: ObjectFieldSchema): T + fun visitObject(object_: ObjectFieldSchema): T /** * Maps an unknown variant of [Schema] to a value of type [T]. @@ -981,44 +989,47 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Schema { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - Schema(integerField = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Schema(longField = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Schema(doubleField = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Schema(stringField = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Schema(booleanField = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Schema(arrayField = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Schema(objectField = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> Schema(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "INTEGER" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Schema(integer = it, _json = json) + } ?: Schema(_json = json) + } + "LONG" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Schema(long_ = it, _json = json) + } ?: Schema(_json = json) + } + "DOUBLE" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Schema(double_ = it, _json = json) + } ?: Schema(_json = json) + } + "STRING" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Schema(string = it, _json = json) + } ?: Schema(_json = json) + } + "BOOLEAN" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Schema(boolean_ = it, _json = json) + } ?: Schema(_json = json) + } + "ARRAY" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Schema(array = it, _json = json) + } ?: Schema(_json = json) + } + "OBJECT" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Schema(object_ = it, _json = json) + } ?: Schema(_json = json) + } } + + return Schema(_json = json) } } @@ -1030,13 +1041,13 @@ private constructor( provider: SerializerProvider, ) { when { - value.integerField != null -> generator.writeObject(value.integerField) - value.longField != null -> generator.writeObject(value.longField) - value.doubleField != null -> generator.writeObject(value.doubleField) - value.stringField != null -> generator.writeObject(value.stringField) - value.booleanField != null -> generator.writeObject(value.booleanField) - value.arrayField != null -> generator.writeObject(value.arrayField) - value.objectField != null -> generator.writeObject(value.objectField) + value.integer != null -> generator.writeObject(value.integer) + value.long_ != null -> generator.writeObject(value.long_) + value.double_ != null -> generator.writeObject(value.double_) + value.string != null -> generator.writeObject(value.string) + value.boolean_ != null -> generator.writeObject(value.boolean_) + value.array != null -> generator.writeObject(value.array) + value.object_ != null -> generator.writeObject(value.object_) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Schema") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinition.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinition.kt index 0e90c2a3..3fdf9b7d 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinition.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinition.kt @@ -19,7 +19,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkKnown import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow @@ -551,20 +550,20 @@ private constructor( /** * Alias for calling [addInputFieldDependency] with - * `InputFieldDependency.ofPublicSingle(publicSingle)`. + * `InputFieldDependency.ofSingleField(singleField)`. */ - fun addInputFieldDependency(publicSingle: PublicSingleFieldDependency) = - addInputFieldDependency(InputFieldDependency.ofPublicSingle(publicSingle)) + fun addInputFieldDependency(singleField: PublicSingleFieldDependency) = + addInputFieldDependency(InputFieldDependency.ofSingleField(singleField)) /** * Alias for calling [addInputFieldDependency] with - * `InputFieldDependency.ofPublicConditionalSingle(publicConditionalSingle)`. + * `InputFieldDependency.ofConditionalSingleField(conditionalSingleField)`. */ fun addInputFieldDependency( - publicConditionalSingle: PublicConditionalSingleFieldDependency + conditionalSingleField: PublicConditionalSingleFieldDependency ) = addInputFieldDependency( - InputFieldDependency.ofPublicConditionalSingle(publicConditionalSingle) + InputFieldDependency.ofConditionalSingleField(conditionalSingleField) ) fun objectRequestOptions(objectRequestOptions: PublicObjectRequestOptions) = @@ -837,25 +836,24 @@ private constructor( @JsonSerialize(using = InputFieldDependency.Serializer::class) class InputFieldDependency private constructor( - private val publicSingle: PublicSingleFieldDependency? = null, - private val publicConditionalSingle: PublicConditionalSingleFieldDependency? = null, + private val singleField: PublicSingleFieldDependency? = null, + private val conditionalSingleField: PublicConditionalSingleFieldDependency? = null, private val _json: JsonValue? = null, ) { - fun publicSingle(): Optional = - Optional.ofNullable(publicSingle) + fun singleField(): Optional = Optional.ofNullable(singleField) - fun publicConditionalSingle(): Optional = - Optional.ofNullable(publicConditionalSingle) + fun conditionalSingleField(): Optional = + Optional.ofNullable(conditionalSingleField) - fun isPublicSingle(): Boolean = publicSingle != null + fun isSingleField(): Boolean = singleField != null - fun isPublicConditionalSingle(): Boolean = publicConditionalSingle != null + fun isConditionalSingleField(): Boolean = conditionalSingleField != null - fun asPublicSingle(): PublicSingleFieldDependency = publicSingle.getOrThrow("publicSingle") + fun asSingleField(): PublicSingleFieldDependency = singleField.getOrThrow("singleField") - fun asPublicConditionalSingle(): PublicConditionalSingleFieldDependency = - publicConditionalSingle.getOrThrow("publicConditionalSingle") + fun asConditionalSingleField(): PublicConditionalSingleFieldDependency = + conditionalSingleField.getOrThrow("conditionalSingleField") fun _json(): Optional = Optional.ofNullable(_json) @@ -871,8 +869,8 @@ private constructor( * * Optional result = inputFieldDependency.accept(new InputFieldDependency.Visitor>() { * @Override - * public Optional visitPublicSingle(PublicSingleFieldDependency publicSingle) { - * return Optional.of(publicSingle.toString()); + * public Optional visitSingleField(PublicSingleFieldDependency singleField) { + * return Optional.of(singleField.toString()); * } * * // ... @@ -890,9 +888,9 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicSingle != null -> visitor.visitPublicSingle(publicSingle) - publicConditionalSingle != null -> - visitor.visitPublicConditionalSingle(publicConditionalSingle) + singleField != null -> visitor.visitSingleField(singleField) + conditionalSingleField != null -> + visitor.visitConditionalSingleField(conditionalSingleField) else -> visitor.unknown(_json) } @@ -914,14 +912,14 @@ private constructor( accept( object : Visitor { - override fun visitPublicSingle(publicSingle: PublicSingleFieldDependency) { - publicSingle.validate() + override fun visitSingleField(singleField: PublicSingleFieldDependency) { + singleField.validate() } - override fun visitPublicConditionalSingle( - publicConditionalSingle: PublicConditionalSingleFieldDependency + override fun visitConditionalSingleField( + conditionalSingleField: PublicConditionalSingleFieldDependency ) { - publicConditionalSingle.validate() + conditionalSingleField.validate() } } ) @@ -946,12 +944,12 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicSingle(publicSingle: PublicSingleFieldDependency) = - publicSingle.validity() + override fun visitSingleField(singleField: PublicSingleFieldDependency) = + singleField.validity() - override fun visitPublicConditionalSingle( - publicConditionalSingle: PublicConditionalSingleFieldDependency - ) = publicConditionalSingle.validity() + override fun visitConditionalSingleField( + conditionalSingleField: PublicConditionalSingleFieldDependency + ) = conditionalSingleField.validity() override fun unknown(json: JsonValue?) = 0 } @@ -963,17 +961,17 @@ private constructor( } return other is InputFieldDependency && - publicSingle == other.publicSingle && - publicConditionalSingle == other.publicConditionalSingle + singleField == other.singleField && + conditionalSingleField == other.conditionalSingleField } - override fun hashCode(): Int = Objects.hash(publicSingle, publicConditionalSingle) + override fun hashCode(): Int = Objects.hash(singleField, conditionalSingleField) override fun toString(): String = when { - publicSingle != null -> "InputFieldDependency{publicSingle=$publicSingle}" - publicConditionalSingle != null -> - "InputFieldDependency{publicConditionalSingle=$publicConditionalSingle}" + singleField != null -> "InputFieldDependency{singleField=$singleField}" + conditionalSingleField != null -> + "InputFieldDependency{conditionalSingleField=$conditionalSingleField}" _json != null -> "InputFieldDependency{_unknown=$_json}" else -> throw IllegalStateException("Invalid InputFieldDependency") } @@ -981,13 +979,13 @@ private constructor( companion object { @JvmStatic - fun ofPublicSingle(publicSingle: PublicSingleFieldDependency) = - InputFieldDependency(publicSingle = publicSingle) + fun ofSingleField(singleField: PublicSingleFieldDependency) = + InputFieldDependency(singleField = singleField) @JvmStatic - fun ofPublicConditionalSingle( - publicConditionalSingle: PublicConditionalSingleFieldDependency - ) = InputFieldDependency(publicConditionalSingle = publicConditionalSingle) + fun ofConditionalSingleField( + conditionalSingleField: PublicConditionalSingleFieldDependency + ) = InputFieldDependency(conditionalSingleField = conditionalSingleField) } /** @@ -996,10 +994,10 @@ private constructor( */ interface Visitor { - fun visitPublicSingle(publicSingle: PublicSingleFieldDependency): T + fun visitSingleField(singleField: PublicSingleFieldDependency): T - fun visitPublicConditionalSingle( - publicConditionalSingle: PublicConditionalSingleFieldDependency + fun visitConditionalSingleField( + conditionalSingleField: PublicConditionalSingleFieldDependency ): T /** @@ -1022,32 +1020,27 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): InputFieldDependency { val json = JsonValue.fromJsonNode(node) - - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { InputFieldDependency(publicSingle = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - InputFieldDependency(publicConditionalSingle = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> InputFieldDependency(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + val dependencyType = + json.asObject().getOrNull()?.get("dependencyType")?.asString()?.getOrNull() + + when (dependencyType) { + "SINGLE_FIELD" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { InputFieldDependency(singleField = it, _json = json) } + ?: InputFieldDependency(_json = json) + } + "CONDITIONAL_SINGLE_FIELD" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { + InputFieldDependency(conditionalSingleField = it, _json = json) + } ?: InputFieldDependency(_json = json) + } } + + return InputFieldDependency(_json = json) } } @@ -1060,9 +1053,9 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicSingle != null -> generator.writeObject(value.publicSingle) - value.publicConditionalSingle != null -> - generator.writeObject(value.publicConditionalSingle) + value.singleField != null -> generator.writeObject(value.singleField) + value.conditionalSingleField != null -> + generator.writeObject(value.conditionalSingleField) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid InputFieldDependency") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionEgg.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionEgg.kt index 63c47753..0084851f 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionEgg.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionEgg.kt @@ -19,7 +19,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkKnown import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow @@ -501,20 +500,20 @@ private constructor( /** * Alias for calling [addInputFieldDependency] with - * `InputFieldDependency.ofPublicSingle(publicSingle)`. + * `InputFieldDependency.ofSingleField(singleField)`. */ - fun addInputFieldDependency(publicSingle: PublicSingleFieldDependency) = - addInputFieldDependency(InputFieldDependency.ofPublicSingle(publicSingle)) + fun addInputFieldDependency(singleField: PublicSingleFieldDependency) = + addInputFieldDependency(InputFieldDependency.ofSingleField(singleField)) /** * Alias for calling [addInputFieldDependency] with - * `InputFieldDependency.ofPublicConditionalSingle(publicConditionalSingle)`. + * `InputFieldDependency.ofConditionalSingleField(conditionalSingleField)`. */ fun addInputFieldDependency( - publicConditionalSingle: PublicConditionalSingleFieldDependency + conditionalSingleField: PublicConditionalSingleFieldDependency ) = addInputFieldDependency( - InputFieldDependency.ofPublicConditionalSingle(publicConditionalSingle) + InputFieldDependency.ofConditionalSingleField(conditionalSingleField) ) fun objectRequestOptions(objectRequestOptions: PublicObjectRequestOptions) = @@ -780,25 +779,24 @@ private constructor( @JsonSerialize(using = InputFieldDependency.Serializer::class) class InputFieldDependency private constructor( - private val publicSingle: PublicSingleFieldDependency? = null, - private val publicConditionalSingle: PublicConditionalSingleFieldDependency? = null, + private val singleField: PublicSingleFieldDependency? = null, + private val conditionalSingleField: PublicConditionalSingleFieldDependency? = null, private val _json: JsonValue? = null, ) { - fun publicSingle(): Optional = - Optional.ofNullable(publicSingle) + fun singleField(): Optional = Optional.ofNullable(singleField) - fun publicConditionalSingle(): Optional = - Optional.ofNullable(publicConditionalSingle) + fun conditionalSingleField(): Optional = + Optional.ofNullable(conditionalSingleField) - fun isPublicSingle(): Boolean = publicSingle != null + fun isSingleField(): Boolean = singleField != null - fun isPublicConditionalSingle(): Boolean = publicConditionalSingle != null + fun isConditionalSingleField(): Boolean = conditionalSingleField != null - fun asPublicSingle(): PublicSingleFieldDependency = publicSingle.getOrThrow("publicSingle") + fun asSingleField(): PublicSingleFieldDependency = singleField.getOrThrow("singleField") - fun asPublicConditionalSingle(): PublicConditionalSingleFieldDependency = - publicConditionalSingle.getOrThrow("publicConditionalSingle") + fun asConditionalSingleField(): PublicConditionalSingleFieldDependency = + conditionalSingleField.getOrThrow("conditionalSingleField") fun _json(): Optional = Optional.ofNullable(_json) @@ -814,8 +812,8 @@ private constructor( * * Optional result = inputFieldDependency.accept(new InputFieldDependency.Visitor>() { * @Override - * public Optional visitPublicSingle(PublicSingleFieldDependency publicSingle) { - * return Optional.of(publicSingle.toString()); + * public Optional visitSingleField(PublicSingleFieldDependency singleField) { + * return Optional.of(singleField.toString()); * } * * // ... @@ -833,9 +831,9 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicSingle != null -> visitor.visitPublicSingle(publicSingle) - publicConditionalSingle != null -> - visitor.visitPublicConditionalSingle(publicConditionalSingle) + singleField != null -> visitor.visitSingleField(singleField) + conditionalSingleField != null -> + visitor.visitConditionalSingleField(conditionalSingleField) else -> visitor.unknown(_json) } @@ -857,14 +855,14 @@ private constructor( accept( object : Visitor { - override fun visitPublicSingle(publicSingle: PublicSingleFieldDependency) { - publicSingle.validate() + override fun visitSingleField(singleField: PublicSingleFieldDependency) { + singleField.validate() } - override fun visitPublicConditionalSingle( - publicConditionalSingle: PublicConditionalSingleFieldDependency + override fun visitConditionalSingleField( + conditionalSingleField: PublicConditionalSingleFieldDependency ) { - publicConditionalSingle.validate() + conditionalSingleField.validate() } } ) @@ -889,12 +887,12 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicSingle(publicSingle: PublicSingleFieldDependency) = - publicSingle.validity() + override fun visitSingleField(singleField: PublicSingleFieldDependency) = + singleField.validity() - override fun visitPublicConditionalSingle( - publicConditionalSingle: PublicConditionalSingleFieldDependency - ) = publicConditionalSingle.validity() + override fun visitConditionalSingleField( + conditionalSingleField: PublicConditionalSingleFieldDependency + ) = conditionalSingleField.validity() override fun unknown(json: JsonValue?) = 0 } @@ -906,17 +904,17 @@ private constructor( } return other is InputFieldDependency && - publicSingle == other.publicSingle && - publicConditionalSingle == other.publicConditionalSingle + singleField == other.singleField && + conditionalSingleField == other.conditionalSingleField } - override fun hashCode(): Int = Objects.hash(publicSingle, publicConditionalSingle) + override fun hashCode(): Int = Objects.hash(singleField, conditionalSingleField) override fun toString(): String = when { - publicSingle != null -> "InputFieldDependency{publicSingle=$publicSingle}" - publicConditionalSingle != null -> - "InputFieldDependency{publicConditionalSingle=$publicConditionalSingle}" + singleField != null -> "InputFieldDependency{singleField=$singleField}" + conditionalSingleField != null -> + "InputFieldDependency{conditionalSingleField=$conditionalSingleField}" _json != null -> "InputFieldDependency{_unknown=$_json}" else -> throw IllegalStateException("Invalid InputFieldDependency") } @@ -924,13 +922,13 @@ private constructor( companion object { @JvmStatic - fun ofPublicSingle(publicSingle: PublicSingleFieldDependency) = - InputFieldDependency(publicSingle = publicSingle) + fun ofSingleField(singleField: PublicSingleFieldDependency) = + InputFieldDependency(singleField = singleField) @JvmStatic - fun ofPublicConditionalSingle( - publicConditionalSingle: PublicConditionalSingleFieldDependency - ) = InputFieldDependency(publicConditionalSingle = publicConditionalSingle) + fun ofConditionalSingleField( + conditionalSingleField: PublicConditionalSingleFieldDependency + ) = InputFieldDependency(conditionalSingleField = conditionalSingleField) } /** @@ -939,10 +937,10 @@ private constructor( */ interface Visitor { - fun visitPublicSingle(publicSingle: PublicSingleFieldDependency): T + fun visitSingleField(singleField: PublicSingleFieldDependency): T - fun visitPublicConditionalSingle( - publicConditionalSingle: PublicConditionalSingleFieldDependency + fun visitConditionalSingleField( + conditionalSingleField: PublicConditionalSingleFieldDependency ): T /** @@ -965,32 +963,27 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): InputFieldDependency { val json = JsonValue.fromJsonNode(node) - - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { InputFieldDependency(publicSingle = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - InputFieldDependency(publicConditionalSingle = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> InputFieldDependency(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + val dependencyType = + json.asObject().getOrNull()?.get("dependencyType")?.asString()?.getOrNull() + + when (dependencyType) { + "SINGLE_FIELD" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { InputFieldDependency(singleField = it, _json = json) } + ?: InputFieldDependency(_json = json) + } + "CONDITIONAL_SINGLE_FIELD" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { + InputFieldDependency(conditionalSingleField = it, _json = json) + } ?: InputFieldDependency(_json = json) + } } + + return InputFieldDependency(_json = json) } } @@ -1003,9 +996,9 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicSingle != null -> generator.writeObject(value.publicSingle) - value.publicConditionalSingle != null -> - generator.writeObject(value.publicConditionalSingle) + value.singleField != null -> generator.writeObject(value.singleField) + value.conditionalSingleField != null -> + generator.writeObject(value.conditionalSingleField) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid InputFieldDependency") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionPatch.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionPatch.kt index 504eb78e..b855338a 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionPatch.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionPatch.kt @@ -19,7 +19,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkKnown import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.core.toImmutable @@ -339,20 +338,20 @@ private constructor( /** * Alias for calling [addInputFieldDependency] with - * `InputFieldDependency.ofPublicSingle(publicSingle)`. + * `InputFieldDependency.ofSingleField(singleField)`. */ - fun addInputFieldDependency(publicSingle: PublicSingleFieldDependency) = - addInputFieldDependency(InputFieldDependency.ofPublicSingle(publicSingle)) + fun addInputFieldDependency(singleField: PublicSingleFieldDependency) = + addInputFieldDependency(InputFieldDependency.ofSingleField(singleField)) /** * Alias for calling [addInputFieldDependency] with - * `InputFieldDependency.ofPublicConditionalSingle(publicConditionalSingle)`. + * `InputFieldDependency.ofConditionalSingleField(conditionalSingleField)`. */ fun addInputFieldDependency( - publicConditionalSingle: PublicConditionalSingleFieldDependency + conditionalSingleField: PublicConditionalSingleFieldDependency ) = addInputFieldDependency( - InputFieldDependency.ofPublicConditionalSingle(publicConditionalSingle) + InputFieldDependency.ofConditionalSingleField(conditionalSingleField) ) fun inputFields(inputFields: List) = @@ -565,25 +564,24 @@ private constructor( @JsonSerialize(using = InputFieldDependency.Serializer::class) class InputFieldDependency private constructor( - private val publicSingle: PublicSingleFieldDependency? = null, - private val publicConditionalSingle: PublicConditionalSingleFieldDependency? = null, + private val singleField: PublicSingleFieldDependency? = null, + private val conditionalSingleField: PublicConditionalSingleFieldDependency? = null, private val _json: JsonValue? = null, ) { - fun publicSingle(): Optional = - Optional.ofNullable(publicSingle) + fun singleField(): Optional = Optional.ofNullable(singleField) - fun publicConditionalSingle(): Optional = - Optional.ofNullable(publicConditionalSingle) + fun conditionalSingleField(): Optional = + Optional.ofNullable(conditionalSingleField) - fun isPublicSingle(): Boolean = publicSingle != null + fun isSingleField(): Boolean = singleField != null - fun isPublicConditionalSingle(): Boolean = publicConditionalSingle != null + fun isConditionalSingleField(): Boolean = conditionalSingleField != null - fun asPublicSingle(): PublicSingleFieldDependency = publicSingle.getOrThrow("publicSingle") + fun asSingleField(): PublicSingleFieldDependency = singleField.getOrThrow("singleField") - fun asPublicConditionalSingle(): PublicConditionalSingleFieldDependency = - publicConditionalSingle.getOrThrow("publicConditionalSingle") + fun asConditionalSingleField(): PublicConditionalSingleFieldDependency = + conditionalSingleField.getOrThrow("conditionalSingleField") fun _json(): Optional = Optional.ofNullable(_json) @@ -599,8 +597,8 @@ private constructor( * * Optional result = inputFieldDependency.accept(new InputFieldDependency.Visitor>() { * @Override - * public Optional visitPublicSingle(PublicSingleFieldDependency publicSingle) { - * return Optional.of(publicSingle.toString()); + * public Optional visitSingleField(PublicSingleFieldDependency singleField) { + * return Optional.of(singleField.toString()); * } * * // ... @@ -618,9 +616,9 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicSingle != null -> visitor.visitPublicSingle(publicSingle) - publicConditionalSingle != null -> - visitor.visitPublicConditionalSingle(publicConditionalSingle) + singleField != null -> visitor.visitSingleField(singleField) + conditionalSingleField != null -> + visitor.visitConditionalSingleField(conditionalSingleField) else -> visitor.unknown(_json) } @@ -642,14 +640,14 @@ private constructor( accept( object : Visitor { - override fun visitPublicSingle(publicSingle: PublicSingleFieldDependency) { - publicSingle.validate() + override fun visitSingleField(singleField: PublicSingleFieldDependency) { + singleField.validate() } - override fun visitPublicConditionalSingle( - publicConditionalSingle: PublicConditionalSingleFieldDependency + override fun visitConditionalSingleField( + conditionalSingleField: PublicConditionalSingleFieldDependency ) { - publicConditionalSingle.validate() + conditionalSingleField.validate() } } ) @@ -674,12 +672,12 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicSingle(publicSingle: PublicSingleFieldDependency) = - publicSingle.validity() + override fun visitSingleField(singleField: PublicSingleFieldDependency) = + singleField.validity() - override fun visitPublicConditionalSingle( - publicConditionalSingle: PublicConditionalSingleFieldDependency - ) = publicConditionalSingle.validity() + override fun visitConditionalSingleField( + conditionalSingleField: PublicConditionalSingleFieldDependency + ) = conditionalSingleField.validity() override fun unknown(json: JsonValue?) = 0 } @@ -691,17 +689,17 @@ private constructor( } return other is InputFieldDependency && - publicSingle == other.publicSingle && - publicConditionalSingle == other.publicConditionalSingle + singleField == other.singleField && + conditionalSingleField == other.conditionalSingleField } - override fun hashCode(): Int = Objects.hash(publicSingle, publicConditionalSingle) + override fun hashCode(): Int = Objects.hash(singleField, conditionalSingleField) override fun toString(): String = when { - publicSingle != null -> "InputFieldDependency{publicSingle=$publicSingle}" - publicConditionalSingle != null -> - "InputFieldDependency{publicConditionalSingle=$publicConditionalSingle}" + singleField != null -> "InputFieldDependency{singleField=$singleField}" + conditionalSingleField != null -> + "InputFieldDependency{conditionalSingleField=$conditionalSingleField}" _json != null -> "InputFieldDependency{_unknown=$_json}" else -> throw IllegalStateException("Invalid InputFieldDependency") } @@ -709,13 +707,13 @@ private constructor( companion object { @JvmStatic - fun ofPublicSingle(publicSingle: PublicSingleFieldDependency) = - InputFieldDependency(publicSingle = publicSingle) + fun ofSingleField(singleField: PublicSingleFieldDependency) = + InputFieldDependency(singleField = singleField) @JvmStatic - fun ofPublicConditionalSingle( - publicConditionalSingle: PublicConditionalSingleFieldDependency - ) = InputFieldDependency(publicConditionalSingle = publicConditionalSingle) + fun ofConditionalSingleField( + conditionalSingleField: PublicConditionalSingleFieldDependency + ) = InputFieldDependency(conditionalSingleField = conditionalSingleField) } /** @@ -724,10 +722,10 @@ private constructor( */ interface Visitor { - fun visitPublicSingle(publicSingle: PublicSingleFieldDependency): T + fun visitSingleField(singleField: PublicSingleFieldDependency): T - fun visitPublicConditionalSingle( - publicConditionalSingle: PublicConditionalSingleFieldDependency + fun visitConditionalSingleField( + conditionalSingleField: PublicConditionalSingleFieldDependency ): T /** @@ -750,32 +748,27 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): InputFieldDependency { val json = JsonValue.fromJsonNode(node) - - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { InputFieldDependency(publicSingle = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - InputFieldDependency(publicConditionalSingle = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> InputFieldDependency(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + val dependencyType = + json.asObject().getOrNull()?.get("dependencyType")?.asString()?.getOrNull() + + when (dependencyType) { + "SINGLE_FIELD" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { InputFieldDependency(singleField = it, _json = json) } + ?: InputFieldDependency(_json = json) + } + "CONDITIONAL_SINGLE_FIELD" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { + InputFieldDependency(conditionalSingleField = it, _json = json) + } ?: InputFieldDependency(_json = json) + } } + + return InputFieldDependency(_json = json) } } @@ -788,9 +781,9 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicSingle != null -> generator.writeObject(value.publicSingle) - value.publicConditionalSingle != null -> - generator.writeObject(value.publicConditionalSingle) + value.singleField != null -> generator.writeObject(value.singleField) + value.conditionalSingleField != null -> + generator.writeObject(value.conditionalSingleField) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid InputFieldDependency") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/AttachToLangPrimaryRequestVNext.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/AttachToLangPrimaryRequestVNext.kt index 775ff1c0..a9ca6b42 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/AttachToLangPrimaryRequestVNext.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/AttachToLangPrimaryRequestVNext.kt @@ -409,6 +409,10 @@ private constructor( @JvmField val BA = of("ba") + @JvmField val BAL = of("bal") + + @JvmField val BAL_PK = of("bal-pk") + @JvmField val BAS = of("bas") @JvmField val BAS_CM = of("bas-cm") @@ -439,6 +443,10 @@ private constructor( @JvmField val BI = of("bi") + @JvmField val BLO = of("blo") + + @JvmField val BLO_BJ = of("blo-bj") + @JvmField val BM = of("bm") @JvmField val BM_ML = of("bm-ml") @@ -515,6 +523,10 @@ private constructor( @JvmField val CS_CZ = of("cs-cz") + @JvmField val CSW = of("csw") + + @JvmField val CSW_CA = of("csw-ca") + @JvmField val CU = of("cu") @JvmField val CU_RU = of("cu-ru") @@ -645,6 +657,8 @@ private constructor( @JvmField val EN_CY = of("en-cy") + @JvmField val EN_CZ = of("en-cz") + @JvmField val EN_DE = of("en-de") @JvmField val EN_DG = of("en-dg") @@ -683,12 +697,16 @@ private constructor( @JvmField val EN_GM = of("en-gm") + @JvmField val EN_GS = of("en-gs") + @JvmField val EN_GU = of("en-gu") @JvmField val EN_GY = of("en-gy") @JvmField val EN_HK = of("en-hk") + @JvmField val EN_HU = of("en-hu") + @JvmField val EN_ID = of("en-id") @JvmField val EN_IE = of("en-ie") @@ -701,6 +719,8 @@ private constructor( @JvmField val EN_IO = of("en-io") + @JvmField val EN_IT = of("en-it") + @JvmField val EN_JE = of("en-je") @JvmField val EN_JM = of("en-jm") @@ -751,6 +771,8 @@ private constructor( @JvmField val EN_NL = of("en-nl") + @JvmField val EN_NO = of("en-no") + @JvmField val EN_NR = of("en-nr") @JvmField val EN_NU = of("en-nu") @@ -763,6 +785,8 @@ private constructor( @JvmField val EN_PK = of("en-pk") + @JvmField val EN_PL = of("en-pl") + @JvmField val EN_PN = of("en-pn") @JvmField val EN_PR = of("en-pr") @@ -771,6 +795,8 @@ private constructor( @JvmField val EN_PW = of("en-pw") + @JvmField val EN_RO = of("en-ro") + @JvmField val EN_RW = of("en-rw") @JvmField val EN_SB = of("en-sb") @@ -787,6 +813,8 @@ private constructor( @JvmField val EN_SI = of("en-si") + @JvmField val EN_SK = of("en-sk") + @JvmField val EN_SL = of("en-sl") @JvmField val EN_SS = of("en-ss") @@ -1069,6 +1097,10 @@ private constructor( @JvmField val GA_IE = of("ga-ie") + @JvmField val GAA = of("gaa") + + @JvmField val GAA_GH = of("gaa-gh") + @JvmField val GD = of("gd") @JvmField val GD_GB = of("gd-gb") @@ -1135,6 +1167,8 @@ private constructor( @JvmField val HT = of("ht") + @JvmField val HT_HT = of("ht-ht") + @JvmField val HU = of("hu") @JvmField val HU_HU = of("hu-hu") @@ -1155,6 +1189,8 @@ private constructor( @JvmField val IE = of("ie") + @JvmField val IE_EE = of("ie-ee") + @JvmField val IG = of("ig") @JvmField val IG_NG = of("ig-ng") @@ -1265,6 +1301,8 @@ private constructor( @JvmField val KO = of("ko") + @JvmField val KO_CN = of("ko-cn") + @JvmField val KO_KP = of("ko-kp") @JvmField val KO_KR = of("ko-kr") @@ -1301,6 +1339,10 @@ private constructor( @JvmField val KW_GB = of("kw-gb") + @JvmField val KXV = of("kxv") + + @JvmField val KXV_IN = of("kxv-in") + @JvmField val KY = of("ky") @JvmField val KY_KG = of("ky-kg") @@ -1321,10 +1363,18 @@ private constructor( @JvmField val LI = of("li") + @JvmField val LIJ = of("lij") + + @JvmField val LIJ_IT = of("lij-it") + @JvmField val LKT = of("lkt") @JvmField val LKT_US = of("lkt-us") + @JvmField val LMO = of("lmo") + + @JvmField val LMO_IT = of("lmo-it") + @JvmField val LN = of("ln") @JvmField val LN_AO = of("ln-ao") @@ -1517,8 +1567,16 @@ private constructor( @JvmField val NO_NO = of("no-no") + @JvmField val NQO = of("nqo") + + @JvmField val NQO_GN = of("nqo-gn") + @JvmField val NR = of("nr") + @JvmField val NSO = of("nso") + + @JvmField val NSO_ZA = of("nso-za") + @JvmField val NUS = of("nus") @JvmField val NUS_SS = of("nus-ss") @@ -1777,6 +1835,10 @@ private constructor( @JvmField val ST = of("st") + @JvmField val ST_LS = of("st-ls") + + @JvmField val ST_ZA = of("st-za") + @JvmField val SU = of("su") @JvmField val SU_ID = of("su-id") @@ -1801,6 +1863,16 @@ private constructor( @JvmField val SY = of("sy") + @JvmField val SYR = of("syr") + + @JvmField val SYR_IQ = of("syr-iq") + + @JvmField val SYR_SY = of("syr-sy") + + @JvmField val SZL = of("szl") + + @JvmField val SZL_PL = of("szl-pl") + @JvmField val TA = of("ta") @JvmField val TA_IN = of("ta-in") @@ -1843,6 +1915,10 @@ private constructor( @JvmField val TN = of("tn") + @JvmField val TN_BW = of("tn-bw") + + @JvmField val TN_ZA = of("tn-za") + @JvmField val TO = of("to") @JvmField val TO_TO = of("to-to") @@ -1901,10 +1977,18 @@ private constructor( @JvmField val VE = of("ve") + @JvmField val VEC = of("vec") + + @JvmField val VEC_IT = of("vec-it") + @JvmField val VI = of("vi") @JvmField val VI_VN = of("vi-vn") + @JvmField val VMW = of("vmw") + + @JvmField val VMW_MZ = of("vmw-mz") + @JvmField val VO = of("vo") @JvmField val VO_001 = of("vo-001") @@ -1927,6 +2011,10 @@ private constructor( @JvmField val XH_ZA = of("xh-za") + @JvmField val XNR = of("xnr") + + @JvmField val XNR_IN = of("xnr-in") + @JvmField val XOG = of("xog") @JvmField val XOG_UG = of("xog-ug") @@ -1939,6 +2027,8 @@ private constructor( @JvmField val YI_001 = of("yi-001") + @JvmField val YI_UA = of("yi-ua") + @JvmField val YO = of("yo") @JvmField val YO_BJ = of("yo-bj") @@ -1959,8 +2049,12 @@ private constructor( @JvmField val YUE_HK = of("yue-hk") + @JvmField val YUE_MO = of("yue-mo") + @JvmField val ZA = of("za") + @JvmField val ZA_CN = of("za-cn") + @JvmField val ZGH = of("zgh") @JvmField val ZGH_MA = of("zgh-ma") @@ -1977,6 +2071,8 @@ private constructor( @JvmField val ZH_MO = of("zh-mo") + @JvmField val ZH_MY = of("zh-my") + @JvmField val ZH_SG = of("zh-sg") @JvmField val ZH_TW = of("zh-tw") @@ -2045,6 +2141,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -2060,6 +2158,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -2098,6 +2198,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -2163,6 +2265,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -2182,15 +2285,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -2216,16 +2322,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -2234,6 +2343,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -2375,6 +2485,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -2408,6 +2520,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -2418,6 +2531,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -2473,6 +2587,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -2491,6 +2606,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -2501,8 +2618,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -2599,7 +2720,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -2729,6 +2854,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -2741,6 +2868,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -2762,6 +2894,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -2791,8 +2925,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -2804,12 +2942,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -2820,7 +2961,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -2829,6 +2972,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -2900,6 +3044,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -2915,6 +3061,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -2953,6 +3101,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -3018,6 +3168,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -3037,15 +3188,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -3071,16 +3225,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -3089,6 +3246,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -3230,6 +3388,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -3263,6 +3423,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -3273,6 +3434,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -3328,6 +3490,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -3346,6 +3509,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -3356,8 +3521,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -3454,7 +3623,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -3584,6 +3757,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -3596,6 +3771,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -3617,6 +3797,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -3646,8 +3828,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -3659,12 +3845,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -3675,7 +3864,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -3684,6 +3875,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -3756,6 +3948,8 @@ private constructor( AZ -> Value.AZ AZ_AZ -> Value.AZ_AZ BA -> Value.BA + BAL -> Value.BAL + BAL_PK -> Value.BAL_PK BAS -> Value.BAS BAS_CM -> Value.BAS_CM BE -> Value.BE @@ -3771,6 +3965,8 @@ private constructor( BHO -> Value.BHO BHO_IN -> Value.BHO_IN BI -> Value.BI + BLO -> Value.BLO + BLO_BJ -> Value.BLO_BJ BM -> Value.BM BM_ML -> Value.BM_ML BN -> Value.BN @@ -3809,6 +4005,8 @@ private constructor( CR -> Value.CR CS -> Value.CS CS_CZ -> Value.CS_CZ + CSW -> Value.CSW + CSW_CA -> Value.CSW_CA CU -> Value.CU CU_RU -> Value.CU_RU CV -> Value.CV @@ -3874,6 +4072,7 @@ private constructor( EN_CN -> Value.EN_CN EN_CX -> Value.EN_CX EN_CY -> Value.EN_CY + EN_CZ -> Value.EN_CZ EN_DE -> Value.EN_DE EN_DG -> Value.EN_DG EN_DK -> Value.EN_DK @@ -3893,15 +4092,18 @@ private constructor( EN_GH -> Value.EN_GH EN_GI -> Value.EN_GI EN_GM -> Value.EN_GM + EN_GS -> Value.EN_GS EN_GU -> Value.EN_GU EN_GY -> Value.EN_GY EN_HK -> Value.EN_HK + EN_HU -> Value.EN_HU EN_ID -> Value.EN_ID EN_IE -> Value.EN_IE EN_IL -> Value.EN_IL EN_IM -> Value.EN_IM EN_IN -> Value.EN_IN EN_IO -> Value.EN_IO + EN_IT -> Value.EN_IT EN_JE -> Value.EN_JE EN_JM -> Value.EN_JM EN_KE -> Value.EN_KE @@ -3927,16 +4129,19 @@ private constructor( EN_NF -> Value.EN_NF EN_NG -> Value.EN_NG EN_NL -> Value.EN_NL + EN_NO -> Value.EN_NO EN_NR -> Value.EN_NR EN_NU -> Value.EN_NU EN_NZ -> Value.EN_NZ EN_PG -> Value.EN_PG EN_PH -> Value.EN_PH EN_PK -> Value.EN_PK + EN_PL -> Value.EN_PL EN_PN -> Value.EN_PN EN_PR -> Value.EN_PR EN_PT -> Value.EN_PT EN_PW -> Value.EN_PW + EN_RO -> Value.EN_RO EN_RW -> Value.EN_RW EN_SB -> Value.EN_SB EN_SC -> Value.EN_SC @@ -3945,6 +4150,7 @@ private constructor( EN_SG -> Value.EN_SG EN_SH -> Value.EN_SH EN_SI -> Value.EN_SI + EN_SK -> Value.EN_SK EN_SL -> Value.EN_SL EN_SS -> Value.EN_SS EN_SX -> Value.EN_SX @@ -4086,6 +4292,8 @@ private constructor( GA -> Value.GA GA_GB -> Value.GA_GB GA_IE -> Value.GA_IE + GAA -> Value.GAA + GAA_GH -> Value.GAA_GH GD -> Value.GD GD_GB -> Value.GD_GB GL -> Value.GL @@ -4119,6 +4327,7 @@ private constructor( HSB -> Value.HSB HSB_DE -> Value.HSB_DE HT -> Value.HT + HT_HT -> Value.HT_HT HU -> Value.HU HU_HU -> Value.HU_HU HY -> Value.HY @@ -4129,6 +4338,7 @@ private constructor( ID -> Value.ID ID_ID -> Value.ID_ID IE -> Value.IE + IE_EE -> Value.IE_EE IG -> Value.IG IG_NG -> Value.IG_NG II -> Value.II @@ -4184,6 +4394,7 @@ private constructor( KN -> Value.KN KN_IN -> Value.KN_IN KO -> Value.KO + KO_CN -> Value.KO_CN KO_KP -> Value.KO_KP KO_KR -> Value.KO_KR KOK -> Value.KOK @@ -4202,6 +4413,8 @@ private constructor( KV -> Value.KV KW -> Value.KW KW_GB -> Value.KW_GB + KXV -> Value.KXV + KXV_IN -> Value.KXV_IN KY -> Value.KY KY_KG -> Value.KY_KG LA -> Value.LA @@ -4212,8 +4425,12 @@ private constructor( LG -> Value.LG LG_UG -> Value.LG_UG LI -> Value.LI + LIJ -> Value.LIJ + LIJ_IT -> Value.LIJ_IT LKT -> Value.LKT LKT_US -> Value.LKT_US + LMO -> Value.LMO + LMO_IT -> Value.LMO_IT LN -> Value.LN LN_AO -> Value.LN_AO LN_CD -> Value.LN_CD @@ -4310,7 +4527,11 @@ private constructor( NNH_CM -> Value.NNH_CM NO -> Value.NO NO_NO -> Value.NO_NO + NQO -> Value.NQO + NQO_GN -> Value.NQO_GN NR -> Value.NR + NSO -> Value.NSO + NSO_ZA -> Value.NSO_ZA NUS -> Value.NUS NUS_SS -> Value.NUS_SS NV -> Value.NV @@ -4440,6 +4661,8 @@ private constructor( SR_XK -> Value.SR_XK SS -> Value.SS ST -> Value.ST + ST_LS -> Value.ST_LS + ST_ZA -> Value.ST_ZA SU -> Value.SU SU_ID -> Value.SU_ID SV -> Value.SV @@ -4452,6 +4675,11 @@ private constructor( SW_TZ -> Value.SW_TZ SW_UG -> Value.SW_UG SY -> Value.SY + SYR -> Value.SYR + SYR_IQ -> Value.SYR_IQ + SYR_SY -> Value.SYR_SY + SZL -> Value.SZL + SZL_PL -> Value.SZL_PL TA -> Value.TA TA_IN -> Value.TA_IN TA_LK -> Value.TA_LK @@ -4473,6 +4701,8 @@ private constructor( TK_TM -> Value.TK_TM TL -> Value.TL TN -> Value.TN + TN_BW -> Value.TN_BW + TN_ZA -> Value.TN_ZA TO -> Value.TO TO_TO -> Value.TO_TO TOK -> Value.TOK @@ -4502,8 +4732,12 @@ private constructor( VAI -> Value.VAI VAI_LR -> Value.VAI_LR VE -> Value.VE + VEC -> Value.VEC + VEC_IT -> Value.VEC_IT VI -> Value.VI VI_VN -> Value.VI_VN + VMW -> Value.VMW + VMW_MZ -> Value.VMW_MZ VO -> Value.VO VO_001 -> Value.VO_001 VUN -> Value.VUN @@ -4515,12 +4749,15 @@ private constructor( WO_SN -> Value.WO_SN XH -> Value.XH XH_ZA -> Value.XH_ZA + XNR -> Value.XNR + XNR_IN -> Value.XNR_IN XOG -> Value.XOG XOG_UG -> Value.XOG_UG YAV -> Value.YAV YAV_CM -> Value.YAV_CM YI -> Value.YI YI_001 -> Value.YI_001 + YI_UA -> Value.YI_UA YO -> Value.YO YO_BJ -> Value.YO_BJ YO_NG -> Value.YO_NG @@ -4531,7 +4768,9 @@ private constructor( YUE -> Value.YUE YUE_CN -> Value.YUE_CN YUE_HK -> Value.YUE_HK + YUE_MO -> Value.YUE_MO ZA -> Value.ZA + ZA_CN -> Value.ZA_CN ZGH -> Value.ZGH ZGH_MA -> Value.ZGH_MA ZH -> Value.ZH @@ -4540,6 +4779,7 @@ private constructor( ZH_HANT -> Value.ZH_HANT ZH_HK -> Value.ZH_HK ZH_MO -> Value.ZH_MO + ZH_MY -> Value.ZH_MY ZH_SG -> Value.ZH_SG ZH_TW -> Value.ZH_TW ZU -> Value.ZU @@ -4613,6 +4853,8 @@ private constructor( AZ -> Known.AZ AZ_AZ -> Known.AZ_AZ BA -> Known.BA + BAL -> Known.BAL + BAL_PK -> Known.BAL_PK BAS -> Known.BAS BAS_CM -> Known.BAS_CM BE -> Known.BE @@ -4628,6 +4870,8 @@ private constructor( BHO -> Known.BHO BHO_IN -> Known.BHO_IN BI -> Known.BI + BLO -> Known.BLO + BLO_BJ -> Known.BLO_BJ BM -> Known.BM BM_ML -> Known.BM_ML BN -> Known.BN @@ -4666,6 +4910,8 @@ private constructor( CR -> Known.CR CS -> Known.CS CS_CZ -> Known.CS_CZ + CSW -> Known.CSW + CSW_CA -> Known.CSW_CA CU -> Known.CU CU_RU -> Known.CU_RU CV -> Known.CV @@ -4731,6 +4977,7 @@ private constructor( EN_CN -> Known.EN_CN EN_CX -> Known.EN_CX EN_CY -> Known.EN_CY + EN_CZ -> Known.EN_CZ EN_DE -> Known.EN_DE EN_DG -> Known.EN_DG EN_DK -> Known.EN_DK @@ -4750,15 +4997,18 @@ private constructor( EN_GH -> Known.EN_GH EN_GI -> Known.EN_GI EN_GM -> Known.EN_GM + EN_GS -> Known.EN_GS EN_GU -> Known.EN_GU EN_GY -> Known.EN_GY EN_HK -> Known.EN_HK + EN_HU -> Known.EN_HU EN_ID -> Known.EN_ID EN_IE -> Known.EN_IE EN_IL -> Known.EN_IL EN_IM -> Known.EN_IM EN_IN -> Known.EN_IN EN_IO -> Known.EN_IO + EN_IT -> Known.EN_IT EN_JE -> Known.EN_JE EN_JM -> Known.EN_JM EN_KE -> Known.EN_KE @@ -4784,16 +5034,19 @@ private constructor( EN_NF -> Known.EN_NF EN_NG -> Known.EN_NG EN_NL -> Known.EN_NL + EN_NO -> Known.EN_NO EN_NR -> Known.EN_NR EN_NU -> Known.EN_NU EN_NZ -> Known.EN_NZ EN_PG -> Known.EN_PG EN_PH -> Known.EN_PH EN_PK -> Known.EN_PK + EN_PL -> Known.EN_PL EN_PN -> Known.EN_PN EN_PR -> Known.EN_PR EN_PT -> Known.EN_PT EN_PW -> Known.EN_PW + EN_RO -> Known.EN_RO EN_RW -> Known.EN_RW EN_SB -> Known.EN_SB EN_SC -> Known.EN_SC @@ -4802,6 +5055,7 @@ private constructor( EN_SG -> Known.EN_SG EN_SH -> Known.EN_SH EN_SI -> Known.EN_SI + EN_SK -> Known.EN_SK EN_SL -> Known.EN_SL EN_SS -> Known.EN_SS EN_SX -> Known.EN_SX @@ -4943,6 +5197,8 @@ private constructor( GA -> Known.GA GA_GB -> Known.GA_GB GA_IE -> Known.GA_IE + GAA -> Known.GAA + GAA_GH -> Known.GAA_GH GD -> Known.GD GD_GB -> Known.GD_GB GL -> Known.GL @@ -4976,6 +5232,7 @@ private constructor( HSB -> Known.HSB HSB_DE -> Known.HSB_DE HT -> Known.HT + HT_HT -> Known.HT_HT HU -> Known.HU HU_HU -> Known.HU_HU HY -> Known.HY @@ -4986,6 +5243,7 @@ private constructor( ID -> Known.ID ID_ID -> Known.ID_ID IE -> Known.IE + IE_EE -> Known.IE_EE IG -> Known.IG IG_NG -> Known.IG_NG II -> Known.II @@ -5041,6 +5299,7 @@ private constructor( KN -> Known.KN KN_IN -> Known.KN_IN KO -> Known.KO + KO_CN -> Known.KO_CN KO_KP -> Known.KO_KP KO_KR -> Known.KO_KR KOK -> Known.KOK @@ -5059,6 +5318,8 @@ private constructor( KV -> Known.KV KW -> Known.KW KW_GB -> Known.KW_GB + KXV -> Known.KXV + KXV_IN -> Known.KXV_IN KY -> Known.KY KY_KG -> Known.KY_KG LA -> Known.LA @@ -5069,8 +5330,12 @@ private constructor( LG -> Known.LG LG_UG -> Known.LG_UG LI -> Known.LI + LIJ -> Known.LIJ + LIJ_IT -> Known.LIJ_IT LKT -> Known.LKT LKT_US -> Known.LKT_US + LMO -> Known.LMO + LMO_IT -> Known.LMO_IT LN -> Known.LN LN_AO -> Known.LN_AO LN_CD -> Known.LN_CD @@ -5167,7 +5432,11 @@ private constructor( NNH_CM -> Known.NNH_CM NO -> Known.NO NO_NO -> Known.NO_NO + NQO -> Known.NQO + NQO_GN -> Known.NQO_GN NR -> Known.NR + NSO -> Known.NSO + NSO_ZA -> Known.NSO_ZA NUS -> Known.NUS NUS_SS -> Known.NUS_SS NV -> Known.NV @@ -5297,6 +5566,8 @@ private constructor( SR_XK -> Known.SR_XK SS -> Known.SS ST -> Known.ST + ST_LS -> Known.ST_LS + ST_ZA -> Known.ST_ZA SU -> Known.SU SU_ID -> Known.SU_ID SV -> Known.SV @@ -5309,6 +5580,11 @@ private constructor( SW_TZ -> Known.SW_TZ SW_UG -> Known.SW_UG SY -> Known.SY + SYR -> Known.SYR + SYR_IQ -> Known.SYR_IQ + SYR_SY -> Known.SYR_SY + SZL -> Known.SZL + SZL_PL -> Known.SZL_PL TA -> Known.TA TA_IN -> Known.TA_IN TA_LK -> Known.TA_LK @@ -5330,6 +5606,8 @@ private constructor( TK_TM -> Known.TK_TM TL -> Known.TL TN -> Known.TN + TN_BW -> Known.TN_BW + TN_ZA -> Known.TN_ZA TO -> Known.TO TO_TO -> Known.TO_TO TOK -> Known.TOK @@ -5359,8 +5637,12 @@ private constructor( VAI -> Known.VAI VAI_LR -> Known.VAI_LR VE -> Known.VE + VEC -> Known.VEC + VEC_IT -> Known.VEC_IT VI -> Known.VI VI_VN -> Known.VI_VN + VMW -> Known.VMW + VMW_MZ -> Known.VMW_MZ VO -> Known.VO VO_001 -> Known.VO_001 VUN -> Known.VUN @@ -5372,12 +5654,15 @@ private constructor( WO_SN -> Known.WO_SN XH -> Known.XH XH_ZA -> Known.XH_ZA + XNR -> Known.XNR + XNR_IN -> Known.XNR_IN XOG -> Known.XOG XOG_UG -> Known.XOG_UG YAV -> Known.YAV YAV_CM -> Known.YAV_CM YI -> Known.YI YI_001 -> Known.YI_001 + YI_UA -> Known.YI_UA YO -> Known.YO YO_BJ -> Known.YO_BJ YO_NG -> Known.YO_NG @@ -5388,7 +5673,9 @@ private constructor( YUE -> Known.YUE YUE_CN -> Known.YUE_CN YUE_HK -> Known.YUE_HK + YUE_MO -> Known.YUE_MO ZA -> Known.ZA + ZA_CN -> Known.ZA_CN ZGH -> Known.ZGH ZGH_MA -> Known.ZGH_MA ZH -> Known.ZH @@ -5397,6 +5684,7 @@ private constructor( ZH_HANT -> Known.ZH_HANT ZH_HK -> Known.ZH_HK ZH_MO -> Known.ZH_MO + ZH_MY -> Known.ZH_MY ZH_SG -> Known.ZH_SG ZH_TW -> Known.ZH_TW ZU -> Known.ZU @@ -5591,6 +5879,10 @@ private constructor( @JvmField val BA = of("ba") + @JvmField val BAL = of("bal") + + @JvmField val BAL_PK = of("bal-pk") + @JvmField val BAS = of("bas") @JvmField val BAS_CM = of("bas-cm") @@ -5621,6 +5913,10 @@ private constructor( @JvmField val BI = of("bi") + @JvmField val BLO = of("blo") + + @JvmField val BLO_BJ = of("blo-bj") + @JvmField val BM = of("bm") @JvmField val BM_ML = of("bm-ml") @@ -5697,6 +5993,10 @@ private constructor( @JvmField val CS_CZ = of("cs-cz") + @JvmField val CSW = of("csw") + + @JvmField val CSW_CA = of("csw-ca") + @JvmField val CU = of("cu") @JvmField val CU_RU = of("cu-ru") @@ -5827,6 +6127,8 @@ private constructor( @JvmField val EN_CY = of("en-cy") + @JvmField val EN_CZ = of("en-cz") + @JvmField val EN_DE = of("en-de") @JvmField val EN_DG = of("en-dg") @@ -5865,12 +6167,16 @@ private constructor( @JvmField val EN_GM = of("en-gm") + @JvmField val EN_GS = of("en-gs") + @JvmField val EN_GU = of("en-gu") @JvmField val EN_GY = of("en-gy") @JvmField val EN_HK = of("en-hk") + @JvmField val EN_HU = of("en-hu") + @JvmField val EN_ID = of("en-id") @JvmField val EN_IE = of("en-ie") @@ -5883,6 +6189,8 @@ private constructor( @JvmField val EN_IO = of("en-io") + @JvmField val EN_IT = of("en-it") + @JvmField val EN_JE = of("en-je") @JvmField val EN_JM = of("en-jm") @@ -5933,6 +6241,8 @@ private constructor( @JvmField val EN_NL = of("en-nl") + @JvmField val EN_NO = of("en-no") + @JvmField val EN_NR = of("en-nr") @JvmField val EN_NU = of("en-nu") @@ -5945,6 +6255,8 @@ private constructor( @JvmField val EN_PK = of("en-pk") + @JvmField val EN_PL = of("en-pl") + @JvmField val EN_PN = of("en-pn") @JvmField val EN_PR = of("en-pr") @@ -5953,6 +6265,8 @@ private constructor( @JvmField val EN_PW = of("en-pw") + @JvmField val EN_RO = of("en-ro") + @JvmField val EN_RW = of("en-rw") @JvmField val EN_SB = of("en-sb") @@ -5969,6 +6283,8 @@ private constructor( @JvmField val EN_SI = of("en-si") + @JvmField val EN_SK = of("en-sk") + @JvmField val EN_SL = of("en-sl") @JvmField val EN_SS = of("en-ss") @@ -6251,6 +6567,10 @@ private constructor( @JvmField val GA_IE = of("ga-ie") + @JvmField val GAA = of("gaa") + + @JvmField val GAA_GH = of("gaa-gh") + @JvmField val GD = of("gd") @JvmField val GD_GB = of("gd-gb") @@ -6317,6 +6637,8 @@ private constructor( @JvmField val HT = of("ht") + @JvmField val HT_HT = of("ht-ht") + @JvmField val HU = of("hu") @JvmField val HU_HU = of("hu-hu") @@ -6337,6 +6659,8 @@ private constructor( @JvmField val IE = of("ie") + @JvmField val IE_EE = of("ie-ee") + @JvmField val IG = of("ig") @JvmField val IG_NG = of("ig-ng") @@ -6447,6 +6771,8 @@ private constructor( @JvmField val KO = of("ko") + @JvmField val KO_CN = of("ko-cn") + @JvmField val KO_KP = of("ko-kp") @JvmField val KO_KR = of("ko-kr") @@ -6483,6 +6809,10 @@ private constructor( @JvmField val KW_GB = of("kw-gb") + @JvmField val KXV = of("kxv") + + @JvmField val KXV_IN = of("kxv-in") + @JvmField val KY = of("ky") @JvmField val KY_KG = of("ky-kg") @@ -6503,10 +6833,18 @@ private constructor( @JvmField val LI = of("li") + @JvmField val LIJ = of("lij") + + @JvmField val LIJ_IT = of("lij-it") + @JvmField val LKT = of("lkt") @JvmField val LKT_US = of("lkt-us") + @JvmField val LMO = of("lmo") + + @JvmField val LMO_IT = of("lmo-it") + @JvmField val LN = of("ln") @JvmField val LN_AO = of("ln-ao") @@ -6699,8 +7037,16 @@ private constructor( @JvmField val NO_NO = of("no-no") + @JvmField val NQO = of("nqo") + + @JvmField val NQO_GN = of("nqo-gn") + @JvmField val NR = of("nr") + @JvmField val NSO = of("nso") + + @JvmField val NSO_ZA = of("nso-za") + @JvmField val NUS = of("nus") @JvmField val NUS_SS = of("nus-ss") @@ -6959,6 +7305,10 @@ private constructor( @JvmField val ST = of("st") + @JvmField val ST_LS = of("st-ls") + + @JvmField val ST_ZA = of("st-za") + @JvmField val SU = of("su") @JvmField val SU_ID = of("su-id") @@ -6983,6 +7333,16 @@ private constructor( @JvmField val SY = of("sy") + @JvmField val SYR = of("syr") + + @JvmField val SYR_IQ = of("syr-iq") + + @JvmField val SYR_SY = of("syr-sy") + + @JvmField val SZL = of("szl") + + @JvmField val SZL_PL = of("szl-pl") + @JvmField val TA = of("ta") @JvmField val TA_IN = of("ta-in") @@ -7025,6 +7385,10 @@ private constructor( @JvmField val TN = of("tn") + @JvmField val TN_BW = of("tn-bw") + + @JvmField val TN_ZA = of("tn-za") + @JvmField val TO = of("to") @JvmField val TO_TO = of("to-to") @@ -7083,10 +7447,18 @@ private constructor( @JvmField val VE = of("ve") + @JvmField val VEC = of("vec") + + @JvmField val VEC_IT = of("vec-it") + @JvmField val VI = of("vi") @JvmField val VI_VN = of("vi-vn") + @JvmField val VMW = of("vmw") + + @JvmField val VMW_MZ = of("vmw-mz") + @JvmField val VO = of("vo") @JvmField val VO_001 = of("vo-001") @@ -7109,6 +7481,10 @@ private constructor( @JvmField val XH_ZA = of("xh-za") + @JvmField val XNR = of("xnr") + + @JvmField val XNR_IN = of("xnr-in") + @JvmField val XOG = of("xog") @JvmField val XOG_UG = of("xog-ug") @@ -7121,6 +7497,8 @@ private constructor( @JvmField val YI_001 = of("yi-001") + @JvmField val YI_UA = of("yi-ua") + @JvmField val YO = of("yo") @JvmField val YO_BJ = of("yo-bj") @@ -7141,8 +7519,12 @@ private constructor( @JvmField val YUE_HK = of("yue-hk") + @JvmField val YUE_MO = of("yue-mo") + @JvmField val ZA = of("za") + @JvmField val ZA_CN = of("za-cn") + @JvmField val ZGH = of("zgh") @JvmField val ZGH_MA = of("zgh-ma") @@ -7159,6 +7541,8 @@ private constructor( @JvmField val ZH_MO = of("zh-mo") + @JvmField val ZH_MY = of("zh-my") + @JvmField val ZH_SG = of("zh-sg") @JvmField val ZH_TW = of("zh-tw") @@ -7227,6 +7611,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -7242,6 +7628,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -7280,6 +7668,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -7345,6 +7735,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -7364,15 +7755,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -7398,16 +7792,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -7416,6 +7813,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -7557,6 +7955,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -7590,6 +7990,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -7600,6 +8001,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -7655,6 +8057,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -7673,6 +8076,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -7683,8 +8088,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -7781,7 +8190,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -7911,6 +8324,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -7923,6 +8338,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -7944,6 +8364,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -7973,8 +8395,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -7986,12 +8412,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -8002,7 +8431,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -8011,6 +8442,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -8082,6 +8514,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -8097,6 +8531,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -8135,6 +8571,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -8200,6 +8638,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -8219,15 +8658,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -8253,16 +8695,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -8271,6 +8716,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -8412,6 +8858,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -8445,6 +8893,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -8455,6 +8904,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -8510,6 +8960,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -8528,6 +8979,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -8538,8 +8991,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -8636,7 +9093,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -8766,6 +9227,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -8778,6 +9241,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -8799,6 +9267,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -8828,8 +9298,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -8841,12 +9315,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -8857,7 +9334,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -8866,6 +9345,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -8941,6 +9421,8 @@ private constructor( AZ -> Value.AZ AZ_AZ -> Value.AZ_AZ BA -> Value.BA + BAL -> Value.BAL + BAL_PK -> Value.BAL_PK BAS -> Value.BAS BAS_CM -> Value.BAS_CM BE -> Value.BE @@ -8956,6 +9438,8 @@ private constructor( BHO -> Value.BHO BHO_IN -> Value.BHO_IN BI -> Value.BI + BLO -> Value.BLO + BLO_BJ -> Value.BLO_BJ BM -> Value.BM BM_ML -> Value.BM_ML BN -> Value.BN @@ -8994,6 +9478,8 @@ private constructor( CR -> Value.CR CS -> Value.CS CS_CZ -> Value.CS_CZ + CSW -> Value.CSW + CSW_CA -> Value.CSW_CA CU -> Value.CU CU_RU -> Value.CU_RU CV -> Value.CV @@ -9059,6 +9545,7 @@ private constructor( EN_CN -> Value.EN_CN EN_CX -> Value.EN_CX EN_CY -> Value.EN_CY + EN_CZ -> Value.EN_CZ EN_DE -> Value.EN_DE EN_DG -> Value.EN_DG EN_DK -> Value.EN_DK @@ -9078,15 +9565,18 @@ private constructor( EN_GH -> Value.EN_GH EN_GI -> Value.EN_GI EN_GM -> Value.EN_GM + EN_GS -> Value.EN_GS EN_GU -> Value.EN_GU EN_GY -> Value.EN_GY EN_HK -> Value.EN_HK + EN_HU -> Value.EN_HU EN_ID -> Value.EN_ID EN_IE -> Value.EN_IE EN_IL -> Value.EN_IL EN_IM -> Value.EN_IM EN_IN -> Value.EN_IN EN_IO -> Value.EN_IO + EN_IT -> Value.EN_IT EN_JE -> Value.EN_JE EN_JM -> Value.EN_JM EN_KE -> Value.EN_KE @@ -9112,16 +9602,19 @@ private constructor( EN_NF -> Value.EN_NF EN_NG -> Value.EN_NG EN_NL -> Value.EN_NL + EN_NO -> Value.EN_NO EN_NR -> Value.EN_NR EN_NU -> Value.EN_NU EN_NZ -> Value.EN_NZ EN_PG -> Value.EN_PG EN_PH -> Value.EN_PH EN_PK -> Value.EN_PK + EN_PL -> Value.EN_PL EN_PN -> Value.EN_PN EN_PR -> Value.EN_PR EN_PT -> Value.EN_PT EN_PW -> Value.EN_PW + EN_RO -> Value.EN_RO EN_RW -> Value.EN_RW EN_SB -> Value.EN_SB EN_SC -> Value.EN_SC @@ -9130,6 +9623,7 @@ private constructor( EN_SG -> Value.EN_SG EN_SH -> Value.EN_SH EN_SI -> Value.EN_SI + EN_SK -> Value.EN_SK EN_SL -> Value.EN_SL EN_SS -> Value.EN_SS EN_SX -> Value.EN_SX @@ -9271,6 +9765,8 @@ private constructor( GA -> Value.GA GA_GB -> Value.GA_GB GA_IE -> Value.GA_IE + GAA -> Value.GAA + GAA_GH -> Value.GAA_GH GD -> Value.GD GD_GB -> Value.GD_GB GL -> Value.GL @@ -9304,6 +9800,7 @@ private constructor( HSB -> Value.HSB HSB_DE -> Value.HSB_DE HT -> Value.HT + HT_HT -> Value.HT_HT HU -> Value.HU HU_HU -> Value.HU_HU HY -> Value.HY @@ -9314,6 +9811,7 @@ private constructor( ID -> Value.ID ID_ID -> Value.ID_ID IE -> Value.IE + IE_EE -> Value.IE_EE IG -> Value.IG IG_NG -> Value.IG_NG II -> Value.II @@ -9369,6 +9867,7 @@ private constructor( KN -> Value.KN KN_IN -> Value.KN_IN KO -> Value.KO + KO_CN -> Value.KO_CN KO_KP -> Value.KO_KP KO_KR -> Value.KO_KR KOK -> Value.KOK @@ -9387,6 +9886,8 @@ private constructor( KV -> Value.KV KW -> Value.KW KW_GB -> Value.KW_GB + KXV -> Value.KXV + KXV_IN -> Value.KXV_IN KY -> Value.KY KY_KG -> Value.KY_KG LA -> Value.LA @@ -9397,8 +9898,12 @@ private constructor( LG -> Value.LG LG_UG -> Value.LG_UG LI -> Value.LI + LIJ -> Value.LIJ + LIJ_IT -> Value.LIJ_IT LKT -> Value.LKT LKT_US -> Value.LKT_US + LMO -> Value.LMO + LMO_IT -> Value.LMO_IT LN -> Value.LN LN_AO -> Value.LN_AO LN_CD -> Value.LN_CD @@ -9495,7 +10000,11 @@ private constructor( NNH_CM -> Value.NNH_CM NO -> Value.NO NO_NO -> Value.NO_NO + NQO -> Value.NQO + NQO_GN -> Value.NQO_GN NR -> Value.NR + NSO -> Value.NSO + NSO_ZA -> Value.NSO_ZA NUS -> Value.NUS NUS_SS -> Value.NUS_SS NV -> Value.NV @@ -9625,6 +10134,8 @@ private constructor( SR_XK -> Value.SR_XK SS -> Value.SS ST -> Value.ST + ST_LS -> Value.ST_LS + ST_ZA -> Value.ST_ZA SU -> Value.SU SU_ID -> Value.SU_ID SV -> Value.SV @@ -9637,6 +10148,11 @@ private constructor( SW_TZ -> Value.SW_TZ SW_UG -> Value.SW_UG SY -> Value.SY + SYR -> Value.SYR + SYR_IQ -> Value.SYR_IQ + SYR_SY -> Value.SYR_SY + SZL -> Value.SZL + SZL_PL -> Value.SZL_PL TA -> Value.TA TA_IN -> Value.TA_IN TA_LK -> Value.TA_LK @@ -9658,6 +10174,8 @@ private constructor( TK_TM -> Value.TK_TM TL -> Value.TL TN -> Value.TN + TN_BW -> Value.TN_BW + TN_ZA -> Value.TN_ZA TO -> Value.TO TO_TO -> Value.TO_TO TOK -> Value.TOK @@ -9687,8 +10205,12 @@ private constructor( VAI -> Value.VAI VAI_LR -> Value.VAI_LR VE -> Value.VE + VEC -> Value.VEC + VEC_IT -> Value.VEC_IT VI -> Value.VI VI_VN -> Value.VI_VN + VMW -> Value.VMW + VMW_MZ -> Value.VMW_MZ VO -> Value.VO VO_001 -> Value.VO_001 VUN -> Value.VUN @@ -9700,12 +10222,15 @@ private constructor( WO_SN -> Value.WO_SN XH -> Value.XH XH_ZA -> Value.XH_ZA + XNR -> Value.XNR + XNR_IN -> Value.XNR_IN XOG -> Value.XOG XOG_UG -> Value.XOG_UG YAV -> Value.YAV YAV_CM -> Value.YAV_CM YI -> Value.YI YI_001 -> Value.YI_001 + YI_UA -> Value.YI_UA YO -> Value.YO YO_BJ -> Value.YO_BJ YO_NG -> Value.YO_NG @@ -9716,7 +10241,9 @@ private constructor( YUE -> Value.YUE YUE_CN -> Value.YUE_CN YUE_HK -> Value.YUE_HK + YUE_MO -> Value.YUE_MO ZA -> Value.ZA + ZA_CN -> Value.ZA_CN ZGH -> Value.ZGH ZGH_MA -> Value.ZGH_MA ZH -> Value.ZH @@ -9725,6 +10252,7 @@ private constructor( ZH_HANT -> Value.ZH_HANT ZH_HK -> Value.ZH_HK ZH_MO -> Value.ZH_MO + ZH_MY -> Value.ZH_MY ZH_SG -> Value.ZH_SG ZH_TW -> Value.ZH_TW ZU -> Value.ZU @@ -9798,6 +10326,8 @@ private constructor( AZ -> Known.AZ AZ_AZ -> Known.AZ_AZ BA -> Known.BA + BAL -> Known.BAL + BAL_PK -> Known.BAL_PK BAS -> Known.BAS BAS_CM -> Known.BAS_CM BE -> Known.BE @@ -9813,6 +10343,8 @@ private constructor( BHO -> Known.BHO BHO_IN -> Known.BHO_IN BI -> Known.BI + BLO -> Known.BLO + BLO_BJ -> Known.BLO_BJ BM -> Known.BM BM_ML -> Known.BM_ML BN -> Known.BN @@ -9851,6 +10383,8 @@ private constructor( CR -> Known.CR CS -> Known.CS CS_CZ -> Known.CS_CZ + CSW -> Known.CSW + CSW_CA -> Known.CSW_CA CU -> Known.CU CU_RU -> Known.CU_RU CV -> Known.CV @@ -9916,6 +10450,7 @@ private constructor( EN_CN -> Known.EN_CN EN_CX -> Known.EN_CX EN_CY -> Known.EN_CY + EN_CZ -> Known.EN_CZ EN_DE -> Known.EN_DE EN_DG -> Known.EN_DG EN_DK -> Known.EN_DK @@ -9935,15 +10470,18 @@ private constructor( EN_GH -> Known.EN_GH EN_GI -> Known.EN_GI EN_GM -> Known.EN_GM + EN_GS -> Known.EN_GS EN_GU -> Known.EN_GU EN_GY -> Known.EN_GY EN_HK -> Known.EN_HK + EN_HU -> Known.EN_HU EN_ID -> Known.EN_ID EN_IE -> Known.EN_IE EN_IL -> Known.EN_IL EN_IM -> Known.EN_IM EN_IN -> Known.EN_IN EN_IO -> Known.EN_IO + EN_IT -> Known.EN_IT EN_JE -> Known.EN_JE EN_JM -> Known.EN_JM EN_KE -> Known.EN_KE @@ -9969,16 +10507,19 @@ private constructor( EN_NF -> Known.EN_NF EN_NG -> Known.EN_NG EN_NL -> Known.EN_NL + EN_NO -> Known.EN_NO EN_NR -> Known.EN_NR EN_NU -> Known.EN_NU EN_NZ -> Known.EN_NZ EN_PG -> Known.EN_PG EN_PH -> Known.EN_PH EN_PK -> Known.EN_PK + EN_PL -> Known.EN_PL EN_PN -> Known.EN_PN EN_PR -> Known.EN_PR EN_PT -> Known.EN_PT EN_PW -> Known.EN_PW + EN_RO -> Known.EN_RO EN_RW -> Known.EN_RW EN_SB -> Known.EN_SB EN_SC -> Known.EN_SC @@ -9987,6 +10528,7 @@ private constructor( EN_SG -> Known.EN_SG EN_SH -> Known.EN_SH EN_SI -> Known.EN_SI + EN_SK -> Known.EN_SK EN_SL -> Known.EN_SL EN_SS -> Known.EN_SS EN_SX -> Known.EN_SX @@ -10128,6 +10670,8 @@ private constructor( GA -> Known.GA GA_GB -> Known.GA_GB GA_IE -> Known.GA_IE + GAA -> Known.GAA + GAA_GH -> Known.GAA_GH GD -> Known.GD GD_GB -> Known.GD_GB GL -> Known.GL @@ -10161,6 +10705,7 @@ private constructor( HSB -> Known.HSB HSB_DE -> Known.HSB_DE HT -> Known.HT + HT_HT -> Known.HT_HT HU -> Known.HU HU_HU -> Known.HU_HU HY -> Known.HY @@ -10171,6 +10716,7 @@ private constructor( ID -> Known.ID ID_ID -> Known.ID_ID IE -> Known.IE + IE_EE -> Known.IE_EE IG -> Known.IG IG_NG -> Known.IG_NG II -> Known.II @@ -10226,6 +10772,7 @@ private constructor( KN -> Known.KN KN_IN -> Known.KN_IN KO -> Known.KO + KO_CN -> Known.KO_CN KO_KP -> Known.KO_KP KO_KR -> Known.KO_KR KOK -> Known.KOK @@ -10244,6 +10791,8 @@ private constructor( KV -> Known.KV KW -> Known.KW KW_GB -> Known.KW_GB + KXV -> Known.KXV + KXV_IN -> Known.KXV_IN KY -> Known.KY KY_KG -> Known.KY_KG LA -> Known.LA @@ -10254,8 +10803,12 @@ private constructor( LG -> Known.LG LG_UG -> Known.LG_UG LI -> Known.LI + LIJ -> Known.LIJ + LIJ_IT -> Known.LIJ_IT LKT -> Known.LKT LKT_US -> Known.LKT_US + LMO -> Known.LMO + LMO_IT -> Known.LMO_IT LN -> Known.LN LN_AO -> Known.LN_AO LN_CD -> Known.LN_CD @@ -10352,7 +10905,11 @@ private constructor( NNH_CM -> Known.NNH_CM NO -> Known.NO NO_NO -> Known.NO_NO + NQO -> Known.NQO + NQO_GN -> Known.NQO_GN NR -> Known.NR + NSO -> Known.NSO + NSO_ZA -> Known.NSO_ZA NUS -> Known.NUS NUS_SS -> Known.NUS_SS NV -> Known.NV @@ -10482,6 +11039,8 @@ private constructor( SR_XK -> Known.SR_XK SS -> Known.SS ST -> Known.ST + ST_LS -> Known.ST_LS + ST_ZA -> Known.ST_ZA SU -> Known.SU SU_ID -> Known.SU_ID SV -> Known.SV @@ -10494,6 +11053,11 @@ private constructor( SW_TZ -> Known.SW_TZ SW_UG -> Known.SW_UG SY -> Known.SY + SYR -> Known.SYR + SYR_IQ -> Known.SYR_IQ + SYR_SY -> Known.SYR_SY + SZL -> Known.SZL + SZL_PL -> Known.SZL_PL TA -> Known.TA TA_IN -> Known.TA_IN TA_LK -> Known.TA_LK @@ -10515,6 +11079,8 @@ private constructor( TK_TM -> Known.TK_TM TL -> Known.TL TN -> Known.TN + TN_BW -> Known.TN_BW + TN_ZA -> Known.TN_ZA TO -> Known.TO TO_TO -> Known.TO_TO TOK -> Known.TOK @@ -10544,8 +11110,12 @@ private constructor( VAI -> Known.VAI VAI_LR -> Known.VAI_LR VE -> Known.VE + VEC -> Known.VEC + VEC_IT -> Known.VEC_IT VI -> Known.VI VI_VN -> Known.VI_VN + VMW -> Known.VMW + VMW_MZ -> Known.VMW_MZ VO -> Known.VO VO_001 -> Known.VO_001 VUN -> Known.VUN @@ -10557,12 +11127,15 @@ private constructor( WO_SN -> Known.WO_SN XH -> Known.XH XH_ZA -> Known.XH_ZA + XNR -> Known.XNR + XNR_IN -> Known.XNR_IN XOG -> Known.XOG XOG_UG -> Known.XOG_UG YAV -> Known.YAV YAV_CM -> Known.YAV_CM YI -> Known.YI YI_001 -> Known.YI_001 + YI_UA -> Known.YI_UA YO -> Known.YO YO_BJ -> Known.YO_BJ YO_NG -> Known.YO_NG @@ -10573,7 +11146,9 @@ private constructor( YUE -> Known.YUE YUE_CN -> Known.YUE_CN YUE_HK -> Known.YUE_HK + YUE_MO -> Known.YUE_MO ZA -> Known.ZA + ZA_CN -> Known.ZA_CN ZGH -> Known.ZGH ZGH_MA -> Known.ZGH_MA ZH -> Known.ZH @@ -10582,6 +11157,7 @@ private constructor( ZH_HANT -> Known.ZH_HANT ZH_HK -> Known.ZH_HK ZH_MO -> Known.ZH_MO + ZH_MY -> Known.ZH_MY ZH_SG -> Known.ZH_SG ZH_TW -> Known.ZH_TW ZU -> Known.ZU diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/blogs/authors/BlogAuthor.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/blogs/authors/BlogAuthor.kt index 8c99db0c..d5ab6055 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/blogs/authors/BlogAuthor.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/blogs/authors/BlogAuthor.kt @@ -913,6 +913,10 @@ private constructor( @JvmField val BA = of("ba") + @JvmField val BAL = of("bal") + + @JvmField val BAL_PK = of("bal-pk") + @JvmField val BAS = of("bas") @JvmField val BAS_CM = of("bas-cm") @@ -943,6 +947,10 @@ private constructor( @JvmField val BI = of("bi") + @JvmField val BLO = of("blo") + + @JvmField val BLO_BJ = of("blo-bj") + @JvmField val BM = of("bm") @JvmField val BM_ML = of("bm-ml") @@ -1019,6 +1027,10 @@ private constructor( @JvmField val CS_CZ = of("cs-cz") + @JvmField val CSW = of("csw") + + @JvmField val CSW_CA = of("csw-ca") + @JvmField val CU = of("cu") @JvmField val CU_RU = of("cu-ru") @@ -1149,6 +1161,8 @@ private constructor( @JvmField val EN_CY = of("en-cy") + @JvmField val EN_CZ = of("en-cz") + @JvmField val EN_DE = of("en-de") @JvmField val EN_DG = of("en-dg") @@ -1187,12 +1201,16 @@ private constructor( @JvmField val EN_GM = of("en-gm") + @JvmField val EN_GS = of("en-gs") + @JvmField val EN_GU = of("en-gu") @JvmField val EN_GY = of("en-gy") @JvmField val EN_HK = of("en-hk") + @JvmField val EN_HU = of("en-hu") + @JvmField val EN_ID = of("en-id") @JvmField val EN_IE = of("en-ie") @@ -1205,6 +1223,8 @@ private constructor( @JvmField val EN_IO = of("en-io") + @JvmField val EN_IT = of("en-it") + @JvmField val EN_JE = of("en-je") @JvmField val EN_JM = of("en-jm") @@ -1255,6 +1275,8 @@ private constructor( @JvmField val EN_NL = of("en-nl") + @JvmField val EN_NO = of("en-no") + @JvmField val EN_NR = of("en-nr") @JvmField val EN_NU = of("en-nu") @@ -1267,6 +1289,8 @@ private constructor( @JvmField val EN_PK = of("en-pk") + @JvmField val EN_PL = of("en-pl") + @JvmField val EN_PN = of("en-pn") @JvmField val EN_PR = of("en-pr") @@ -1275,6 +1299,8 @@ private constructor( @JvmField val EN_PW = of("en-pw") + @JvmField val EN_RO = of("en-ro") + @JvmField val EN_RW = of("en-rw") @JvmField val EN_SB = of("en-sb") @@ -1291,6 +1317,8 @@ private constructor( @JvmField val EN_SI = of("en-si") + @JvmField val EN_SK = of("en-sk") + @JvmField val EN_SL = of("en-sl") @JvmField val EN_SS = of("en-ss") @@ -1573,6 +1601,10 @@ private constructor( @JvmField val GA_IE = of("ga-ie") + @JvmField val GAA = of("gaa") + + @JvmField val GAA_GH = of("gaa-gh") + @JvmField val GD = of("gd") @JvmField val GD_GB = of("gd-gb") @@ -1639,6 +1671,8 @@ private constructor( @JvmField val HT = of("ht") + @JvmField val HT_HT = of("ht-ht") + @JvmField val HU = of("hu") @JvmField val HU_HU = of("hu-hu") @@ -1659,6 +1693,8 @@ private constructor( @JvmField val IE = of("ie") + @JvmField val IE_EE = of("ie-ee") + @JvmField val IG = of("ig") @JvmField val IG_NG = of("ig-ng") @@ -1769,6 +1805,8 @@ private constructor( @JvmField val KO = of("ko") + @JvmField val KO_CN = of("ko-cn") + @JvmField val KO_KP = of("ko-kp") @JvmField val KO_KR = of("ko-kr") @@ -1805,6 +1843,10 @@ private constructor( @JvmField val KW_GB = of("kw-gb") + @JvmField val KXV = of("kxv") + + @JvmField val KXV_IN = of("kxv-in") + @JvmField val KY = of("ky") @JvmField val KY_KG = of("ky-kg") @@ -1825,10 +1867,18 @@ private constructor( @JvmField val LI = of("li") + @JvmField val LIJ = of("lij") + + @JvmField val LIJ_IT = of("lij-it") + @JvmField val LKT = of("lkt") @JvmField val LKT_US = of("lkt-us") + @JvmField val LMO = of("lmo") + + @JvmField val LMO_IT = of("lmo-it") + @JvmField val LN = of("ln") @JvmField val LN_AO = of("ln-ao") @@ -2021,8 +2071,16 @@ private constructor( @JvmField val NO_NO = of("no-no") + @JvmField val NQO = of("nqo") + + @JvmField val NQO_GN = of("nqo-gn") + @JvmField val NR = of("nr") + @JvmField val NSO = of("nso") + + @JvmField val NSO_ZA = of("nso-za") + @JvmField val NUS = of("nus") @JvmField val NUS_SS = of("nus-ss") @@ -2281,6 +2339,10 @@ private constructor( @JvmField val ST = of("st") + @JvmField val ST_LS = of("st-ls") + + @JvmField val ST_ZA = of("st-za") + @JvmField val SU = of("su") @JvmField val SU_ID = of("su-id") @@ -2305,6 +2367,16 @@ private constructor( @JvmField val SY = of("sy") + @JvmField val SYR = of("syr") + + @JvmField val SYR_IQ = of("syr-iq") + + @JvmField val SYR_SY = of("syr-sy") + + @JvmField val SZL = of("szl") + + @JvmField val SZL_PL = of("szl-pl") + @JvmField val TA = of("ta") @JvmField val TA_IN = of("ta-in") @@ -2347,6 +2419,10 @@ private constructor( @JvmField val TN = of("tn") + @JvmField val TN_BW = of("tn-bw") + + @JvmField val TN_ZA = of("tn-za") + @JvmField val TO = of("to") @JvmField val TO_TO = of("to-to") @@ -2405,10 +2481,18 @@ private constructor( @JvmField val VE = of("ve") + @JvmField val VEC = of("vec") + + @JvmField val VEC_IT = of("vec-it") + @JvmField val VI = of("vi") @JvmField val VI_VN = of("vi-vn") + @JvmField val VMW = of("vmw") + + @JvmField val VMW_MZ = of("vmw-mz") + @JvmField val VO = of("vo") @JvmField val VO_001 = of("vo-001") @@ -2431,6 +2515,10 @@ private constructor( @JvmField val XH_ZA = of("xh-za") + @JvmField val XNR = of("xnr") + + @JvmField val XNR_IN = of("xnr-in") + @JvmField val XOG = of("xog") @JvmField val XOG_UG = of("xog-ug") @@ -2443,6 +2531,8 @@ private constructor( @JvmField val YI_001 = of("yi-001") + @JvmField val YI_UA = of("yi-ua") + @JvmField val YO = of("yo") @JvmField val YO_BJ = of("yo-bj") @@ -2463,8 +2553,12 @@ private constructor( @JvmField val YUE_HK = of("yue-hk") + @JvmField val YUE_MO = of("yue-mo") + @JvmField val ZA = of("za") + @JvmField val ZA_CN = of("za-cn") + @JvmField val ZGH = of("zgh") @JvmField val ZGH_MA = of("zgh-ma") @@ -2481,6 +2575,8 @@ private constructor( @JvmField val ZH_MO = of("zh-mo") + @JvmField val ZH_MY = of("zh-my") + @JvmField val ZH_SG = of("zh-sg") @JvmField val ZH_TW = of("zh-tw") @@ -2549,6 +2645,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -2564,6 +2662,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -2602,6 +2702,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -2667,6 +2769,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -2686,15 +2789,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -2720,16 +2826,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -2738,6 +2847,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -2879,6 +2989,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -2912,6 +3024,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -2922,6 +3035,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -2977,6 +3091,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -2995,6 +3110,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -3005,8 +3122,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -3103,7 +3224,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -3233,6 +3358,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -3245,6 +3372,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -3266,6 +3398,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -3295,8 +3429,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -3308,12 +3446,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -3324,7 +3465,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -3333,6 +3476,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -3404,6 +3548,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -3419,6 +3565,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -3457,6 +3605,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -3522,6 +3672,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -3541,15 +3692,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -3575,16 +3729,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -3593,6 +3750,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -3734,6 +3892,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -3767,6 +3927,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -3777,6 +3938,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -3832,6 +3994,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -3850,6 +4013,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -3860,8 +4025,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -3958,7 +4127,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -4088,6 +4261,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -4100,6 +4275,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -4121,6 +4301,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -4150,8 +4332,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -4163,12 +4349,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -4179,7 +4368,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -4188,6 +4379,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -4260,6 +4452,8 @@ private constructor( AZ -> Value.AZ AZ_AZ -> Value.AZ_AZ BA -> Value.BA + BAL -> Value.BAL + BAL_PK -> Value.BAL_PK BAS -> Value.BAS BAS_CM -> Value.BAS_CM BE -> Value.BE @@ -4275,6 +4469,8 @@ private constructor( BHO -> Value.BHO BHO_IN -> Value.BHO_IN BI -> Value.BI + BLO -> Value.BLO + BLO_BJ -> Value.BLO_BJ BM -> Value.BM BM_ML -> Value.BM_ML BN -> Value.BN @@ -4313,6 +4509,8 @@ private constructor( CR -> Value.CR CS -> Value.CS CS_CZ -> Value.CS_CZ + CSW -> Value.CSW + CSW_CA -> Value.CSW_CA CU -> Value.CU CU_RU -> Value.CU_RU CV -> Value.CV @@ -4378,6 +4576,7 @@ private constructor( EN_CN -> Value.EN_CN EN_CX -> Value.EN_CX EN_CY -> Value.EN_CY + EN_CZ -> Value.EN_CZ EN_DE -> Value.EN_DE EN_DG -> Value.EN_DG EN_DK -> Value.EN_DK @@ -4397,15 +4596,18 @@ private constructor( EN_GH -> Value.EN_GH EN_GI -> Value.EN_GI EN_GM -> Value.EN_GM + EN_GS -> Value.EN_GS EN_GU -> Value.EN_GU EN_GY -> Value.EN_GY EN_HK -> Value.EN_HK + EN_HU -> Value.EN_HU EN_ID -> Value.EN_ID EN_IE -> Value.EN_IE EN_IL -> Value.EN_IL EN_IM -> Value.EN_IM EN_IN -> Value.EN_IN EN_IO -> Value.EN_IO + EN_IT -> Value.EN_IT EN_JE -> Value.EN_JE EN_JM -> Value.EN_JM EN_KE -> Value.EN_KE @@ -4431,16 +4633,19 @@ private constructor( EN_NF -> Value.EN_NF EN_NG -> Value.EN_NG EN_NL -> Value.EN_NL + EN_NO -> Value.EN_NO EN_NR -> Value.EN_NR EN_NU -> Value.EN_NU EN_NZ -> Value.EN_NZ EN_PG -> Value.EN_PG EN_PH -> Value.EN_PH EN_PK -> Value.EN_PK + EN_PL -> Value.EN_PL EN_PN -> Value.EN_PN EN_PR -> Value.EN_PR EN_PT -> Value.EN_PT EN_PW -> Value.EN_PW + EN_RO -> Value.EN_RO EN_RW -> Value.EN_RW EN_SB -> Value.EN_SB EN_SC -> Value.EN_SC @@ -4449,6 +4654,7 @@ private constructor( EN_SG -> Value.EN_SG EN_SH -> Value.EN_SH EN_SI -> Value.EN_SI + EN_SK -> Value.EN_SK EN_SL -> Value.EN_SL EN_SS -> Value.EN_SS EN_SX -> Value.EN_SX @@ -4590,6 +4796,8 @@ private constructor( GA -> Value.GA GA_GB -> Value.GA_GB GA_IE -> Value.GA_IE + GAA -> Value.GAA + GAA_GH -> Value.GAA_GH GD -> Value.GD GD_GB -> Value.GD_GB GL -> Value.GL @@ -4623,6 +4831,7 @@ private constructor( HSB -> Value.HSB HSB_DE -> Value.HSB_DE HT -> Value.HT + HT_HT -> Value.HT_HT HU -> Value.HU HU_HU -> Value.HU_HU HY -> Value.HY @@ -4633,6 +4842,7 @@ private constructor( ID -> Value.ID ID_ID -> Value.ID_ID IE -> Value.IE + IE_EE -> Value.IE_EE IG -> Value.IG IG_NG -> Value.IG_NG II -> Value.II @@ -4688,6 +4898,7 @@ private constructor( KN -> Value.KN KN_IN -> Value.KN_IN KO -> Value.KO + KO_CN -> Value.KO_CN KO_KP -> Value.KO_KP KO_KR -> Value.KO_KR KOK -> Value.KOK @@ -4706,6 +4917,8 @@ private constructor( KV -> Value.KV KW -> Value.KW KW_GB -> Value.KW_GB + KXV -> Value.KXV + KXV_IN -> Value.KXV_IN KY -> Value.KY KY_KG -> Value.KY_KG LA -> Value.LA @@ -4716,8 +4929,12 @@ private constructor( LG -> Value.LG LG_UG -> Value.LG_UG LI -> Value.LI + LIJ -> Value.LIJ + LIJ_IT -> Value.LIJ_IT LKT -> Value.LKT LKT_US -> Value.LKT_US + LMO -> Value.LMO + LMO_IT -> Value.LMO_IT LN -> Value.LN LN_AO -> Value.LN_AO LN_CD -> Value.LN_CD @@ -4814,7 +5031,11 @@ private constructor( NNH_CM -> Value.NNH_CM NO -> Value.NO NO_NO -> Value.NO_NO + NQO -> Value.NQO + NQO_GN -> Value.NQO_GN NR -> Value.NR + NSO -> Value.NSO + NSO_ZA -> Value.NSO_ZA NUS -> Value.NUS NUS_SS -> Value.NUS_SS NV -> Value.NV @@ -4944,6 +5165,8 @@ private constructor( SR_XK -> Value.SR_XK SS -> Value.SS ST -> Value.ST + ST_LS -> Value.ST_LS + ST_ZA -> Value.ST_ZA SU -> Value.SU SU_ID -> Value.SU_ID SV -> Value.SV @@ -4956,6 +5179,11 @@ private constructor( SW_TZ -> Value.SW_TZ SW_UG -> Value.SW_UG SY -> Value.SY + SYR -> Value.SYR + SYR_IQ -> Value.SYR_IQ + SYR_SY -> Value.SYR_SY + SZL -> Value.SZL + SZL_PL -> Value.SZL_PL TA -> Value.TA TA_IN -> Value.TA_IN TA_LK -> Value.TA_LK @@ -4977,6 +5205,8 @@ private constructor( TK_TM -> Value.TK_TM TL -> Value.TL TN -> Value.TN + TN_BW -> Value.TN_BW + TN_ZA -> Value.TN_ZA TO -> Value.TO TO_TO -> Value.TO_TO TOK -> Value.TOK @@ -5006,8 +5236,12 @@ private constructor( VAI -> Value.VAI VAI_LR -> Value.VAI_LR VE -> Value.VE + VEC -> Value.VEC + VEC_IT -> Value.VEC_IT VI -> Value.VI VI_VN -> Value.VI_VN + VMW -> Value.VMW + VMW_MZ -> Value.VMW_MZ VO -> Value.VO VO_001 -> Value.VO_001 VUN -> Value.VUN @@ -5019,12 +5253,15 @@ private constructor( WO_SN -> Value.WO_SN XH -> Value.XH XH_ZA -> Value.XH_ZA + XNR -> Value.XNR + XNR_IN -> Value.XNR_IN XOG -> Value.XOG XOG_UG -> Value.XOG_UG YAV -> Value.YAV YAV_CM -> Value.YAV_CM YI -> Value.YI YI_001 -> Value.YI_001 + YI_UA -> Value.YI_UA YO -> Value.YO YO_BJ -> Value.YO_BJ YO_NG -> Value.YO_NG @@ -5035,7 +5272,9 @@ private constructor( YUE -> Value.YUE YUE_CN -> Value.YUE_CN YUE_HK -> Value.YUE_HK + YUE_MO -> Value.YUE_MO ZA -> Value.ZA + ZA_CN -> Value.ZA_CN ZGH -> Value.ZGH ZGH_MA -> Value.ZGH_MA ZH -> Value.ZH @@ -5044,6 +5283,7 @@ private constructor( ZH_HANT -> Value.ZH_HANT ZH_HK -> Value.ZH_HK ZH_MO -> Value.ZH_MO + ZH_MY -> Value.ZH_MY ZH_SG -> Value.ZH_SG ZH_TW -> Value.ZH_TW ZU -> Value.ZU @@ -5117,6 +5357,8 @@ private constructor( AZ -> Known.AZ AZ_AZ -> Known.AZ_AZ BA -> Known.BA + BAL -> Known.BAL + BAL_PK -> Known.BAL_PK BAS -> Known.BAS BAS_CM -> Known.BAS_CM BE -> Known.BE @@ -5132,6 +5374,8 @@ private constructor( BHO -> Known.BHO BHO_IN -> Known.BHO_IN BI -> Known.BI + BLO -> Known.BLO + BLO_BJ -> Known.BLO_BJ BM -> Known.BM BM_ML -> Known.BM_ML BN -> Known.BN @@ -5170,6 +5414,8 @@ private constructor( CR -> Known.CR CS -> Known.CS CS_CZ -> Known.CS_CZ + CSW -> Known.CSW + CSW_CA -> Known.CSW_CA CU -> Known.CU CU_RU -> Known.CU_RU CV -> Known.CV @@ -5235,6 +5481,7 @@ private constructor( EN_CN -> Known.EN_CN EN_CX -> Known.EN_CX EN_CY -> Known.EN_CY + EN_CZ -> Known.EN_CZ EN_DE -> Known.EN_DE EN_DG -> Known.EN_DG EN_DK -> Known.EN_DK @@ -5254,15 +5501,18 @@ private constructor( EN_GH -> Known.EN_GH EN_GI -> Known.EN_GI EN_GM -> Known.EN_GM + EN_GS -> Known.EN_GS EN_GU -> Known.EN_GU EN_GY -> Known.EN_GY EN_HK -> Known.EN_HK + EN_HU -> Known.EN_HU EN_ID -> Known.EN_ID EN_IE -> Known.EN_IE EN_IL -> Known.EN_IL EN_IM -> Known.EN_IM EN_IN -> Known.EN_IN EN_IO -> Known.EN_IO + EN_IT -> Known.EN_IT EN_JE -> Known.EN_JE EN_JM -> Known.EN_JM EN_KE -> Known.EN_KE @@ -5288,16 +5538,19 @@ private constructor( EN_NF -> Known.EN_NF EN_NG -> Known.EN_NG EN_NL -> Known.EN_NL + EN_NO -> Known.EN_NO EN_NR -> Known.EN_NR EN_NU -> Known.EN_NU EN_NZ -> Known.EN_NZ EN_PG -> Known.EN_PG EN_PH -> Known.EN_PH EN_PK -> Known.EN_PK + EN_PL -> Known.EN_PL EN_PN -> Known.EN_PN EN_PR -> Known.EN_PR EN_PT -> Known.EN_PT EN_PW -> Known.EN_PW + EN_RO -> Known.EN_RO EN_RW -> Known.EN_RW EN_SB -> Known.EN_SB EN_SC -> Known.EN_SC @@ -5306,6 +5559,7 @@ private constructor( EN_SG -> Known.EN_SG EN_SH -> Known.EN_SH EN_SI -> Known.EN_SI + EN_SK -> Known.EN_SK EN_SL -> Known.EN_SL EN_SS -> Known.EN_SS EN_SX -> Known.EN_SX @@ -5447,6 +5701,8 @@ private constructor( GA -> Known.GA GA_GB -> Known.GA_GB GA_IE -> Known.GA_IE + GAA -> Known.GAA + GAA_GH -> Known.GAA_GH GD -> Known.GD GD_GB -> Known.GD_GB GL -> Known.GL @@ -5480,6 +5736,7 @@ private constructor( HSB -> Known.HSB HSB_DE -> Known.HSB_DE HT -> Known.HT + HT_HT -> Known.HT_HT HU -> Known.HU HU_HU -> Known.HU_HU HY -> Known.HY @@ -5490,6 +5747,7 @@ private constructor( ID -> Known.ID ID_ID -> Known.ID_ID IE -> Known.IE + IE_EE -> Known.IE_EE IG -> Known.IG IG_NG -> Known.IG_NG II -> Known.II @@ -5545,6 +5803,7 @@ private constructor( KN -> Known.KN KN_IN -> Known.KN_IN KO -> Known.KO + KO_CN -> Known.KO_CN KO_KP -> Known.KO_KP KO_KR -> Known.KO_KR KOK -> Known.KOK @@ -5563,6 +5822,8 @@ private constructor( KV -> Known.KV KW -> Known.KW KW_GB -> Known.KW_GB + KXV -> Known.KXV + KXV_IN -> Known.KXV_IN KY -> Known.KY KY_KG -> Known.KY_KG LA -> Known.LA @@ -5573,8 +5834,12 @@ private constructor( LG -> Known.LG LG_UG -> Known.LG_UG LI -> Known.LI + LIJ -> Known.LIJ + LIJ_IT -> Known.LIJ_IT LKT -> Known.LKT LKT_US -> Known.LKT_US + LMO -> Known.LMO + LMO_IT -> Known.LMO_IT LN -> Known.LN LN_AO -> Known.LN_AO LN_CD -> Known.LN_CD @@ -5671,7 +5936,11 @@ private constructor( NNH_CM -> Known.NNH_CM NO -> Known.NO NO_NO -> Known.NO_NO + NQO -> Known.NQO + NQO_GN -> Known.NQO_GN NR -> Known.NR + NSO -> Known.NSO + NSO_ZA -> Known.NSO_ZA NUS -> Known.NUS NUS_SS -> Known.NUS_SS NV -> Known.NV @@ -5801,6 +6070,8 @@ private constructor( SR_XK -> Known.SR_XK SS -> Known.SS ST -> Known.ST + ST_LS -> Known.ST_LS + ST_ZA -> Known.ST_ZA SU -> Known.SU SU_ID -> Known.SU_ID SV -> Known.SV @@ -5813,6 +6084,11 @@ private constructor( SW_TZ -> Known.SW_TZ SW_UG -> Known.SW_UG SY -> Known.SY + SYR -> Known.SYR + SYR_IQ -> Known.SYR_IQ + SYR_SY -> Known.SYR_SY + SZL -> Known.SZL + SZL_PL -> Known.SZL_PL TA -> Known.TA TA_IN -> Known.TA_IN TA_LK -> Known.TA_LK @@ -5834,6 +6110,8 @@ private constructor( TK_TM -> Known.TK_TM TL -> Known.TL TN -> Known.TN + TN_BW -> Known.TN_BW + TN_ZA -> Known.TN_ZA TO -> Known.TO TO_TO -> Known.TO_TO TOK -> Known.TOK @@ -5863,8 +6141,12 @@ private constructor( VAI -> Known.VAI VAI_LR -> Known.VAI_LR VE -> Known.VE + VEC -> Known.VEC + VEC_IT -> Known.VEC_IT VI -> Known.VI VI_VN -> Known.VI_VN + VMW -> Known.VMW + VMW_MZ -> Known.VMW_MZ VO -> Known.VO VO_001 -> Known.VO_001 VUN -> Known.VUN @@ -5876,12 +6158,15 @@ private constructor( WO_SN -> Known.WO_SN XH -> Known.XH XH_ZA -> Known.XH_ZA + XNR -> Known.XNR + XNR_IN -> Known.XNR_IN XOG -> Known.XOG XOG_UG -> Known.XOG_UG YAV -> Known.YAV YAV_CM -> Known.YAV_CM YI -> Known.YI YI_001 -> Known.YI_001 + YI_UA -> Known.YI_UA YO -> Known.YO YO_BJ -> Known.YO_BJ YO_NG -> Known.YO_NG @@ -5892,7 +6177,9 @@ private constructor( YUE -> Known.YUE YUE_CN -> Known.YUE_CN YUE_HK -> Known.YUE_HK + YUE_MO -> Known.YUE_MO ZA -> Known.ZA + ZA_CN -> Known.ZA_CN ZGH -> Known.ZGH ZGH_MA -> Known.ZGH_MA ZH -> Known.ZH @@ -5901,6 +6188,7 @@ private constructor( ZH_HANT -> Known.ZH_HANT ZH_HK -> Known.ZH_HK ZH_MO -> Known.ZH_MO + ZH_MY -> Known.ZH_MY ZH_SG -> Known.ZH_SG ZH_TW -> Known.ZH_TW ZU -> Known.ZU diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/blogs/posts/BlogPost.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/blogs/posts/BlogPost.kt index 0e8e4c73..242a794a 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/blogs/posts/BlogPost.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/blogs/posts/BlogPost.kt @@ -3754,6 +3754,10 @@ private constructor( @JvmField val BA = of("ba") + @JvmField val BAL = of("bal") + + @JvmField val BAL_PK = of("bal-pk") + @JvmField val BAS = of("bas") @JvmField val BAS_CM = of("bas-cm") @@ -3784,6 +3788,10 @@ private constructor( @JvmField val BI = of("bi") + @JvmField val BLO = of("blo") + + @JvmField val BLO_BJ = of("blo-bj") + @JvmField val BM = of("bm") @JvmField val BM_ML = of("bm-ml") @@ -3860,6 +3868,10 @@ private constructor( @JvmField val CS_CZ = of("cs-cz") + @JvmField val CSW = of("csw") + + @JvmField val CSW_CA = of("csw-ca") + @JvmField val CU = of("cu") @JvmField val CU_RU = of("cu-ru") @@ -3990,6 +4002,8 @@ private constructor( @JvmField val EN_CY = of("en-cy") + @JvmField val EN_CZ = of("en-cz") + @JvmField val EN_DE = of("en-de") @JvmField val EN_DG = of("en-dg") @@ -4028,12 +4042,16 @@ private constructor( @JvmField val EN_GM = of("en-gm") + @JvmField val EN_GS = of("en-gs") + @JvmField val EN_GU = of("en-gu") @JvmField val EN_GY = of("en-gy") @JvmField val EN_HK = of("en-hk") + @JvmField val EN_HU = of("en-hu") + @JvmField val EN_ID = of("en-id") @JvmField val EN_IE = of("en-ie") @@ -4046,6 +4064,8 @@ private constructor( @JvmField val EN_IO = of("en-io") + @JvmField val EN_IT = of("en-it") + @JvmField val EN_JE = of("en-je") @JvmField val EN_JM = of("en-jm") @@ -4096,6 +4116,8 @@ private constructor( @JvmField val EN_NL = of("en-nl") + @JvmField val EN_NO = of("en-no") + @JvmField val EN_NR = of("en-nr") @JvmField val EN_NU = of("en-nu") @@ -4108,6 +4130,8 @@ private constructor( @JvmField val EN_PK = of("en-pk") + @JvmField val EN_PL = of("en-pl") + @JvmField val EN_PN = of("en-pn") @JvmField val EN_PR = of("en-pr") @@ -4116,6 +4140,8 @@ private constructor( @JvmField val EN_PW = of("en-pw") + @JvmField val EN_RO = of("en-ro") + @JvmField val EN_RW = of("en-rw") @JvmField val EN_SB = of("en-sb") @@ -4132,6 +4158,8 @@ private constructor( @JvmField val EN_SI = of("en-si") + @JvmField val EN_SK = of("en-sk") + @JvmField val EN_SL = of("en-sl") @JvmField val EN_SS = of("en-ss") @@ -4414,6 +4442,10 @@ private constructor( @JvmField val GA_IE = of("ga-ie") + @JvmField val GAA = of("gaa") + + @JvmField val GAA_GH = of("gaa-gh") + @JvmField val GD = of("gd") @JvmField val GD_GB = of("gd-gb") @@ -4480,6 +4512,8 @@ private constructor( @JvmField val HT = of("ht") + @JvmField val HT_HT = of("ht-ht") + @JvmField val HU = of("hu") @JvmField val HU_HU = of("hu-hu") @@ -4500,6 +4534,8 @@ private constructor( @JvmField val IE = of("ie") + @JvmField val IE_EE = of("ie-ee") + @JvmField val IG = of("ig") @JvmField val IG_NG = of("ig-ng") @@ -4610,6 +4646,8 @@ private constructor( @JvmField val KO = of("ko") + @JvmField val KO_CN = of("ko-cn") + @JvmField val KO_KP = of("ko-kp") @JvmField val KO_KR = of("ko-kr") @@ -4646,6 +4684,10 @@ private constructor( @JvmField val KW_GB = of("kw-gb") + @JvmField val KXV = of("kxv") + + @JvmField val KXV_IN = of("kxv-in") + @JvmField val KY = of("ky") @JvmField val KY_KG = of("ky-kg") @@ -4666,10 +4708,18 @@ private constructor( @JvmField val LI = of("li") + @JvmField val LIJ = of("lij") + + @JvmField val LIJ_IT = of("lij-it") + @JvmField val LKT = of("lkt") @JvmField val LKT_US = of("lkt-us") + @JvmField val LMO = of("lmo") + + @JvmField val LMO_IT = of("lmo-it") + @JvmField val LN = of("ln") @JvmField val LN_AO = of("ln-ao") @@ -4862,8 +4912,16 @@ private constructor( @JvmField val NO_NO = of("no-no") + @JvmField val NQO = of("nqo") + + @JvmField val NQO_GN = of("nqo-gn") + @JvmField val NR = of("nr") + @JvmField val NSO = of("nso") + + @JvmField val NSO_ZA = of("nso-za") + @JvmField val NUS = of("nus") @JvmField val NUS_SS = of("nus-ss") @@ -5122,6 +5180,10 @@ private constructor( @JvmField val ST = of("st") + @JvmField val ST_LS = of("st-ls") + + @JvmField val ST_ZA = of("st-za") + @JvmField val SU = of("su") @JvmField val SU_ID = of("su-id") @@ -5146,6 +5208,16 @@ private constructor( @JvmField val SY = of("sy") + @JvmField val SYR = of("syr") + + @JvmField val SYR_IQ = of("syr-iq") + + @JvmField val SYR_SY = of("syr-sy") + + @JvmField val SZL = of("szl") + + @JvmField val SZL_PL = of("szl-pl") + @JvmField val TA = of("ta") @JvmField val TA_IN = of("ta-in") @@ -5188,6 +5260,10 @@ private constructor( @JvmField val TN = of("tn") + @JvmField val TN_BW = of("tn-bw") + + @JvmField val TN_ZA = of("tn-za") + @JvmField val TO = of("to") @JvmField val TO_TO = of("to-to") @@ -5246,10 +5322,18 @@ private constructor( @JvmField val VE = of("ve") + @JvmField val VEC = of("vec") + + @JvmField val VEC_IT = of("vec-it") + @JvmField val VI = of("vi") @JvmField val VI_VN = of("vi-vn") + @JvmField val VMW = of("vmw") + + @JvmField val VMW_MZ = of("vmw-mz") + @JvmField val VO = of("vo") @JvmField val VO_001 = of("vo-001") @@ -5272,6 +5356,10 @@ private constructor( @JvmField val XH_ZA = of("xh-za") + @JvmField val XNR = of("xnr") + + @JvmField val XNR_IN = of("xnr-in") + @JvmField val XOG = of("xog") @JvmField val XOG_UG = of("xog-ug") @@ -5284,6 +5372,8 @@ private constructor( @JvmField val YI_001 = of("yi-001") + @JvmField val YI_UA = of("yi-ua") + @JvmField val YO = of("yo") @JvmField val YO_BJ = of("yo-bj") @@ -5304,8 +5394,12 @@ private constructor( @JvmField val YUE_HK = of("yue-hk") + @JvmField val YUE_MO = of("yue-mo") + @JvmField val ZA = of("za") + @JvmField val ZA_CN = of("za-cn") + @JvmField val ZGH = of("zgh") @JvmField val ZGH_MA = of("zgh-ma") @@ -5322,6 +5416,8 @@ private constructor( @JvmField val ZH_MO = of("zh-mo") + @JvmField val ZH_MY = of("zh-my") + @JvmField val ZH_SG = of("zh-sg") @JvmField val ZH_TW = of("zh-tw") @@ -5390,6 +5486,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -5405,6 +5503,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -5443,6 +5543,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -5508,6 +5610,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -5527,15 +5630,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -5561,16 +5667,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -5579,6 +5688,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -5720,6 +5830,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -5753,6 +5865,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -5763,6 +5876,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -5818,6 +5932,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -5836,6 +5951,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -5846,8 +5963,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -5944,7 +6065,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -6074,6 +6199,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -6086,6 +6213,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -6107,6 +6239,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -6136,8 +6270,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -6149,12 +6287,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -6165,7 +6306,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -6174,6 +6317,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -6245,6 +6389,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -6260,6 +6406,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -6298,6 +6446,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -6363,6 +6513,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -6382,15 +6533,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -6416,16 +6570,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -6434,6 +6591,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -6575,6 +6733,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -6608,6 +6768,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -6618,6 +6779,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -6673,6 +6835,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -6691,6 +6854,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -6701,8 +6866,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -6799,7 +6968,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -6929,6 +7102,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -6941,6 +7116,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -6962,6 +7142,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -6991,8 +7173,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -7004,12 +7190,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -7020,7 +7209,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -7029,6 +7220,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -7101,6 +7293,8 @@ private constructor( AZ -> Value.AZ AZ_AZ -> Value.AZ_AZ BA -> Value.BA + BAL -> Value.BAL + BAL_PK -> Value.BAL_PK BAS -> Value.BAS BAS_CM -> Value.BAS_CM BE -> Value.BE @@ -7116,6 +7310,8 @@ private constructor( BHO -> Value.BHO BHO_IN -> Value.BHO_IN BI -> Value.BI + BLO -> Value.BLO + BLO_BJ -> Value.BLO_BJ BM -> Value.BM BM_ML -> Value.BM_ML BN -> Value.BN @@ -7154,6 +7350,8 @@ private constructor( CR -> Value.CR CS -> Value.CS CS_CZ -> Value.CS_CZ + CSW -> Value.CSW + CSW_CA -> Value.CSW_CA CU -> Value.CU CU_RU -> Value.CU_RU CV -> Value.CV @@ -7219,6 +7417,7 @@ private constructor( EN_CN -> Value.EN_CN EN_CX -> Value.EN_CX EN_CY -> Value.EN_CY + EN_CZ -> Value.EN_CZ EN_DE -> Value.EN_DE EN_DG -> Value.EN_DG EN_DK -> Value.EN_DK @@ -7238,15 +7437,18 @@ private constructor( EN_GH -> Value.EN_GH EN_GI -> Value.EN_GI EN_GM -> Value.EN_GM + EN_GS -> Value.EN_GS EN_GU -> Value.EN_GU EN_GY -> Value.EN_GY EN_HK -> Value.EN_HK + EN_HU -> Value.EN_HU EN_ID -> Value.EN_ID EN_IE -> Value.EN_IE EN_IL -> Value.EN_IL EN_IM -> Value.EN_IM EN_IN -> Value.EN_IN EN_IO -> Value.EN_IO + EN_IT -> Value.EN_IT EN_JE -> Value.EN_JE EN_JM -> Value.EN_JM EN_KE -> Value.EN_KE @@ -7272,16 +7474,19 @@ private constructor( EN_NF -> Value.EN_NF EN_NG -> Value.EN_NG EN_NL -> Value.EN_NL + EN_NO -> Value.EN_NO EN_NR -> Value.EN_NR EN_NU -> Value.EN_NU EN_NZ -> Value.EN_NZ EN_PG -> Value.EN_PG EN_PH -> Value.EN_PH EN_PK -> Value.EN_PK + EN_PL -> Value.EN_PL EN_PN -> Value.EN_PN EN_PR -> Value.EN_PR EN_PT -> Value.EN_PT EN_PW -> Value.EN_PW + EN_RO -> Value.EN_RO EN_RW -> Value.EN_RW EN_SB -> Value.EN_SB EN_SC -> Value.EN_SC @@ -7290,6 +7495,7 @@ private constructor( EN_SG -> Value.EN_SG EN_SH -> Value.EN_SH EN_SI -> Value.EN_SI + EN_SK -> Value.EN_SK EN_SL -> Value.EN_SL EN_SS -> Value.EN_SS EN_SX -> Value.EN_SX @@ -7431,6 +7637,8 @@ private constructor( GA -> Value.GA GA_GB -> Value.GA_GB GA_IE -> Value.GA_IE + GAA -> Value.GAA + GAA_GH -> Value.GAA_GH GD -> Value.GD GD_GB -> Value.GD_GB GL -> Value.GL @@ -7464,6 +7672,7 @@ private constructor( HSB -> Value.HSB HSB_DE -> Value.HSB_DE HT -> Value.HT + HT_HT -> Value.HT_HT HU -> Value.HU HU_HU -> Value.HU_HU HY -> Value.HY @@ -7474,6 +7683,7 @@ private constructor( ID -> Value.ID ID_ID -> Value.ID_ID IE -> Value.IE + IE_EE -> Value.IE_EE IG -> Value.IG IG_NG -> Value.IG_NG II -> Value.II @@ -7529,6 +7739,7 @@ private constructor( KN -> Value.KN KN_IN -> Value.KN_IN KO -> Value.KO + KO_CN -> Value.KO_CN KO_KP -> Value.KO_KP KO_KR -> Value.KO_KR KOK -> Value.KOK @@ -7547,6 +7758,8 @@ private constructor( KV -> Value.KV KW -> Value.KW KW_GB -> Value.KW_GB + KXV -> Value.KXV + KXV_IN -> Value.KXV_IN KY -> Value.KY KY_KG -> Value.KY_KG LA -> Value.LA @@ -7557,8 +7770,12 @@ private constructor( LG -> Value.LG LG_UG -> Value.LG_UG LI -> Value.LI + LIJ -> Value.LIJ + LIJ_IT -> Value.LIJ_IT LKT -> Value.LKT LKT_US -> Value.LKT_US + LMO -> Value.LMO + LMO_IT -> Value.LMO_IT LN -> Value.LN LN_AO -> Value.LN_AO LN_CD -> Value.LN_CD @@ -7655,7 +7872,11 @@ private constructor( NNH_CM -> Value.NNH_CM NO -> Value.NO NO_NO -> Value.NO_NO + NQO -> Value.NQO + NQO_GN -> Value.NQO_GN NR -> Value.NR + NSO -> Value.NSO + NSO_ZA -> Value.NSO_ZA NUS -> Value.NUS NUS_SS -> Value.NUS_SS NV -> Value.NV @@ -7785,6 +8006,8 @@ private constructor( SR_XK -> Value.SR_XK SS -> Value.SS ST -> Value.ST + ST_LS -> Value.ST_LS + ST_ZA -> Value.ST_ZA SU -> Value.SU SU_ID -> Value.SU_ID SV -> Value.SV @@ -7797,6 +8020,11 @@ private constructor( SW_TZ -> Value.SW_TZ SW_UG -> Value.SW_UG SY -> Value.SY + SYR -> Value.SYR + SYR_IQ -> Value.SYR_IQ + SYR_SY -> Value.SYR_SY + SZL -> Value.SZL + SZL_PL -> Value.SZL_PL TA -> Value.TA TA_IN -> Value.TA_IN TA_LK -> Value.TA_LK @@ -7818,6 +8046,8 @@ private constructor( TK_TM -> Value.TK_TM TL -> Value.TL TN -> Value.TN + TN_BW -> Value.TN_BW + TN_ZA -> Value.TN_ZA TO -> Value.TO TO_TO -> Value.TO_TO TOK -> Value.TOK @@ -7847,8 +8077,12 @@ private constructor( VAI -> Value.VAI VAI_LR -> Value.VAI_LR VE -> Value.VE + VEC -> Value.VEC + VEC_IT -> Value.VEC_IT VI -> Value.VI VI_VN -> Value.VI_VN + VMW -> Value.VMW + VMW_MZ -> Value.VMW_MZ VO -> Value.VO VO_001 -> Value.VO_001 VUN -> Value.VUN @@ -7860,12 +8094,15 @@ private constructor( WO_SN -> Value.WO_SN XH -> Value.XH XH_ZA -> Value.XH_ZA + XNR -> Value.XNR + XNR_IN -> Value.XNR_IN XOG -> Value.XOG XOG_UG -> Value.XOG_UG YAV -> Value.YAV YAV_CM -> Value.YAV_CM YI -> Value.YI YI_001 -> Value.YI_001 + YI_UA -> Value.YI_UA YO -> Value.YO YO_BJ -> Value.YO_BJ YO_NG -> Value.YO_NG @@ -7876,7 +8113,9 @@ private constructor( YUE -> Value.YUE YUE_CN -> Value.YUE_CN YUE_HK -> Value.YUE_HK + YUE_MO -> Value.YUE_MO ZA -> Value.ZA + ZA_CN -> Value.ZA_CN ZGH -> Value.ZGH ZGH_MA -> Value.ZGH_MA ZH -> Value.ZH @@ -7885,6 +8124,7 @@ private constructor( ZH_HANT -> Value.ZH_HANT ZH_HK -> Value.ZH_HK ZH_MO -> Value.ZH_MO + ZH_MY -> Value.ZH_MY ZH_SG -> Value.ZH_SG ZH_TW -> Value.ZH_TW ZU -> Value.ZU @@ -7958,6 +8198,8 @@ private constructor( AZ -> Known.AZ AZ_AZ -> Known.AZ_AZ BA -> Known.BA + BAL -> Known.BAL + BAL_PK -> Known.BAL_PK BAS -> Known.BAS BAS_CM -> Known.BAS_CM BE -> Known.BE @@ -7973,6 +8215,8 @@ private constructor( BHO -> Known.BHO BHO_IN -> Known.BHO_IN BI -> Known.BI + BLO -> Known.BLO + BLO_BJ -> Known.BLO_BJ BM -> Known.BM BM_ML -> Known.BM_ML BN -> Known.BN @@ -8011,6 +8255,8 @@ private constructor( CR -> Known.CR CS -> Known.CS CS_CZ -> Known.CS_CZ + CSW -> Known.CSW + CSW_CA -> Known.CSW_CA CU -> Known.CU CU_RU -> Known.CU_RU CV -> Known.CV @@ -8076,6 +8322,7 @@ private constructor( EN_CN -> Known.EN_CN EN_CX -> Known.EN_CX EN_CY -> Known.EN_CY + EN_CZ -> Known.EN_CZ EN_DE -> Known.EN_DE EN_DG -> Known.EN_DG EN_DK -> Known.EN_DK @@ -8095,15 +8342,18 @@ private constructor( EN_GH -> Known.EN_GH EN_GI -> Known.EN_GI EN_GM -> Known.EN_GM + EN_GS -> Known.EN_GS EN_GU -> Known.EN_GU EN_GY -> Known.EN_GY EN_HK -> Known.EN_HK + EN_HU -> Known.EN_HU EN_ID -> Known.EN_ID EN_IE -> Known.EN_IE EN_IL -> Known.EN_IL EN_IM -> Known.EN_IM EN_IN -> Known.EN_IN EN_IO -> Known.EN_IO + EN_IT -> Known.EN_IT EN_JE -> Known.EN_JE EN_JM -> Known.EN_JM EN_KE -> Known.EN_KE @@ -8129,16 +8379,19 @@ private constructor( EN_NF -> Known.EN_NF EN_NG -> Known.EN_NG EN_NL -> Known.EN_NL + EN_NO -> Known.EN_NO EN_NR -> Known.EN_NR EN_NU -> Known.EN_NU EN_NZ -> Known.EN_NZ EN_PG -> Known.EN_PG EN_PH -> Known.EN_PH EN_PK -> Known.EN_PK + EN_PL -> Known.EN_PL EN_PN -> Known.EN_PN EN_PR -> Known.EN_PR EN_PT -> Known.EN_PT EN_PW -> Known.EN_PW + EN_RO -> Known.EN_RO EN_RW -> Known.EN_RW EN_SB -> Known.EN_SB EN_SC -> Known.EN_SC @@ -8147,6 +8400,7 @@ private constructor( EN_SG -> Known.EN_SG EN_SH -> Known.EN_SH EN_SI -> Known.EN_SI + EN_SK -> Known.EN_SK EN_SL -> Known.EN_SL EN_SS -> Known.EN_SS EN_SX -> Known.EN_SX @@ -8288,6 +8542,8 @@ private constructor( GA -> Known.GA GA_GB -> Known.GA_GB GA_IE -> Known.GA_IE + GAA -> Known.GAA + GAA_GH -> Known.GAA_GH GD -> Known.GD GD_GB -> Known.GD_GB GL -> Known.GL @@ -8321,6 +8577,7 @@ private constructor( HSB -> Known.HSB HSB_DE -> Known.HSB_DE HT -> Known.HT + HT_HT -> Known.HT_HT HU -> Known.HU HU_HU -> Known.HU_HU HY -> Known.HY @@ -8331,6 +8588,7 @@ private constructor( ID -> Known.ID ID_ID -> Known.ID_ID IE -> Known.IE + IE_EE -> Known.IE_EE IG -> Known.IG IG_NG -> Known.IG_NG II -> Known.II @@ -8386,6 +8644,7 @@ private constructor( KN -> Known.KN KN_IN -> Known.KN_IN KO -> Known.KO + KO_CN -> Known.KO_CN KO_KP -> Known.KO_KP KO_KR -> Known.KO_KR KOK -> Known.KOK @@ -8404,6 +8663,8 @@ private constructor( KV -> Known.KV KW -> Known.KW KW_GB -> Known.KW_GB + KXV -> Known.KXV + KXV_IN -> Known.KXV_IN KY -> Known.KY KY_KG -> Known.KY_KG LA -> Known.LA @@ -8414,8 +8675,12 @@ private constructor( LG -> Known.LG LG_UG -> Known.LG_UG LI -> Known.LI + LIJ -> Known.LIJ + LIJ_IT -> Known.LIJ_IT LKT -> Known.LKT LKT_US -> Known.LKT_US + LMO -> Known.LMO + LMO_IT -> Known.LMO_IT LN -> Known.LN LN_AO -> Known.LN_AO LN_CD -> Known.LN_CD @@ -8512,7 +8777,11 @@ private constructor( NNH_CM -> Known.NNH_CM NO -> Known.NO NO_NO -> Known.NO_NO + NQO -> Known.NQO + NQO_GN -> Known.NQO_GN NR -> Known.NR + NSO -> Known.NSO + NSO_ZA -> Known.NSO_ZA NUS -> Known.NUS NUS_SS -> Known.NUS_SS NV -> Known.NV @@ -8642,6 +8911,8 @@ private constructor( SR_XK -> Known.SR_XK SS -> Known.SS ST -> Known.ST + ST_LS -> Known.ST_LS + ST_ZA -> Known.ST_ZA SU -> Known.SU SU_ID -> Known.SU_ID SV -> Known.SV @@ -8654,6 +8925,11 @@ private constructor( SW_TZ -> Known.SW_TZ SW_UG -> Known.SW_UG SY -> Known.SY + SYR -> Known.SYR + SYR_IQ -> Known.SYR_IQ + SYR_SY -> Known.SYR_SY + SZL -> Known.SZL + SZL_PL -> Known.SZL_PL TA -> Known.TA TA_IN -> Known.TA_IN TA_LK -> Known.TA_LK @@ -8675,6 +8951,8 @@ private constructor( TK_TM -> Known.TK_TM TL -> Known.TL TN -> Known.TN + TN_BW -> Known.TN_BW + TN_ZA -> Known.TN_ZA TO -> Known.TO TO_TO -> Known.TO_TO TOK -> Known.TOK @@ -8704,8 +8982,12 @@ private constructor( VAI -> Known.VAI VAI_LR -> Known.VAI_LR VE -> Known.VE + VEC -> Known.VEC + VEC_IT -> Known.VEC_IT VI -> Known.VI VI_VN -> Known.VI_VN + VMW -> Known.VMW + VMW_MZ -> Known.VMW_MZ VO -> Known.VO VO_001 -> Known.VO_001 VUN -> Known.VUN @@ -8717,12 +8999,15 @@ private constructor( WO_SN -> Known.WO_SN XH -> Known.XH XH_ZA -> Known.XH_ZA + XNR -> Known.XNR + XNR_IN -> Known.XNR_IN XOG -> Known.XOG XOG_UG -> Known.XOG_UG YAV -> Known.YAV YAV_CM -> Known.YAV_CM YI -> Known.YI YI_001 -> Known.YI_001 + YI_UA -> Known.YI_UA YO -> Known.YO YO_BJ -> Known.YO_BJ YO_NG -> Known.YO_NG @@ -8733,7 +9018,9 @@ private constructor( YUE -> Known.YUE YUE_CN -> Known.YUE_CN YUE_HK -> Known.YUE_HK + YUE_MO -> Known.YUE_MO ZA -> Known.ZA + ZA_CN -> Known.ZA_CN ZGH -> Known.ZGH ZGH_MA -> Known.ZGH_MA ZH -> Known.ZH @@ -8742,6 +9029,7 @@ private constructor( ZH_HANT -> Known.ZH_HANT ZH_HK -> Known.ZH_HK ZH_MO -> Known.ZH_MO + ZH_MY -> Known.ZH_MY ZH_SG -> Known.ZH_SG ZH_TW -> Known.ZH_TW ZU -> Known.ZU diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/blogs/settings/Blog.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/blogs/settings/Blog.kt index 58b90987..4d46ff00 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/blogs/settings/Blog.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/blogs/settings/Blog.kt @@ -923,6 +923,10 @@ private constructor( @JvmField val BA = of("ba") + @JvmField val BAL = of("bal") + + @JvmField val BAL_PK = of("bal-pk") + @JvmField val BAS = of("bas") @JvmField val BAS_CM = of("bas-cm") @@ -953,6 +957,10 @@ private constructor( @JvmField val BI = of("bi") + @JvmField val BLO = of("blo") + + @JvmField val BLO_BJ = of("blo-bj") + @JvmField val BM = of("bm") @JvmField val BM_ML = of("bm-ml") @@ -1029,6 +1037,10 @@ private constructor( @JvmField val CS_CZ = of("cs-cz") + @JvmField val CSW = of("csw") + + @JvmField val CSW_CA = of("csw-ca") + @JvmField val CU = of("cu") @JvmField val CU_RU = of("cu-ru") @@ -1159,6 +1171,8 @@ private constructor( @JvmField val EN_CY = of("en-cy") + @JvmField val EN_CZ = of("en-cz") + @JvmField val EN_DE = of("en-de") @JvmField val EN_DG = of("en-dg") @@ -1197,12 +1211,16 @@ private constructor( @JvmField val EN_GM = of("en-gm") + @JvmField val EN_GS = of("en-gs") + @JvmField val EN_GU = of("en-gu") @JvmField val EN_GY = of("en-gy") @JvmField val EN_HK = of("en-hk") + @JvmField val EN_HU = of("en-hu") + @JvmField val EN_ID = of("en-id") @JvmField val EN_IE = of("en-ie") @@ -1215,6 +1233,8 @@ private constructor( @JvmField val EN_IO = of("en-io") + @JvmField val EN_IT = of("en-it") + @JvmField val EN_JE = of("en-je") @JvmField val EN_JM = of("en-jm") @@ -1265,6 +1285,8 @@ private constructor( @JvmField val EN_NL = of("en-nl") + @JvmField val EN_NO = of("en-no") + @JvmField val EN_NR = of("en-nr") @JvmField val EN_NU = of("en-nu") @@ -1277,6 +1299,8 @@ private constructor( @JvmField val EN_PK = of("en-pk") + @JvmField val EN_PL = of("en-pl") + @JvmField val EN_PN = of("en-pn") @JvmField val EN_PR = of("en-pr") @@ -1285,6 +1309,8 @@ private constructor( @JvmField val EN_PW = of("en-pw") + @JvmField val EN_RO = of("en-ro") + @JvmField val EN_RW = of("en-rw") @JvmField val EN_SB = of("en-sb") @@ -1301,6 +1327,8 @@ private constructor( @JvmField val EN_SI = of("en-si") + @JvmField val EN_SK = of("en-sk") + @JvmField val EN_SL = of("en-sl") @JvmField val EN_SS = of("en-ss") @@ -1583,6 +1611,10 @@ private constructor( @JvmField val GA_IE = of("ga-ie") + @JvmField val GAA = of("gaa") + + @JvmField val GAA_GH = of("gaa-gh") + @JvmField val GD = of("gd") @JvmField val GD_GB = of("gd-gb") @@ -1649,6 +1681,8 @@ private constructor( @JvmField val HT = of("ht") + @JvmField val HT_HT = of("ht-ht") + @JvmField val HU = of("hu") @JvmField val HU_HU = of("hu-hu") @@ -1669,6 +1703,8 @@ private constructor( @JvmField val IE = of("ie") + @JvmField val IE_EE = of("ie-ee") + @JvmField val IG = of("ig") @JvmField val IG_NG = of("ig-ng") @@ -1779,6 +1815,8 @@ private constructor( @JvmField val KO = of("ko") + @JvmField val KO_CN = of("ko-cn") + @JvmField val KO_KP = of("ko-kp") @JvmField val KO_KR = of("ko-kr") @@ -1815,6 +1853,10 @@ private constructor( @JvmField val KW_GB = of("kw-gb") + @JvmField val KXV = of("kxv") + + @JvmField val KXV_IN = of("kxv-in") + @JvmField val KY = of("ky") @JvmField val KY_KG = of("ky-kg") @@ -1835,10 +1877,18 @@ private constructor( @JvmField val LI = of("li") + @JvmField val LIJ = of("lij") + + @JvmField val LIJ_IT = of("lij-it") + @JvmField val LKT = of("lkt") @JvmField val LKT_US = of("lkt-us") + @JvmField val LMO = of("lmo") + + @JvmField val LMO_IT = of("lmo-it") + @JvmField val LN = of("ln") @JvmField val LN_AO = of("ln-ao") @@ -2031,8 +2081,16 @@ private constructor( @JvmField val NO_NO = of("no-no") + @JvmField val NQO = of("nqo") + + @JvmField val NQO_GN = of("nqo-gn") + @JvmField val NR = of("nr") + @JvmField val NSO = of("nso") + + @JvmField val NSO_ZA = of("nso-za") + @JvmField val NUS = of("nus") @JvmField val NUS_SS = of("nus-ss") @@ -2291,6 +2349,10 @@ private constructor( @JvmField val ST = of("st") + @JvmField val ST_LS = of("st-ls") + + @JvmField val ST_ZA = of("st-za") + @JvmField val SU = of("su") @JvmField val SU_ID = of("su-id") @@ -2315,6 +2377,16 @@ private constructor( @JvmField val SY = of("sy") + @JvmField val SYR = of("syr") + + @JvmField val SYR_IQ = of("syr-iq") + + @JvmField val SYR_SY = of("syr-sy") + + @JvmField val SZL = of("szl") + + @JvmField val SZL_PL = of("szl-pl") + @JvmField val TA = of("ta") @JvmField val TA_IN = of("ta-in") @@ -2357,6 +2429,10 @@ private constructor( @JvmField val TN = of("tn") + @JvmField val TN_BW = of("tn-bw") + + @JvmField val TN_ZA = of("tn-za") + @JvmField val TO = of("to") @JvmField val TO_TO = of("to-to") @@ -2415,10 +2491,18 @@ private constructor( @JvmField val VE = of("ve") + @JvmField val VEC = of("vec") + + @JvmField val VEC_IT = of("vec-it") + @JvmField val VI = of("vi") @JvmField val VI_VN = of("vi-vn") + @JvmField val VMW = of("vmw") + + @JvmField val VMW_MZ = of("vmw-mz") + @JvmField val VO = of("vo") @JvmField val VO_001 = of("vo-001") @@ -2441,6 +2525,10 @@ private constructor( @JvmField val XH_ZA = of("xh-za") + @JvmField val XNR = of("xnr") + + @JvmField val XNR_IN = of("xnr-in") + @JvmField val XOG = of("xog") @JvmField val XOG_UG = of("xog-ug") @@ -2453,6 +2541,8 @@ private constructor( @JvmField val YI_001 = of("yi-001") + @JvmField val YI_UA = of("yi-ua") + @JvmField val YO = of("yo") @JvmField val YO_BJ = of("yo-bj") @@ -2473,8 +2563,12 @@ private constructor( @JvmField val YUE_HK = of("yue-hk") + @JvmField val YUE_MO = of("yue-mo") + @JvmField val ZA = of("za") + @JvmField val ZA_CN = of("za-cn") + @JvmField val ZGH = of("zgh") @JvmField val ZGH_MA = of("zgh-ma") @@ -2491,6 +2585,8 @@ private constructor( @JvmField val ZH_MO = of("zh-mo") + @JvmField val ZH_MY = of("zh-my") + @JvmField val ZH_SG = of("zh-sg") @JvmField val ZH_TW = of("zh-tw") @@ -2559,6 +2655,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -2574,6 +2672,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -2612,6 +2712,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -2677,6 +2779,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -2696,15 +2799,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -2730,16 +2836,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -2748,6 +2857,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -2889,6 +2999,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -2922,6 +3034,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -2932,6 +3045,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -2987,6 +3101,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -3005,6 +3120,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -3015,8 +3132,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -3113,7 +3234,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -3243,6 +3368,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -3255,6 +3382,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -3276,6 +3408,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -3305,8 +3439,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -3318,12 +3456,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -3334,7 +3475,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -3343,6 +3486,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -3414,6 +3558,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -3429,6 +3575,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -3467,6 +3615,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -3532,6 +3682,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -3551,15 +3702,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -3585,16 +3739,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -3603,6 +3760,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -3744,6 +3902,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -3777,6 +3937,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -3787,6 +3948,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -3842,6 +4004,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -3860,6 +4023,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -3870,8 +4035,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -3968,7 +4137,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -4098,6 +4271,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -4110,6 +4285,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -4131,6 +4311,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -4160,8 +4342,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -4173,12 +4359,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -4189,7 +4378,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -4198,6 +4389,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -4270,6 +4462,8 @@ private constructor( AZ -> Value.AZ AZ_AZ -> Value.AZ_AZ BA -> Value.BA + BAL -> Value.BAL + BAL_PK -> Value.BAL_PK BAS -> Value.BAS BAS_CM -> Value.BAS_CM BE -> Value.BE @@ -4285,6 +4479,8 @@ private constructor( BHO -> Value.BHO BHO_IN -> Value.BHO_IN BI -> Value.BI + BLO -> Value.BLO + BLO_BJ -> Value.BLO_BJ BM -> Value.BM BM_ML -> Value.BM_ML BN -> Value.BN @@ -4323,6 +4519,8 @@ private constructor( CR -> Value.CR CS -> Value.CS CS_CZ -> Value.CS_CZ + CSW -> Value.CSW + CSW_CA -> Value.CSW_CA CU -> Value.CU CU_RU -> Value.CU_RU CV -> Value.CV @@ -4388,6 +4586,7 @@ private constructor( EN_CN -> Value.EN_CN EN_CX -> Value.EN_CX EN_CY -> Value.EN_CY + EN_CZ -> Value.EN_CZ EN_DE -> Value.EN_DE EN_DG -> Value.EN_DG EN_DK -> Value.EN_DK @@ -4407,15 +4606,18 @@ private constructor( EN_GH -> Value.EN_GH EN_GI -> Value.EN_GI EN_GM -> Value.EN_GM + EN_GS -> Value.EN_GS EN_GU -> Value.EN_GU EN_GY -> Value.EN_GY EN_HK -> Value.EN_HK + EN_HU -> Value.EN_HU EN_ID -> Value.EN_ID EN_IE -> Value.EN_IE EN_IL -> Value.EN_IL EN_IM -> Value.EN_IM EN_IN -> Value.EN_IN EN_IO -> Value.EN_IO + EN_IT -> Value.EN_IT EN_JE -> Value.EN_JE EN_JM -> Value.EN_JM EN_KE -> Value.EN_KE @@ -4441,16 +4643,19 @@ private constructor( EN_NF -> Value.EN_NF EN_NG -> Value.EN_NG EN_NL -> Value.EN_NL + EN_NO -> Value.EN_NO EN_NR -> Value.EN_NR EN_NU -> Value.EN_NU EN_NZ -> Value.EN_NZ EN_PG -> Value.EN_PG EN_PH -> Value.EN_PH EN_PK -> Value.EN_PK + EN_PL -> Value.EN_PL EN_PN -> Value.EN_PN EN_PR -> Value.EN_PR EN_PT -> Value.EN_PT EN_PW -> Value.EN_PW + EN_RO -> Value.EN_RO EN_RW -> Value.EN_RW EN_SB -> Value.EN_SB EN_SC -> Value.EN_SC @@ -4459,6 +4664,7 @@ private constructor( EN_SG -> Value.EN_SG EN_SH -> Value.EN_SH EN_SI -> Value.EN_SI + EN_SK -> Value.EN_SK EN_SL -> Value.EN_SL EN_SS -> Value.EN_SS EN_SX -> Value.EN_SX @@ -4600,6 +4806,8 @@ private constructor( GA -> Value.GA GA_GB -> Value.GA_GB GA_IE -> Value.GA_IE + GAA -> Value.GAA + GAA_GH -> Value.GAA_GH GD -> Value.GD GD_GB -> Value.GD_GB GL -> Value.GL @@ -4633,6 +4841,7 @@ private constructor( HSB -> Value.HSB HSB_DE -> Value.HSB_DE HT -> Value.HT + HT_HT -> Value.HT_HT HU -> Value.HU HU_HU -> Value.HU_HU HY -> Value.HY @@ -4643,6 +4852,7 @@ private constructor( ID -> Value.ID ID_ID -> Value.ID_ID IE -> Value.IE + IE_EE -> Value.IE_EE IG -> Value.IG IG_NG -> Value.IG_NG II -> Value.II @@ -4698,6 +4908,7 @@ private constructor( KN -> Value.KN KN_IN -> Value.KN_IN KO -> Value.KO + KO_CN -> Value.KO_CN KO_KP -> Value.KO_KP KO_KR -> Value.KO_KR KOK -> Value.KOK @@ -4716,6 +4927,8 @@ private constructor( KV -> Value.KV KW -> Value.KW KW_GB -> Value.KW_GB + KXV -> Value.KXV + KXV_IN -> Value.KXV_IN KY -> Value.KY KY_KG -> Value.KY_KG LA -> Value.LA @@ -4726,8 +4939,12 @@ private constructor( LG -> Value.LG LG_UG -> Value.LG_UG LI -> Value.LI + LIJ -> Value.LIJ + LIJ_IT -> Value.LIJ_IT LKT -> Value.LKT LKT_US -> Value.LKT_US + LMO -> Value.LMO + LMO_IT -> Value.LMO_IT LN -> Value.LN LN_AO -> Value.LN_AO LN_CD -> Value.LN_CD @@ -4824,7 +5041,11 @@ private constructor( NNH_CM -> Value.NNH_CM NO -> Value.NO NO_NO -> Value.NO_NO + NQO -> Value.NQO + NQO_GN -> Value.NQO_GN NR -> Value.NR + NSO -> Value.NSO + NSO_ZA -> Value.NSO_ZA NUS -> Value.NUS NUS_SS -> Value.NUS_SS NV -> Value.NV @@ -4954,6 +5175,8 @@ private constructor( SR_XK -> Value.SR_XK SS -> Value.SS ST -> Value.ST + ST_LS -> Value.ST_LS + ST_ZA -> Value.ST_ZA SU -> Value.SU SU_ID -> Value.SU_ID SV -> Value.SV @@ -4966,6 +5189,11 @@ private constructor( SW_TZ -> Value.SW_TZ SW_UG -> Value.SW_UG SY -> Value.SY + SYR -> Value.SYR + SYR_IQ -> Value.SYR_IQ + SYR_SY -> Value.SYR_SY + SZL -> Value.SZL + SZL_PL -> Value.SZL_PL TA -> Value.TA TA_IN -> Value.TA_IN TA_LK -> Value.TA_LK @@ -4987,6 +5215,8 @@ private constructor( TK_TM -> Value.TK_TM TL -> Value.TL TN -> Value.TN + TN_BW -> Value.TN_BW + TN_ZA -> Value.TN_ZA TO -> Value.TO TO_TO -> Value.TO_TO TOK -> Value.TOK @@ -5016,8 +5246,12 @@ private constructor( VAI -> Value.VAI VAI_LR -> Value.VAI_LR VE -> Value.VE + VEC -> Value.VEC + VEC_IT -> Value.VEC_IT VI -> Value.VI VI_VN -> Value.VI_VN + VMW -> Value.VMW + VMW_MZ -> Value.VMW_MZ VO -> Value.VO VO_001 -> Value.VO_001 VUN -> Value.VUN @@ -5029,12 +5263,15 @@ private constructor( WO_SN -> Value.WO_SN XH -> Value.XH XH_ZA -> Value.XH_ZA + XNR -> Value.XNR + XNR_IN -> Value.XNR_IN XOG -> Value.XOG XOG_UG -> Value.XOG_UG YAV -> Value.YAV YAV_CM -> Value.YAV_CM YI -> Value.YI YI_001 -> Value.YI_001 + YI_UA -> Value.YI_UA YO -> Value.YO YO_BJ -> Value.YO_BJ YO_NG -> Value.YO_NG @@ -5045,7 +5282,9 @@ private constructor( YUE -> Value.YUE YUE_CN -> Value.YUE_CN YUE_HK -> Value.YUE_HK + YUE_MO -> Value.YUE_MO ZA -> Value.ZA + ZA_CN -> Value.ZA_CN ZGH -> Value.ZGH ZGH_MA -> Value.ZGH_MA ZH -> Value.ZH @@ -5054,6 +5293,7 @@ private constructor( ZH_HANT -> Value.ZH_HANT ZH_HK -> Value.ZH_HK ZH_MO -> Value.ZH_MO + ZH_MY -> Value.ZH_MY ZH_SG -> Value.ZH_SG ZH_TW -> Value.ZH_TW ZU -> Value.ZU @@ -5127,6 +5367,8 @@ private constructor( AZ -> Known.AZ AZ_AZ -> Known.AZ_AZ BA -> Known.BA + BAL -> Known.BAL + BAL_PK -> Known.BAL_PK BAS -> Known.BAS BAS_CM -> Known.BAS_CM BE -> Known.BE @@ -5142,6 +5384,8 @@ private constructor( BHO -> Known.BHO BHO_IN -> Known.BHO_IN BI -> Known.BI + BLO -> Known.BLO + BLO_BJ -> Known.BLO_BJ BM -> Known.BM BM_ML -> Known.BM_ML BN -> Known.BN @@ -5180,6 +5424,8 @@ private constructor( CR -> Known.CR CS -> Known.CS CS_CZ -> Known.CS_CZ + CSW -> Known.CSW + CSW_CA -> Known.CSW_CA CU -> Known.CU CU_RU -> Known.CU_RU CV -> Known.CV @@ -5245,6 +5491,7 @@ private constructor( EN_CN -> Known.EN_CN EN_CX -> Known.EN_CX EN_CY -> Known.EN_CY + EN_CZ -> Known.EN_CZ EN_DE -> Known.EN_DE EN_DG -> Known.EN_DG EN_DK -> Known.EN_DK @@ -5264,15 +5511,18 @@ private constructor( EN_GH -> Known.EN_GH EN_GI -> Known.EN_GI EN_GM -> Known.EN_GM + EN_GS -> Known.EN_GS EN_GU -> Known.EN_GU EN_GY -> Known.EN_GY EN_HK -> Known.EN_HK + EN_HU -> Known.EN_HU EN_ID -> Known.EN_ID EN_IE -> Known.EN_IE EN_IL -> Known.EN_IL EN_IM -> Known.EN_IM EN_IN -> Known.EN_IN EN_IO -> Known.EN_IO + EN_IT -> Known.EN_IT EN_JE -> Known.EN_JE EN_JM -> Known.EN_JM EN_KE -> Known.EN_KE @@ -5298,16 +5548,19 @@ private constructor( EN_NF -> Known.EN_NF EN_NG -> Known.EN_NG EN_NL -> Known.EN_NL + EN_NO -> Known.EN_NO EN_NR -> Known.EN_NR EN_NU -> Known.EN_NU EN_NZ -> Known.EN_NZ EN_PG -> Known.EN_PG EN_PH -> Known.EN_PH EN_PK -> Known.EN_PK + EN_PL -> Known.EN_PL EN_PN -> Known.EN_PN EN_PR -> Known.EN_PR EN_PT -> Known.EN_PT EN_PW -> Known.EN_PW + EN_RO -> Known.EN_RO EN_RW -> Known.EN_RW EN_SB -> Known.EN_SB EN_SC -> Known.EN_SC @@ -5316,6 +5569,7 @@ private constructor( EN_SG -> Known.EN_SG EN_SH -> Known.EN_SH EN_SI -> Known.EN_SI + EN_SK -> Known.EN_SK EN_SL -> Known.EN_SL EN_SS -> Known.EN_SS EN_SX -> Known.EN_SX @@ -5457,6 +5711,8 @@ private constructor( GA -> Known.GA GA_GB -> Known.GA_GB GA_IE -> Known.GA_IE + GAA -> Known.GAA + GAA_GH -> Known.GAA_GH GD -> Known.GD GD_GB -> Known.GD_GB GL -> Known.GL @@ -5490,6 +5746,7 @@ private constructor( HSB -> Known.HSB HSB_DE -> Known.HSB_DE HT -> Known.HT + HT_HT -> Known.HT_HT HU -> Known.HU HU_HU -> Known.HU_HU HY -> Known.HY @@ -5500,6 +5757,7 @@ private constructor( ID -> Known.ID ID_ID -> Known.ID_ID IE -> Known.IE + IE_EE -> Known.IE_EE IG -> Known.IG IG_NG -> Known.IG_NG II -> Known.II @@ -5555,6 +5813,7 @@ private constructor( KN -> Known.KN KN_IN -> Known.KN_IN KO -> Known.KO + KO_CN -> Known.KO_CN KO_KP -> Known.KO_KP KO_KR -> Known.KO_KR KOK -> Known.KOK @@ -5573,6 +5832,8 @@ private constructor( KV -> Known.KV KW -> Known.KW KW_GB -> Known.KW_GB + KXV -> Known.KXV + KXV_IN -> Known.KXV_IN KY -> Known.KY KY_KG -> Known.KY_KG LA -> Known.LA @@ -5583,8 +5844,12 @@ private constructor( LG -> Known.LG LG_UG -> Known.LG_UG LI -> Known.LI + LIJ -> Known.LIJ + LIJ_IT -> Known.LIJ_IT LKT -> Known.LKT LKT_US -> Known.LKT_US + LMO -> Known.LMO + LMO_IT -> Known.LMO_IT LN -> Known.LN LN_AO -> Known.LN_AO LN_CD -> Known.LN_CD @@ -5681,7 +5946,11 @@ private constructor( NNH_CM -> Known.NNH_CM NO -> Known.NO NO_NO -> Known.NO_NO + NQO -> Known.NQO + NQO_GN -> Known.NQO_GN NR -> Known.NR + NSO -> Known.NSO + NSO_ZA -> Known.NSO_ZA NUS -> Known.NUS NUS_SS -> Known.NUS_SS NV -> Known.NV @@ -5811,6 +6080,8 @@ private constructor( SR_XK -> Known.SR_XK SS -> Known.SS ST -> Known.ST + ST_LS -> Known.ST_LS + ST_ZA -> Known.ST_ZA SU -> Known.SU SU_ID -> Known.SU_ID SV -> Known.SV @@ -5823,6 +6094,11 @@ private constructor( SW_TZ -> Known.SW_TZ SW_UG -> Known.SW_UG SY -> Known.SY + SYR -> Known.SYR + SYR_IQ -> Known.SYR_IQ + SYR_SY -> Known.SYR_SY + SZL -> Known.SZL + SZL_PL -> Known.SZL_PL TA -> Known.TA TA_IN -> Known.TA_IN TA_LK -> Known.TA_LK @@ -5844,6 +6120,8 @@ private constructor( TK_TM -> Known.TK_TM TL -> Known.TL TN -> Known.TN + TN_BW -> Known.TN_BW + TN_ZA -> Known.TN_ZA TO -> Known.TO TO_TO -> Known.TO_TO TOK -> Known.TOK @@ -5873,8 +6151,12 @@ private constructor( VAI -> Known.VAI VAI_LR -> Known.VAI_LR VE -> Known.VE + VEC -> Known.VEC + VEC_IT -> Known.VEC_IT VI -> Known.VI VI_VN -> Known.VI_VN + VMW -> Known.VMW + VMW_MZ -> Known.VMW_MZ VO -> Known.VO VO_001 -> Known.VO_001 VUN -> Known.VUN @@ -5886,12 +6168,15 @@ private constructor( WO_SN -> Known.WO_SN XH -> Known.XH XH_ZA -> Known.XH_ZA + XNR -> Known.XNR + XNR_IN -> Known.XNR_IN XOG -> Known.XOG XOG_UG -> Known.XOG_UG YAV -> Known.YAV YAV_CM -> Known.YAV_CM YI -> Known.YI YI_001 -> Known.YI_001 + YI_UA -> Known.YI_UA YO -> Known.YO YO_BJ -> Known.YO_BJ YO_NG -> Known.YO_NG @@ -5902,7 +6187,9 @@ private constructor( YUE -> Known.YUE YUE_CN -> Known.YUE_CN YUE_HK -> Known.YUE_HK + YUE_MO -> Known.YUE_MO ZA -> Known.ZA + ZA_CN -> Known.ZA_CN ZGH -> Known.ZGH ZGH_MA -> Known.ZGH_MA ZH -> Known.ZH @@ -5911,6 +6198,7 @@ private constructor( ZH_HANT -> Known.ZH_HANT ZH_HK -> Known.ZH_HK ZH_MO -> Known.ZH_MO + ZH_MY -> Known.ZH_MY ZH_SG -> Known.ZH_SG ZH_TW -> Known.ZH_TW ZU -> Known.ZU diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/blogs/tags/Tag.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/blogs/tags/Tag.kt index 7e1d7e55..c546f7fb 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/blogs/tags/Tag.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/blogs/tags/Tag.kt @@ -565,6 +565,10 @@ private constructor( @JvmField val BA = of("ba") + @JvmField val BAL = of("bal") + + @JvmField val BAL_PK = of("bal-pk") + @JvmField val BAS = of("bas") @JvmField val BAS_CM = of("bas-cm") @@ -595,6 +599,10 @@ private constructor( @JvmField val BI = of("bi") + @JvmField val BLO = of("blo") + + @JvmField val BLO_BJ = of("blo-bj") + @JvmField val BM = of("bm") @JvmField val BM_ML = of("bm-ml") @@ -671,6 +679,10 @@ private constructor( @JvmField val CS_CZ = of("cs-cz") + @JvmField val CSW = of("csw") + + @JvmField val CSW_CA = of("csw-ca") + @JvmField val CU = of("cu") @JvmField val CU_RU = of("cu-ru") @@ -801,6 +813,8 @@ private constructor( @JvmField val EN_CY = of("en-cy") + @JvmField val EN_CZ = of("en-cz") + @JvmField val EN_DE = of("en-de") @JvmField val EN_DG = of("en-dg") @@ -839,12 +853,16 @@ private constructor( @JvmField val EN_GM = of("en-gm") + @JvmField val EN_GS = of("en-gs") + @JvmField val EN_GU = of("en-gu") @JvmField val EN_GY = of("en-gy") @JvmField val EN_HK = of("en-hk") + @JvmField val EN_HU = of("en-hu") + @JvmField val EN_ID = of("en-id") @JvmField val EN_IE = of("en-ie") @@ -857,6 +875,8 @@ private constructor( @JvmField val EN_IO = of("en-io") + @JvmField val EN_IT = of("en-it") + @JvmField val EN_JE = of("en-je") @JvmField val EN_JM = of("en-jm") @@ -907,6 +927,8 @@ private constructor( @JvmField val EN_NL = of("en-nl") + @JvmField val EN_NO = of("en-no") + @JvmField val EN_NR = of("en-nr") @JvmField val EN_NU = of("en-nu") @@ -919,6 +941,8 @@ private constructor( @JvmField val EN_PK = of("en-pk") + @JvmField val EN_PL = of("en-pl") + @JvmField val EN_PN = of("en-pn") @JvmField val EN_PR = of("en-pr") @@ -927,6 +951,8 @@ private constructor( @JvmField val EN_PW = of("en-pw") + @JvmField val EN_RO = of("en-ro") + @JvmField val EN_RW = of("en-rw") @JvmField val EN_SB = of("en-sb") @@ -943,6 +969,8 @@ private constructor( @JvmField val EN_SI = of("en-si") + @JvmField val EN_SK = of("en-sk") + @JvmField val EN_SL = of("en-sl") @JvmField val EN_SS = of("en-ss") @@ -1225,6 +1253,10 @@ private constructor( @JvmField val GA_IE = of("ga-ie") + @JvmField val GAA = of("gaa") + + @JvmField val GAA_GH = of("gaa-gh") + @JvmField val GD = of("gd") @JvmField val GD_GB = of("gd-gb") @@ -1291,6 +1323,8 @@ private constructor( @JvmField val HT = of("ht") + @JvmField val HT_HT = of("ht-ht") + @JvmField val HU = of("hu") @JvmField val HU_HU = of("hu-hu") @@ -1311,6 +1345,8 @@ private constructor( @JvmField val IE = of("ie") + @JvmField val IE_EE = of("ie-ee") + @JvmField val IG = of("ig") @JvmField val IG_NG = of("ig-ng") @@ -1421,6 +1457,8 @@ private constructor( @JvmField val KO = of("ko") + @JvmField val KO_CN = of("ko-cn") + @JvmField val KO_KP = of("ko-kp") @JvmField val KO_KR = of("ko-kr") @@ -1457,6 +1495,10 @@ private constructor( @JvmField val KW_GB = of("kw-gb") + @JvmField val KXV = of("kxv") + + @JvmField val KXV_IN = of("kxv-in") + @JvmField val KY = of("ky") @JvmField val KY_KG = of("ky-kg") @@ -1477,10 +1519,18 @@ private constructor( @JvmField val LI = of("li") + @JvmField val LIJ = of("lij") + + @JvmField val LIJ_IT = of("lij-it") + @JvmField val LKT = of("lkt") @JvmField val LKT_US = of("lkt-us") + @JvmField val LMO = of("lmo") + + @JvmField val LMO_IT = of("lmo-it") + @JvmField val LN = of("ln") @JvmField val LN_AO = of("ln-ao") @@ -1673,8 +1723,16 @@ private constructor( @JvmField val NO_NO = of("no-no") + @JvmField val NQO = of("nqo") + + @JvmField val NQO_GN = of("nqo-gn") + @JvmField val NR = of("nr") + @JvmField val NSO = of("nso") + + @JvmField val NSO_ZA = of("nso-za") + @JvmField val NUS = of("nus") @JvmField val NUS_SS = of("nus-ss") @@ -1933,6 +1991,10 @@ private constructor( @JvmField val ST = of("st") + @JvmField val ST_LS = of("st-ls") + + @JvmField val ST_ZA = of("st-za") + @JvmField val SU = of("su") @JvmField val SU_ID = of("su-id") @@ -1957,6 +2019,16 @@ private constructor( @JvmField val SY = of("sy") + @JvmField val SYR = of("syr") + + @JvmField val SYR_IQ = of("syr-iq") + + @JvmField val SYR_SY = of("syr-sy") + + @JvmField val SZL = of("szl") + + @JvmField val SZL_PL = of("szl-pl") + @JvmField val TA = of("ta") @JvmField val TA_IN = of("ta-in") @@ -1999,6 +2071,10 @@ private constructor( @JvmField val TN = of("tn") + @JvmField val TN_BW = of("tn-bw") + + @JvmField val TN_ZA = of("tn-za") + @JvmField val TO = of("to") @JvmField val TO_TO = of("to-to") @@ -2057,10 +2133,18 @@ private constructor( @JvmField val VE = of("ve") + @JvmField val VEC = of("vec") + + @JvmField val VEC_IT = of("vec-it") + @JvmField val VI = of("vi") @JvmField val VI_VN = of("vi-vn") + @JvmField val VMW = of("vmw") + + @JvmField val VMW_MZ = of("vmw-mz") + @JvmField val VO = of("vo") @JvmField val VO_001 = of("vo-001") @@ -2083,6 +2167,10 @@ private constructor( @JvmField val XH_ZA = of("xh-za") + @JvmField val XNR = of("xnr") + + @JvmField val XNR_IN = of("xnr-in") + @JvmField val XOG = of("xog") @JvmField val XOG_UG = of("xog-ug") @@ -2095,6 +2183,8 @@ private constructor( @JvmField val YI_001 = of("yi-001") + @JvmField val YI_UA = of("yi-ua") + @JvmField val YO = of("yo") @JvmField val YO_BJ = of("yo-bj") @@ -2115,8 +2205,12 @@ private constructor( @JvmField val YUE_HK = of("yue-hk") + @JvmField val YUE_MO = of("yue-mo") + @JvmField val ZA = of("za") + @JvmField val ZA_CN = of("za-cn") + @JvmField val ZGH = of("zgh") @JvmField val ZGH_MA = of("zgh-ma") @@ -2133,6 +2227,8 @@ private constructor( @JvmField val ZH_MO = of("zh-mo") + @JvmField val ZH_MY = of("zh-my") + @JvmField val ZH_SG = of("zh-sg") @JvmField val ZH_TW = of("zh-tw") @@ -2201,6 +2297,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -2216,6 +2314,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -2254,6 +2354,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -2319,6 +2421,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -2338,15 +2441,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -2372,16 +2478,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -2390,6 +2499,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -2531,6 +2641,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -2564,6 +2676,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -2574,6 +2687,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -2629,6 +2743,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -2647,6 +2762,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -2657,8 +2774,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -2755,7 +2876,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -2885,6 +3010,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -2897,6 +3024,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -2918,6 +3050,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -2947,8 +3081,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -2960,12 +3098,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -2976,7 +3117,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -2985,6 +3128,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -3056,6 +3200,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -3071,6 +3217,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -3109,6 +3257,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -3174,6 +3324,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -3193,15 +3344,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -3227,16 +3381,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -3245,6 +3402,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -3386,6 +3544,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -3419,6 +3579,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -3429,6 +3590,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -3484,6 +3646,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -3502,6 +3665,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -3512,8 +3677,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -3610,7 +3779,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -3740,6 +3913,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -3752,6 +3927,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -3773,6 +3953,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -3802,8 +3984,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -3815,12 +4001,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -3831,7 +4020,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -3840,6 +4031,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -3912,6 +4104,8 @@ private constructor( AZ -> Value.AZ AZ_AZ -> Value.AZ_AZ BA -> Value.BA + BAL -> Value.BAL + BAL_PK -> Value.BAL_PK BAS -> Value.BAS BAS_CM -> Value.BAS_CM BE -> Value.BE @@ -3927,6 +4121,8 @@ private constructor( BHO -> Value.BHO BHO_IN -> Value.BHO_IN BI -> Value.BI + BLO -> Value.BLO + BLO_BJ -> Value.BLO_BJ BM -> Value.BM BM_ML -> Value.BM_ML BN -> Value.BN @@ -3965,6 +4161,8 @@ private constructor( CR -> Value.CR CS -> Value.CS CS_CZ -> Value.CS_CZ + CSW -> Value.CSW + CSW_CA -> Value.CSW_CA CU -> Value.CU CU_RU -> Value.CU_RU CV -> Value.CV @@ -4030,6 +4228,7 @@ private constructor( EN_CN -> Value.EN_CN EN_CX -> Value.EN_CX EN_CY -> Value.EN_CY + EN_CZ -> Value.EN_CZ EN_DE -> Value.EN_DE EN_DG -> Value.EN_DG EN_DK -> Value.EN_DK @@ -4049,15 +4248,18 @@ private constructor( EN_GH -> Value.EN_GH EN_GI -> Value.EN_GI EN_GM -> Value.EN_GM + EN_GS -> Value.EN_GS EN_GU -> Value.EN_GU EN_GY -> Value.EN_GY EN_HK -> Value.EN_HK + EN_HU -> Value.EN_HU EN_ID -> Value.EN_ID EN_IE -> Value.EN_IE EN_IL -> Value.EN_IL EN_IM -> Value.EN_IM EN_IN -> Value.EN_IN EN_IO -> Value.EN_IO + EN_IT -> Value.EN_IT EN_JE -> Value.EN_JE EN_JM -> Value.EN_JM EN_KE -> Value.EN_KE @@ -4083,16 +4285,19 @@ private constructor( EN_NF -> Value.EN_NF EN_NG -> Value.EN_NG EN_NL -> Value.EN_NL + EN_NO -> Value.EN_NO EN_NR -> Value.EN_NR EN_NU -> Value.EN_NU EN_NZ -> Value.EN_NZ EN_PG -> Value.EN_PG EN_PH -> Value.EN_PH EN_PK -> Value.EN_PK + EN_PL -> Value.EN_PL EN_PN -> Value.EN_PN EN_PR -> Value.EN_PR EN_PT -> Value.EN_PT EN_PW -> Value.EN_PW + EN_RO -> Value.EN_RO EN_RW -> Value.EN_RW EN_SB -> Value.EN_SB EN_SC -> Value.EN_SC @@ -4101,6 +4306,7 @@ private constructor( EN_SG -> Value.EN_SG EN_SH -> Value.EN_SH EN_SI -> Value.EN_SI + EN_SK -> Value.EN_SK EN_SL -> Value.EN_SL EN_SS -> Value.EN_SS EN_SX -> Value.EN_SX @@ -4242,6 +4448,8 @@ private constructor( GA -> Value.GA GA_GB -> Value.GA_GB GA_IE -> Value.GA_IE + GAA -> Value.GAA + GAA_GH -> Value.GAA_GH GD -> Value.GD GD_GB -> Value.GD_GB GL -> Value.GL @@ -4275,6 +4483,7 @@ private constructor( HSB -> Value.HSB HSB_DE -> Value.HSB_DE HT -> Value.HT + HT_HT -> Value.HT_HT HU -> Value.HU HU_HU -> Value.HU_HU HY -> Value.HY @@ -4285,6 +4494,7 @@ private constructor( ID -> Value.ID ID_ID -> Value.ID_ID IE -> Value.IE + IE_EE -> Value.IE_EE IG -> Value.IG IG_NG -> Value.IG_NG II -> Value.II @@ -4340,6 +4550,7 @@ private constructor( KN -> Value.KN KN_IN -> Value.KN_IN KO -> Value.KO + KO_CN -> Value.KO_CN KO_KP -> Value.KO_KP KO_KR -> Value.KO_KR KOK -> Value.KOK @@ -4358,6 +4569,8 @@ private constructor( KV -> Value.KV KW -> Value.KW KW_GB -> Value.KW_GB + KXV -> Value.KXV + KXV_IN -> Value.KXV_IN KY -> Value.KY KY_KG -> Value.KY_KG LA -> Value.LA @@ -4368,8 +4581,12 @@ private constructor( LG -> Value.LG LG_UG -> Value.LG_UG LI -> Value.LI + LIJ -> Value.LIJ + LIJ_IT -> Value.LIJ_IT LKT -> Value.LKT LKT_US -> Value.LKT_US + LMO -> Value.LMO + LMO_IT -> Value.LMO_IT LN -> Value.LN LN_AO -> Value.LN_AO LN_CD -> Value.LN_CD @@ -4466,7 +4683,11 @@ private constructor( NNH_CM -> Value.NNH_CM NO -> Value.NO NO_NO -> Value.NO_NO + NQO -> Value.NQO + NQO_GN -> Value.NQO_GN NR -> Value.NR + NSO -> Value.NSO + NSO_ZA -> Value.NSO_ZA NUS -> Value.NUS NUS_SS -> Value.NUS_SS NV -> Value.NV @@ -4596,6 +4817,8 @@ private constructor( SR_XK -> Value.SR_XK SS -> Value.SS ST -> Value.ST + ST_LS -> Value.ST_LS + ST_ZA -> Value.ST_ZA SU -> Value.SU SU_ID -> Value.SU_ID SV -> Value.SV @@ -4608,6 +4831,11 @@ private constructor( SW_TZ -> Value.SW_TZ SW_UG -> Value.SW_UG SY -> Value.SY + SYR -> Value.SYR + SYR_IQ -> Value.SYR_IQ + SYR_SY -> Value.SYR_SY + SZL -> Value.SZL + SZL_PL -> Value.SZL_PL TA -> Value.TA TA_IN -> Value.TA_IN TA_LK -> Value.TA_LK @@ -4629,6 +4857,8 @@ private constructor( TK_TM -> Value.TK_TM TL -> Value.TL TN -> Value.TN + TN_BW -> Value.TN_BW + TN_ZA -> Value.TN_ZA TO -> Value.TO TO_TO -> Value.TO_TO TOK -> Value.TOK @@ -4658,8 +4888,12 @@ private constructor( VAI -> Value.VAI VAI_LR -> Value.VAI_LR VE -> Value.VE + VEC -> Value.VEC + VEC_IT -> Value.VEC_IT VI -> Value.VI VI_VN -> Value.VI_VN + VMW -> Value.VMW + VMW_MZ -> Value.VMW_MZ VO -> Value.VO VO_001 -> Value.VO_001 VUN -> Value.VUN @@ -4671,12 +4905,15 @@ private constructor( WO_SN -> Value.WO_SN XH -> Value.XH XH_ZA -> Value.XH_ZA + XNR -> Value.XNR + XNR_IN -> Value.XNR_IN XOG -> Value.XOG XOG_UG -> Value.XOG_UG YAV -> Value.YAV YAV_CM -> Value.YAV_CM YI -> Value.YI YI_001 -> Value.YI_001 + YI_UA -> Value.YI_UA YO -> Value.YO YO_BJ -> Value.YO_BJ YO_NG -> Value.YO_NG @@ -4687,7 +4924,9 @@ private constructor( YUE -> Value.YUE YUE_CN -> Value.YUE_CN YUE_HK -> Value.YUE_HK + YUE_MO -> Value.YUE_MO ZA -> Value.ZA + ZA_CN -> Value.ZA_CN ZGH -> Value.ZGH ZGH_MA -> Value.ZGH_MA ZH -> Value.ZH @@ -4696,6 +4935,7 @@ private constructor( ZH_HANT -> Value.ZH_HANT ZH_HK -> Value.ZH_HK ZH_MO -> Value.ZH_MO + ZH_MY -> Value.ZH_MY ZH_SG -> Value.ZH_SG ZH_TW -> Value.ZH_TW ZU -> Value.ZU @@ -4769,6 +5009,8 @@ private constructor( AZ -> Known.AZ AZ_AZ -> Known.AZ_AZ BA -> Known.BA + BAL -> Known.BAL + BAL_PK -> Known.BAL_PK BAS -> Known.BAS BAS_CM -> Known.BAS_CM BE -> Known.BE @@ -4784,6 +5026,8 @@ private constructor( BHO -> Known.BHO BHO_IN -> Known.BHO_IN BI -> Known.BI + BLO -> Known.BLO + BLO_BJ -> Known.BLO_BJ BM -> Known.BM BM_ML -> Known.BM_ML BN -> Known.BN @@ -4822,6 +5066,8 @@ private constructor( CR -> Known.CR CS -> Known.CS CS_CZ -> Known.CS_CZ + CSW -> Known.CSW + CSW_CA -> Known.CSW_CA CU -> Known.CU CU_RU -> Known.CU_RU CV -> Known.CV @@ -4887,6 +5133,7 @@ private constructor( EN_CN -> Known.EN_CN EN_CX -> Known.EN_CX EN_CY -> Known.EN_CY + EN_CZ -> Known.EN_CZ EN_DE -> Known.EN_DE EN_DG -> Known.EN_DG EN_DK -> Known.EN_DK @@ -4906,15 +5153,18 @@ private constructor( EN_GH -> Known.EN_GH EN_GI -> Known.EN_GI EN_GM -> Known.EN_GM + EN_GS -> Known.EN_GS EN_GU -> Known.EN_GU EN_GY -> Known.EN_GY EN_HK -> Known.EN_HK + EN_HU -> Known.EN_HU EN_ID -> Known.EN_ID EN_IE -> Known.EN_IE EN_IL -> Known.EN_IL EN_IM -> Known.EN_IM EN_IN -> Known.EN_IN EN_IO -> Known.EN_IO + EN_IT -> Known.EN_IT EN_JE -> Known.EN_JE EN_JM -> Known.EN_JM EN_KE -> Known.EN_KE @@ -4940,16 +5190,19 @@ private constructor( EN_NF -> Known.EN_NF EN_NG -> Known.EN_NG EN_NL -> Known.EN_NL + EN_NO -> Known.EN_NO EN_NR -> Known.EN_NR EN_NU -> Known.EN_NU EN_NZ -> Known.EN_NZ EN_PG -> Known.EN_PG EN_PH -> Known.EN_PH EN_PK -> Known.EN_PK + EN_PL -> Known.EN_PL EN_PN -> Known.EN_PN EN_PR -> Known.EN_PR EN_PT -> Known.EN_PT EN_PW -> Known.EN_PW + EN_RO -> Known.EN_RO EN_RW -> Known.EN_RW EN_SB -> Known.EN_SB EN_SC -> Known.EN_SC @@ -4958,6 +5211,7 @@ private constructor( EN_SG -> Known.EN_SG EN_SH -> Known.EN_SH EN_SI -> Known.EN_SI + EN_SK -> Known.EN_SK EN_SL -> Known.EN_SL EN_SS -> Known.EN_SS EN_SX -> Known.EN_SX @@ -5099,6 +5353,8 @@ private constructor( GA -> Known.GA GA_GB -> Known.GA_GB GA_IE -> Known.GA_IE + GAA -> Known.GAA + GAA_GH -> Known.GAA_GH GD -> Known.GD GD_GB -> Known.GD_GB GL -> Known.GL @@ -5132,6 +5388,7 @@ private constructor( HSB -> Known.HSB HSB_DE -> Known.HSB_DE HT -> Known.HT + HT_HT -> Known.HT_HT HU -> Known.HU HU_HU -> Known.HU_HU HY -> Known.HY @@ -5142,6 +5399,7 @@ private constructor( ID -> Known.ID ID_ID -> Known.ID_ID IE -> Known.IE + IE_EE -> Known.IE_EE IG -> Known.IG IG_NG -> Known.IG_NG II -> Known.II @@ -5197,6 +5455,7 @@ private constructor( KN -> Known.KN KN_IN -> Known.KN_IN KO -> Known.KO + KO_CN -> Known.KO_CN KO_KP -> Known.KO_KP KO_KR -> Known.KO_KR KOK -> Known.KOK @@ -5215,6 +5474,8 @@ private constructor( KV -> Known.KV KW -> Known.KW KW_GB -> Known.KW_GB + KXV -> Known.KXV + KXV_IN -> Known.KXV_IN KY -> Known.KY KY_KG -> Known.KY_KG LA -> Known.LA @@ -5225,8 +5486,12 @@ private constructor( LG -> Known.LG LG_UG -> Known.LG_UG LI -> Known.LI + LIJ -> Known.LIJ + LIJ_IT -> Known.LIJ_IT LKT -> Known.LKT LKT_US -> Known.LKT_US + LMO -> Known.LMO + LMO_IT -> Known.LMO_IT LN -> Known.LN LN_AO -> Known.LN_AO LN_CD -> Known.LN_CD @@ -5323,7 +5588,11 @@ private constructor( NNH_CM -> Known.NNH_CM NO -> Known.NO NO_NO -> Known.NO_NO + NQO -> Known.NQO + NQO_GN -> Known.NQO_GN NR -> Known.NR + NSO -> Known.NSO + NSO_ZA -> Known.NSO_ZA NUS -> Known.NUS NUS_SS -> Known.NUS_SS NV -> Known.NV @@ -5453,6 +5722,8 @@ private constructor( SR_XK -> Known.SR_XK SS -> Known.SS ST -> Known.ST + ST_LS -> Known.ST_LS + ST_ZA -> Known.ST_ZA SU -> Known.SU SU_ID -> Known.SU_ID SV -> Known.SV @@ -5465,6 +5736,11 @@ private constructor( SW_TZ -> Known.SW_TZ SW_UG -> Known.SW_UG SY -> Known.SY + SYR -> Known.SYR + SYR_IQ -> Known.SYR_IQ + SYR_SY -> Known.SYR_SY + SZL -> Known.SZL + SZL_PL -> Known.SZL_PL TA -> Known.TA TA_IN -> Known.TA_IN TA_LK -> Known.TA_LK @@ -5486,6 +5762,8 @@ private constructor( TK_TM -> Known.TK_TM TL -> Known.TL TN -> Known.TN + TN_BW -> Known.TN_BW + TN_ZA -> Known.TN_ZA TO -> Known.TO TO_TO -> Known.TO_TO TOK -> Known.TOK @@ -5515,8 +5793,12 @@ private constructor( VAI -> Known.VAI VAI_LR -> Known.VAI_LR VE -> Known.VE + VEC -> Known.VEC + VEC_IT -> Known.VEC_IT VI -> Known.VI VI_VN -> Known.VI_VN + VMW -> Known.VMW + VMW_MZ -> Known.VMW_MZ VO -> Known.VO VO_001 -> Known.VO_001 VUN -> Known.VUN @@ -5528,12 +5810,15 @@ private constructor( WO_SN -> Known.WO_SN XH -> Known.XH XH_ZA -> Known.XH_ZA + XNR -> Known.XNR + XNR_IN -> Known.XNR_IN XOG -> Known.XOG XOG_UG -> Known.XOG_UG YAV -> Known.YAV YAV_CM -> Known.YAV_CM YI -> Known.YI YI_001 -> Known.YI_001 + YI_UA -> Known.YI_UA YO -> Known.YO YO_BJ -> Known.YO_BJ YO_NG -> Known.YO_NG @@ -5544,7 +5829,9 @@ private constructor( YUE -> Known.YUE YUE_CN -> Known.YUE_CN YUE_HK -> Known.YUE_HK + YUE_MO -> Known.YUE_MO ZA -> Known.ZA + ZA_CN -> Known.ZA_CN ZGH -> Known.ZGH ZGH_MA -> Known.ZGH_MA ZH -> Known.ZH @@ -5553,6 +5840,7 @@ private constructor( ZH_HANT -> Known.ZH_HANT ZH_HK -> Known.ZH_HK ZH_MO -> Known.ZH_MO + ZH_MY -> Known.ZH_MY ZH_SG -> Known.ZH_SG ZH_TW -> Known.ZH_TW ZU -> Known.ZU diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/hubdb/UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/hubdb/UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3.kt index e07986c1..7d94776c 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/hubdb/UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/hubdb/UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3.kt @@ -12,48 +12,36 @@ import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import com.hubspot.sdk.core.BaseDeserializer import com.hubspot.sdk.core.BaseSerializer import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @JsonDeserialize(using = UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3.Deserializer::class) @JsonSerialize(using = UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3.Serializer::class) class UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3 private constructor( - private val randomAccessCollectionResponseWithTotal: - RandomAccessCollectionResponseWithTotalHubDbTableRowV3? = - null, - private val streamingCollectionResponseWithTotal: - StreamingCollectionResponseWithTotalHubDbTableRowV3? = - null, + private val randomAccess: RandomAccessCollectionResponseWithTotalHubDbTableRowV3? = null, + private val streaming: StreamingCollectionResponseWithTotalHubDbTableRowV3? = null, private val _json: JsonValue? = null, ) { - fun randomAccessCollectionResponseWithTotal(): - Optional = - Optional.ofNullable(randomAccessCollectionResponseWithTotal) + fun randomAccess(): Optional = + Optional.ofNullable(randomAccess) - fun streamingCollectionResponseWithTotal(): - Optional = - Optional.ofNullable(streamingCollectionResponseWithTotal) + fun streaming(): Optional = + Optional.ofNullable(streaming) - fun isRandomAccessCollectionResponseWithTotal(): Boolean = - randomAccessCollectionResponseWithTotal != null + fun isRandomAccess(): Boolean = randomAccess != null - fun isStreamingCollectionResponseWithTotal(): Boolean = - streamingCollectionResponseWithTotal != null + fun isStreaming(): Boolean = streaming != null - fun asRandomAccessCollectionResponseWithTotal(): - RandomAccessCollectionResponseWithTotalHubDbTableRowV3 = - randomAccessCollectionResponseWithTotal.getOrThrow( - "randomAccessCollectionResponseWithTotal" - ) + fun asRandomAccess(): RandomAccessCollectionResponseWithTotalHubDbTableRowV3 = + randomAccess.getOrThrow("randomAccess") - fun asStreamingCollectionResponseWithTotal(): - StreamingCollectionResponseWithTotalHubDbTableRowV3 = - streamingCollectionResponseWithTotal.getOrThrow("streamingCollectionResponseWithTotal") + fun asStreaming(): StreamingCollectionResponseWithTotalHubDbTableRowV3 = + streaming.getOrThrow("streaming") fun _json(): Optional = Optional.ofNullable(_json) @@ -69,8 +57,8 @@ private constructor( * * Optional result = unifiedCollectionResponseWithTotalBaseHubDbTableRowV3.accept(new UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3.Visitor>() { * @Override - * public Optional visitRandomAccessCollectionResponseWithTotal(RandomAccessCollectionResponseWithTotalHubDbTableRowV3 randomAccessCollectionResponseWithTotal) { - * return Optional.of(randomAccessCollectionResponseWithTotal.toString()); + * public Optional visitRandomAccess(RandomAccessCollectionResponseWithTotalHubDbTableRowV3 randomAccess) { + * return Optional.of(randomAccess.toString()); * } * * // ... @@ -88,14 +76,8 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - randomAccessCollectionResponseWithTotal != null -> - visitor.visitRandomAccessCollectionResponseWithTotal( - randomAccessCollectionResponseWithTotal - ) - streamingCollectionResponseWithTotal != null -> - visitor.visitStreamingCollectionResponseWithTotal( - streamingCollectionResponseWithTotal - ) + randomAccess != null -> visitor.visitRandomAccess(randomAccess) + streaming != null -> visitor.visitStreaming(streaming) else -> visitor.unknown(_json) } @@ -116,18 +98,16 @@ private constructor( accept( object : Visitor { - override fun visitRandomAccessCollectionResponseWithTotal( - randomAccessCollectionResponseWithTotal: - RandomAccessCollectionResponseWithTotalHubDbTableRowV3 + override fun visitRandomAccess( + randomAccess: RandomAccessCollectionResponseWithTotalHubDbTableRowV3 ) { - randomAccessCollectionResponseWithTotal.validate() + randomAccess.validate() } - override fun visitStreamingCollectionResponseWithTotal( - streamingCollectionResponseWithTotal: - StreamingCollectionResponseWithTotalHubDbTableRowV3 + override fun visitStreaming( + streaming: StreamingCollectionResponseWithTotalHubDbTableRowV3 ) { - streamingCollectionResponseWithTotal.validate() + streaming.validate() } } ) @@ -151,15 +131,13 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitRandomAccessCollectionResponseWithTotal( - randomAccessCollectionResponseWithTotal: - RandomAccessCollectionResponseWithTotalHubDbTableRowV3 - ) = randomAccessCollectionResponseWithTotal.validity() + override fun visitRandomAccess( + randomAccess: RandomAccessCollectionResponseWithTotalHubDbTableRowV3 + ) = randomAccess.validity() - override fun visitStreamingCollectionResponseWithTotal( - streamingCollectionResponseWithTotal: - StreamingCollectionResponseWithTotalHubDbTableRowV3 - ) = streamingCollectionResponseWithTotal.validity() + override fun visitStreaming( + streaming: StreamingCollectionResponseWithTotalHubDbTableRowV3 + ) = streaming.validity() override fun unknown(json: JsonValue?) = 0 } @@ -171,20 +149,18 @@ private constructor( } return other is UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3 && - randomAccessCollectionResponseWithTotal == - other.randomAccessCollectionResponseWithTotal && - streamingCollectionResponseWithTotal == other.streamingCollectionResponseWithTotal + randomAccess == other.randomAccess && + streaming == other.streaming } - override fun hashCode(): Int = - Objects.hash(randomAccessCollectionResponseWithTotal, streamingCollectionResponseWithTotal) + override fun hashCode(): Int = Objects.hash(randomAccess, streaming) override fun toString(): String = when { - randomAccessCollectionResponseWithTotal != null -> - "UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3{randomAccessCollectionResponseWithTotal=$randomAccessCollectionResponseWithTotal}" - streamingCollectionResponseWithTotal != null -> - "UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3{streamingCollectionResponseWithTotal=$streamingCollectionResponseWithTotal}" + randomAccess != null -> + "UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3{randomAccess=$randomAccess}" + streaming != null -> + "UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3{streaming=$streaming}" _json != null -> "UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3{_unknown=$_json}" else -> @@ -196,22 +172,12 @@ private constructor( companion object { @JvmStatic - fun ofRandomAccessCollectionResponseWithTotal( - randomAccessCollectionResponseWithTotal: - RandomAccessCollectionResponseWithTotalHubDbTableRowV3 - ) = - UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3( - randomAccessCollectionResponseWithTotal = randomAccessCollectionResponseWithTotal - ) + fun ofRandomAccess(randomAccess: RandomAccessCollectionResponseWithTotalHubDbTableRowV3) = + UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3(randomAccess = randomAccess) @JvmStatic - fun ofStreamingCollectionResponseWithTotal( - streamingCollectionResponseWithTotal: - StreamingCollectionResponseWithTotalHubDbTableRowV3 - ) = - UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3( - streamingCollectionResponseWithTotal = streamingCollectionResponseWithTotal - ) + fun ofStreaming(streaming: StreamingCollectionResponseWithTotalHubDbTableRowV3) = + UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3(streaming = streaming) } /** @@ -220,15 +186,11 @@ private constructor( */ interface Visitor { - fun visitRandomAccessCollectionResponseWithTotal( - randomAccessCollectionResponseWithTotal: - RandomAccessCollectionResponseWithTotalHubDbTableRowV3 + fun visitRandomAccess( + randomAccess: RandomAccessCollectionResponseWithTotalHubDbTableRowV3 ): T - fun visitStreamingCollectionResponseWithTotal( - streamingCollectionResponseWithTotal: - StreamingCollectionResponseWithTotalHubDbTableRowV3 - ): T + fun visitStreaming(streaming: StreamingCollectionResponseWithTotalHubDbTableRowV3): T /** * Maps an unknown variant of [UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3] to a @@ -257,46 +219,36 @@ private constructor( node: JsonNode ): UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3 { val json = JsonValue.fromJsonNode(node) - - val bestMatches = - sequenceOf( - tryDeserialize( - node, - jacksonTypeRef< - RandomAccessCollectionResponseWithTotalHubDbTableRowV3 - >(), + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() + + when (type) { + "RANDOM_ACCESS" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { + UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3( + randomAccess = it, + _json = json, ) - ?.let { - UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3( - randomAccessCollectionResponseWithTotal = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef< - StreamingCollectionResponseWithTotalHubDbTableRowV3 - >(), + } ?: UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3(_json = json) + } + "STREAMING" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { + UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3( + streaming = it, + _json = json, ) - ?.let { - UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3( - streamingCollectionResponseWithTotal = it, - _json = json, - ) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with all - // the possible variants (e.g. deserializing from boolean). - 0 -> UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + } ?: UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3(_json = json) + } } + + return UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3(_json = json) } } @@ -311,10 +263,8 @@ private constructor( provider: SerializerProvider, ) { when { - value.randomAccessCollectionResponseWithTotal != null -> - generator.writeObject(value.randomAccessCollectionResponseWithTotal) - value.streamingCollectionResponseWithTotal != null -> - generator.writeObject(value.streamingCollectionResponseWithTotal) + value.randomAccess != null -> generator.writeObject(value.randomAccess) + value.streaming != null -> generator.writeObject(value.streaming) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException( diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/mediabridge/MediaBridgePropertyUpdate.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/mediabridge/MediaBridgePropertyUpdate.kt index 5defabc2..668c5362 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/mediabridge/MediaBridgePropertyUpdate.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/mediabridge/MediaBridgePropertyUpdate.kt @@ -36,6 +36,7 @@ private constructor( private val numberDisplayHint: JsonField, private val options: JsonField>, private val showCurrencySymbol: JsonField, + private val textDisplayHint: JsonField, private val type: JsonField, private val additionalProperties: MutableMap, ) { @@ -73,6 +74,9 @@ private constructor( @JsonProperty("showCurrencySymbol") @ExcludeMissing showCurrencySymbol: JsonField = JsonMissing.of(), + @JsonProperty("textDisplayHint") + @ExcludeMissing + textDisplayHint: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), ) : this( calculationFormula, @@ -88,6 +92,7 @@ private constructor( numberDisplayHint, options, showCurrencySymbol, + textDisplayHint, type, mutableMapOf(), ) @@ -174,6 +179,13 @@ private constructor( fun showCurrencySymbol(): Optional = showCurrencySymbol.getOptional("showCurrencySymbol") + /** + * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun textDisplayHint(): Optional = + textDisplayHint.getOptional("textDisplayHint") + /** * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -285,6 +297,15 @@ private constructor( @ExcludeMissing fun _showCurrencySymbol(): JsonField = showCurrencySymbol + /** + * Returns the raw JSON value of [textDisplayHint]. + * + * Unlike [textDisplayHint], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("textDisplayHint") + @ExcludeMissing + fun _textDisplayHint(): JsonField = textDisplayHint + /** * Returns the raw JSON value of [type]. * @@ -328,6 +349,7 @@ private constructor( private var numberDisplayHint: JsonField = JsonMissing.of() private var options: JsonField>? = null private var showCurrencySymbol: JsonField = JsonMissing.of() + private var textDisplayHint: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -346,6 +368,7 @@ private constructor( numberDisplayHint = mediaBridgePropertyUpdate.numberDisplayHint options = mediaBridgePropertyUpdate.options.map { it.toMutableList() } showCurrencySymbol = mediaBridgePropertyUpdate.showCurrencySymbol + textDisplayHint = mediaBridgePropertyUpdate.textDisplayHint type = mediaBridgePropertyUpdate.type additionalProperties = mediaBridgePropertyUpdate.additionalProperties.toMutableMap() } @@ -519,6 +542,20 @@ private constructor( this.showCurrencySymbol = showCurrencySymbol } + fun textDisplayHint(textDisplayHint: TextDisplayHint) = + textDisplayHint(JsonField.of(textDisplayHint)) + + /** + * Sets [Builder.textDisplayHint] to an arbitrary JSON value. + * + * You should usually call [Builder.textDisplayHint] with a well-typed [TextDisplayHint] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun textDisplayHint(textDisplayHint: JsonField) = apply { + this.textDisplayHint = textDisplayHint + } + fun type(type: Type) = type(JsonField.of(type)) /** @@ -568,6 +605,7 @@ private constructor( numberDisplayHint, (options ?: JsonMissing.of()).map { it.toImmutable() }, showCurrencySymbol, + textDisplayHint, type, additionalProperties.toMutableMap(), ) @@ -601,6 +639,7 @@ private constructor( numberDisplayHint().ifPresent { it.validate() } options().ifPresent { it.forEach { it.validate() } } showCurrencySymbol() + textDisplayHint().ifPresent { it.validate() } type().ifPresent { it.validate() } validated = true } @@ -633,6 +672,7 @@ private constructor( (numberDisplayHint.asKnown().getOrNull()?.validity() ?: 0) + (options.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (showCurrencySymbol.asKnown().isPresent) 1 else 0) + + (textDisplayHint.asKnown().getOrNull()?.validity() ?: 0) + (type.asKnown().getOrNull()?.validity() ?: 0) class FieldType @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -993,6 +1033,180 @@ private constructor( override fun toString() = value.toString() } + class TextDisplayHint @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val DOMAIN_NAME = of("domain_name") + + @JvmField val EMAIL = of("email") + + @JvmField val IP_ADDRESS = of("ip_address") + + @JvmField val MULTI_LINE = of("multi_line") + + @JvmField val PHONE_NUMBER = of("phone_number") + + @JvmField val PHYSICAL_ADDRESS = of("physical_address") + + @JvmField val POSTAL_CODE = of("postal_code") + + @JvmField val UNFORMATTED_SINGLE_LINE = of("unformatted_single_line") + + @JvmStatic fun of(value: String) = TextDisplayHint(JsonField.of(value)) + } + + /** An enum containing [TextDisplayHint]'s known values. */ + enum class Known { + DOMAIN_NAME, + EMAIL, + IP_ADDRESS, + MULTI_LINE, + PHONE_NUMBER, + PHYSICAL_ADDRESS, + POSTAL_CODE, + UNFORMATTED_SINGLE_LINE, + } + + /** + * An enum containing [TextDisplayHint]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [TextDisplayHint] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DOMAIN_NAME, + EMAIL, + IP_ADDRESS, + MULTI_LINE, + PHONE_NUMBER, + PHYSICAL_ADDRESS, + POSTAL_CODE, + UNFORMATTED_SINGLE_LINE, + /** + * An enum member indicating that [TextDisplayHint] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DOMAIN_NAME -> Value.DOMAIN_NAME + EMAIL -> Value.EMAIL + IP_ADDRESS -> Value.IP_ADDRESS + MULTI_LINE -> Value.MULTI_LINE + PHONE_NUMBER -> Value.PHONE_NUMBER + PHYSICAL_ADDRESS -> Value.PHYSICAL_ADDRESS + POSTAL_CODE -> Value.POSTAL_CODE + UNFORMATTED_SINGLE_LINE -> Value.UNFORMATTED_SINGLE_LINE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws HubSpotInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + DOMAIN_NAME -> Known.DOMAIN_NAME + EMAIL -> Known.EMAIL + IP_ADDRESS -> Known.IP_ADDRESS + MULTI_LINE -> Known.MULTI_LINE + PHONE_NUMBER -> Known.PHONE_NUMBER + PHYSICAL_ADDRESS -> Known.PHYSICAL_ADDRESS + POSTAL_CODE -> Known.POSTAL_CODE + UNFORMATTED_SINGLE_LINE -> Known.UNFORMATTED_SINGLE_LINE + else -> throw HubSpotInvalidDataException("Unknown TextDisplayHint: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws HubSpotInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { HubSpotInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws HubSpotInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): TextDisplayHint = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: HubSpotInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TextDisplayHint && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** @@ -1176,6 +1390,7 @@ private constructor( numberDisplayHint == other.numberDisplayHint && options == other.options && showCurrencySymbol == other.showCurrencySymbol && + textDisplayHint == other.textDisplayHint && type == other.type && additionalProperties == other.additionalProperties } @@ -1195,6 +1410,7 @@ private constructor( numberDisplayHint, options, showCurrencySymbol, + textDisplayHint, type, additionalProperties, ) @@ -1203,5 +1419,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "MediaBridgePropertyUpdate{calculationFormula=$calculationFormula, currencyPropertyName=$currencyPropertyName, description=$description, displayOrder=$displayOrder, fieldType=$fieldType, formField=$formField, groupName=$groupName, hasUniqueValue=$hasUniqueValue, hidden=$hidden, label=$label, numberDisplayHint=$numberDisplayHint, options=$options, showCurrencySymbol=$showCurrencySymbol, type=$type, additionalProperties=$additionalProperties}" + "MediaBridgePropertyUpdate{calculationFormula=$calculationFormula, currencyPropertyName=$currencyPropertyName, description=$description, displayOrder=$displayOrder, fieldType=$fieldType, formField=$formField, groupName=$groupName, hasUniqueValue=$hasUniqueValue, hidden=$hidden, label=$label, numberDisplayHint=$numberDisplayHint, options=$options, showCurrencySymbol=$showCurrencySymbol, textDisplayHint=$textDisplayHint, type=$type, additionalProperties=$additionalProperties}" } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/mediabridge/Property1.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/mediabridge/Property1.kt index a7f8996b..63aed321 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/mediabridge/Property1.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/mediabridge/Property1.kt @@ -52,6 +52,7 @@ private constructor( private val referencedObjectType: JsonField, private val sensitiveDataCategories: JsonField>, private val showCurrencySymbol: JsonField, + private val textDisplayHint: JsonField, private val updatedAt: JsonField, private val updatedUserId: JsonField, private val additionalProperties: MutableMap, @@ -124,6 +125,9 @@ private constructor( @JsonProperty("showCurrencySymbol") @ExcludeMissing showCurrencySymbol: JsonField = JsonMissing.of(), + @JsonProperty("textDisplayHint") + @ExcludeMissing + textDisplayHint: JsonField = JsonMissing.of(), @JsonProperty("updatedAt") @ExcludeMissing updatedAt: JsonField = JsonMissing.of(), @@ -158,6 +162,7 @@ private constructor( referencedObjectType, sensitiveDataCategories, showCurrencySymbol, + textDisplayHint, updatedAt, updatedUserId, mutableMapOf(), @@ -334,6 +339,13 @@ private constructor( fun showCurrencySymbol(): Optional = showCurrencySymbol.getOptional("showCurrencySymbol") + /** + * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun textDisplayHint(): Optional = + textDisplayHint.getOptional("textDisplayHint") + /** * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -572,6 +584,15 @@ private constructor( @ExcludeMissing fun _showCurrencySymbol(): JsonField = showCurrencySymbol + /** + * Returns the raw JSON value of [textDisplayHint]. + * + * Unlike [textDisplayHint], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("textDisplayHint") + @ExcludeMissing + fun _textDisplayHint(): JsonField = textDisplayHint + /** * Returns the raw JSON value of [updatedAt]. * @@ -651,6 +672,7 @@ private constructor( private var referencedObjectType: JsonField = JsonMissing.of() private var sensitiveDataCategories: JsonField>? = null private var showCurrencySymbol: JsonField = JsonMissing.of() + private var textDisplayHint: JsonField = JsonMissing.of() private var updatedAt: JsonField = JsonMissing.of() private var updatedUserId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -684,6 +706,7 @@ private constructor( referencedObjectType = property1.referencedObjectType sensitiveDataCategories = property1.sensitiveDataCategories.map { it.toMutableList() } showCurrencySymbol = property1.showCurrencySymbol + textDisplayHint = property1.textDisplayHint updatedAt = property1.updatedAt updatedUserId = property1.updatedUserId additionalProperties = property1.additionalProperties.toMutableMap() @@ -1047,6 +1070,20 @@ private constructor( this.showCurrencySymbol = showCurrencySymbol } + fun textDisplayHint(textDisplayHint: TextDisplayHint) = + textDisplayHint(JsonField.of(textDisplayHint)) + + /** + * Sets [Builder.textDisplayHint] to an arbitrary JSON value. + * + * You should usually call [Builder.textDisplayHint] with a well-typed [TextDisplayHint] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun textDisplayHint(textDisplayHint: JsonField) = apply { + this.textDisplayHint = textDisplayHint + } + fun updatedAt(updatedAt: OffsetDateTime) = updatedAt(JsonField.of(updatedAt)) /** @@ -1137,6 +1174,7 @@ private constructor( referencedObjectType, (sensitiveDataCategories ?: JsonMissing.of()).map { it.toImmutable() }, showCurrencySymbol, + textDisplayHint, updatedAt, updatedUserId, additionalProperties.toMutableMap(), @@ -1185,6 +1223,7 @@ private constructor( referencedObjectType() sensitiveDataCategories() showCurrencySymbol() + textDisplayHint().ifPresent { it.validate() } updatedAt() updatedUserId() validated = true @@ -1232,6 +1271,7 @@ private constructor( (if (referencedObjectType.asKnown().isPresent) 1 else 0) + (sensitiveDataCategories.asKnown().getOrNull()?.size ?: 0) + (if (showCurrencySymbol.asKnown().isPresent) 1 else 0) + + (textDisplayHint.asKnown().getOrNull()?.validity() ?: 0) + (if (updatedAt.asKnown().isPresent) 1 else 0) + (if (updatedUserId.asKnown().isPresent) 1 else 0) @@ -1691,6 +1731,180 @@ private constructor( override fun toString() = value.toString() } + class TextDisplayHint @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val DOMAIN_NAME = of("domain_name") + + @JvmField val EMAIL = of("email") + + @JvmField val IP_ADDRESS = of("ip_address") + + @JvmField val MULTI_LINE = of("multi_line") + + @JvmField val PHONE_NUMBER = of("phone_number") + + @JvmField val PHYSICAL_ADDRESS = of("physical_address") + + @JvmField val POSTAL_CODE = of("postal_code") + + @JvmField val UNFORMATTED_SINGLE_LINE = of("unformatted_single_line") + + @JvmStatic fun of(value: String) = TextDisplayHint(JsonField.of(value)) + } + + /** An enum containing [TextDisplayHint]'s known values. */ + enum class Known { + DOMAIN_NAME, + EMAIL, + IP_ADDRESS, + MULTI_LINE, + PHONE_NUMBER, + PHYSICAL_ADDRESS, + POSTAL_CODE, + UNFORMATTED_SINGLE_LINE, + } + + /** + * An enum containing [TextDisplayHint]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [TextDisplayHint] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DOMAIN_NAME, + EMAIL, + IP_ADDRESS, + MULTI_LINE, + PHONE_NUMBER, + PHYSICAL_ADDRESS, + POSTAL_CODE, + UNFORMATTED_SINGLE_LINE, + /** + * An enum member indicating that [TextDisplayHint] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DOMAIN_NAME -> Value.DOMAIN_NAME + EMAIL -> Value.EMAIL + IP_ADDRESS -> Value.IP_ADDRESS + MULTI_LINE -> Value.MULTI_LINE + PHONE_NUMBER -> Value.PHONE_NUMBER + PHYSICAL_ADDRESS -> Value.PHYSICAL_ADDRESS + POSTAL_CODE -> Value.POSTAL_CODE + UNFORMATTED_SINGLE_LINE -> Value.UNFORMATTED_SINGLE_LINE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws HubSpotInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + DOMAIN_NAME -> Known.DOMAIN_NAME + EMAIL -> Known.EMAIL + IP_ADDRESS -> Known.IP_ADDRESS + MULTI_LINE -> Known.MULTI_LINE + PHONE_NUMBER -> Known.PHONE_NUMBER + PHYSICAL_ADDRESS -> Known.PHYSICAL_ADDRESS + POSTAL_CODE -> Known.POSTAL_CODE + UNFORMATTED_SINGLE_LINE -> Known.UNFORMATTED_SINGLE_LINE + else -> throw HubSpotInvalidDataException("Unknown TextDisplayHint: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws HubSpotInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { HubSpotInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws HubSpotInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): TextDisplayHint = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: HubSpotInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TextDisplayHint && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -1724,6 +1938,7 @@ private constructor( referencedObjectType == other.referencedObjectType && sensitiveDataCategories == other.sensitiveDataCategories && showCurrencySymbol == other.showCurrencySymbol && + textDisplayHint == other.textDisplayHint && updatedAt == other.updatedAt && updatedUserId == other.updatedUserId && additionalProperties == other.additionalProperties @@ -1758,6 +1973,7 @@ private constructor( referencedObjectType, sensitiveDataCategories, showCurrencySymbol, + textDisplayHint, updatedAt, updatedUserId, additionalProperties, @@ -1767,5 +1983,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Property1{description=$description, fieldType=$fieldType, groupName=$groupName, label=$label, name=$name, options=$options, type=$type, archived=$archived, archivedAt=$archivedAt, calculated=$calculated, calculationFormula=$calculationFormula, createdAt=$createdAt, createdUserId=$createdUserId, currencyPropertyName=$currencyPropertyName, dataSensitivity=$dataSensitivity, dateDisplayHint=$dateDisplayHint, displayOrder=$displayOrder, externalOptions=$externalOptions, formField=$formField, hasUniqueValue=$hasUniqueValue, hidden=$hidden, hubSpotDefined=$hubSpotDefined, modificationMetadata=$modificationMetadata, numberDisplayHint=$numberDisplayHint, referencedObjectType=$referencedObjectType, sensitiveDataCategories=$sensitiveDataCategories, showCurrencySymbol=$showCurrencySymbol, updatedAt=$updatedAt, updatedUserId=$updatedUserId, additionalProperties=$additionalProperties}" + "Property1{description=$description, fieldType=$fieldType, groupName=$groupName, label=$label, name=$name, options=$options, type=$type, archived=$archived, archivedAt=$archivedAt, calculated=$calculated, calculationFormula=$calculationFormula, createdAt=$createdAt, createdUserId=$createdUserId, currencyPropertyName=$currencyPropertyName, dataSensitivity=$dataSensitivity, dateDisplayHint=$dateDisplayHint, displayOrder=$displayOrder, externalOptions=$externalOptions, formField=$formField, hasUniqueValue=$hasUniqueValue, hidden=$hidden, hubSpotDefined=$hubSpotDefined, modificationMetadata=$modificationMetadata, numberDisplayHint=$numberDisplayHint, referencedObjectType=$referencedObjectType, sensitiveDataCategories=$sensitiveDataCategories, showCurrencySymbol=$showCurrencySymbol, textDisplayHint=$textDisplayHint, updatedAt=$updatedAt, updatedUserId=$updatedUserId, additionalProperties=$additionalProperties}" } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/pages/PagesPage.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/pages/PagesPage.kt index e2318ef5..7d78d7b2 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/pages/PagesPage.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/pages/PagesPage.kt @@ -3584,6 +3584,10 @@ private constructor( @JvmField val BA = of("ba") + @JvmField val BAL = of("bal") + + @JvmField val BAL_PK = of("bal-pk") + @JvmField val BAS = of("bas") @JvmField val BAS_CM = of("bas-cm") @@ -3614,6 +3618,10 @@ private constructor( @JvmField val BI = of("bi") + @JvmField val BLO = of("blo") + + @JvmField val BLO_BJ = of("blo-bj") + @JvmField val BM = of("bm") @JvmField val BM_ML = of("bm-ml") @@ -3690,6 +3698,10 @@ private constructor( @JvmField val CS_CZ = of("cs-cz") + @JvmField val CSW = of("csw") + + @JvmField val CSW_CA = of("csw-ca") + @JvmField val CU = of("cu") @JvmField val CU_RU = of("cu-ru") @@ -3820,6 +3832,8 @@ private constructor( @JvmField val EN_CY = of("en-cy") + @JvmField val EN_CZ = of("en-cz") + @JvmField val EN_DE = of("en-de") @JvmField val EN_DG = of("en-dg") @@ -3858,12 +3872,16 @@ private constructor( @JvmField val EN_GM = of("en-gm") + @JvmField val EN_GS = of("en-gs") + @JvmField val EN_GU = of("en-gu") @JvmField val EN_GY = of("en-gy") @JvmField val EN_HK = of("en-hk") + @JvmField val EN_HU = of("en-hu") + @JvmField val EN_ID = of("en-id") @JvmField val EN_IE = of("en-ie") @@ -3876,6 +3894,8 @@ private constructor( @JvmField val EN_IO = of("en-io") + @JvmField val EN_IT = of("en-it") + @JvmField val EN_JE = of("en-je") @JvmField val EN_JM = of("en-jm") @@ -3926,6 +3946,8 @@ private constructor( @JvmField val EN_NL = of("en-nl") + @JvmField val EN_NO = of("en-no") + @JvmField val EN_NR = of("en-nr") @JvmField val EN_NU = of("en-nu") @@ -3938,6 +3960,8 @@ private constructor( @JvmField val EN_PK = of("en-pk") + @JvmField val EN_PL = of("en-pl") + @JvmField val EN_PN = of("en-pn") @JvmField val EN_PR = of("en-pr") @@ -3946,6 +3970,8 @@ private constructor( @JvmField val EN_PW = of("en-pw") + @JvmField val EN_RO = of("en-ro") + @JvmField val EN_RW = of("en-rw") @JvmField val EN_SB = of("en-sb") @@ -3962,6 +3988,8 @@ private constructor( @JvmField val EN_SI = of("en-si") + @JvmField val EN_SK = of("en-sk") + @JvmField val EN_SL = of("en-sl") @JvmField val EN_SS = of("en-ss") @@ -4244,6 +4272,10 @@ private constructor( @JvmField val GA_IE = of("ga-ie") + @JvmField val GAA = of("gaa") + + @JvmField val GAA_GH = of("gaa-gh") + @JvmField val GD = of("gd") @JvmField val GD_GB = of("gd-gb") @@ -4310,6 +4342,8 @@ private constructor( @JvmField val HT = of("ht") + @JvmField val HT_HT = of("ht-ht") + @JvmField val HU = of("hu") @JvmField val HU_HU = of("hu-hu") @@ -4330,6 +4364,8 @@ private constructor( @JvmField val IE = of("ie") + @JvmField val IE_EE = of("ie-ee") + @JvmField val IG = of("ig") @JvmField val IG_NG = of("ig-ng") @@ -4440,6 +4476,8 @@ private constructor( @JvmField val KO = of("ko") + @JvmField val KO_CN = of("ko-cn") + @JvmField val KO_KP = of("ko-kp") @JvmField val KO_KR = of("ko-kr") @@ -4476,6 +4514,10 @@ private constructor( @JvmField val KW_GB = of("kw-gb") + @JvmField val KXV = of("kxv") + + @JvmField val KXV_IN = of("kxv-in") + @JvmField val KY = of("ky") @JvmField val KY_KG = of("ky-kg") @@ -4496,10 +4538,18 @@ private constructor( @JvmField val LI = of("li") + @JvmField val LIJ = of("lij") + + @JvmField val LIJ_IT = of("lij-it") + @JvmField val LKT = of("lkt") @JvmField val LKT_US = of("lkt-us") + @JvmField val LMO = of("lmo") + + @JvmField val LMO_IT = of("lmo-it") + @JvmField val LN = of("ln") @JvmField val LN_AO = of("ln-ao") @@ -4692,8 +4742,16 @@ private constructor( @JvmField val NO_NO = of("no-no") + @JvmField val NQO = of("nqo") + + @JvmField val NQO_GN = of("nqo-gn") + @JvmField val NR = of("nr") + @JvmField val NSO = of("nso") + + @JvmField val NSO_ZA = of("nso-za") + @JvmField val NUS = of("nus") @JvmField val NUS_SS = of("nus-ss") @@ -4952,6 +5010,10 @@ private constructor( @JvmField val ST = of("st") + @JvmField val ST_LS = of("st-ls") + + @JvmField val ST_ZA = of("st-za") + @JvmField val SU = of("su") @JvmField val SU_ID = of("su-id") @@ -4976,6 +5038,16 @@ private constructor( @JvmField val SY = of("sy") + @JvmField val SYR = of("syr") + + @JvmField val SYR_IQ = of("syr-iq") + + @JvmField val SYR_SY = of("syr-sy") + + @JvmField val SZL = of("szl") + + @JvmField val SZL_PL = of("szl-pl") + @JvmField val TA = of("ta") @JvmField val TA_IN = of("ta-in") @@ -5018,6 +5090,10 @@ private constructor( @JvmField val TN = of("tn") + @JvmField val TN_BW = of("tn-bw") + + @JvmField val TN_ZA = of("tn-za") + @JvmField val TO = of("to") @JvmField val TO_TO = of("to-to") @@ -5076,10 +5152,18 @@ private constructor( @JvmField val VE = of("ve") + @JvmField val VEC = of("vec") + + @JvmField val VEC_IT = of("vec-it") + @JvmField val VI = of("vi") @JvmField val VI_VN = of("vi-vn") + @JvmField val VMW = of("vmw") + + @JvmField val VMW_MZ = of("vmw-mz") + @JvmField val VO = of("vo") @JvmField val VO_001 = of("vo-001") @@ -5102,6 +5186,10 @@ private constructor( @JvmField val XH_ZA = of("xh-za") + @JvmField val XNR = of("xnr") + + @JvmField val XNR_IN = of("xnr-in") + @JvmField val XOG = of("xog") @JvmField val XOG_UG = of("xog-ug") @@ -5114,6 +5202,8 @@ private constructor( @JvmField val YI_001 = of("yi-001") + @JvmField val YI_UA = of("yi-ua") + @JvmField val YO = of("yo") @JvmField val YO_BJ = of("yo-bj") @@ -5134,8 +5224,12 @@ private constructor( @JvmField val YUE_HK = of("yue-hk") + @JvmField val YUE_MO = of("yue-mo") + @JvmField val ZA = of("za") + @JvmField val ZA_CN = of("za-cn") + @JvmField val ZGH = of("zgh") @JvmField val ZGH_MA = of("zgh-ma") @@ -5152,6 +5246,8 @@ private constructor( @JvmField val ZH_MO = of("zh-mo") + @JvmField val ZH_MY = of("zh-my") + @JvmField val ZH_SG = of("zh-sg") @JvmField val ZH_TW = of("zh-tw") @@ -5220,6 +5316,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -5235,6 +5333,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -5273,6 +5373,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -5338,6 +5440,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -5357,15 +5460,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -5391,16 +5497,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -5409,6 +5518,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -5550,6 +5660,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -5583,6 +5695,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -5593,6 +5706,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -5648,6 +5762,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -5666,6 +5781,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -5676,8 +5793,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -5774,7 +5895,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -5904,6 +6029,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -5916,6 +6043,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -5937,6 +6069,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -5966,8 +6100,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -5979,12 +6117,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -5995,7 +6136,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -6004,6 +6147,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -6075,6 +6219,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -6090,6 +6236,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -6128,6 +6276,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -6193,6 +6343,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -6212,15 +6363,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -6246,16 +6400,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -6264,6 +6421,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -6405,6 +6563,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -6438,6 +6598,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -6448,6 +6609,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -6503,6 +6665,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -6521,6 +6684,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -6531,8 +6696,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -6629,7 +6798,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -6759,6 +6932,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -6771,6 +6946,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -6792,6 +6972,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -6821,8 +7003,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -6834,12 +7020,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -6850,7 +7039,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -6859,6 +7050,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -6931,6 +7123,8 @@ private constructor( AZ -> Value.AZ AZ_AZ -> Value.AZ_AZ BA -> Value.BA + BAL -> Value.BAL + BAL_PK -> Value.BAL_PK BAS -> Value.BAS BAS_CM -> Value.BAS_CM BE -> Value.BE @@ -6946,6 +7140,8 @@ private constructor( BHO -> Value.BHO BHO_IN -> Value.BHO_IN BI -> Value.BI + BLO -> Value.BLO + BLO_BJ -> Value.BLO_BJ BM -> Value.BM BM_ML -> Value.BM_ML BN -> Value.BN @@ -6984,6 +7180,8 @@ private constructor( CR -> Value.CR CS -> Value.CS CS_CZ -> Value.CS_CZ + CSW -> Value.CSW + CSW_CA -> Value.CSW_CA CU -> Value.CU CU_RU -> Value.CU_RU CV -> Value.CV @@ -7049,6 +7247,7 @@ private constructor( EN_CN -> Value.EN_CN EN_CX -> Value.EN_CX EN_CY -> Value.EN_CY + EN_CZ -> Value.EN_CZ EN_DE -> Value.EN_DE EN_DG -> Value.EN_DG EN_DK -> Value.EN_DK @@ -7068,15 +7267,18 @@ private constructor( EN_GH -> Value.EN_GH EN_GI -> Value.EN_GI EN_GM -> Value.EN_GM + EN_GS -> Value.EN_GS EN_GU -> Value.EN_GU EN_GY -> Value.EN_GY EN_HK -> Value.EN_HK + EN_HU -> Value.EN_HU EN_ID -> Value.EN_ID EN_IE -> Value.EN_IE EN_IL -> Value.EN_IL EN_IM -> Value.EN_IM EN_IN -> Value.EN_IN EN_IO -> Value.EN_IO + EN_IT -> Value.EN_IT EN_JE -> Value.EN_JE EN_JM -> Value.EN_JM EN_KE -> Value.EN_KE @@ -7102,16 +7304,19 @@ private constructor( EN_NF -> Value.EN_NF EN_NG -> Value.EN_NG EN_NL -> Value.EN_NL + EN_NO -> Value.EN_NO EN_NR -> Value.EN_NR EN_NU -> Value.EN_NU EN_NZ -> Value.EN_NZ EN_PG -> Value.EN_PG EN_PH -> Value.EN_PH EN_PK -> Value.EN_PK + EN_PL -> Value.EN_PL EN_PN -> Value.EN_PN EN_PR -> Value.EN_PR EN_PT -> Value.EN_PT EN_PW -> Value.EN_PW + EN_RO -> Value.EN_RO EN_RW -> Value.EN_RW EN_SB -> Value.EN_SB EN_SC -> Value.EN_SC @@ -7120,6 +7325,7 @@ private constructor( EN_SG -> Value.EN_SG EN_SH -> Value.EN_SH EN_SI -> Value.EN_SI + EN_SK -> Value.EN_SK EN_SL -> Value.EN_SL EN_SS -> Value.EN_SS EN_SX -> Value.EN_SX @@ -7261,6 +7467,8 @@ private constructor( GA -> Value.GA GA_GB -> Value.GA_GB GA_IE -> Value.GA_IE + GAA -> Value.GAA + GAA_GH -> Value.GAA_GH GD -> Value.GD GD_GB -> Value.GD_GB GL -> Value.GL @@ -7294,6 +7502,7 @@ private constructor( HSB -> Value.HSB HSB_DE -> Value.HSB_DE HT -> Value.HT + HT_HT -> Value.HT_HT HU -> Value.HU HU_HU -> Value.HU_HU HY -> Value.HY @@ -7304,6 +7513,7 @@ private constructor( ID -> Value.ID ID_ID -> Value.ID_ID IE -> Value.IE + IE_EE -> Value.IE_EE IG -> Value.IG IG_NG -> Value.IG_NG II -> Value.II @@ -7359,6 +7569,7 @@ private constructor( KN -> Value.KN KN_IN -> Value.KN_IN KO -> Value.KO + KO_CN -> Value.KO_CN KO_KP -> Value.KO_KP KO_KR -> Value.KO_KR KOK -> Value.KOK @@ -7377,6 +7588,8 @@ private constructor( KV -> Value.KV KW -> Value.KW KW_GB -> Value.KW_GB + KXV -> Value.KXV + KXV_IN -> Value.KXV_IN KY -> Value.KY KY_KG -> Value.KY_KG LA -> Value.LA @@ -7387,8 +7600,12 @@ private constructor( LG -> Value.LG LG_UG -> Value.LG_UG LI -> Value.LI + LIJ -> Value.LIJ + LIJ_IT -> Value.LIJ_IT LKT -> Value.LKT LKT_US -> Value.LKT_US + LMO -> Value.LMO + LMO_IT -> Value.LMO_IT LN -> Value.LN LN_AO -> Value.LN_AO LN_CD -> Value.LN_CD @@ -7485,7 +7702,11 @@ private constructor( NNH_CM -> Value.NNH_CM NO -> Value.NO NO_NO -> Value.NO_NO + NQO -> Value.NQO + NQO_GN -> Value.NQO_GN NR -> Value.NR + NSO -> Value.NSO + NSO_ZA -> Value.NSO_ZA NUS -> Value.NUS NUS_SS -> Value.NUS_SS NV -> Value.NV @@ -7615,6 +7836,8 @@ private constructor( SR_XK -> Value.SR_XK SS -> Value.SS ST -> Value.ST + ST_LS -> Value.ST_LS + ST_ZA -> Value.ST_ZA SU -> Value.SU SU_ID -> Value.SU_ID SV -> Value.SV @@ -7627,6 +7850,11 @@ private constructor( SW_TZ -> Value.SW_TZ SW_UG -> Value.SW_UG SY -> Value.SY + SYR -> Value.SYR + SYR_IQ -> Value.SYR_IQ + SYR_SY -> Value.SYR_SY + SZL -> Value.SZL + SZL_PL -> Value.SZL_PL TA -> Value.TA TA_IN -> Value.TA_IN TA_LK -> Value.TA_LK @@ -7648,6 +7876,8 @@ private constructor( TK_TM -> Value.TK_TM TL -> Value.TL TN -> Value.TN + TN_BW -> Value.TN_BW + TN_ZA -> Value.TN_ZA TO -> Value.TO TO_TO -> Value.TO_TO TOK -> Value.TOK @@ -7677,8 +7907,12 @@ private constructor( VAI -> Value.VAI VAI_LR -> Value.VAI_LR VE -> Value.VE + VEC -> Value.VEC + VEC_IT -> Value.VEC_IT VI -> Value.VI VI_VN -> Value.VI_VN + VMW -> Value.VMW + VMW_MZ -> Value.VMW_MZ VO -> Value.VO VO_001 -> Value.VO_001 VUN -> Value.VUN @@ -7690,12 +7924,15 @@ private constructor( WO_SN -> Value.WO_SN XH -> Value.XH XH_ZA -> Value.XH_ZA + XNR -> Value.XNR + XNR_IN -> Value.XNR_IN XOG -> Value.XOG XOG_UG -> Value.XOG_UG YAV -> Value.YAV YAV_CM -> Value.YAV_CM YI -> Value.YI YI_001 -> Value.YI_001 + YI_UA -> Value.YI_UA YO -> Value.YO YO_BJ -> Value.YO_BJ YO_NG -> Value.YO_NG @@ -7706,7 +7943,9 @@ private constructor( YUE -> Value.YUE YUE_CN -> Value.YUE_CN YUE_HK -> Value.YUE_HK + YUE_MO -> Value.YUE_MO ZA -> Value.ZA + ZA_CN -> Value.ZA_CN ZGH -> Value.ZGH ZGH_MA -> Value.ZGH_MA ZH -> Value.ZH @@ -7715,6 +7954,7 @@ private constructor( ZH_HANT -> Value.ZH_HANT ZH_HK -> Value.ZH_HK ZH_MO -> Value.ZH_MO + ZH_MY -> Value.ZH_MY ZH_SG -> Value.ZH_SG ZH_TW -> Value.ZH_TW ZU -> Value.ZU @@ -7788,6 +8028,8 @@ private constructor( AZ -> Known.AZ AZ_AZ -> Known.AZ_AZ BA -> Known.BA + BAL -> Known.BAL + BAL_PK -> Known.BAL_PK BAS -> Known.BAS BAS_CM -> Known.BAS_CM BE -> Known.BE @@ -7803,6 +8045,8 @@ private constructor( BHO -> Known.BHO BHO_IN -> Known.BHO_IN BI -> Known.BI + BLO -> Known.BLO + BLO_BJ -> Known.BLO_BJ BM -> Known.BM BM_ML -> Known.BM_ML BN -> Known.BN @@ -7841,6 +8085,8 @@ private constructor( CR -> Known.CR CS -> Known.CS CS_CZ -> Known.CS_CZ + CSW -> Known.CSW + CSW_CA -> Known.CSW_CA CU -> Known.CU CU_RU -> Known.CU_RU CV -> Known.CV @@ -7906,6 +8152,7 @@ private constructor( EN_CN -> Known.EN_CN EN_CX -> Known.EN_CX EN_CY -> Known.EN_CY + EN_CZ -> Known.EN_CZ EN_DE -> Known.EN_DE EN_DG -> Known.EN_DG EN_DK -> Known.EN_DK @@ -7925,15 +8172,18 @@ private constructor( EN_GH -> Known.EN_GH EN_GI -> Known.EN_GI EN_GM -> Known.EN_GM + EN_GS -> Known.EN_GS EN_GU -> Known.EN_GU EN_GY -> Known.EN_GY EN_HK -> Known.EN_HK + EN_HU -> Known.EN_HU EN_ID -> Known.EN_ID EN_IE -> Known.EN_IE EN_IL -> Known.EN_IL EN_IM -> Known.EN_IM EN_IN -> Known.EN_IN EN_IO -> Known.EN_IO + EN_IT -> Known.EN_IT EN_JE -> Known.EN_JE EN_JM -> Known.EN_JM EN_KE -> Known.EN_KE @@ -7959,16 +8209,19 @@ private constructor( EN_NF -> Known.EN_NF EN_NG -> Known.EN_NG EN_NL -> Known.EN_NL + EN_NO -> Known.EN_NO EN_NR -> Known.EN_NR EN_NU -> Known.EN_NU EN_NZ -> Known.EN_NZ EN_PG -> Known.EN_PG EN_PH -> Known.EN_PH EN_PK -> Known.EN_PK + EN_PL -> Known.EN_PL EN_PN -> Known.EN_PN EN_PR -> Known.EN_PR EN_PT -> Known.EN_PT EN_PW -> Known.EN_PW + EN_RO -> Known.EN_RO EN_RW -> Known.EN_RW EN_SB -> Known.EN_SB EN_SC -> Known.EN_SC @@ -7977,6 +8230,7 @@ private constructor( EN_SG -> Known.EN_SG EN_SH -> Known.EN_SH EN_SI -> Known.EN_SI + EN_SK -> Known.EN_SK EN_SL -> Known.EN_SL EN_SS -> Known.EN_SS EN_SX -> Known.EN_SX @@ -8118,6 +8372,8 @@ private constructor( GA -> Known.GA GA_GB -> Known.GA_GB GA_IE -> Known.GA_IE + GAA -> Known.GAA + GAA_GH -> Known.GAA_GH GD -> Known.GD GD_GB -> Known.GD_GB GL -> Known.GL @@ -8151,6 +8407,7 @@ private constructor( HSB -> Known.HSB HSB_DE -> Known.HSB_DE HT -> Known.HT + HT_HT -> Known.HT_HT HU -> Known.HU HU_HU -> Known.HU_HU HY -> Known.HY @@ -8161,6 +8418,7 @@ private constructor( ID -> Known.ID ID_ID -> Known.ID_ID IE -> Known.IE + IE_EE -> Known.IE_EE IG -> Known.IG IG_NG -> Known.IG_NG II -> Known.II @@ -8216,6 +8474,7 @@ private constructor( KN -> Known.KN KN_IN -> Known.KN_IN KO -> Known.KO + KO_CN -> Known.KO_CN KO_KP -> Known.KO_KP KO_KR -> Known.KO_KR KOK -> Known.KOK @@ -8234,6 +8493,8 @@ private constructor( KV -> Known.KV KW -> Known.KW KW_GB -> Known.KW_GB + KXV -> Known.KXV + KXV_IN -> Known.KXV_IN KY -> Known.KY KY_KG -> Known.KY_KG LA -> Known.LA @@ -8244,8 +8505,12 @@ private constructor( LG -> Known.LG LG_UG -> Known.LG_UG LI -> Known.LI + LIJ -> Known.LIJ + LIJ_IT -> Known.LIJ_IT LKT -> Known.LKT LKT_US -> Known.LKT_US + LMO -> Known.LMO + LMO_IT -> Known.LMO_IT LN -> Known.LN LN_AO -> Known.LN_AO LN_CD -> Known.LN_CD @@ -8342,7 +8607,11 @@ private constructor( NNH_CM -> Known.NNH_CM NO -> Known.NO NO_NO -> Known.NO_NO + NQO -> Known.NQO + NQO_GN -> Known.NQO_GN NR -> Known.NR + NSO -> Known.NSO + NSO_ZA -> Known.NSO_ZA NUS -> Known.NUS NUS_SS -> Known.NUS_SS NV -> Known.NV @@ -8472,6 +8741,8 @@ private constructor( SR_XK -> Known.SR_XK SS -> Known.SS ST -> Known.ST + ST_LS -> Known.ST_LS + ST_ZA -> Known.ST_ZA SU -> Known.SU SU_ID -> Known.SU_ID SV -> Known.SV @@ -8484,6 +8755,11 @@ private constructor( SW_TZ -> Known.SW_TZ SW_UG -> Known.SW_UG SY -> Known.SY + SYR -> Known.SYR + SYR_IQ -> Known.SYR_IQ + SYR_SY -> Known.SYR_SY + SZL -> Known.SZL + SZL_PL -> Known.SZL_PL TA -> Known.TA TA_IN -> Known.TA_IN TA_LK -> Known.TA_LK @@ -8505,6 +8781,8 @@ private constructor( TK_TM -> Known.TK_TM TL -> Known.TL TN -> Known.TN + TN_BW -> Known.TN_BW + TN_ZA -> Known.TN_ZA TO -> Known.TO TO_TO -> Known.TO_TO TOK -> Known.TOK @@ -8534,8 +8812,12 @@ private constructor( VAI -> Known.VAI VAI_LR -> Known.VAI_LR VE -> Known.VE + VEC -> Known.VEC + VEC_IT -> Known.VEC_IT VI -> Known.VI VI_VN -> Known.VI_VN + VMW -> Known.VMW + VMW_MZ -> Known.VMW_MZ VO -> Known.VO VO_001 -> Known.VO_001 VUN -> Known.VUN @@ -8547,12 +8829,15 @@ private constructor( WO_SN -> Known.WO_SN XH -> Known.XH XH_ZA -> Known.XH_ZA + XNR -> Known.XNR + XNR_IN -> Known.XNR_IN XOG -> Known.XOG XOG_UG -> Known.XOG_UG YAV -> Known.YAV YAV_CM -> Known.YAV_CM YI -> Known.YI YI_001 -> Known.YI_001 + YI_UA -> Known.YI_UA YO -> Known.YO YO_BJ -> Known.YO_BJ YO_NG -> Known.YO_NG @@ -8563,7 +8848,9 @@ private constructor( YUE -> Known.YUE YUE_CN -> Known.YUE_CN YUE_HK -> Known.YUE_HK + YUE_MO -> Known.YUE_MO ZA -> Known.ZA + ZA_CN -> Known.ZA_CN ZGH -> Known.ZGH ZGH_MA -> Known.ZGH_MA ZH -> Known.ZH @@ -8572,6 +8859,7 @@ private constructor( ZH_HANT -> Known.ZH_HANT ZH_HK -> Known.ZH_HK ZH_MO -> Known.ZH_MO + ZH_MY -> Known.ZH_MY ZH_SG -> Known.ZH_SG ZH_TW -> Known.ZH_TW ZU -> Known.ZU diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/conversations/customchannels/ChannelIntegrationMessageEgg.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/conversations/customchannels/ChannelIntegrationMessageEgg.kt index c07bc151..4a39e9dc 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/conversations/customchannels/ChannelIntegrationMessageEgg.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/conversations/customchannels/ChannelIntegrationMessageEgg.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkKnown import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow @@ -399,6 +398,20 @@ private constructor( /** Alias for calling [addAttachment] with `Attachment.ofFile(file)`. */ fun addAttachment(file: FileAttachment) = addAttachment(Attachment.ofFile(file)) + /** + * Alias for calling [addAttachment] with the following: + * ```java + * FileAttachment.builder() + * .type(FileAttachment.Type.FILE) + * .fileId(fileId) + * .build() + * ``` + */ + fun addFileAttachment(fileId: String) = + addAttachment( + FileAttachment.builder().type(FileAttachment.Type.FILE).fileId(fileId).build() + ) + /** Alias for calling [addAttachment] with `Attachment.ofLocation(location)`. */ fun addAttachment(location: LocationAttachment) = addAttachment(Attachment.ofLocation(location)) @@ -406,6 +419,23 @@ private constructor( /** Alias for calling [addAttachment] with `Attachment.ofContact(contact)`. */ fun addAttachment(contact: ContactAttachment) = addAttachment(Attachment.ofContact(contact)) + /** + * Alias for calling [addAttachment] with the following: + * ```java + * ContactAttachment.builder() + * .type(ContactAttachment.Type.CONTACT) + * .contactProfile(contactProfile) + * .build() + * ``` + */ + fun addContactAttachment(contactProfile: ContactProfile) = + addAttachment( + ContactAttachment.builder() + .type(ContactAttachment.Type.CONTACT) + .contactProfile(contactProfile) + .build() + ) + /** * Alias for calling [addAttachment] with * `Attachment.ofUnsupportedContent(unsupportedContent)`. @@ -421,12 +451,46 @@ private constructor( fun addAttachment(quickReplies: QuickRepliesAttachment) = addAttachment(Attachment.ofQuickReplies(quickReplies)) + /** + * Alias for calling [addAttachment] with the following: + * ```java + * QuickRepliesAttachment.builder() + * .type(QuickRepliesAttachment.Type.QUICK_REPLIES) + * .quickReplies(quickReplies) + * .build() + * ``` + */ + fun addQuickRepliesAttachment(quickReplies: List) = + addAttachment( + QuickRepliesAttachment.builder() + .type(QuickRepliesAttachment.Type.QUICK_REPLIES) + .quickReplies(quickReplies) + .build() + ) + /** * Alias for calling [addAttachment] with - * `Attachment.ofSocialMetadataIntegration(socialMetadataIntegration)`. + * `Attachment.ofSocialMediaMetadata(socialMediaMetadata)`. + */ + fun addAttachment(socialMediaMetadata: SocialMetadataIntegrationAttachment) = + addAttachment(Attachment.ofSocialMediaMetadata(socialMediaMetadata)) + + /** + * Alias for calling [addAttachment] with the following: + * ```java + * SocialMetadataIntegrationAttachment.builder() + * .type(SocialMetadataIntegrationAttachment.Type.SOCIAL_MEDIA_METADATA) + * .socialMetadata(socialMetadata) + * .build() + * ``` */ - fun addAttachment(socialMetadataIntegration: SocialMetadataIntegrationAttachment) = - addAttachment(Attachment.ofSocialMetadataIntegration(socialMetadataIntegration)) + fun addSocialMediaMetadataAttachment(socialMetadata: SocialMetadata) = + addAttachment( + SocialMetadataIntegrationAttachment.builder() + .type(SocialMetadataIntegrationAttachment.Type.SOCIAL_MEDIA_METADATA) + .socialMetadata(socialMetadata) + .build() + ) fun channelAccountId(channelAccountId: String) = channelAccountId(JsonField.of(channelAccountId)) @@ -731,7 +795,7 @@ private constructor( private val unsupportedContent: UnsupportedContentAttachment? = null, private val messageHeader: MessageHeaderAttachment? = null, private val quickReplies: QuickRepliesAttachment? = null, - private val socialMetadataIntegration: SocialMetadataIntegrationAttachment? = null, + private val socialMediaMetadata: SocialMetadataIntegrationAttachment? = null, private val _json: JsonValue? = null, ) { @@ -748,8 +812,8 @@ private constructor( fun quickReplies(): Optional = Optional.ofNullable(quickReplies) - fun socialMetadataIntegration(): Optional = - Optional.ofNullable(socialMetadataIntegration) + fun socialMediaMetadata(): Optional = + Optional.ofNullable(socialMediaMetadata) fun isFile(): Boolean = file != null @@ -763,7 +827,7 @@ private constructor( fun isQuickReplies(): Boolean = quickReplies != null - fun isSocialMetadataIntegration(): Boolean = socialMetadataIntegration != null + fun isSocialMediaMetadata(): Boolean = socialMediaMetadata != null fun asFile(): FileAttachment = file.getOrThrow("file") @@ -778,8 +842,8 @@ private constructor( fun asQuickReplies(): QuickRepliesAttachment = quickReplies.getOrThrow("quickReplies") - fun asSocialMetadataIntegration(): SocialMetadataIntegrationAttachment = - socialMetadataIntegration.getOrThrow("socialMetadataIntegration") + fun asSocialMediaMetadata(): SocialMetadataIntegrationAttachment = + socialMediaMetadata.getOrThrow("socialMediaMetadata") fun _json(): Optional = Optional.ofNullable(_json) @@ -820,8 +884,7 @@ private constructor( unsupportedContent != null -> visitor.visitUnsupportedContent(unsupportedContent) messageHeader != null -> visitor.visitMessageHeader(messageHeader) quickReplies != null -> visitor.visitQuickReplies(quickReplies) - socialMetadataIntegration != null -> - visitor.visitSocialMetadataIntegration(socialMetadataIntegration) + socialMediaMetadata != null -> visitor.visitSocialMediaMetadata(socialMediaMetadata) else -> visitor.unknown(_json) } @@ -869,10 +932,10 @@ private constructor( quickReplies.validate() } - override fun visitSocialMetadataIntegration( - socialMetadataIntegration: SocialMetadataIntegrationAttachment + override fun visitSocialMediaMetadata( + socialMediaMetadata: SocialMetadataIntegrationAttachment ) { - socialMetadataIntegration.validate() + socialMediaMetadata.validate() } } ) @@ -913,9 +976,9 @@ private constructor( override fun visitQuickReplies(quickReplies: QuickRepliesAttachment) = quickReplies.validity() - override fun visitSocialMetadataIntegration( - socialMetadataIntegration: SocialMetadataIntegrationAttachment - ) = socialMetadataIntegration.validity() + override fun visitSocialMediaMetadata( + socialMediaMetadata: SocialMetadataIntegrationAttachment + ) = socialMediaMetadata.validity() override fun unknown(json: JsonValue?) = 0 } @@ -933,7 +996,7 @@ private constructor( unsupportedContent == other.unsupportedContent && messageHeader == other.messageHeader && quickReplies == other.quickReplies && - socialMetadataIntegration == other.socialMetadataIntegration + socialMediaMetadata == other.socialMediaMetadata } override fun hashCode(): Int = @@ -944,7 +1007,7 @@ private constructor( unsupportedContent, messageHeader, quickReplies, - socialMetadataIntegration, + socialMediaMetadata, ) override fun toString(): String = @@ -955,8 +1018,8 @@ private constructor( unsupportedContent != null -> "Attachment{unsupportedContent=$unsupportedContent}" messageHeader != null -> "Attachment{messageHeader=$messageHeader}" quickReplies != null -> "Attachment{quickReplies=$quickReplies}" - socialMetadataIntegration != null -> - "Attachment{socialMetadataIntegration=$socialMetadataIntegration}" + socialMediaMetadata != null -> + "Attachment{socialMediaMetadata=$socialMediaMetadata}" _json != null -> "Attachment{_unknown=$_json}" else -> throw IllegalStateException("Invalid Attachment") } @@ -983,9 +1046,8 @@ private constructor( Attachment(quickReplies = quickReplies) @JvmStatic - fun ofSocialMetadataIntegration( - socialMetadataIntegration: SocialMetadataIntegrationAttachment - ) = Attachment(socialMetadataIntegration = socialMetadataIntegration) + fun ofSocialMediaMetadata(socialMediaMetadata: SocialMetadataIntegrationAttachment) = + Attachment(socialMediaMetadata = socialMediaMetadata) } /** @@ -1005,8 +1067,8 @@ private constructor( fun visitQuickReplies(quickReplies: QuickRepliesAttachment): T - fun visitSocialMetadataIntegration( - socialMetadataIntegration: SocialMetadataIntegrationAttachment + fun visitSocialMediaMetadata( + socialMediaMetadata: SocialMetadataIntegrationAttachment ): T /** @@ -1028,45 +1090,50 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Attachment { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - Attachment(file = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Attachment(location = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Attachment(contact = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Attachment(unsupportedContent = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - Attachment(messageHeader = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Attachment(quickReplies = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { Attachment(socialMetadataIntegration = it, _json = json) }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> Attachment(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "FILE" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Attachment(file = it, _json = json) + } ?: Attachment(_json = json) + } + "LOCATION" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Attachment(location = it, _json = json) + } ?: Attachment(_json = json) + } + "CONTACT" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Attachment(contact = it, _json = json) + } ?: Attachment(_json = json) + } + "UNSUPPORTED_CONTENT" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Attachment(unsupportedContent = it, _json = json) } + ?: Attachment(_json = json) + } + "MESSAGE_HEADER" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Attachment(messageHeader = it, _json = json) } + ?: Attachment(_json = json) + } + "QUICK_REPLIES" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Attachment(quickReplies = it, _json = json) + } ?: Attachment(_json = json) + } + "SOCIAL_MEDIA_METADATA" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Attachment(socialMediaMetadata = it, _json = json) } + ?: Attachment(_json = json) + } } + + return Attachment(_json = json) } } @@ -1085,8 +1152,8 @@ private constructor( generator.writeObject(value.unsupportedContent) value.messageHeader != null -> generator.writeObject(value.messageHeader) value.quickReplies != null -> generator.writeObject(value.quickReplies) - value.socialMetadataIntegration != null -> - generator.writeObject(value.socialMetadataIntegration) + value.socialMediaMetadata != null -> + generator.writeObject(value.socialMediaMetadata) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Attachment") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/conversations/customchannels/PreResolvedContact.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/conversations/customchannels/PreResolvedContact.kt index 83520670..529f76ac 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/conversations/customchannels/PreResolvedContact.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/conversations/customchannels/PreResolvedContact.kt @@ -660,6 +660,10 @@ private constructor( @JvmField val HS_IS_ENRICHED = of("hs_is_enriched") + @JvmField + val HS_IS_MASS_MARKETING_ACTIVATION_DISALLOWED = + of("hs_is_mass_marketing_activation_disallowed") + @JvmField val HS_IS_MERGE_REVERTIBLE = of("hs_is_merge_revertible") @JvmField val HS_IS_UNWORKED = of("hs_is_unworked") @@ -1331,6 +1335,7 @@ private constructor( HS_IP_TIMEZONE, HS_IS_CONTACT, HS_IS_ENRICHED, + HS_IS_MASS_MARKETING_ACTIVATION_DISALLOWED, HS_IS_MERGE_REVERTIBLE, HS_IS_UNWORKED, HS_JOB_CHANGE_DETECTED_DATE, @@ -1735,6 +1740,7 @@ private constructor( HS_IP_TIMEZONE, HS_IS_CONTACT, HS_IS_ENRICHED, + HS_IS_MASS_MARKETING_ACTIVATION_DISALLOWED, HS_IS_MERGE_REVERTIBLE, HS_IS_UNWORKED, HS_JOB_CHANGE_DETECTED_DATE, @@ -2158,6 +2164,8 @@ private constructor( HS_IP_TIMEZONE -> Value.HS_IP_TIMEZONE HS_IS_CONTACT -> Value.HS_IS_CONTACT HS_IS_ENRICHED -> Value.HS_IS_ENRICHED + HS_IS_MASS_MARKETING_ACTIVATION_DISALLOWED -> + Value.HS_IS_MASS_MARKETING_ACTIVATION_DISALLOWED HS_IS_MERGE_REVERTIBLE -> Value.HS_IS_MERGE_REVERTIBLE HS_IS_UNWORKED -> Value.HS_IS_UNWORKED HS_JOB_CHANGE_DETECTED_DATE -> Value.HS_JOB_CHANGE_DETECTED_DATE @@ -2601,6 +2609,8 @@ private constructor( HS_IP_TIMEZONE -> Known.HS_IP_TIMEZONE HS_IS_CONTACT -> Known.HS_IS_CONTACT HS_IS_ENRICHED -> Known.HS_IS_ENRICHED + HS_IS_MASS_MARKETING_ACTIVATION_DISALLOWED -> + Known.HS_IS_MASS_MARKETING_ACTIVATION_DISALLOWED HS_IS_MERGE_REVERTIBLE -> Known.HS_IS_MERGE_REVERTIBLE HS_IS_UNWORKED -> Known.HS_IS_UNWORKED HS_JOB_CHANGE_DETECTED_DATE -> Known.HS_JOB_CHANGE_DETECTED_DATE diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/conversations/customchannels/PublicConversationsMessage.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/conversations/customchannels/PublicConversationsMessage.kt index 540d8144..2041aa4c 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/conversations/customchannels/PublicConversationsMessage.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/conversations/customchannels/PublicConversationsMessage.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkKnown import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow @@ -538,54 +537,77 @@ private constructor( } } - /** Alias for calling [addAttachment] with `Attachment.ofPublicFile(publicFile)`. */ - fun addAttachment(publicFile: PublicFile) = - addAttachment(Attachment.ofPublicFile(publicFile)) + /** Alias for calling [addAttachment] with `Attachment.ofFile(file)`. */ + fun addAttachment(file: PublicFile) = addAttachment(Attachment.ofFile(file)) - /** Alias for calling [addAttachment] with `Attachment.ofPublicLocation(publicLocation)`. */ - fun addAttachment(publicLocation: PublicLocation) = - addAttachment(Attachment.ofPublicLocation(publicLocation)) + /** Alias for calling [addAttachment] with `Attachment.ofLocation(location)`. */ + fun addAttachment(location: PublicLocation) = addAttachment(Attachment.ofLocation(location)) - /** Alias for calling [addAttachment] with `Attachment.ofPublicContact(publicContact)`. */ - fun addAttachment(publicContact: PublicContact) = - addAttachment(Attachment.ofPublicContact(publicContact)) + /** Alias for calling [addAttachment] with `Attachment.ofContact(contact)`. */ + fun addAttachment(contact: PublicContact) = addAttachment(Attachment.ofContact(contact)) /** - * Alias for calling [addAttachment] with - * `Attachment.ofPublicUnsupportedContent(publicUnsupportedContent)`. + * Alias for calling [addAttachment] with the following: + * ```java + * PublicContact.builder() + * .type(PublicContact.Type.CONTACT) + * .contactProfile(contactProfile) + * .build() + * ``` */ - fun addAttachment(publicUnsupportedContent: PublicUnsupportedContent) = - addAttachment(Attachment.ofPublicUnsupportedContent(publicUnsupportedContent)) + fun addContactAttachment(contactProfile: ContactProfile) = + addAttachment( + PublicContact.builder() + .type(PublicContact.Type.CONTACT) + .contactProfile(contactProfile) + .build() + ) /** * Alias for calling [addAttachment] with - * `Attachment.ofPublicMessageHeader(publicMessageHeader)`. + * `Attachment.ofUnsupportedContent(unsupportedContent)`. */ - fun addAttachment(publicMessageHeader: PublicMessageHeader) = - addAttachment(Attachment.ofPublicMessageHeader(publicMessageHeader)) + fun addAttachment(unsupportedContent: PublicUnsupportedContent) = + addAttachment(Attachment.ofUnsupportedContent(unsupportedContent)) + + /** Alias for calling [addAttachment] with `Attachment.ofMessageHeader(messageHeader)`. */ + fun addAttachment(messageHeader: PublicMessageHeader) = + addAttachment(Attachment.ofMessageHeader(messageHeader)) + + /** Alias for calling [addAttachment] with `Attachment.ofQuickReplies(quickReplies)`. */ + fun addAttachment(quickReplies: PublicQuickReplies) = + addAttachment(Attachment.ofQuickReplies(quickReplies)) /** * Alias for calling [addAttachment] with - * `Attachment.ofPublicQuickReplies(publicQuickReplies)`. + * `Attachment.ofWhatsappTemplateMetadata(whatsappTemplateMetadata)`. */ - fun addAttachment(publicQuickReplies: PublicQuickReplies) = - addAttachment(Attachment.ofPublicQuickReplies(publicQuickReplies)) + fun addAttachment(whatsappTemplateMetadata: PublicWhatsAppTemplateMetadata) = + addAttachment(Attachment.ofWhatsappTemplateMetadata(whatsappTemplateMetadata)) /** * Alias for calling [addAttachment] with - * `Attachment.ofPublicWhatsAppTemplateMetadata(publicWhatsAppTemplateMetadata)`. + * `Attachment.ofSocialMediaMetadata(socialMediaMetadata)`. */ - fun addAttachment(publicWhatsAppTemplateMetadata: PublicWhatsAppTemplateMetadata) = - addAttachment( - Attachment.ofPublicWhatsAppTemplateMetadata(publicWhatsAppTemplateMetadata) - ) + fun addAttachment(socialMediaMetadata: PublicSocialMetadataAttachment) = + addAttachment(Attachment.ofSocialMediaMetadata(socialMediaMetadata)) /** - * Alias for calling [addAttachment] with - * `Attachment.ofPublicSocialMetadata(publicSocialMetadata)`. + * Alias for calling [addAttachment] with the following: + * ```java + * PublicSocialMetadataAttachment.builder() + * .type(PublicSocialMetadataAttachment.Type.SOCIAL_MEDIA_METADATA) + * .socialMetadata(socialMetadata) + * .build() + * ``` */ - fun addAttachment(publicSocialMetadata: PublicSocialMetadataAttachment) = - addAttachment(Attachment.ofPublicSocialMetadata(publicSocialMetadata)) + fun addSocialMediaMetadataAttachment(socialMetadata: SocialMetadata) = + addAttachment( + PublicSocialMetadataAttachment.builder() + .type(PublicSocialMetadataAttachment.Type.SOCIAL_MEDIA_METADATA) + .socialMetadata(socialMetadata) + .build() + ) fun channelAccountId(channelAccountId: String) = channelAccountId(JsonField.of(channelAccountId)) @@ -956,74 +978,70 @@ private constructor( @JsonSerialize(using = Attachment.Serializer::class) class Attachment private constructor( - private val publicFile: PublicFile? = null, - private val publicLocation: PublicLocation? = null, - private val publicContact: PublicContact? = null, - private val publicUnsupportedContent: PublicUnsupportedContent? = null, - private val publicMessageHeader: PublicMessageHeader? = null, - private val publicQuickReplies: PublicQuickReplies? = null, - private val publicWhatsAppTemplateMetadata: PublicWhatsAppTemplateMetadata? = null, - private val publicSocialMetadata: PublicSocialMetadataAttachment? = null, + private val file: PublicFile? = null, + private val location: PublicLocation? = null, + private val contact: PublicContact? = null, + private val unsupportedContent: PublicUnsupportedContent? = null, + private val messageHeader: PublicMessageHeader? = null, + private val quickReplies: PublicQuickReplies? = null, + private val whatsappTemplateMetadata: PublicWhatsAppTemplateMetadata? = null, + private val socialMediaMetadata: PublicSocialMetadataAttachment? = null, private val _json: JsonValue? = null, ) { - fun publicFile(): Optional = Optional.ofNullable(publicFile) + fun file(): Optional = Optional.ofNullable(file) - fun publicLocation(): Optional = Optional.ofNullable(publicLocation) + fun location(): Optional = Optional.ofNullable(location) - fun publicContact(): Optional = Optional.ofNullable(publicContact) + fun contact(): Optional = Optional.ofNullable(contact) - fun publicUnsupportedContent(): Optional = - Optional.ofNullable(publicUnsupportedContent) + fun unsupportedContent(): Optional = + Optional.ofNullable(unsupportedContent) - fun publicMessageHeader(): Optional = - Optional.ofNullable(publicMessageHeader) + fun messageHeader(): Optional = Optional.ofNullable(messageHeader) - fun publicQuickReplies(): Optional = - Optional.ofNullable(publicQuickReplies) + fun quickReplies(): Optional = Optional.ofNullable(quickReplies) - fun publicWhatsAppTemplateMetadata(): Optional = - Optional.ofNullable(publicWhatsAppTemplateMetadata) + fun whatsappTemplateMetadata(): Optional = + Optional.ofNullable(whatsappTemplateMetadata) - fun publicSocialMetadata(): Optional = - Optional.ofNullable(publicSocialMetadata) + fun socialMediaMetadata(): Optional = + Optional.ofNullable(socialMediaMetadata) - fun isPublicFile(): Boolean = publicFile != null + fun isFile(): Boolean = file != null - fun isPublicLocation(): Boolean = publicLocation != null + fun isLocation(): Boolean = location != null - fun isPublicContact(): Boolean = publicContact != null + fun isContact(): Boolean = contact != null - fun isPublicUnsupportedContent(): Boolean = publicUnsupportedContent != null + fun isUnsupportedContent(): Boolean = unsupportedContent != null - fun isPublicMessageHeader(): Boolean = publicMessageHeader != null + fun isMessageHeader(): Boolean = messageHeader != null - fun isPublicQuickReplies(): Boolean = publicQuickReplies != null + fun isQuickReplies(): Boolean = quickReplies != null - fun isPublicWhatsAppTemplateMetadata(): Boolean = publicWhatsAppTemplateMetadata != null + fun isWhatsappTemplateMetadata(): Boolean = whatsappTemplateMetadata != null - fun isPublicSocialMetadata(): Boolean = publicSocialMetadata != null + fun isSocialMediaMetadata(): Boolean = socialMediaMetadata != null - fun asPublicFile(): PublicFile = publicFile.getOrThrow("publicFile") + fun asFile(): PublicFile = file.getOrThrow("file") - fun asPublicLocation(): PublicLocation = publicLocation.getOrThrow("publicLocation") + fun asLocation(): PublicLocation = location.getOrThrow("location") - fun asPublicContact(): PublicContact = publicContact.getOrThrow("publicContact") + fun asContact(): PublicContact = contact.getOrThrow("contact") - fun asPublicUnsupportedContent(): PublicUnsupportedContent = - publicUnsupportedContent.getOrThrow("publicUnsupportedContent") + fun asUnsupportedContent(): PublicUnsupportedContent = + unsupportedContent.getOrThrow("unsupportedContent") - fun asPublicMessageHeader(): PublicMessageHeader = - publicMessageHeader.getOrThrow("publicMessageHeader") + fun asMessageHeader(): PublicMessageHeader = messageHeader.getOrThrow("messageHeader") - fun asPublicQuickReplies(): PublicQuickReplies = - publicQuickReplies.getOrThrow("publicQuickReplies") + fun asQuickReplies(): PublicQuickReplies = quickReplies.getOrThrow("quickReplies") - fun asPublicWhatsAppTemplateMetadata(): PublicWhatsAppTemplateMetadata = - publicWhatsAppTemplateMetadata.getOrThrow("publicWhatsAppTemplateMetadata") + fun asWhatsappTemplateMetadata(): PublicWhatsAppTemplateMetadata = + whatsappTemplateMetadata.getOrThrow("whatsappTemplateMetadata") - fun asPublicSocialMetadata(): PublicSocialMetadataAttachment = - publicSocialMetadata.getOrThrow("publicSocialMetadata") + fun asSocialMediaMetadata(): PublicSocialMetadataAttachment = + socialMediaMetadata.getOrThrow("socialMediaMetadata") fun _json(): Optional = Optional.ofNullable(_json) @@ -1039,8 +1057,8 @@ private constructor( * * Optional result = attachment.accept(new Attachment.Visitor>() { * @Override - * public Optional visitPublicFile(PublicFile publicFile) { - * return Optional.of(publicFile.toString()); + * public Optional visitFile(PublicFile file) { + * return Optional.of(file.toString()); * } * * // ... @@ -1058,17 +1076,15 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicFile != null -> visitor.visitPublicFile(publicFile) - publicLocation != null -> visitor.visitPublicLocation(publicLocation) - publicContact != null -> visitor.visitPublicContact(publicContact) - publicUnsupportedContent != null -> - visitor.visitPublicUnsupportedContent(publicUnsupportedContent) - publicMessageHeader != null -> visitor.visitPublicMessageHeader(publicMessageHeader) - publicQuickReplies != null -> visitor.visitPublicQuickReplies(publicQuickReplies) - publicWhatsAppTemplateMetadata != null -> - visitor.visitPublicWhatsAppTemplateMetadata(publicWhatsAppTemplateMetadata) - publicSocialMetadata != null -> - visitor.visitPublicSocialMetadata(publicSocialMetadata) + file != null -> visitor.visitFile(file) + location != null -> visitor.visitLocation(location) + contact != null -> visitor.visitContact(contact) + unsupportedContent != null -> visitor.visitUnsupportedContent(unsupportedContent) + messageHeader != null -> visitor.visitMessageHeader(messageHeader) + quickReplies != null -> visitor.visitQuickReplies(quickReplies) + whatsappTemplateMetadata != null -> + visitor.visitWhatsappTemplateMetadata(whatsappTemplateMetadata) + socialMediaMetadata != null -> visitor.visitSocialMediaMetadata(socialMediaMetadata) else -> visitor.unknown(_json) } @@ -1090,44 +1106,42 @@ private constructor( accept( object : Visitor { - override fun visitPublicFile(publicFile: PublicFile) { - publicFile.validate() + override fun visitFile(file: PublicFile) { + file.validate() } - override fun visitPublicLocation(publicLocation: PublicLocation) { - publicLocation.validate() + override fun visitLocation(location: PublicLocation) { + location.validate() } - override fun visitPublicContact(publicContact: PublicContact) { - publicContact.validate() + override fun visitContact(contact: PublicContact) { + contact.validate() } - override fun visitPublicUnsupportedContent( - publicUnsupportedContent: PublicUnsupportedContent + override fun visitUnsupportedContent( + unsupportedContent: PublicUnsupportedContent ) { - publicUnsupportedContent.validate() + unsupportedContent.validate() } - override fun visitPublicMessageHeader( - publicMessageHeader: PublicMessageHeader - ) { - publicMessageHeader.validate() + override fun visitMessageHeader(messageHeader: PublicMessageHeader) { + messageHeader.validate() } - override fun visitPublicQuickReplies(publicQuickReplies: PublicQuickReplies) { - publicQuickReplies.validate() + override fun visitQuickReplies(quickReplies: PublicQuickReplies) { + quickReplies.validate() } - override fun visitPublicWhatsAppTemplateMetadata( - publicWhatsAppTemplateMetadata: PublicWhatsAppTemplateMetadata + override fun visitWhatsappTemplateMetadata( + whatsappTemplateMetadata: PublicWhatsAppTemplateMetadata ) { - publicWhatsAppTemplateMetadata.validate() + whatsappTemplateMetadata.validate() } - override fun visitPublicSocialMetadata( - publicSocialMetadata: PublicSocialMetadataAttachment + override fun visitSocialMediaMetadata( + socialMediaMetadata: PublicSocialMetadataAttachment ) { - publicSocialMetadata.validate() + socialMediaMetadata.validate() } } ) @@ -1152,32 +1166,29 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicFile(publicFile: PublicFile) = publicFile.validity() + override fun visitFile(file: PublicFile) = file.validity() - override fun visitPublicLocation(publicLocation: PublicLocation) = - publicLocation.validity() + override fun visitLocation(location: PublicLocation) = location.validity() - override fun visitPublicContact(publicContact: PublicContact) = - publicContact.validity() + override fun visitContact(contact: PublicContact) = contact.validity() - override fun visitPublicUnsupportedContent( - publicUnsupportedContent: PublicUnsupportedContent - ) = publicUnsupportedContent.validity() + override fun visitUnsupportedContent( + unsupportedContent: PublicUnsupportedContent + ) = unsupportedContent.validity() - override fun visitPublicMessageHeader( - publicMessageHeader: PublicMessageHeader - ) = publicMessageHeader.validity() + override fun visitMessageHeader(messageHeader: PublicMessageHeader) = + messageHeader.validity() - override fun visitPublicQuickReplies(publicQuickReplies: PublicQuickReplies) = - publicQuickReplies.validity() + override fun visitQuickReplies(quickReplies: PublicQuickReplies) = + quickReplies.validity() - override fun visitPublicWhatsAppTemplateMetadata( - publicWhatsAppTemplateMetadata: PublicWhatsAppTemplateMetadata - ) = publicWhatsAppTemplateMetadata.validity() + override fun visitWhatsappTemplateMetadata( + whatsappTemplateMetadata: PublicWhatsAppTemplateMetadata + ) = whatsappTemplateMetadata.validity() - override fun visitPublicSocialMetadata( - publicSocialMetadata: PublicSocialMetadataAttachment - ) = publicSocialMetadata.validity() + override fun visitSocialMediaMetadata( + socialMediaMetadata: PublicSocialMetadataAttachment + ) = socialMediaMetadata.validity() override fun unknown(json: JsonValue?) = 0 } @@ -1189,79 +1200,72 @@ private constructor( } return other is Attachment && - publicFile == other.publicFile && - publicLocation == other.publicLocation && - publicContact == other.publicContact && - publicUnsupportedContent == other.publicUnsupportedContent && - publicMessageHeader == other.publicMessageHeader && - publicQuickReplies == other.publicQuickReplies && - publicWhatsAppTemplateMetadata == other.publicWhatsAppTemplateMetadata && - publicSocialMetadata == other.publicSocialMetadata + file == other.file && + location == other.location && + contact == other.contact && + unsupportedContent == other.unsupportedContent && + messageHeader == other.messageHeader && + quickReplies == other.quickReplies && + whatsappTemplateMetadata == other.whatsappTemplateMetadata && + socialMediaMetadata == other.socialMediaMetadata } override fun hashCode(): Int = Objects.hash( - publicFile, - publicLocation, - publicContact, - publicUnsupportedContent, - publicMessageHeader, - publicQuickReplies, - publicWhatsAppTemplateMetadata, - publicSocialMetadata, + file, + location, + contact, + unsupportedContent, + messageHeader, + quickReplies, + whatsappTemplateMetadata, + socialMediaMetadata, ) override fun toString(): String = when { - publicFile != null -> "Attachment{publicFile=$publicFile}" - publicLocation != null -> "Attachment{publicLocation=$publicLocation}" - publicContact != null -> "Attachment{publicContact=$publicContact}" - publicUnsupportedContent != null -> - "Attachment{publicUnsupportedContent=$publicUnsupportedContent}" - publicMessageHeader != null -> - "Attachment{publicMessageHeader=$publicMessageHeader}" - publicQuickReplies != null -> "Attachment{publicQuickReplies=$publicQuickReplies}" - publicWhatsAppTemplateMetadata != null -> - "Attachment{publicWhatsAppTemplateMetadata=$publicWhatsAppTemplateMetadata}" - publicSocialMetadata != null -> - "Attachment{publicSocialMetadata=$publicSocialMetadata}" + file != null -> "Attachment{file=$file}" + location != null -> "Attachment{location=$location}" + contact != null -> "Attachment{contact=$contact}" + unsupportedContent != null -> "Attachment{unsupportedContent=$unsupportedContent}" + messageHeader != null -> "Attachment{messageHeader=$messageHeader}" + quickReplies != null -> "Attachment{quickReplies=$quickReplies}" + whatsappTemplateMetadata != null -> + "Attachment{whatsappTemplateMetadata=$whatsappTemplateMetadata}" + socialMediaMetadata != null -> + "Attachment{socialMediaMetadata=$socialMediaMetadata}" _json != null -> "Attachment{_unknown=$_json}" else -> throw IllegalStateException("Invalid Attachment") } companion object { - @JvmStatic - fun ofPublicFile(publicFile: PublicFile) = Attachment(publicFile = publicFile) + @JvmStatic fun ofFile(file: PublicFile) = Attachment(file = file) - @JvmStatic - fun ofPublicLocation(publicLocation: PublicLocation) = - Attachment(publicLocation = publicLocation) + @JvmStatic fun ofLocation(location: PublicLocation) = Attachment(location = location) - @JvmStatic - fun ofPublicContact(publicContact: PublicContact) = - Attachment(publicContact = publicContact) + @JvmStatic fun ofContact(contact: PublicContact) = Attachment(contact = contact) @JvmStatic - fun ofPublicUnsupportedContent(publicUnsupportedContent: PublicUnsupportedContent) = - Attachment(publicUnsupportedContent = publicUnsupportedContent) + fun ofUnsupportedContent(unsupportedContent: PublicUnsupportedContent) = + Attachment(unsupportedContent = unsupportedContent) @JvmStatic - fun ofPublicMessageHeader(publicMessageHeader: PublicMessageHeader) = - Attachment(publicMessageHeader = publicMessageHeader) + fun ofMessageHeader(messageHeader: PublicMessageHeader) = + Attachment(messageHeader = messageHeader) @JvmStatic - fun ofPublicQuickReplies(publicQuickReplies: PublicQuickReplies) = - Attachment(publicQuickReplies = publicQuickReplies) + fun ofQuickReplies(quickReplies: PublicQuickReplies) = + Attachment(quickReplies = quickReplies) @JvmStatic - fun ofPublicWhatsAppTemplateMetadata( - publicWhatsAppTemplateMetadata: PublicWhatsAppTemplateMetadata - ) = Attachment(publicWhatsAppTemplateMetadata = publicWhatsAppTemplateMetadata) + fun ofWhatsappTemplateMetadata( + whatsappTemplateMetadata: PublicWhatsAppTemplateMetadata + ) = Attachment(whatsappTemplateMetadata = whatsappTemplateMetadata) @JvmStatic - fun ofPublicSocialMetadata(publicSocialMetadata: PublicSocialMetadataAttachment) = - Attachment(publicSocialMetadata = publicSocialMetadata) + fun ofSocialMediaMetadata(socialMediaMetadata: PublicSocialMetadataAttachment) = + Attachment(socialMediaMetadata = socialMediaMetadata) } /** @@ -1269,23 +1273,23 @@ private constructor( */ interface Visitor { - fun visitPublicFile(publicFile: PublicFile): T + fun visitFile(file: PublicFile): T - fun visitPublicLocation(publicLocation: PublicLocation): T + fun visitLocation(location: PublicLocation): T - fun visitPublicContact(publicContact: PublicContact): T + fun visitContact(contact: PublicContact): T - fun visitPublicUnsupportedContent(publicUnsupportedContent: PublicUnsupportedContent): T + fun visitUnsupportedContent(unsupportedContent: PublicUnsupportedContent): T - fun visitPublicMessageHeader(publicMessageHeader: PublicMessageHeader): T + fun visitMessageHeader(messageHeader: PublicMessageHeader): T - fun visitPublicQuickReplies(publicQuickReplies: PublicQuickReplies): T + fun visitQuickReplies(quickReplies: PublicQuickReplies): T - fun visitPublicWhatsAppTemplateMetadata( - publicWhatsAppTemplateMetadata: PublicWhatsAppTemplateMetadata + fun visitWhatsappTemplateMetadata( + whatsappTemplateMetadata: PublicWhatsAppTemplateMetadata ): T - fun visitPublicSocialMetadata(publicSocialMetadata: PublicSocialMetadataAttachment): T + fun visitSocialMediaMetadata(socialMediaMetadata: PublicSocialMetadataAttachment): T /** * Maps an unknown variant of [Attachment] to a value of type [T]. @@ -1306,47 +1310,58 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Attachment { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - Attachment(publicFile = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Attachment(publicLocation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Attachment(publicContact = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Attachment(publicUnsupportedContent = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Attachment(publicMessageHeader = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Attachment(publicQuickReplies = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - Attachment(publicWhatsAppTemplateMetadata = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Attachment(publicSocialMetadata = it, _json = json) }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> Attachment(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "FILE" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Attachment(file = it, _json = json) + } ?: Attachment(_json = json) + } + "LOCATION" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Attachment(location = it, _json = json) + } ?: Attachment(_json = json) + } + "CONTACT" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Attachment(contact = it, _json = json) + } ?: Attachment(_json = json) + } + "UNSUPPORTED_CONTENT" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Attachment(unsupportedContent = it, _json = json) } + ?: Attachment(_json = json) + } + "MESSAGE_HEADER" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Attachment(messageHeader = it, _json = json) + } ?: Attachment(_json = json) + } + "QUICK_REPLIES" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Attachment(quickReplies = it, _json = json) + } ?: Attachment(_json = json) + } + "WHATSAPP_TEMPLATE_METADATA" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Attachment(whatsappTemplateMetadata = it, _json = json) } + ?: Attachment(_json = json) + } + "SOCIAL_MEDIA_METADATA" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Attachment(socialMediaMetadata = it, _json = json) } + ?: Attachment(_json = json) + } } + + return Attachment(_json = json) } } @@ -1358,19 +1373,17 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicFile != null -> generator.writeObject(value.publicFile) - value.publicLocation != null -> generator.writeObject(value.publicLocation) - value.publicContact != null -> generator.writeObject(value.publicContact) - value.publicUnsupportedContent != null -> - generator.writeObject(value.publicUnsupportedContent) - value.publicMessageHeader != null -> - generator.writeObject(value.publicMessageHeader) - value.publicQuickReplies != null -> - generator.writeObject(value.publicQuickReplies) - value.publicWhatsAppTemplateMetadata != null -> - generator.writeObject(value.publicWhatsAppTemplateMetadata) - value.publicSocialMetadata != null -> - generator.writeObject(value.publicSocialMetadata) + value.file != null -> generator.writeObject(value.file) + value.location != null -> generator.writeObject(value.location) + value.contact != null -> generator.writeObject(value.contact) + value.unsupportedContent != null -> + generator.writeObject(value.unsupportedContent) + value.messageHeader != null -> generator.writeObject(value.messageHeader) + value.quickReplies != null -> generator.writeObject(value.quickReplies) + value.whatsappTemplateMetadata != null -> + generator.writeObject(value.whatsappTemplateMetadata) + value.socialMediaMetadata != null -> + generator.writeObject(value.socialMediaMetadata) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Attachment") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/exports/PublicExportRequest.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/exports/PublicExportRequest.kt index bb68b58f..ed94b9f1 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/exports/PublicExportRequest.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/exports/PublicExportRequest.kt @@ -12,11 +12,11 @@ import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import com.hubspot.sdk.core.BaseDeserializer import com.hubspot.sdk.core.BaseSerializer import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @JsonDeserialize(using = PublicExportRequest.Deserializer::class) @JsonSerialize(using = PublicExportRequest.Serializer::class) @@ -186,28 +186,22 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): PublicExportRequest { val json = JsonValue.fromJsonNode(node) + val exportType = json.asObject().getOrNull()?.get("exportType")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - PublicExportRequest(view = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PublicExportRequest(list = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with all - // the possible variants (e.g. deserializing from boolean). - 0 -> PublicExportRequest(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (exportType) { + "VIEW" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + PublicExportRequest(view = it, _json = json) + } ?: PublicExportRequest(_json = json) + } + "LIST" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + PublicExportRequest(list = it, _json = json) + } ?: PublicExportRequest(_json = json) + } } + + return PublicExportRequest(_json = json) } } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/extensions/calling/CompletedThirdPartyCallResponse.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/extensions/calling/CompletedThirdPartyCallResponse.kt index 12876275..7e396a96 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/extensions/calling/CompletedThirdPartyCallResponse.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/extensions/calling/CompletedThirdPartyCallResponse.kt @@ -19,7 +19,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkKnown import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow @@ -126,19 +125,47 @@ private constructor( } } + /** Alias for calling [addCallerIdMatch] with `CallerIdMatch.ofContact(contact)`. */ + fun addCallerIdMatch(contact: ContactCallerId) = + addCallerIdMatch(CallerIdMatch.ofContact(contact)) + /** - * Alias for calling [addCallerIdMatch] with - * `CallerIdMatch.ofContactCallerId(contactCallerId)`. + * Alias for calling [addCallerIdMatch] with the following: + * ```java + * ContactCallerId.builder() + * .callerIdType(ContactCallerId.CallerIdType.CONTACT) + * .objectCoordinates(objectCoordinates) + * .build() + * ``` */ - fun addCallerIdMatch(contactCallerId: ContactCallerId) = - addCallerIdMatch(CallerIdMatch.ofContactCallerId(contactCallerId)) + fun addContactCallerIdMatch(objectCoordinates: ObjectCoordinates) = + addCallerIdMatch( + ContactCallerId.builder() + .callerIdType(ContactCallerId.CallerIdType.CONTACT) + .objectCoordinates(objectCoordinates) + .build() + ) + + /** Alias for calling [addCallerIdMatch] with `CallerIdMatch.ofCompany(company)`. */ + fun addCallerIdMatch(company: CompanyCallerId) = + addCallerIdMatch(CallerIdMatch.ofCompany(company)) /** - * Alias for calling [addCallerIdMatch] with - * `CallerIdMatch.ofCompanyCallerId(companyCallerId)`. + * Alias for calling [addCallerIdMatch] with the following: + * ```java + * CompanyCallerId.builder() + * .callerIdType(CompanyCallerId.CallerIdType.COMPANY) + * .objectCoordinates(objectCoordinates) + * .build() + * ``` */ - fun addCallerIdMatch(companyCallerId: CompanyCallerId) = - addCallerIdMatch(CallerIdMatch.ofCompanyCallerId(companyCallerId)) + fun addCompanyCallerIdMatch(objectCoordinates: ObjectCoordinates) = + addCallerIdMatch( + CompanyCallerId.builder() + .callerIdType(CompanyCallerId.CallerIdType.COMPANY) + .objectCoordinates(objectCoordinates) + .build() + ) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -218,22 +245,22 @@ private constructor( @JsonSerialize(using = CallerIdMatch.Serializer::class) class CallerIdMatch private constructor( - private val contactCallerId: ContactCallerId? = null, - private val companyCallerId: CompanyCallerId? = null, + private val contact: ContactCallerId? = null, + private val company: CompanyCallerId? = null, private val _json: JsonValue? = null, ) { - fun contactCallerId(): Optional = Optional.ofNullable(contactCallerId) + fun contact(): Optional = Optional.ofNullable(contact) - fun companyCallerId(): Optional = Optional.ofNullable(companyCallerId) + fun company(): Optional = Optional.ofNullable(company) - fun isContactCallerId(): Boolean = contactCallerId != null + fun isContact(): Boolean = contact != null - fun isCompanyCallerId(): Boolean = companyCallerId != null + fun isCompany(): Boolean = company != null - fun asContactCallerId(): ContactCallerId = contactCallerId.getOrThrow("contactCallerId") + fun asContact(): ContactCallerId = contact.getOrThrow("contact") - fun asCompanyCallerId(): CompanyCallerId = companyCallerId.getOrThrow("companyCallerId") + fun asCompany(): CompanyCallerId = company.getOrThrow("company") fun _json(): Optional = Optional.ofNullable(_json) @@ -249,8 +276,8 @@ private constructor( * * Optional result = callerIdMatch.accept(new CallerIdMatch.Visitor>() { * @Override - * public Optional visitContactCallerId(ContactCallerId contactCallerId) { - * return Optional.of(contactCallerId.toString()); + * public Optional visitContact(ContactCallerId contact) { + * return Optional.of(contact.toString()); * } * * // ... @@ -268,8 +295,8 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - contactCallerId != null -> visitor.visitContactCallerId(contactCallerId) - companyCallerId != null -> visitor.visitCompanyCallerId(companyCallerId) + contact != null -> visitor.visitContact(contact) + company != null -> visitor.visitCompany(company) else -> visitor.unknown(_json) } @@ -291,12 +318,12 @@ private constructor( accept( object : Visitor { - override fun visitContactCallerId(contactCallerId: ContactCallerId) { - contactCallerId.validate() + override fun visitContact(contact: ContactCallerId) { + contact.validate() } - override fun visitCompanyCallerId(companyCallerId: CompanyCallerId) { - companyCallerId.validate() + override fun visitCompany(company: CompanyCallerId) { + company.validate() } } ) @@ -321,11 +348,9 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitContactCallerId(contactCallerId: ContactCallerId) = - contactCallerId.validity() + override fun visitContact(contact: ContactCallerId) = contact.validity() - override fun visitCompanyCallerId(companyCallerId: CompanyCallerId) = - companyCallerId.validity() + override fun visitCompany(company: CompanyCallerId) = company.validity() override fun unknown(json: JsonValue?) = 0 } @@ -336,30 +361,24 @@ private constructor( return true } - return other is CallerIdMatch && - contactCallerId == other.contactCallerId && - companyCallerId == other.companyCallerId + return other is CallerIdMatch && contact == other.contact && company == other.company } - override fun hashCode(): Int = Objects.hash(contactCallerId, companyCallerId) + override fun hashCode(): Int = Objects.hash(contact, company) override fun toString(): String = when { - contactCallerId != null -> "CallerIdMatch{contactCallerId=$contactCallerId}" - companyCallerId != null -> "CallerIdMatch{companyCallerId=$companyCallerId}" + contact != null -> "CallerIdMatch{contact=$contact}" + company != null -> "CallerIdMatch{company=$company}" _json != null -> "CallerIdMatch{_unknown=$_json}" else -> throw IllegalStateException("Invalid CallerIdMatch") } companion object { - @JvmStatic - fun ofContactCallerId(contactCallerId: ContactCallerId) = - CallerIdMatch(contactCallerId = contactCallerId) + @JvmStatic fun ofContact(contact: ContactCallerId) = CallerIdMatch(contact = contact) - @JvmStatic - fun ofCompanyCallerId(companyCallerId: CompanyCallerId) = - CallerIdMatch(companyCallerId = companyCallerId) + @JvmStatic fun ofCompany(company: CompanyCallerId) = CallerIdMatch(company = company) } /** @@ -368,9 +387,9 @@ private constructor( */ interface Visitor { - fun visitContactCallerId(contactCallerId: ContactCallerId): T + fun visitContact(contact: ContactCallerId): T - fun visitCompanyCallerId(companyCallerId: CompanyCallerId): T + fun visitCompany(company: CompanyCallerId): T /** * Maps an unknown variant of [CallerIdMatch] to a value of type [T]. @@ -391,29 +410,23 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): CallerIdMatch { val json = JsonValue.fromJsonNode(node) - - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - CallerIdMatch(contactCallerId = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CallerIdMatch(companyCallerId = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> CallerIdMatch(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + val callerIdType = + json.asObject().getOrNull()?.get("callerIdType")?.asString()?.getOrNull() + + when (callerIdType) { + "CONTACT" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + CallerIdMatch(contact = it, _json = json) + } ?: CallerIdMatch(_json = json) + } + "COMPANY" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + CallerIdMatch(company = it, _json = json) + } ?: CallerIdMatch(_json = json) + } } + + return CallerIdMatch(_json = json) } } @@ -425,8 +438,8 @@ private constructor( provider: SerializerProvider, ) { when { - value.contactCallerId != null -> generator.writeObject(value.contactCallerId) - value.companyCallerId != null -> generator.writeObject(value.companyCallerId) + value.contact != null -> generator.writeObject(value.contact) + value.company != null -> generator.writeObject(value.company) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid CallerIdMatch") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/extensions/cardsdev/IntegratorObjectResult.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/extensions/cardsdev/IntegratorObjectResult.kt index f7053a8c..46802270 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/extensions/cardsdev/IntegratorObjectResult.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/extensions/cardsdev/IntegratorObjectResult.kt @@ -19,7 +19,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkKnown import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow @@ -218,13 +217,11 @@ private constructor( } } - /** Alias for calling [addAction] with `Action.ofHookActionBody(hookActionBody)`. */ - fun addAction(hookActionBody: ActionHookActionBody) = - addAction(Action.ofHookActionBody(hookActionBody)) + /** Alias for calling [addAction] with `Action.ofHook(hook)`. */ + fun addAction(hook: ActionHookActionBody) = addAction(Action.ofHook(hook)) - /** Alias for calling [addAction] with `Action.ofIFrameActionBody(iFrameActionBody)`. */ - fun addAction(iFrameActionBody: IFrameActionBody) = - addAction(Action.ofIFrameActionBody(iFrameActionBody)) + /** Alias for calling [addAction] with `Action.ofIframe(iframe)`. */ + fun addAction(iframe: IFrameActionBody) = addAction(Action.ofIframe(iframe)) /** The top-level title for this card. Displayed to users in the CRM UI. */ fun title(title: String) = title(JsonField.of(title)) @@ -367,22 +364,22 @@ private constructor( @JsonSerialize(using = Action.Serializer::class) class Action private constructor( - private val hookActionBody: ActionHookActionBody? = null, - private val iFrameActionBody: IFrameActionBody? = null, + private val hook: ActionHookActionBody? = null, + private val iframe: IFrameActionBody? = null, private val _json: JsonValue? = null, ) { - fun hookActionBody(): Optional = Optional.ofNullable(hookActionBody) + fun hook(): Optional = Optional.ofNullable(hook) - fun iFrameActionBody(): Optional = Optional.ofNullable(iFrameActionBody) + fun iframe(): Optional = Optional.ofNullable(iframe) - fun isHookActionBody(): Boolean = hookActionBody != null + fun isHook(): Boolean = hook != null - fun isIFrameActionBody(): Boolean = iFrameActionBody != null + fun isIframe(): Boolean = iframe != null - fun asHookActionBody(): ActionHookActionBody = hookActionBody.getOrThrow("hookActionBody") + fun asHook(): ActionHookActionBody = hook.getOrThrow("hook") - fun asIFrameActionBody(): IFrameActionBody = iFrameActionBody.getOrThrow("iFrameActionBody") + fun asIframe(): IFrameActionBody = iframe.getOrThrow("iframe") fun _json(): Optional = Optional.ofNullable(_json) @@ -398,8 +395,8 @@ private constructor( * * Optional result = action.accept(new Action.Visitor>() { * @Override - * public Optional visitHookActionBody(ActionHookActionBody hookActionBody) { - * return Optional.of(hookActionBody.toString()); + * public Optional visitHook(ActionHookActionBody hook) { + * return Optional.of(hook.toString()); * } * * // ... @@ -417,8 +414,8 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - hookActionBody != null -> visitor.visitHookActionBody(hookActionBody) - iFrameActionBody != null -> visitor.visitIFrameActionBody(iFrameActionBody) + hook != null -> visitor.visitHook(hook) + iframe != null -> visitor.visitIframe(iframe) else -> visitor.unknown(_json) } @@ -440,12 +437,12 @@ private constructor( accept( object : Visitor { - override fun visitHookActionBody(hookActionBody: ActionHookActionBody) { - hookActionBody.validate() + override fun visitHook(hook: ActionHookActionBody) { + hook.validate() } - override fun visitIFrameActionBody(iFrameActionBody: IFrameActionBody) { - iFrameActionBody.validate() + override fun visitIframe(iframe: IFrameActionBody) { + iframe.validate() } } ) @@ -470,11 +467,9 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitHookActionBody(hookActionBody: ActionHookActionBody) = - hookActionBody.validity() + override fun visitHook(hook: ActionHookActionBody) = hook.validity() - override fun visitIFrameActionBody(iFrameActionBody: IFrameActionBody) = - iFrameActionBody.validity() + override fun visitIframe(iframe: IFrameActionBody) = iframe.validity() override fun unknown(json: JsonValue?) = 0 } @@ -485,38 +480,32 @@ private constructor( return true } - return other is Action && - hookActionBody == other.hookActionBody && - iFrameActionBody == other.iFrameActionBody + return other is Action && hook == other.hook && iframe == other.iframe } - override fun hashCode(): Int = Objects.hash(hookActionBody, iFrameActionBody) + override fun hashCode(): Int = Objects.hash(hook, iframe) override fun toString(): String = when { - hookActionBody != null -> "Action{hookActionBody=$hookActionBody}" - iFrameActionBody != null -> "Action{iFrameActionBody=$iFrameActionBody}" + hook != null -> "Action{hook=$hook}" + iframe != null -> "Action{iframe=$iframe}" _json != null -> "Action{_unknown=$_json}" else -> throw IllegalStateException("Invalid Action") } companion object { - @JvmStatic - fun ofHookActionBody(hookActionBody: ActionHookActionBody) = - Action(hookActionBody = hookActionBody) + @JvmStatic fun ofHook(hook: ActionHookActionBody) = Action(hook = hook) - @JvmStatic - fun ofIFrameActionBody(iFrameActionBody: IFrameActionBody) = - Action(iFrameActionBody = iFrameActionBody) + @JvmStatic fun ofIframe(iframe: IFrameActionBody) = Action(iframe = iframe) } /** An interface that defines how to map each variant of [Action] to a value of type [T]. */ interface Visitor { - fun visitHookActionBody(hookActionBody: ActionHookActionBody): T + fun visitHook(hook: ActionHookActionBody): T - fun visitIFrameActionBody(iFrameActionBody: IFrameActionBody): T + fun visitIframe(iframe: IFrameActionBody): T /** * Maps an unknown variant of [Action] to a value of type [T]. @@ -537,29 +526,22 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Action { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - Action(hookActionBody = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Action(iFrameActionBody = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> Action(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "ACTION_HOOK" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Action(hook = it, _json = json) + } ?: Action(_json = json) + } + "IFRAME" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Action(iframe = it, _json = json) + } ?: Action(_json = json) + } } + + return Action(_json = json) } } @@ -571,8 +553,8 @@ private constructor( provider: SerializerProvider, ) { when { - value.hookActionBody != null -> generator.writeObject(value.hookActionBody) - value.iFrameActionBody != null -> generator.writeObject(value.iFrameActionBody) + value.hook != null -> generator.writeObject(value.hook) + value.iframe != null -> generator.writeObject(value.iframe) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Action") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/extensions/cardsdev/TopLevelActions.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/extensions/cardsdev/TopLevelActions.kt index d1b78759..11d1cd63 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/extensions/cardsdev/TopLevelActions.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/extensions/cardsdev/TopLevelActions.kt @@ -19,7 +19,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkKnown import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow @@ -168,18 +167,12 @@ private constructor( } } - /** - * Alias for calling [addSecondary] with - * `Secondary.ofActionHookActionBody(actionHookActionBody)`. - */ - fun addSecondary(actionHookActionBody: ActionHookActionBody) = - addSecondary(Secondary.ofActionHookActionBody(actionHookActionBody)) + /** Alias for calling [addSecondary] with `Secondary.ofActionHook(actionHook)`. */ + fun addSecondary(actionHook: ActionHookActionBody) = + addSecondary(Secondary.ofActionHook(actionHook)) - /** - * Alias for calling [addSecondary] with `Secondary.ofIFrameActionBody(iFrameActionBody)`. - */ - fun addSecondary(iFrameActionBody: IFrameActionBody) = - addSecondary(Secondary.ofIFrameActionBody(iFrameActionBody)) + /** Alias for calling [addSecondary] with `Secondary.ofIframe(iframe)`. */ + fun addSecondary(iframe: IFrameActionBody) = addSecondary(Secondary.ofIframe(iframe)) /** * Defines the primary action for a card, which can be either an action hook or an iframe. @@ -194,15 +187,11 @@ private constructor( */ fun primary(primary: JsonField) = apply { this.primary = primary } - /** - * Alias for calling [primary] with `Primary.ofActionHookActionBody(actionHookActionBody)`. - */ - fun primary(actionHookActionBody: ActionHookActionBody) = - primary(Primary.ofActionHookActionBody(actionHookActionBody)) + /** Alias for calling [primary] with `Primary.ofActionHook(actionHook)`. */ + fun primary(actionHook: ActionHookActionBody) = primary(Primary.ofActionHook(actionHook)) - /** Alias for calling [primary] with `Primary.ofIFrameActionBody(iFrameActionBody)`. */ - fun primary(iFrameActionBody: IFrameActionBody) = - primary(Primary.ofIFrameActionBody(iFrameActionBody)) + /** Alias for calling [primary] with `Primary.ofIframe(iframe)`. */ + fun primary(iframe: IFrameActionBody) = primary(Primary.ofIframe(iframe)) fun settings(settings: IFrameActionBody) = settings(JsonField.of(settings)) @@ -299,24 +288,22 @@ private constructor( @JsonSerialize(using = Secondary.Serializer::class) class Secondary private constructor( - private val actionHookActionBody: ActionHookActionBody? = null, - private val iFrameActionBody: IFrameActionBody? = null, + private val actionHook: ActionHookActionBody? = null, + private val iframe: IFrameActionBody? = null, private val _json: JsonValue? = null, ) { - fun actionHookActionBody(): Optional = - Optional.ofNullable(actionHookActionBody) + fun actionHook(): Optional = Optional.ofNullable(actionHook) - fun iFrameActionBody(): Optional = Optional.ofNullable(iFrameActionBody) + fun iframe(): Optional = Optional.ofNullable(iframe) - fun isActionHookActionBody(): Boolean = actionHookActionBody != null + fun isActionHook(): Boolean = actionHook != null - fun isIFrameActionBody(): Boolean = iFrameActionBody != null + fun isIframe(): Boolean = iframe != null - fun asActionHookActionBody(): ActionHookActionBody = - actionHookActionBody.getOrThrow("actionHookActionBody") + fun asActionHook(): ActionHookActionBody = actionHook.getOrThrow("actionHook") - fun asIFrameActionBody(): IFrameActionBody = iFrameActionBody.getOrThrow("iFrameActionBody") + fun asIframe(): IFrameActionBody = iframe.getOrThrow("iframe") fun _json(): Optional = Optional.ofNullable(_json) @@ -332,8 +319,8 @@ private constructor( * * Optional result = secondary.accept(new Secondary.Visitor>() { * @Override - * public Optional visitActionHookActionBody(ActionHookActionBody actionHookActionBody) { - * return Optional.of(actionHookActionBody.toString()); + * public Optional visitActionHook(ActionHookActionBody actionHook) { + * return Optional.of(actionHook.toString()); * } * * // ... @@ -351,9 +338,8 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - actionHookActionBody != null -> - visitor.visitActionHookActionBody(actionHookActionBody) - iFrameActionBody != null -> visitor.visitIFrameActionBody(iFrameActionBody) + actionHook != null -> visitor.visitActionHook(actionHook) + iframe != null -> visitor.visitIframe(iframe) else -> visitor.unknown(_json) } @@ -375,14 +361,12 @@ private constructor( accept( object : Visitor { - override fun visitActionHookActionBody( - actionHookActionBody: ActionHookActionBody - ) { - actionHookActionBody.validate() + override fun visitActionHook(actionHook: ActionHookActionBody) { + actionHook.validate() } - override fun visitIFrameActionBody(iFrameActionBody: IFrameActionBody) { - iFrameActionBody.validate() + override fun visitIframe(iframe: IFrameActionBody) { + iframe.validate() } } ) @@ -407,12 +391,10 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitActionHookActionBody( - actionHookActionBody: ActionHookActionBody - ) = actionHookActionBody.validity() + override fun visitActionHook(actionHook: ActionHookActionBody) = + actionHook.validity() - override fun visitIFrameActionBody(iFrameActionBody: IFrameActionBody) = - iFrameActionBody.validity() + override fun visitIframe(iframe: IFrameActionBody) = iframe.validity() override fun unknown(json: JsonValue?) = 0 } @@ -423,18 +405,15 @@ private constructor( return true } - return other is Secondary && - actionHookActionBody == other.actionHookActionBody && - iFrameActionBody == other.iFrameActionBody + return other is Secondary && actionHook == other.actionHook && iframe == other.iframe } - override fun hashCode(): Int = Objects.hash(actionHookActionBody, iFrameActionBody) + override fun hashCode(): Int = Objects.hash(actionHook, iframe) override fun toString(): String = when { - actionHookActionBody != null -> - "Secondary{actionHookActionBody=$actionHookActionBody}" - iFrameActionBody != null -> "Secondary{iFrameActionBody=$iFrameActionBody}" + actionHook != null -> "Secondary{actionHook=$actionHook}" + iframe != null -> "Secondary{iframe=$iframe}" _json != null -> "Secondary{_unknown=$_json}" else -> throw IllegalStateException("Invalid Secondary") } @@ -442,12 +421,9 @@ private constructor( companion object { @JvmStatic - fun ofActionHookActionBody(actionHookActionBody: ActionHookActionBody) = - Secondary(actionHookActionBody = actionHookActionBody) + fun ofActionHook(actionHook: ActionHookActionBody) = Secondary(actionHook = actionHook) - @JvmStatic - fun ofIFrameActionBody(iFrameActionBody: IFrameActionBody) = - Secondary(iFrameActionBody = iFrameActionBody) + @JvmStatic fun ofIframe(iframe: IFrameActionBody) = Secondary(iframe = iframe) } /** @@ -455,9 +431,9 @@ private constructor( */ interface Visitor { - fun visitActionHookActionBody(actionHookActionBody: ActionHookActionBody): T + fun visitActionHook(actionHook: ActionHookActionBody): T - fun visitIFrameActionBody(iFrameActionBody: IFrameActionBody): T + fun visitIframe(iframe: IFrameActionBody): T /** * Maps an unknown variant of [Secondary] to a value of type [T]. @@ -478,29 +454,22 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Secondary { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - Secondary(actionHookActionBody = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Secondary(iFrameActionBody = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> Secondary(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "ACTION_HOOK" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Secondary(actionHook = it, _json = json) + } ?: Secondary(_json = json) + } + "IFRAME" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Secondary(iframe = it, _json = json) + } ?: Secondary(_json = json) + } } + + return Secondary(_json = json) } } @@ -512,9 +481,8 @@ private constructor( provider: SerializerProvider, ) { when { - value.actionHookActionBody != null -> - generator.writeObject(value.actionHookActionBody) - value.iFrameActionBody != null -> generator.writeObject(value.iFrameActionBody) + value.actionHook != null -> generator.writeObject(value.actionHook) + value.iframe != null -> generator.writeObject(value.iframe) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Secondary") } @@ -527,24 +495,22 @@ private constructor( @JsonSerialize(using = Primary.Serializer::class) class Primary private constructor( - private val actionHookActionBody: ActionHookActionBody? = null, - private val iFrameActionBody: IFrameActionBody? = null, + private val actionHook: ActionHookActionBody? = null, + private val iframe: IFrameActionBody? = null, private val _json: JsonValue? = null, ) { - fun actionHookActionBody(): Optional = - Optional.ofNullable(actionHookActionBody) + fun actionHook(): Optional = Optional.ofNullable(actionHook) - fun iFrameActionBody(): Optional = Optional.ofNullable(iFrameActionBody) + fun iframe(): Optional = Optional.ofNullable(iframe) - fun isActionHookActionBody(): Boolean = actionHookActionBody != null + fun isActionHook(): Boolean = actionHook != null - fun isIFrameActionBody(): Boolean = iFrameActionBody != null + fun isIframe(): Boolean = iframe != null - fun asActionHookActionBody(): ActionHookActionBody = - actionHookActionBody.getOrThrow("actionHookActionBody") + fun asActionHook(): ActionHookActionBody = actionHook.getOrThrow("actionHook") - fun asIFrameActionBody(): IFrameActionBody = iFrameActionBody.getOrThrow("iFrameActionBody") + fun asIframe(): IFrameActionBody = iframe.getOrThrow("iframe") fun _json(): Optional = Optional.ofNullable(_json) @@ -560,8 +526,8 @@ private constructor( * * Optional result = primary.accept(new Primary.Visitor>() { * @Override - * public Optional visitActionHookActionBody(ActionHookActionBody actionHookActionBody) { - * return Optional.of(actionHookActionBody.toString()); + * public Optional visitActionHook(ActionHookActionBody actionHook) { + * return Optional.of(actionHook.toString()); * } * * // ... @@ -579,9 +545,8 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - actionHookActionBody != null -> - visitor.visitActionHookActionBody(actionHookActionBody) - iFrameActionBody != null -> visitor.visitIFrameActionBody(iFrameActionBody) + actionHook != null -> visitor.visitActionHook(actionHook) + iframe != null -> visitor.visitIframe(iframe) else -> visitor.unknown(_json) } @@ -603,14 +568,12 @@ private constructor( accept( object : Visitor { - override fun visitActionHookActionBody( - actionHookActionBody: ActionHookActionBody - ) { - actionHookActionBody.validate() + override fun visitActionHook(actionHook: ActionHookActionBody) { + actionHook.validate() } - override fun visitIFrameActionBody(iFrameActionBody: IFrameActionBody) { - iFrameActionBody.validate() + override fun visitIframe(iframe: IFrameActionBody) { + iframe.validate() } } ) @@ -635,12 +598,10 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitActionHookActionBody( - actionHookActionBody: ActionHookActionBody - ) = actionHookActionBody.validity() + override fun visitActionHook(actionHook: ActionHookActionBody) = + actionHook.validity() - override fun visitIFrameActionBody(iFrameActionBody: IFrameActionBody) = - iFrameActionBody.validity() + override fun visitIframe(iframe: IFrameActionBody) = iframe.validity() override fun unknown(json: JsonValue?) = 0 } @@ -651,18 +612,15 @@ private constructor( return true } - return other is Primary && - actionHookActionBody == other.actionHookActionBody && - iFrameActionBody == other.iFrameActionBody + return other is Primary && actionHook == other.actionHook && iframe == other.iframe } - override fun hashCode(): Int = Objects.hash(actionHookActionBody, iFrameActionBody) + override fun hashCode(): Int = Objects.hash(actionHook, iframe) override fun toString(): String = when { - actionHookActionBody != null -> - "Primary{actionHookActionBody=$actionHookActionBody}" - iFrameActionBody != null -> "Primary{iFrameActionBody=$iFrameActionBody}" + actionHook != null -> "Primary{actionHook=$actionHook}" + iframe != null -> "Primary{iframe=$iframe}" _json != null -> "Primary{_unknown=$_json}" else -> throw IllegalStateException("Invalid Primary") } @@ -670,12 +628,9 @@ private constructor( companion object { @JvmStatic - fun ofActionHookActionBody(actionHookActionBody: ActionHookActionBody) = - Primary(actionHookActionBody = actionHookActionBody) + fun ofActionHook(actionHook: ActionHookActionBody) = Primary(actionHook = actionHook) - @JvmStatic - fun ofIFrameActionBody(iFrameActionBody: IFrameActionBody) = - Primary(iFrameActionBody = iFrameActionBody) + @JvmStatic fun ofIframe(iframe: IFrameActionBody) = Primary(iframe = iframe) } /** @@ -683,9 +638,9 @@ private constructor( */ interface Visitor { - fun visitActionHookActionBody(actionHookActionBody: ActionHookActionBody): T + fun visitActionHook(actionHook: ActionHookActionBody): T - fun visitIFrameActionBody(iFrameActionBody: IFrameActionBody): T + fun visitIframe(iframe: IFrameActionBody): T /** * Maps an unknown variant of [Primary] to a value of type [T]. @@ -706,29 +661,22 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Primary { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - Primary(actionHookActionBody = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Primary(iFrameActionBody = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> Primary(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "ACTION_HOOK" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Primary(actionHook = it, _json = json) + } ?: Primary(_json = json) + } + "IFRAME" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Primary(iframe = it, _json = json) + } ?: Primary(_json = json) + } } + + return Primary(_json = json) } } @@ -740,9 +688,8 @@ private constructor( provider: SerializerProvider, ) { when { - value.actionHookActionBody != null -> - generator.writeObject(value.actionHookActionBody) - value.iFrameActionBody != null -> generator.writeObject(value.iFrameActionBody) + value.actionHook != null -> generator.writeObject(value.actionHook) + value.iframe != null -> generator.writeObject(value.iframe) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Primary") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/ListUpdateScheduleConversionParams.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/ListUpdateScheduleConversionParams.kt index 8c3029e2..f5b46423 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/ListUpdateScheduleConversionParams.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/ListUpdateScheduleConversionParams.kt @@ -74,10 +74,10 @@ private constructor( /** * Alias for calling [publicListConversionTime] with - * `PublicListConversionTime.ofDate(date)`. + * `PublicListConversionTime.ofConversionDate(conversionDate)`. */ - fun publicListConversionTime(date: PublicListConversionDate) = - publicListConversionTime(PublicListConversionTime.ofDate(date)) + fun publicListConversionTime(conversionDate: PublicListConversionDate) = + publicListConversionTime(PublicListConversionTime.ofConversionDate(conversionDate)) /** * Alias for calling [publicListConversionTime] with diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicAdsTimeFilter.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicAdsTimeFilter.kt index d57d9821..2eec25fb 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicAdsTimeFilter.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicAdsTimeFilter.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -150,68 +149,66 @@ private constructor( /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `PruningRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun pruningRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun pruningRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `PruningRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun pruningRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun pruningRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [pruningRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun pruningRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesPruningRefineBy(setType: String) = pruningRefineBy( - PruningRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `PruningRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun pruningRefineBy(publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun pruningRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `PruningRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun pruningRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun pruningRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `PruningRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun pruningRefineBy(publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun pruningRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `PruningRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun pruningRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicAllHistory(publicAllHistory)) + fun pruningRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofAllHistory(allHistory)`. */ + fun pruningRefineBy(allHistory: PublicAllHistoryRefineBy) = + pruningRefineBy(PruningRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [pruningRefineBy] with @@ -220,12 +217,9 @@ private constructor( fun pruningRefineBy(publicTimePointOperation: PublicTimePointOperation) = pruningRefineBy(PruningRefineBy.ofPublicTimePointOperation(publicTimePointOperation)) - /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. - */ - fun pruningRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - pruningRefineBy(PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)) + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofTimeRanged(timeRanged)`. */ + fun pruningRefineBy(timeRanged: PublicRangedTimeOperation) = + pruningRefineBy(PruningRefineBy.ofTimeRanged(timeRanged)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -441,97 +435,85 @@ private constructor( @JsonSerialize(using = PruningRefineBy.Serializer::class) class PruningRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -547,8 +529,8 @@ private constructor( * * Optional result = pruningRefineBy.accept(new PruningRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -566,27 +548,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -608,46 +579,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -656,10 +621,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -684,42 +647,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -731,49 +689,44 @@ private constructor( } return other is PruningRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "PruningRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "PruningRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "PruningRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "PruningRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "PruningRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "PruningRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "PruningRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "PruningRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "PruningRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "PruningRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "PruningRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "PruningRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "PruningRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "PruningRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "PruningRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "PruningRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "PruningRefineBy{timeRanged=$timeRanged}" _json != null -> "PruningRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid PruningRefineBy") } @@ -781,50 +734,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - PruningRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + PruningRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - PruningRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + PruningRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = PruningRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = PruningRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + PruningRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = PruningRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = PruningRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + PruningRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - PruningRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + PruningRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = PruningRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - PruningRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + PruningRefineBy(timeRanged = timeRanged) } /** @@ -833,33 +778,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [PruningRefineBy] to a value of type [T]. @@ -880,76 +819,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): PruningRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicNumOccurrences = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicSetOccurrences = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> PruningRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(numOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(setOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(allHistory = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(timeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + PruningRefineBy(publicTimePointOperation = it, _json = json) + } ?: PruningRefineBy(_json = json) } } @@ -961,23 +890,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid PruningRefineBy") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicAndFilterBranch.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicAndFilterBranch.kt index deda8b57..5a74e8be 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicAndFilterBranch.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicAndFilterBranch.kt @@ -392,78 +392,73 @@ private constructor( /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun addAdsTimeFilter(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences) - ) + fun addAdsTimeFilter(numOccurrences: PublicNumOccurrencesRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun addAdsTimeFilter(publicSetOccurrences: PublicSetOccurrencesRefineBy) = + fun addAdsTimeFilter(setOccurrences: PublicSetOccurrencesRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofSetOccurrences(setOccurrences)) + + /** + * Alias for calling [addAdsTimeFilter] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` + */ + fun addSetOccurrencesAdsTimeFilter(setType: String) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun addAdsTimeFilter( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun addAdsTimeFilter(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicAdsTimeFilter.PruningRefineBy.ofRelativeComparative(relativeComparative) ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun addAdsTimeFilter(publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp - ) - ) + fun addAdsTimeFilter(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun addAdsTimeFilter( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = + fun addAdsTimeFilter(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) + PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteComparative(absoluteComparative) ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun addAdsTimeFilter(publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp - ) - ) + fun addAdsTimeFilter(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteRanged(absoluteRanged)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAllHistory(allHistory)`. */ - fun addAdsTimeFilter(publicAllHistory: PublicAllHistoryRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAllHistory(publicAllHistory) - ) + fun addAdsTimeFilter(allHistory: PublicAllHistoryRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [addAdsTimeFilter] with @@ -478,14 +473,10 @@ private constructor( /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofTimeRanged(timeRanged)`. */ - fun addAdsTimeFilter(publicRangedTimeOperation: PublicRangedTimeOperation) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRangedTimeOperation( - publicRangedTimeOperation - ) - ) + fun addAdsTimeFilter(timeRanged: PublicRangedTimeOperation) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofTimeRanged(timeRanged)) /** Alias for calling [addFilter] with `Filter.ofInList(inList)`. */ fun addFilter(inList: PublicInListFilter) = addFilter(Filter.ofInList(inList)) diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicAssociationFilterBranch.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicAssociationFilterBranch.kt index e79c2d14..852d9711 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicAssociationFilterBranch.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicAssociationFilterBranch.kt @@ -533,78 +533,73 @@ private constructor( /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun addAdsTimeFilter(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences) - ) + fun addAdsTimeFilter(numOccurrences: PublicNumOccurrencesRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun addAdsTimeFilter(publicSetOccurrences: PublicSetOccurrencesRefineBy) = + fun addAdsTimeFilter(setOccurrences: PublicSetOccurrencesRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofSetOccurrences(setOccurrences)) + + /** + * Alias for calling [addAdsTimeFilter] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` + */ + fun addSetOccurrencesAdsTimeFilter(setType: String) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun addAdsTimeFilter( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun addAdsTimeFilter(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicAdsTimeFilter.PruningRefineBy.ofRelativeComparative(relativeComparative) ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun addAdsTimeFilter(publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp - ) - ) + fun addAdsTimeFilter(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun addAdsTimeFilter( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = + fun addAdsTimeFilter(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) + PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteComparative(absoluteComparative) ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun addAdsTimeFilter(publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp - ) - ) + fun addAdsTimeFilter(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteRanged(absoluteRanged)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAllHistory(allHistory)`. */ - fun addAdsTimeFilter(publicAllHistory: PublicAllHistoryRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAllHistory(publicAllHistory) - ) + fun addAdsTimeFilter(allHistory: PublicAllHistoryRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [addAdsTimeFilter] with @@ -619,14 +614,10 @@ private constructor( /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofTimeRanged(timeRanged)`. */ - fun addAdsTimeFilter(publicRangedTimeOperation: PublicRangedTimeOperation) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRangedTimeOperation( - publicRangedTimeOperation - ) - ) + fun addAdsTimeFilter(timeRanged: PublicRangedTimeOperation) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofTimeRanged(timeRanged)) /** Alias for calling [addFilter] with `Filter.ofInList(inList)`. */ fun addFilter(inList: PublicInListFilter) = addFilter(Filter.ofInList(inList)) diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicAssociationInListFilter.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicAssociationInListFilter.kt index a1c60e8e..af8be831 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicAssociationInListFilter.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicAssociationInListFilter.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -321,72 +320,69 @@ private constructor( /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `CoalescingRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun coalescingRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun coalescingRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `CoalescingRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun coalescingRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun coalescingRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [coalescingRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun coalescingRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesCoalescingRefineBy(setType: String) = coalescingRefineBy( - CoalescingRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `CoalescingRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun coalescingRefineBy( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun coalescingRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `CoalescingRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun coalescingRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun coalescingRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `CoalescingRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun coalescingRefineBy( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun coalescingRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `CoalescingRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun coalescingRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicAllHistory(publicAllHistory)) + fun coalescingRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** + * Alias for calling [coalescingRefineBy] with + * `CoalescingRefineBy.ofAllHistory(allHistory)`. + */ + fun coalescingRefineBy(allHistory: PublicAllHistoryRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [coalescingRefineBy] with @@ -399,12 +395,10 @@ private constructor( /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. + * `CoalescingRefineBy.ofTimeRanged(timeRanged)`. */ - fun coalescingRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation) - ) + fun coalescingRefineBy(timeRanged: PublicRangedTimeOperation) = + coalescingRefineBy(CoalescingRefineBy.ofTimeRanged(timeRanged)) /** Indicates the type of filter being applied, which is 'ASSOCIATION' by default. */ fun filterType(filterType: FilterType) = filterType(JsonField.of(filterType)) @@ -576,97 +570,85 @@ private constructor( @JsonSerialize(using = CoalescingRefineBy.Serializer::class) class CoalescingRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -682,8 +664,8 @@ private constructor( * * Optional result = coalescingRefineBy.accept(new CoalescingRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -701,27 +683,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -743,46 +714,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -791,10 +756,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -819,42 +782,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -866,49 +824,44 @@ private constructor( } return other is CoalescingRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "CoalescingRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "CoalescingRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "CoalescingRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "CoalescingRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "CoalescingRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "CoalescingRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "CoalescingRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "CoalescingRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "CoalescingRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "CoalescingRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "CoalescingRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "CoalescingRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "CoalescingRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "CoalescingRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "CoalescingRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "CoalescingRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "CoalescingRefineBy{timeRanged=$timeRanged}" _json != null -> "CoalescingRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid CoalescingRefineBy") } @@ -916,50 +869,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - CoalescingRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + CoalescingRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - CoalescingRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + CoalescingRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - CoalescingRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = CoalescingRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = CoalescingRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + CoalescingRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - CoalescingRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = CoalescingRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = CoalescingRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + CoalescingRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - CoalescingRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + CoalescingRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = CoalescingRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - CoalescingRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + CoalescingRefineBy(timeRanged = timeRanged) } /** @@ -968,33 +913,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [CoalescingRefineBy] to a value of type [T]. @@ -1016,80 +955,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): CoalescingRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { - CoalescingRefineBy(publicNumOccurrences = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - CoalescingRefineBy(publicSetOccurrences = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> CoalescingRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(numOccurrences = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(setOccurrences = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(relativeComparative = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(relativeRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(absoluteComparative = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(absoluteRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(allHistory = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(timeRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + CoalescingRefineBy(publicTimePointOperation = it, _json = json) + } ?: CoalescingRefineBy(_json = json) } } @@ -1101,23 +1026,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid CoalescingRefineBy") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicCtaAnalyticsFilter.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicCtaAnalyticsFilter.kt index 9f50be36..66096fc7 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicCtaAnalyticsFilter.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicCtaAnalyticsFilter.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -243,72 +242,69 @@ private constructor( /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `CoalescingRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun coalescingRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun coalescingRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `CoalescingRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun coalescingRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun coalescingRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [coalescingRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun coalescingRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesCoalescingRefineBy(setType: String) = coalescingRefineBy( - CoalescingRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `CoalescingRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun coalescingRefineBy( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun coalescingRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `CoalescingRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun coalescingRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun coalescingRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `CoalescingRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun coalescingRefineBy( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun coalescingRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `CoalescingRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun coalescingRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicAllHistory(publicAllHistory)) + fun coalescingRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** + * Alias for calling [coalescingRefineBy] with + * `CoalescingRefineBy.ofAllHistory(allHistory)`. + */ + fun coalescingRefineBy(allHistory: PublicAllHistoryRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [coalescingRefineBy] with @@ -321,12 +317,10 @@ private constructor( /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. + * `CoalescingRefineBy.ofTimeRanged(timeRanged)`. */ - fun coalescingRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation) - ) + fun coalescingRefineBy(timeRanged: PublicRangedTimeOperation) = + coalescingRefineBy(CoalescingRefineBy.ofTimeRanged(timeRanged)) /** Specifies the criteria for refining the filter by pruning. */ fun pruningRefineBy(pruningRefineBy: PruningRefineBy) = @@ -345,68 +339,66 @@ private constructor( /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `PruningRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun pruningRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun pruningRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `PruningRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun pruningRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun pruningRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [pruningRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun pruningRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesPruningRefineBy(setType: String) = pruningRefineBy( - PruningRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `PruningRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun pruningRefineBy(publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun pruningRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `PruningRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun pruningRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun pruningRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `PruningRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun pruningRefineBy(publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun pruningRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `PruningRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun pruningRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicAllHistory(publicAllHistory)) + fun pruningRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofAllHistory(allHistory)`. */ + fun pruningRefineBy(allHistory: PublicAllHistoryRefineBy) = + pruningRefineBy(PruningRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [pruningRefineBy] with @@ -415,12 +407,9 @@ private constructor( fun pruningRefineBy(publicTimePointOperation: PublicTimePointOperation) = pruningRefineBy(PruningRefineBy.ofPublicTimePointOperation(publicTimePointOperation)) - /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. - */ - fun pruningRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - pruningRefineBy(PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)) + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofTimeRanged(timeRanged)`. */ + fun pruningRefineBy(timeRanged: PublicRangedTimeOperation) = + pruningRefineBy(PruningRefineBy.ofTimeRanged(timeRanged)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -646,97 +635,85 @@ private constructor( @JsonSerialize(using = CoalescingRefineBy.Serializer::class) class CoalescingRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -752,8 +729,8 @@ private constructor( * * Optional result = coalescingRefineBy.accept(new CoalescingRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -771,27 +748,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -813,46 +779,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -861,10 +821,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -889,42 +847,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -936,49 +889,44 @@ private constructor( } return other is CoalescingRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "CoalescingRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "CoalescingRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "CoalescingRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "CoalescingRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "CoalescingRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "CoalescingRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "CoalescingRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "CoalescingRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "CoalescingRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "CoalescingRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "CoalescingRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "CoalescingRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "CoalescingRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "CoalescingRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "CoalescingRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "CoalescingRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "CoalescingRefineBy{timeRanged=$timeRanged}" _json != null -> "CoalescingRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid CoalescingRefineBy") } @@ -986,50 +934,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - CoalescingRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + CoalescingRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - CoalescingRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + CoalescingRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - CoalescingRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = CoalescingRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = CoalescingRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + CoalescingRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - CoalescingRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = CoalescingRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = CoalescingRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + CoalescingRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - CoalescingRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + CoalescingRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = CoalescingRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - CoalescingRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + CoalescingRefineBy(timeRanged = timeRanged) } /** @@ -1038,33 +978,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [CoalescingRefineBy] to a value of type [T]. @@ -1086,80 +1020,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): CoalescingRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { - CoalescingRefineBy(publicNumOccurrences = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - CoalescingRefineBy(publicSetOccurrences = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> CoalescingRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(numOccurrences = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(setOccurrences = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(relativeComparative = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(relativeRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(absoluteComparative = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(absoluteRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(allHistory = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(timeRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + CoalescingRefineBy(publicTimePointOperation = it, _json = json) + } ?: CoalescingRefineBy(_json = json) } } @@ -1171,23 +1091,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid CoalescingRefineBy") } @@ -1200,97 +1115,85 @@ private constructor( @JsonSerialize(using = PruningRefineBy.Serializer::class) class PruningRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -1306,8 +1209,8 @@ private constructor( * * Optional result = pruningRefineBy.accept(new PruningRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -1325,27 +1228,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -1367,46 +1259,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -1415,10 +1301,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -1443,42 +1327,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -1490,49 +1369,44 @@ private constructor( } return other is PruningRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "PruningRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "PruningRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "PruningRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "PruningRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "PruningRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "PruningRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "PruningRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "PruningRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "PruningRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "PruningRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "PruningRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "PruningRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "PruningRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "PruningRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "PruningRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "PruningRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "PruningRefineBy{timeRanged=$timeRanged}" _json != null -> "PruningRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid PruningRefineBy") } @@ -1540,50 +1414,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - PruningRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + PruningRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - PruningRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + PruningRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = PruningRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = PruningRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + PruningRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = PruningRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = PruningRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + PruningRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - PruningRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + PruningRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = PruningRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - PruningRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + PruningRefineBy(timeRanged = timeRanged) } /** @@ -1592,33 +1458,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [PruningRefineBy] to a value of type [T]. @@ -1639,76 +1499,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): PruningRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicNumOccurrences = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicSetOccurrences = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> PruningRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(numOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(setOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(allHistory = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(timeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + PruningRefineBy(publicTimePointOperation = it, _json = json) + } ?: PruningRefineBy(_json = json) } } @@ -1720,23 +1570,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid PruningRefineBy") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicEmailEventFilter.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicEmailEventFilter.kt index 03f77d33..26a01997 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicEmailEventFilter.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicEmailEventFilter.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -313,68 +312,66 @@ private constructor( /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `PruningRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun pruningRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun pruningRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `PruningRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun pruningRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun pruningRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [pruningRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun pruningRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesPruningRefineBy(setType: String) = pruningRefineBy( - PruningRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `PruningRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun pruningRefineBy(publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun pruningRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `PruningRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun pruningRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun pruningRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `PruningRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun pruningRefineBy(publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun pruningRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `PruningRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun pruningRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicAllHistory(publicAllHistory)) + fun pruningRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofAllHistory(allHistory)`. */ + fun pruningRefineBy(allHistory: PublicAllHistoryRefineBy) = + pruningRefineBy(PruningRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [pruningRefineBy] with @@ -383,12 +380,9 @@ private constructor( fun pruningRefineBy(publicTimePointOperation: PublicTimePointOperation) = pruningRefineBy(PruningRefineBy.ofPublicTimePointOperation(publicTimePointOperation)) - /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. - */ - fun pruningRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - pruningRefineBy(PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)) + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofTimeRanged(timeRanged)`. */ + fun pruningRefineBy(timeRanged: PublicRangedTimeOperation) = + pruningRefineBy(PruningRefineBy.ofTimeRanged(timeRanged)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -828,97 +822,85 @@ private constructor( @JsonSerialize(using = PruningRefineBy.Serializer::class) class PruningRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -934,8 +916,8 @@ private constructor( * * Optional result = pruningRefineBy.accept(new PruningRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -953,27 +935,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -995,46 +966,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -1043,10 +1008,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -1071,42 +1034,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -1118,49 +1076,44 @@ private constructor( } return other is PruningRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "PruningRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "PruningRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "PruningRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "PruningRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "PruningRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "PruningRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "PruningRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "PruningRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "PruningRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "PruningRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "PruningRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "PruningRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "PruningRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "PruningRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "PruningRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "PruningRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "PruningRefineBy{timeRanged=$timeRanged}" _json != null -> "PruningRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid PruningRefineBy") } @@ -1168,50 +1121,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - PruningRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + PruningRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - PruningRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + PruningRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = PruningRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = PruningRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + PruningRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = PruningRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = PruningRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + PruningRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - PruningRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + PruningRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = PruningRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - PruningRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + PruningRefineBy(timeRanged = timeRanged) } /** @@ -1220,33 +1165,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [PruningRefineBy] to a value of type [T]. @@ -1267,76 +1206,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): PruningRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicNumOccurrences = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicSetOccurrences = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> PruningRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(numOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(setOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(allHistory = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(timeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + PruningRefineBy(publicTimePointOperation = it, _json = json) + } ?: PruningRefineBy(_json = json) } } @@ -1348,23 +1277,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid PruningRefineBy") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicEventAnalyticsFilter.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicEventAnalyticsFilter.kt index 61782d02..41c384ce 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicEventAnalyticsFilter.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicEventAnalyticsFilter.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -239,72 +238,69 @@ private constructor( /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `CoalescingRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun coalescingRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun coalescingRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `CoalescingRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun coalescingRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun coalescingRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [coalescingRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun coalescingRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesCoalescingRefineBy(setType: String) = coalescingRefineBy( - CoalescingRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `CoalescingRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun coalescingRefineBy( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun coalescingRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `CoalescingRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun coalescingRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun coalescingRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `CoalescingRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun coalescingRefineBy( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun coalescingRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `CoalescingRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun coalescingRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicAllHistory(publicAllHistory)) + fun coalescingRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** + * Alias for calling [coalescingRefineBy] with + * `CoalescingRefineBy.ofAllHistory(allHistory)`. + */ + fun coalescingRefineBy(allHistory: PublicAllHistoryRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [coalescingRefineBy] with @@ -317,12 +313,10 @@ private constructor( /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. + * `CoalescingRefineBy.ofTimeRanged(timeRanged)`. */ - fun coalescingRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation) - ) + fun coalescingRefineBy(timeRanged: PublicRangedTimeOperation) = + coalescingRefineBy(CoalescingRefineBy.ofTimeRanged(timeRanged)) /** Specifies the criteria for refining the event filter by pruning. */ fun pruningRefineBy(pruningRefineBy: PruningRefineBy) = @@ -341,68 +335,66 @@ private constructor( /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `PruningRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun pruningRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun pruningRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `PruningRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun pruningRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun pruningRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [pruningRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun pruningRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesPruningRefineBy(setType: String) = pruningRefineBy( - PruningRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `PruningRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun pruningRefineBy(publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun pruningRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `PruningRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun pruningRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun pruningRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `PruningRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun pruningRefineBy(publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun pruningRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `PruningRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun pruningRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicAllHistory(publicAllHistory)) + fun pruningRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofAllHistory(allHistory)`. */ + fun pruningRefineBy(allHistory: PublicAllHistoryRefineBy) = + pruningRefineBy(PruningRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [pruningRefineBy] with @@ -411,12 +403,9 @@ private constructor( fun pruningRefineBy(publicTimePointOperation: PublicTimePointOperation) = pruningRefineBy(PruningRefineBy.ofPublicTimePointOperation(publicTimePointOperation)) - /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. - */ - fun pruningRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - pruningRefineBy(PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)) + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofTimeRanged(timeRanged)`. */ + fun pruningRefineBy(timeRanged: PublicRangedTimeOperation) = + pruningRefineBy(PruningRefineBy.ofTimeRanged(timeRanged)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -642,97 +631,85 @@ private constructor( @JsonSerialize(using = CoalescingRefineBy.Serializer::class) class CoalescingRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -748,8 +725,8 @@ private constructor( * * Optional result = coalescingRefineBy.accept(new CoalescingRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -767,27 +744,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -809,46 +775,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -857,10 +817,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -885,42 +843,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -932,49 +885,44 @@ private constructor( } return other is CoalescingRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "CoalescingRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "CoalescingRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "CoalescingRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "CoalescingRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "CoalescingRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "CoalescingRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "CoalescingRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "CoalescingRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "CoalescingRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "CoalescingRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "CoalescingRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "CoalescingRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "CoalescingRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "CoalescingRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "CoalescingRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "CoalescingRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "CoalescingRefineBy{timeRanged=$timeRanged}" _json != null -> "CoalescingRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid CoalescingRefineBy") } @@ -982,50 +930,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - CoalescingRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + CoalescingRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - CoalescingRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + CoalescingRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - CoalescingRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = CoalescingRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = CoalescingRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + CoalescingRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - CoalescingRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = CoalescingRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = CoalescingRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + CoalescingRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - CoalescingRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + CoalescingRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = CoalescingRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - CoalescingRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + CoalescingRefineBy(timeRanged = timeRanged) } /** @@ -1034,33 +974,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [CoalescingRefineBy] to a value of type [T]. @@ -1082,80 +1016,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): CoalescingRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { - CoalescingRefineBy(publicNumOccurrences = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - CoalescingRefineBy(publicSetOccurrences = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> CoalescingRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(numOccurrences = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(setOccurrences = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(relativeComparative = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(relativeRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(absoluteComparative = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(absoluteRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(allHistory = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(timeRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + CoalescingRefineBy(publicTimePointOperation = it, _json = json) + } ?: CoalescingRefineBy(_json = json) } } @@ -1167,23 +1087,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid CoalescingRefineBy") } @@ -1196,97 +1111,85 @@ private constructor( @JsonSerialize(using = PruningRefineBy.Serializer::class) class PruningRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -1302,8 +1205,8 @@ private constructor( * * Optional result = pruningRefineBy.accept(new PruningRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -1321,27 +1224,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -1363,46 +1255,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -1411,10 +1297,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -1439,42 +1323,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -1486,49 +1365,44 @@ private constructor( } return other is PruningRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "PruningRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "PruningRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "PruningRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "PruningRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "PruningRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "PruningRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "PruningRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "PruningRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "PruningRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "PruningRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "PruningRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "PruningRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "PruningRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "PruningRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "PruningRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "PruningRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "PruningRefineBy{timeRanged=$timeRanged}" _json != null -> "PruningRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid PruningRefineBy") } @@ -1536,50 +1410,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - PruningRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + PruningRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - PruningRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + PruningRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = PruningRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = PruningRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + PruningRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = PruningRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = PruningRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + PruningRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - PruningRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + PruningRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = PruningRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - PruningRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + PruningRefineBy(timeRanged = timeRanged) } /** @@ -1588,33 +1454,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [PruningRefineBy] to a value of type [T]. @@ -1635,76 +1495,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): PruningRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicNumOccurrences = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicSetOccurrences = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> PruningRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(numOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(setOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(allHistory = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(timeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + PruningRefineBy(publicTimePointOperation = it, _json = json) + } ?: PruningRefineBy(_json = json) } } @@ -1716,23 +1566,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid PruningRefineBy") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicEventFilterMetadata.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicEventFilterMetadata.kt index d1f5cc5f..d7d4efc4 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicEventFilterMetadata.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicEventFilterMetadata.kt @@ -19,7 +19,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -126,118 +125,75 @@ private constructor( */ fun operation(operation: JsonField) = apply { this.operation = operation } - /** - * Alias for calling [operation] with `Operation.ofPublicBoolProperty(publicBoolProperty)`. - */ - fun operation(publicBoolProperty: PublicBoolPropertyOperation) = - operation(Operation.ofPublicBoolProperty(publicBoolProperty)) + /** Alias for calling [operation] with `Operation.ofBool(bool)`. */ + fun operation(bool: PublicBoolPropertyOperation) = operation(Operation.ofBool(bool)) - /** - * Alias for calling [operation] with - * `Operation.ofPublicNumberProperty(publicNumberProperty)`. - */ - fun operation(publicNumberProperty: PublicNumberPropertyOperation) = - operation(Operation.ofPublicNumberProperty(publicNumberProperty)) + /** Alias for calling [operation] with `Operation.ofNumber(number)`. */ + fun operation(number: PublicNumberPropertyOperation) = operation(Operation.ofNumber(number)) - /** - * Alias for calling [operation] with - * `Operation.ofPublicStringProperty(publicStringProperty)`. - */ - fun operation(publicStringProperty: PublicStringPropertyOperation) = - operation(Operation.ofPublicStringProperty(publicStringProperty)) + /** Alias for calling [operation] with `Operation.ofString(string)`. */ + fun operation(string: PublicStringPropertyOperation) = operation(Operation.ofString(string)) - /** - * Alias for calling [operation] with - * `Operation.ofPublicDateTimeProperty(publicDateTimeProperty)`. - */ - fun operation(publicDateTimeProperty: PublicDateTimePropertyOperation) = - operation(Operation.ofPublicDateTimeProperty(publicDateTimeProperty)) + /** Alias for calling [operation] with `Operation.ofDatetime(datetime)`. */ + fun operation(datetime: PublicDateTimePropertyOperation) = + operation(Operation.ofDatetime(datetime)) - /** - * Alias for calling [operation] with - * `Operation.ofPublicRangedDateProperty(publicRangedDateProperty)`. - */ - fun operation(publicRangedDateProperty: PublicRangedDatePropertyOperation) = - operation(Operation.ofPublicRangedDateProperty(publicRangedDateProperty)) + /** Alias for calling [operation] with `Operation.ofRangedDate(rangedDate)`. */ + fun operation(rangedDate: PublicRangedDatePropertyOperation) = + operation(Operation.ofRangedDate(rangedDate)) /** * Alias for calling [operation] with - * `Operation.ofPublicComparativePropertyUpdated(publicComparativePropertyUpdated)`. + * `Operation.ofComparativePropertyUpdated(comparativePropertyUpdated)`. */ - fun operation(publicComparativePropertyUpdated: PublicComparativePropertyUpdatedOperation) = - operation( - Operation.ofPublicComparativePropertyUpdated(publicComparativePropertyUpdated) - ) + fun operation(comparativePropertyUpdated: PublicComparativePropertyUpdatedOperation) = + operation(Operation.ofComparativePropertyUpdated(comparativePropertyUpdated)) - /** - * Alias for calling [operation] with - * `Operation.ofPublicComparativeDateProperty(publicComparativeDateProperty)`. - */ - fun operation(publicComparativeDateProperty: PublicComparativeDatePropertyOperation) = - operation(Operation.ofPublicComparativeDateProperty(publicComparativeDateProperty)) + /** Alias for calling [operation] with `Operation.ofComparativeDate(comparativeDate)`. */ + fun operation(comparativeDate: PublicComparativeDatePropertyOperation) = + operation(Operation.ofComparativeDate(comparativeDate)) - /** - * Alias for calling [operation] with - * `Operation.ofPublicRollingDateRangeProperty(publicRollingDateRangeProperty)`. - */ - fun operation(publicRollingDateRangeProperty: PublicRollingDateRangePropertyOperation) = - operation(Operation.ofPublicRollingDateRangeProperty(publicRollingDateRangeProperty)) + /** Alias for calling [operation] with `Operation.ofRollingDateRange(rollingDateRange)`. */ + fun operation(rollingDateRange: PublicRollingDateRangePropertyOperation) = + operation(Operation.ofRollingDateRange(rollingDateRange)) /** * Alias for calling [operation] with - * `Operation.ofPublicRollingPropertyUpdated(publicRollingPropertyUpdated)`. + * `Operation.ofRollingPropertyUpdated(rollingPropertyUpdated)`. */ - fun operation(publicRollingPropertyUpdated: PublicRollingPropertyUpdatedOperation) = - operation(Operation.ofPublicRollingPropertyUpdated(publicRollingPropertyUpdated)) + fun operation(rollingPropertyUpdated: PublicRollingPropertyUpdatedOperation) = + operation(Operation.ofRollingPropertyUpdated(rollingPropertyUpdated)) - /** - * Alias for calling [operation] with - * `Operation.ofPublicEnumerationProperty(publicEnumerationProperty)`. - */ - fun operation(publicEnumerationProperty: PublicEnumerationPropertyOperation) = - operation(Operation.ofPublicEnumerationProperty(publicEnumerationProperty)) + /** Alias for calling [operation] with `Operation.ofEnumeration(enumeration)`. */ + fun operation(enumeration: PublicEnumerationPropertyOperation) = + operation(Operation.ofEnumeration(enumeration)) - /** - * Alias for calling [operation] with - * `Operation.ofPublicAllPropertyTypes(publicAllPropertyTypes)`. - */ - fun operation(publicAllPropertyTypes: PublicAllPropertyTypesOperation) = - operation(Operation.ofPublicAllPropertyTypes(publicAllPropertyTypes)) + /** Alias for calling [operation] with `Operation.ofAllProperty(allProperty)`. */ + fun operation(allProperty: PublicAllPropertyTypesOperation) = + operation(Operation.ofAllProperty(allProperty)) - /** - * Alias for calling [operation] with - * `Operation.ofPublicRangedNumberProperty(publicRangedNumberProperty)`. - */ - fun operation(publicRangedNumberProperty: PublicRangedNumberPropertyOperation) = - operation(Operation.ofPublicRangedNumberProperty(publicRangedNumberProperty)) + /** Alias for calling [operation] with `Operation.ofNumberRanged(numberRanged)`. */ + fun operation(numberRanged: PublicRangedNumberPropertyOperation) = + operation(Operation.ofNumberRanged(numberRanged)) - /** - * Alias for calling [operation] with - * `Operation.ofPublicMultiStringProperty(publicMultiStringProperty)`. - */ - fun operation(publicMultiStringProperty: PublicMultiStringPropertyOperation) = - operation(Operation.ofPublicMultiStringProperty(publicMultiStringProperty)) + /** Alias for calling [operation] with `Operation.ofMultistring(multistring)`. */ + fun operation(multistring: PublicMultiStringPropertyOperation) = + operation(Operation.ofMultistring(multistring)) - /** - * Alias for calling [operation] with `Operation.ofPublicDateProperty(publicDateProperty)`. - */ - fun operation(publicDateProperty: PublicDatePropertyOperation) = - operation(Operation.ofPublicDateProperty(publicDateProperty)) + /** Alias for calling [operation] with `Operation.ofDate(date)`. */ + fun operation(date: PublicDatePropertyOperation) = operation(Operation.ofDate(date)) - /** - * Alias for calling [operation] with - * `Operation.ofPublicCalendarDateProperty(publicCalendarDateProperty)`. - */ - fun operation(publicCalendarDateProperty: PublicCalendarDatePropertyOperation) = - operation(Operation.ofPublicCalendarDateProperty(publicCalendarDateProperty)) + /** Alias for calling [operation] with `Operation.ofCalendarDate(calendarDate)`. */ + fun operation(calendarDate: PublicCalendarDatePropertyOperation) = + operation(Operation.ofCalendarDate(calendarDate)) - /** Alias for calling [operation] with `Operation.ofPublicTimePoint(publicTimePoint)`. */ - fun operation(publicTimePoint: PublicTimePointOperation) = - operation(Operation.ofPublicTimePoint(publicTimePoint)) + /** Alias for calling [operation] with `Operation.ofTimePoint(timePoint)`. */ + fun operation(timePoint: PublicTimePointOperation) = + operation(Operation.ofTimePoint(timePoint)) - /** Alias for calling [operation] with `Operation.ofPublicRangedTime(publicRangedTime)`. */ - fun operation(publicRangedTime: PublicRangedTimeOperation) = - operation(Operation.ofPublicRangedTime(publicRangedTime)) + /** Alias for calling [operation] with `Operation.ofTimeRanged(timeRanged)`. */ + fun operation(timeRanged: PublicRangedTimeOperation) = + operation(Operation.ofTimeRanged(timeRanged)) /** Specifies the property on which the operation is to be applied. */ fun property(property: String) = property(JsonField.of(property)) @@ -333,163 +289,145 @@ private constructor( @JsonSerialize(using = Operation.Serializer::class) class Operation private constructor( - private val publicBoolProperty: PublicBoolPropertyOperation? = null, - private val publicNumberProperty: PublicNumberPropertyOperation? = null, - private val publicStringProperty: PublicStringPropertyOperation? = null, - private val publicDateTimeProperty: PublicDateTimePropertyOperation? = null, - private val publicRangedDateProperty: PublicRangedDatePropertyOperation? = null, - private val publicComparativePropertyUpdated: PublicComparativePropertyUpdatedOperation? = - null, - private val publicComparativeDateProperty: PublicComparativeDatePropertyOperation? = null, - private val publicRollingDateRangeProperty: PublicRollingDateRangePropertyOperation? = null, - private val publicRollingPropertyUpdated: PublicRollingPropertyUpdatedOperation? = null, - private val publicEnumerationProperty: PublicEnumerationPropertyOperation? = null, - private val publicAllPropertyTypes: PublicAllPropertyTypesOperation? = null, - private val publicRangedNumberProperty: PublicRangedNumberPropertyOperation? = null, - private val publicMultiStringProperty: PublicMultiStringPropertyOperation? = null, - private val publicDateProperty: PublicDatePropertyOperation? = null, - private val publicCalendarDateProperty: PublicCalendarDatePropertyOperation? = null, - private val publicTimePoint: PublicTimePointOperation? = null, - private val publicRangedTime: PublicRangedTimeOperation? = null, + private val bool: PublicBoolPropertyOperation? = null, + private val number: PublicNumberPropertyOperation? = null, + private val string: PublicStringPropertyOperation? = null, + private val datetime: PublicDateTimePropertyOperation? = null, + private val rangedDate: PublicRangedDatePropertyOperation? = null, + private val comparativePropertyUpdated: PublicComparativePropertyUpdatedOperation? = null, + private val comparativeDate: PublicComparativeDatePropertyOperation? = null, + private val rollingDateRange: PublicRollingDateRangePropertyOperation? = null, + private val rollingPropertyUpdated: PublicRollingPropertyUpdatedOperation? = null, + private val enumeration: PublicEnumerationPropertyOperation? = null, + private val allProperty: PublicAllPropertyTypesOperation? = null, + private val numberRanged: PublicRangedNumberPropertyOperation? = null, + private val multistring: PublicMultiStringPropertyOperation? = null, + private val date: PublicDatePropertyOperation? = null, + private val calendarDate: PublicCalendarDatePropertyOperation? = null, + private val timePoint: PublicTimePointOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicBoolProperty(): Optional = - Optional.ofNullable(publicBoolProperty) + fun bool(): Optional = Optional.ofNullable(bool) - fun publicNumberProperty(): Optional = - Optional.ofNullable(publicNumberProperty) + fun number(): Optional = Optional.ofNullable(number) - fun publicStringProperty(): Optional = - Optional.ofNullable(publicStringProperty) + fun string(): Optional = Optional.ofNullable(string) - fun publicDateTimeProperty(): Optional = - Optional.ofNullable(publicDateTimeProperty) + fun datetime(): Optional = Optional.ofNullable(datetime) - fun publicRangedDateProperty(): Optional = - Optional.ofNullable(publicRangedDateProperty) + fun rangedDate(): Optional = + Optional.ofNullable(rangedDate) - fun publicComparativePropertyUpdated(): - Optional = - Optional.ofNullable(publicComparativePropertyUpdated) + fun comparativePropertyUpdated(): Optional = + Optional.ofNullable(comparativePropertyUpdated) - fun publicComparativeDateProperty(): Optional = - Optional.ofNullable(publicComparativeDateProperty) + fun comparativeDate(): Optional = + Optional.ofNullable(comparativeDate) - fun publicRollingDateRangeProperty(): Optional = - Optional.ofNullable(publicRollingDateRangeProperty) + fun rollingDateRange(): Optional = + Optional.ofNullable(rollingDateRange) - fun publicRollingPropertyUpdated(): Optional = - Optional.ofNullable(publicRollingPropertyUpdated) + fun rollingPropertyUpdated(): Optional = + Optional.ofNullable(rollingPropertyUpdated) - fun publicEnumerationProperty(): Optional = - Optional.ofNullable(publicEnumerationProperty) + fun enumeration(): Optional = + Optional.ofNullable(enumeration) - fun publicAllPropertyTypes(): Optional = - Optional.ofNullable(publicAllPropertyTypes) + fun allProperty(): Optional = + Optional.ofNullable(allProperty) - fun publicRangedNumberProperty(): Optional = - Optional.ofNullable(publicRangedNumberProperty) + fun numberRanged(): Optional = + Optional.ofNullable(numberRanged) - fun publicMultiStringProperty(): Optional = - Optional.ofNullable(publicMultiStringProperty) + fun multistring(): Optional = + Optional.ofNullable(multistring) - fun publicDateProperty(): Optional = - Optional.ofNullable(publicDateProperty) + fun date(): Optional = Optional.ofNullable(date) - fun publicCalendarDateProperty(): Optional = - Optional.ofNullable(publicCalendarDateProperty) + fun calendarDate(): Optional = + Optional.ofNullable(calendarDate) - fun publicTimePoint(): Optional = - Optional.ofNullable(publicTimePoint) + fun timePoint(): Optional = Optional.ofNullable(timePoint) - fun publicRangedTime(): Optional = - Optional.ofNullable(publicRangedTime) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicBoolProperty(): Boolean = publicBoolProperty != null + fun isBool(): Boolean = bool != null - fun isPublicNumberProperty(): Boolean = publicNumberProperty != null + fun isNumber(): Boolean = number != null - fun isPublicStringProperty(): Boolean = publicStringProperty != null + fun isString(): Boolean = string != null - fun isPublicDateTimeProperty(): Boolean = publicDateTimeProperty != null + fun isDatetime(): Boolean = datetime != null - fun isPublicRangedDateProperty(): Boolean = publicRangedDateProperty != null + fun isRangedDate(): Boolean = rangedDate != null - fun isPublicComparativePropertyUpdated(): Boolean = publicComparativePropertyUpdated != null + fun isComparativePropertyUpdated(): Boolean = comparativePropertyUpdated != null - fun isPublicComparativeDateProperty(): Boolean = publicComparativeDateProperty != null + fun isComparativeDate(): Boolean = comparativeDate != null - fun isPublicRollingDateRangeProperty(): Boolean = publicRollingDateRangeProperty != null + fun isRollingDateRange(): Boolean = rollingDateRange != null - fun isPublicRollingPropertyUpdated(): Boolean = publicRollingPropertyUpdated != null + fun isRollingPropertyUpdated(): Boolean = rollingPropertyUpdated != null - fun isPublicEnumerationProperty(): Boolean = publicEnumerationProperty != null + fun isEnumeration(): Boolean = enumeration != null - fun isPublicAllPropertyTypes(): Boolean = publicAllPropertyTypes != null + fun isAllProperty(): Boolean = allProperty != null - fun isPublicRangedNumberProperty(): Boolean = publicRangedNumberProperty != null + fun isNumberRanged(): Boolean = numberRanged != null - fun isPublicMultiStringProperty(): Boolean = publicMultiStringProperty != null + fun isMultistring(): Boolean = multistring != null - fun isPublicDateProperty(): Boolean = publicDateProperty != null + fun isDate(): Boolean = date != null - fun isPublicCalendarDateProperty(): Boolean = publicCalendarDateProperty != null + fun isCalendarDate(): Boolean = calendarDate != null - fun isPublicTimePoint(): Boolean = publicTimePoint != null + fun isTimePoint(): Boolean = timePoint != null - fun isPublicRangedTime(): Boolean = publicRangedTime != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicBoolProperty(): PublicBoolPropertyOperation = - publicBoolProperty.getOrThrow("publicBoolProperty") + fun asBool(): PublicBoolPropertyOperation = bool.getOrThrow("bool") - fun asPublicNumberProperty(): PublicNumberPropertyOperation = - publicNumberProperty.getOrThrow("publicNumberProperty") + fun asNumber(): PublicNumberPropertyOperation = number.getOrThrow("number") - fun asPublicStringProperty(): PublicStringPropertyOperation = - publicStringProperty.getOrThrow("publicStringProperty") + fun asString(): PublicStringPropertyOperation = string.getOrThrow("string") - fun asPublicDateTimeProperty(): PublicDateTimePropertyOperation = - publicDateTimeProperty.getOrThrow("publicDateTimeProperty") + fun asDatetime(): PublicDateTimePropertyOperation = datetime.getOrThrow("datetime") - fun asPublicRangedDateProperty(): PublicRangedDatePropertyOperation = - publicRangedDateProperty.getOrThrow("publicRangedDateProperty") + fun asRangedDate(): PublicRangedDatePropertyOperation = rangedDate.getOrThrow("rangedDate") - fun asPublicComparativePropertyUpdated(): PublicComparativePropertyUpdatedOperation = - publicComparativePropertyUpdated.getOrThrow("publicComparativePropertyUpdated") + fun asComparativePropertyUpdated(): PublicComparativePropertyUpdatedOperation = + comparativePropertyUpdated.getOrThrow("comparativePropertyUpdated") - fun asPublicComparativeDateProperty(): PublicComparativeDatePropertyOperation = - publicComparativeDateProperty.getOrThrow("publicComparativeDateProperty") + fun asComparativeDate(): PublicComparativeDatePropertyOperation = + comparativeDate.getOrThrow("comparativeDate") - fun asPublicRollingDateRangeProperty(): PublicRollingDateRangePropertyOperation = - publicRollingDateRangeProperty.getOrThrow("publicRollingDateRangeProperty") + fun asRollingDateRange(): PublicRollingDateRangePropertyOperation = + rollingDateRange.getOrThrow("rollingDateRange") - fun asPublicRollingPropertyUpdated(): PublicRollingPropertyUpdatedOperation = - publicRollingPropertyUpdated.getOrThrow("publicRollingPropertyUpdated") + fun asRollingPropertyUpdated(): PublicRollingPropertyUpdatedOperation = + rollingPropertyUpdated.getOrThrow("rollingPropertyUpdated") - fun asPublicEnumerationProperty(): PublicEnumerationPropertyOperation = - publicEnumerationProperty.getOrThrow("publicEnumerationProperty") + fun asEnumeration(): PublicEnumerationPropertyOperation = + enumeration.getOrThrow("enumeration") - fun asPublicAllPropertyTypes(): PublicAllPropertyTypesOperation = - publicAllPropertyTypes.getOrThrow("publicAllPropertyTypes") + fun asAllProperty(): PublicAllPropertyTypesOperation = allProperty.getOrThrow("allProperty") - fun asPublicRangedNumberProperty(): PublicRangedNumberPropertyOperation = - publicRangedNumberProperty.getOrThrow("publicRangedNumberProperty") + fun asNumberRanged(): PublicRangedNumberPropertyOperation = + numberRanged.getOrThrow("numberRanged") - fun asPublicMultiStringProperty(): PublicMultiStringPropertyOperation = - publicMultiStringProperty.getOrThrow("publicMultiStringProperty") + fun asMultistring(): PublicMultiStringPropertyOperation = + multistring.getOrThrow("multistring") - fun asPublicDateProperty(): PublicDatePropertyOperation = - publicDateProperty.getOrThrow("publicDateProperty") + fun asDate(): PublicDatePropertyOperation = date.getOrThrow("date") - fun asPublicCalendarDateProperty(): PublicCalendarDatePropertyOperation = - publicCalendarDateProperty.getOrThrow("publicCalendarDateProperty") + fun asCalendarDate(): PublicCalendarDatePropertyOperation = + calendarDate.getOrThrow("calendarDate") - fun asPublicTimePoint(): PublicTimePointOperation = - publicTimePoint.getOrThrow("publicTimePoint") + fun asTimePoint(): PublicTimePointOperation = timePoint.getOrThrow("timePoint") - fun asPublicRangedTime(): PublicRangedTimeOperation = - publicRangedTime.getOrThrow("publicRangedTime") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -505,8 +443,8 @@ private constructor( * * Optional result = operation.accept(new Operation.Visitor>() { * @Override - * public Optional visitPublicBoolProperty(PublicBoolPropertyOperation publicBoolProperty) { - * return Optional.of(publicBoolProperty.toString()); + * public Optional visitBool(PublicBoolPropertyOperation bool) { + * return Optional.of(bool.toString()); * } * * // ... @@ -524,36 +462,25 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicBoolProperty != null -> visitor.visitPublicBoolProperty(publicBoolProperty) - publicNumberProperty != null -> - visitor.visitPublicNumberProperty(publicNumberProperty) - publicStringProperty != null -> - visitor.visitPublicStringProperty(publicStringProperty) - publicDateTimeProperty != null -> - visitor.visitPublicDateTimeProperty(publicDateTimeProperty) - publicRangedDateProperty != null -> - visitor.visitPublicRangedDateProperty(publicRangedDateProperty) - publicComparativePropertyUpdated != null -> - visitor.visitPublicComparativePropertyUpdated(publicComparativePropertyUpdated) - publicComparativeDateProperty != null -> - visitor.visitPublicComparativeDateProperty(publicComparativeDateProperty) - publicRollingDateRangeProperty != null -> - visitor.visitPublicRollingDateRangeProperty(publicRollingDateRangeProperty) - publicRollingPropertyUpdated != null -> - visitor.visitPublicRollingPropertyUpdated(publicRollingPropertyUpdated) - publicEnumerationProperty != null -> - visitor.visitPublicEnumerationProperty(publicEnumerationProperty) - publicAllPropertyTypes != null -> - visitor.visitPublicAllPropertyTypes(publicAllPropertyTypes) - publicRangedNumberProperty != null -> - visitor.visitPublicRangedNumberProperty(publicRangedNumberProperty) - publicMultiStringProperty != null -> - visitor.visitPublicMultiStringProperty(publicMultiStringProperty) - publicDateProperty != null -> visitor.visitPublicDateProperty(publicDateProperty) - publicCalendarDateProperty != null -> - visitor.visitPublicCalendarDateProperty(publicCalendarDateProperty) - publicTimePoint != null -> visitor.visitPublicTimePoint(publicTimePoint) - publicRangedTime != null -> visitor.visitPublicRangedTime(publicRangedTime) + bool != null -> visitor.visitBool(bool) + number != null -> visitor.visitNumber(number) + string != null -> visitor.visitString(string) + datetime != null -> visitor.visitDatetime(datetime) + rangedDate != null -> visitor.visitRangedDate(rangedDate) + comparativePropertyUpdated != null -> + visitor.visitComparativePropertyUpdated(comparativePropertyUpdated) + comparativeDate != null -> visitor.visitComparativeDate(comparativeDate) + rollingDateRange != null -> visitor.visitRollingDateRange(rollingDateRange) + rollingPropertyUpdated != null -> + visitor.visitRollingPropertyUpdated(rollingPropertyUpdated) + enumeration != null -> visitor.visitEnumeration(enumeration) + allProperty != null -> visitor.visitAllProperty(allProperty) + numberRanged != null -> visitor.visitNumberRanged(numberRanged) + multistring != null -> visitor.visitMultistring(multistring) + date != null -> visitor.visitDate(date) + calendarDate != null -> visitor.visitCalendarDate(calendarDate) + timePoint != null -> visitor.visitTimePoint(timePoint) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -575,104 +502,84 @@ private constructor( accept( object : Visitor { - override fun visitPublicBoolProperty( - publicBoolProperty: PublicBoolPropertyOperation - ) { - publicBoolProperty.validate() + override fun visitBool(bool: PublicBoolPropertyOperation) { + bool.validate() } - override fun visitPublicNumberProperty( - publicNumberProperty: PublicNumberPropertyOperation - ) { - publicNumberProperty.validate() + override fun visitNumber(number: PublicNumberPropertyOperation) { + number.validate() } - override fun visitPublicStringProperty( - publicStringProperty: PublicStringPropertyOperation - ) { - publicStringProperty.validate() + override fun visitString(string: PublicStringPropertyOperation) { + string.validate() } - override fun visitPublicDateTimeProperty( - publicDateTimeProperty: PublicDateTimePropertyOperation - ) { - publicDateTimeProperty.validate() + override fun visitDatetime(datetime: PublicDateTimePropertyOperation) { + datetime.validate() } - override fun visitPublicRangedDateProperty( - publicRangedDateProperty: PublicRangedDatePropertyOperation - ) { - publicRangedDateProperty.validate() + override fun visitRangedDate(rangedDate: PublicRangedDatePropertyOperation) { + rangedDate.validate() } - override fun visitPublicComparativePropertyUpdated( - publicComparativePropertyUpdated: PublicComparativePropertyUpdatedOperation + override fun visitComparativePropertyUpdated( + comparativePropertyUpdated: PublicComparativePropertyUpdatedOperation ) { - publicComparativePropertyUpdated.validate() + comparativePropertyUpdated.validate() } - override fun visitPublicComparativeDateProperty( - publicComparativeDateProperty: PublicComparativeDatePropertyOperation + override fun visitComparativeDate( + comparativeDate: PublicComparativeDatePropertyOperation ) { - publicComparativeDateProperty.validate() + comparativeDate.validate() } - override fun visitPublicRollingDateRangeProperty( - publicRollingDateRangeProperty: PublicRollingDateRangePropertyOperation + override fun visitRollingDateRange( + rollingDateRange: PublicRollingDateRangePropertyOperation ) { - publicRollingDateRangeProperty.validate() + rollingDateRange.validate() } - override fun visitPublicRollingPropertyUpdated( - publicRollingPropertyUpdated: PublicRollingPropertyUpdatedOperation + override fun visitRollingPropertyUpdated( + rollingPropertyUpdated: PublicRollingPropertyUpdatedOperation ) { - publicRollingPropertyUpdated.validate() + rollingPropertyUpdated.validate() } - override fun visitPublicEnumerationProperty( - publicEnumerationProperty: PublicEnumerationPropertyOperation - ) { - publicEnumerationProperty.validate() + override fun visitEnumeration(enumeration: PublicEnumerationPropertyOperation) { + enumeration.validate() } - override fun visitPublicAllPropertyTypes( - publicAllPropertyTypes: PublicAllPropertyTypesOperation - ) { - publicAllPropertyTypes.validate() + override fun visitAllProperty(allProperty: PublicAllPropertyTypesOperation) { + allProperty.validate() } - override fun visitPublicRangedNumberProperty( - publicRangedNumberProperty: PublicRangedNumberPropertyOperation + override fun visitNumberRanged( + numberRanged: PublicRangedNumberPropertyOperation ) { - publicRangedNumberProperty.validate() + numberRanged.validate() } - override fun visitPublicMultiStringProperty( - publicMultiStringProperty: PublicMultiStringPropertyOperation - ) { - publicMultiStringProperty.validate() + override fun visitMultistring(multistring: PublicMultiStringPropertyOperation) { + multistring.validate() } - override fun visitPublicDateProperty( - publicDateProperty: PublicDatePropertyOperation - ) { - publicDateProperty.validate() + override fun visitDate(date: PublicDatePropertyOperation) { + date.validate() } - override fun visitPublicCalendarDateProperty( - publicCalendarDateProperty: PublicCalendarDatePropertyOperation + override fun visitCalendarDate( + calendarDate: PublicCalendarDatePropertyOperation ) { - publicCalendarDateProperty.validate() + calendarDate.validate() } - override fun visitPublicTimePoint(publicTimePoint: PublicTimePointOperation) { - publicTimePoint.validate() + override fun visitTimePoint(timePoint: PublicTimePointOperation) { + timePoint.validate() } - override fun visitPublicRangedTime( - publicRangedTime: PublicRangedTimeOperation - ) { - publicRangedTime.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -697,72 +604,60 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicBoolProperty( - publicBoolProperty: PublicBoolPropertyOperation - ) = publicBoolProperty.validity() + override fun visitBool(bool: PublicBoolPropertyOperation) = bool.validity() - override fun visitPublicNumberProperty( - publicNumberProperty: PublicNumberPropertyOperation - ) = publicNumberProperty.validity() + override fun visitNumber(number: PublicNumberPropertyOperation) = + number.validity() - override fun visitPublicStringProperty( - publicStringProperty: PublicStringPropertyOperation - ) = publicStringProperty.validity() + override fun visitString(string: PublicStringPropertyOperation) = + string.validity() - override fun visitPublicDateTimeProperty( - publicDateTimeProperty: PublicDateTimePropertyOperation - ) = publicDateTimeProperty.validity() + override fun visitDatetime(datetime: PublicDateTimePropertyOperation) = + datetime.validity() - override fun visitPublicRangedDateProperty( - publicRangedDateProperty: PublicRangedDatePropertyOperation - ) = publicRangedDateProperty.validity() + override fun visitRangedDate(rangedDate: PublicRangedDatePropertyOperation) = + rangedDate.validity() - override fun visitPublicComparativePropertyUpdated( - publicComparativePropertyUpdated: PublicComparativePropertyUpdatedOperation - ) = publicComparativePropertyUpdated.validity() + override fun visitComparativePropertyUpdated( + comparativePropertyUpdated: PublicComparativePropertyUpdatedOperation + ) = comparativePropertyUpdated.validity() - override fun visitPublicComparativeDateProperty( - publicComparativeDateProperty: PublicComparativeDatePropertyOperation - ) = publicComparativeDateProperty.validity() + override fun visitComparativeDate( + comparativeDate: PublicComparativeDatePropertyOperation + ) = comparativeDate.validity() - override fun visitPublicRollingDateRangeProperty( - publicRollingDateRangeProperty: PublicRollingDateRangePropertyOperation - ) = publicRollingDateRangeProperty.validity() + override fun visitRollingDateRange( + rollingDateRange: PublicRollingDateRangePropertyOperation + ) = rollingDateRange.validity() - override fun visitPublicRollingPropertyUpdated( - publicRollingPropertyUpdated: PublicRollingPropertyUpdatedOperation - ) = publicRollingPropertyUpdated.validity() + override fun visitRollingPropertyUpdated( + rollingPropertyUpdated: PublicRollingPropertyUpdatedOperation + ) = rollingPropertyUpdated.validity() - override fun visitPublicEnumerationProperty( - publicEnumerationProperty: PublicEnumerationPropertyOperation - ) = publicEnumerationProperty.validity() + override fun visitEnumeration(enumeration: PublicEnumerationPropertyOperation) = + enumeration.validity() - override fun visitPublicAllPropertyTypes( - publicAllPropertyTypes: PublicAllPropertyTypesOperation - ) = publicAllPropertyTypes.validity() + override fun visitAllProperty(allProperty: PublicAllPropertyTypesOperation) = + allProperty.validity() - override fun visitPublicRangedNumberProperty( - publicRangedNumberProperty: PublicRangedNumberPropertyOperation - ) = publicRangedNumberProperty.validity() + override fun visitNumberRanged( + numberRanged: PublicRangedNumberPropertyOperation + ) = numberRanged.validity() - override fun visitPublicMultiStringProperty( - publicMultiStringProperty: PublicMultiStringPropertyOperation - ) = publicMultiStringProperty.validity() + override fun visitMultistring(multistring: PublicMultiStringPropertyOperation) = + multistring.validity() - override fun visitPublicDateProperty( - publicDateProperty: PublicDatePropertyOperation - ) = publicDateProperty.validity() + override fun visitDate(date: PublicDatePropertyOperation) = date.validity() - override fun visitPublicCalendarDateProperty( - publicCalendarDateProperty: PublicCalendarDatePropertyOperation - ) = publicCalendarDateProperty.validity() + override fun visitCalendarDate( + calendarDate: PublicCalendarDatePropertyOperation + ) = calendarDate.validity() - override fun visitPublicTimePoint(publicTimePoint: PublicTimePointOperation) = - publicTimePoint.validity() + override fun visitTimePoint(timePoint: PublicTimePointOperation) = + timePoint.validity() - override fun visitPublicRangedTime( - publicRangedTime: PublicRangedTimeOperation - ) = publicRangedTime.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -774,160 +669,135 @@ private constructor( } return other is Operation && - publicBoolProperty == other.publicBoolProperty && - publicNumberProperty == other.publicNumberProperty && - publicStringProperty == other.publicStringProperty && - publicDateTimeProperty == other.publicDateTimeProperty && - publicRangedDateProperty == other.publicRangedDateProperty && - publicComparativePropertyUpdated == other.publicComparativePropertyUpdated && - publicComparativeDateProperty == other.publicComparativeDateProperty && - publicRollingDateRangeProperty == other.publicRollingDateRangeProperty && - publicRollingPropertyUpdated == other.publicRollingPropertyUpdated && - publicEnumerationProperty == other.publicEnumerationProperty && - publicAllPropertyTypes == other.publicAllPropertyTypes && - publicRangedNumberProperty == other.publicRangedNumberProperty && - publicMultiStringProperty == other.publicMultiStringProperty && - publicDateProperty == other.publicDateProperty && - publicCalendarDateProperty == other.publicCalendarDateProperty && - publicTimePoint == other.publicTimePoint && - publicRangedTime == other.publicRangedTime + bool == other.bool && + number == other.number && + string == other.string && + datetime == other.datetime && + rangedDate == other.rangedDate && + comparativePropertyUpdated == other.comparativePropertyUpdated && + comparativeDate == other.comparativeDate && + rollingDateRange == other.rollingDateRange && + rollingPropertyUpdated == other.rollingPropertyUpdated && + enumeration == other.enumeration && + allProperty == other.allProperty && + numberRanged == other.numberRanged && + multistring == other.multistring && + date == other.date && + calendarDate == other.calendarDate && + timePoint == other.timePoint && + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicBoolProperty, - publicNumberProperty, - publicStringProperty, - publicDateTimeProperty, - publicRangedDateProperty, - publicComparativePropertyUpdated, - publicComparativeDateProperty, - publicRollingDateRangeProperty, - publicRollingPropertyUpdated, - publicEnumerationProperty, - publicAllPropertyTypes, - publicRangedNumberProperty, - publicMultiStringProperty, - publicDateProperty, - publicCalendarDateProperty, - publicTimePoint, - publicRangedTime, + bool, + number, + string, + datetime, + rangedDate, + comparativePropertyUpdated, + comparativeDate, + rollingDateRange, + rollingPropertyUpdated, + enumeration, + allProperty, + numberRanged, + multistring, + date, + calendarDate, + timePoint, + timeRanged, ) override fun toString(): String = when { - publicBoolProperty != null -> "Operation{publicBoolProperty=$publicBoolProperty}" - publicNumberProperty != null -> - "Operation{publicNumberProperty=$publicNumberProperty}" - publicStringProperty != null -> - "Operation{publicStringProperty=$publicStringProperty}" - publicDateTimeProperty != null -> - "Operation{publicDateTimeProperty=$publicDateTimeProperty}" - publicRangedDateProperty != null -> - "Operation{publicRangedDateProperty=$publicRangedDateProperty}" - publicComparativePropertyUpdated != null -> - "Operation{publicComparativePropertyUpdated=$publicComparativePropertyUpdated}" - publicComparativeDateProperty != null -> - "Operation{publicComparativeDateProperty=$publicComparativeDateProperty}" - publicRollingDateRangeProperty != null -> - "Operation{publicRollingDateRangeProperty=$publicRollingDateRangeProperty}" - publicRollingPropertyUpdated != null -> - "Operation{publicRollingPropertyUpdated=$publicRollingPropertyUpdated}" - publicEnumerationProperty != null -> - "Operation{publicEnumerationProperty=$publicEnumerationProperty}" - publicAllPropertyTypes != null -> - "Operation{publicAllPropertyTypes=$publicAllPropertyTypes}" - publicRangedNumberProperty != null -> - "Operation{publicRangedNumberProperty=$publicRangedNumberProperty}" - publicMultiStringProperty != null -> - "Operation{publicMultiStringProperty=$publicMultiStringProperty}" - publicDateProperty != null -> "Operation{publicDateProperty=$publicDateProperty}" - publicCalendarDateProperty != null -> - "Operation{publicCalendarDateProperty=$publicCalendarDateProperty}" - publicTimePoint != null -> "Operation{publicTimePoint=$publicTimePoint}" - publicRangedTime != null -> "Operation{publicRangedTime=$publicRangedTime}" + bool != null -> "Operation{bool=$bool}" + number != null -> "Operation{number=$number}" + string != null -> "Operation{string=$string}" + datetime != null -> "Operation{datetime=$datetime}" + rangedDate != null -> "Operation{rangedDate=$rangedDate}" + comparativePropertyUpdated != null -> + "Operation{comparativePropertyUpdated=$comparativePropertyUpdated}" + comparativeDate != null -> "Operation{comparativeDate=$comparativeDate}" + rollingDateRange != null -> "Operation{rollingDateRange=$rollingDateRange}" + rollingPropertyUpdated != null -> + "Operation{rollingPropertyUpdated=$rollingPropertyUpdated}" + enumeration != null -> "Operation{enumeration=$enumeration}" + allProperty != null -> "Operation{allProperty=$allProperty}" + numberRanged != null -> "Operation{numberRanged=$numberRanged}" + multistring != null -> "Operation{multistring=$multistring}" + date != null -> "Operation{date=$date}" + calendarDate != null -> "Operation{calendarDate=$calendarDate}" + timePoint != null -> "Operation{timePoint=$timePoint}" + timeRanged != null -> "Operation{timeRanged=$timeRanged}" _json != null -> "Operation{_unknown=$_json}" else -> throw IllegalStateException("Invalid Operation") } companion object { - @JvmStatic - fun ofPublicBoolProperty(publicBoolProperty: PublicBoolPropertyOperation) = - Operation(publicBoolProperty = publicBoolProperty) + @JvmStatic fun ofBool(bool: PublicBoolPropertyOperation) = Operation(bool = bool) @JvmStatic - fun ofPublicNumberProperty(publicNumberProperty: PublicNumberPropertyOperation) = - Operation(publicNumberProperty = publicNumberProperty) + fun ofNumber(number: PublicNumberPropertyOperation) = Operation(number = number) @JvmStatic - fun ofPublicStringProperty(publicStringProperty: PublicStringPropertyOperation) = - Operation(publicStringProperty = publicStringProperty) + fun ofString(string: PublicStringPropertyOperation) = Operation(string = string) @JvmStatic - fun ofPublicDateTimeProperty(publicDateTimeProperty: PublicDateTimePropertyOperation) = - Operation(publicDateTimeProperty = publicDateTimeProperty) + fun ofDatetime(datetime: PublicDateTimePropertyOperation) = + Operation(datetime = datetime) @JvmStatic - fun ofPublicRangedDateProperty( - publicRangedDateProperty: PublicRangedDatePropertyOperation - ) = Operation(publicRangedDateProperty = publicRangedDateProperty) + fun ofRangedDate(rangedDate: PublicRangedDatePropertyOperation) = + Operation(rangedDate = rangedDate) @JvmStatic - fun ofPublicComparativePropertyUpdated( - publicComparativePropertyUpdated: PublicComparativePropertyUpdatedOperation - ) = Operation(publicComparativePropertyUpdated = publicComparativePropertyUpdated) + fun ofComparativePropertyUpdated( + comparativePropertyUpdated: PublicComparativePropertyUpdatedOperation + ) = Operation(comparativePropertyUpdated = comparativePropertyUpdated) @JvmStatic - fun ofPublicComparativeDateProperty( - publicComparativeDateProperty: PublicComparativeDatePropertyOperation - ) = Operation(publicComparativeDateProperty = publicComparativeDateProperty) + fun ofComparativeDate(comparativeDate: PublicComparativeDatePropertyOperation) = + Operation(comparativeDate = comparativeDate) @JvmStatic - fun ofPublicRollingDateRangeProperty( - publicRollingDateRangeProperty: PublicRollingDateRangePropertyOperation - ) = Operation(publicRollingDateRangeProperty = publicRollingDateRangeProperty) + fun ofRollingDateRange(rollingDateRange: PublicRollingDateRangePropertyOperation) = + Operation(rollingDateRange = rollingDateRange) @JvmStatic - fun ofPublicRollingPropertyUpdated( - publicRollingPropertyUpdated: PublicRollingPropertyUpdatedOperation - ) = Operation(publicRollingPropertyUpdated = publicRollingPropertyUpdated) + fun ofRollingPropertyUpdated( + rollingPropertyUpdated: PublicRollingPropertyUpdatedOperation + ) = Operation(rollingPropertyUpdated = rollingPropertyUpdated) @JvmStatic - fun ofPublicEnumerationProperty( - publicEnumerationProperty: PublicEnumerationPropertyOperation - ) = Operation(publicEnumerationProperty = publicEnumerationProperty) + fun ofEnumeration(enumeration: PublicEnumerationPropertyOperation) = + Operation(enumeration = enumeration) @JvmStatic - fun ofPublicAllPropertyTypes(publicAllPropertyTypes: PublicAllPropertyTypesOperation) = - Operation(publicAllPropertyTypes = publicAllPropertyTypes) + fun ofAllProperty(allProperty: PublicAllPropertyTypesOperation) = + Operation(allProperty = allProperty) @JvmStatic - fun ofPublicRangedNumberProperty( - publicRangedNumberProperty: PublicRangedNumberPropertyOperation - ) = Operation(publicRangedNumberProperty = publicRangedNumberProperty) + fun ofNumberRanged(numberRanged: PublicRangedNumberPropertyOperation) = + Operation(numberRanged = numberRanged) @JvmStatic - fun ofPublicMultiStringProperty( - publicMultiStringProperty: PublicMultiStringPropertyOperation - ) = Operation(publicMultiStringProperty = publicMultiStringProperty) + fun ofMultistring(multistring: PublicMultiStringPropertyOperation) = + Operation(multistring = multistring) - @JvmStatic - fun ofPublicDateProperty(publicDateProperty: PublicDatePropertyOperation) = - Operation(publicDateProperty = publicDateProperty) + @JvmStatic fun ofDate(date: PublicDatePropertyOperation) = Operation(date = date) @JvmStatic - fun ofPublicCalendarDateProperty( - publicCalendarDateProperty: PublicCalendarDatePropertyOperation - ) = Operation(publicCalendarDateProperty = publicCalendarDateProperty) + fun ofCalendarDate(calendarDate: PublicCalendarDatePropertyOperation) = + Operation(calendarDate = calendarDate) @JvmStatic - fun ofPublicTimePoint(publicTimePoint: PublicTimePointOperation) = - Operation(publicTimePoint = publicTimePoint) + fun ofTimePoint(timePoint: PublicTimePointOperation) = Operation(timePoint = timePoint) @JvmStatic - fun ofPublicRangedTime(publicRangedTime: PublicRangedTimeOperation) = - Operation(publicRangedTime = publicRangedTime) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + Operation(timeRanged = timeRanged) } /** @@ -935,61 +805,43 @@ private constructor( */ interface Visitor { - fun visitPublicBoolProperty(publicBoolProperty: PublicBoolPropertyOperation): T + fun visitBool(bool: PublicBoolPropertyOperation): T - fun visitPublicNumberProperty(publicNumberProperty: PublicNumberPropertyOperation): T + fun visitNumber(number: PublicNumberPropertyOperation): T - fun visitPublicStringProperty(publicStringProperty: PublicStringPropertyOperation): T + fun visitString(string: PublicStringPropertyOperation): T - fun visitPublicDateTimeProperty( - publicDateTimeProperty: PublicDateTimePropertyOperation - ): T + fun visitDatetime(datetime: PublicDateTimePropertyOperation): T - fun visitPublicRangedDateProperty( - publicRangedDateProperty: PublicRangedDatePropertyOperation - ): T + fun visitRangedDate(rangedDate: PublicRangedDatePropertyOperation): T - fun visitPublicComparativePropertyUpdated( - publicComparativePropertyUpdated: PublicComparativePropertyUpdatedOperation + fun visitComparativePropertyUpdated( + comparativePropertyUpdated: PublicComparativePropertyUpdatedOperation ): T - fun visitPublicComparativeDateProperty( - publicComparativeDateProperty: PublicComparativeDatePropertyOperation - ): T + fun visitComparativeDate(comparativeDate: PublicComparativeDatePropertyOperation): T - fun visitPublicRollingDateRangeProperty( - publicRollingDateRangeProperty: PublicRollingDateRangePropertyOperation - ): T + fun visitRollingDateRange(rollingDateRange: PublicRollingDateRangePropertyOperation): T - fun visitPublicRollingPropertyUpdated( - publicRollingPropertyUpdated: PublicRollingPropertyUpdatedOperation + fun visitRollingPropertyUpdated( + rollingPropertyUpdated: PublicRollingPropertyUpdatedOperation ): T - fun visitPublicEnumerationProperty( - publicEnumerationProperty: PublicEnumerationPropertyOperation - ): T + fun visitEnumeration(enumeration: PublicEnumerationPropertyOperation): T - fun visitPublicAllPropertyTypes( - publicAllPropertyTypes: PublicAllPropertyTypesOperation - ): T + fun visitAllProperty(allProperty: PublicAllPropertyTypesOperation): T - fun visitPublicRangedNumberProperty( - publicRangedNumberProperty: PublicRangedNumberPropertyOperation - ): T + fun visitNumberRanged(numberRanged: PublicRangedNumberPropertyOperation): T - fun visitPublicMultiStringProperty( - publicMultiStringProperty: PublicMultiStringPropertyOperation - ): T + fun visitMultistring(multistring: PublicMultiStringPropertyOperation): T - fun visitPublicDateProperty(publicDateProperty: PublicDatePropertyOperation): T + fun visitDate(date: PublicDatePropertyOperation): T - fun visitPublicCalendarDateProperty( - publicCalendarDateProperty: PublicCalendarDatePropertyOperation - ): T + fun visitCalendarDate(calendarDate: PublicCalendarDatePropertyOperation): T - fun visitPublicTimePoint(publicTimePoint: PublicTimePointOperation): T + fun visitTimePoint(timePoint: PublicTimePointOperation): T - fun visitPublicRangedTime(publicRangedTime: PublicRangedTimeOperation): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [Operation] to a value of type [T]. @@ -1010,94 +862,129 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Operation { val json = JsonValue.fromJsonNode(node) + val operationType = + json.asObject().getOrNull()?.get("operationType")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { Operation(publicBoolProperty = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Operation(publicNumberProperty = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Operation(publicStringProperty = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Operation(publicDateTimeProperty = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { Operation(publicRangedDateProperty = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - Operation(publicComparativePropertyUpdated = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - Operation(publicComparativeDateProperty = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - Operation(publicRollingDateRangeProperty = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - Operation(publicRollingPropertyUpdated = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { Operation(publicEnumerationProperty = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Operation(publicAllPropertyTypes = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { Operation(publicRangedNumberProperty = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { Operation(publicMultiStringProperty = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Operation(publicDateProperty = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { Operation(publicCalendarDateProperty = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - Operation(publicTimePoint = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Operation(publicRangedTime = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> Operation(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (operationType) { + "BOOL" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Operation(bool = it, _json = json) } ?: Operation(_json = json) + } + "NUMBER" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Operation(number = it, _json = json) } + ?: Operation(_json = json) + } + "STRING" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Operation(string = it, _json = json) } + ?: Operation(_json = json) + } + "DATETIME" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(datetime = it, _json = json) } + ?: Operation(_json = json) + } + "RANGED_DATE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(rangedDate = it, _json = json) } + ?: Operation(_json = json) + } + "COMPARATIVE_PROPERTY_UPDATED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(comparativePropertyUpdated = it, _json = json) } + ?: Operation(_json = json) + } + "COMPARATIVE_DATE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(comparativeDate = it, _json = json) } + ?: Operation(_json = json) + } + "ROLLING_DATE_RANGE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(rollingDateRange = it, _json = json) } + ?: Operation(_json = json) + } + "ROLLING_PROPERTY_UPDATED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(rollingPropertyUpdated = it, _json = json) } + ?: Operation(_json = json) + } + "ENUMERATION" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(enumeration = it, _json = json) } + ?: Operation(_json = json) + } + "ALL_PROPERTY" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(allProperty = it, _json = json) } + ?: Operation(_json = json) + } + "NUMBER_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(numberRanged = it, _json = json) } + ?: Operation(_json = json) + } + "MULTISTRING" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(multistring = it, _json = json) } + ?: Operation(_json = json) + } + "DATE" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Operation(date = it, _json = json) } ?: Operation(_json = json) + } + "CALENDAR_DATE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(calendarDate = it, _json = json) } + ?: Operation(_json = json) + } + "TIME_POINT" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Operation(timePoint = it, _json = json) } + ?: Operation(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Operation(timeRanged = it, _json = json) } + ?: Operation(_json = json) + } } + + return Operation(_json = json) } } @@ -1109,38 +996,25 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicBoolProperty != null -> - generator.writeObject(value.publicBoolProperty) - value.publicNumberProperty != null -> - generator.writeObject(value.publicNumberProperty) - value.publicStringProperty != null -> - generator.writeObject(value.publicStringProperty) - value.publicDateTimeProperty != null -> - generator.writeObject(value.publicDateTimeProperty) - value.publicRangedDateProperty != null -> - generator.writeObject(value.publicRangedDateProperty) - value.publicComparativePropertyUpdated != null -> - generator.writeObject(value.publicComparativePropertyUpdated) - value.publicComparativeDateProperty != null -> - generator.writeObject(value.publicComparativeDateProperty) - value.publicRollingDateRangeProperty != null -> - generator.writeObject(value.publicRollingDateRangeProperty) - value.publicRollingPropertyUpdated != null -> - generator.writeObject(value.publicRollingPropertyUpdated) - value.publicEnumerationProperty != null -> - generator.writeObject(value.publicEnumerationProperty) - value.publicAllPropertyTypes != null -> - generator.writeObject(value.publicAllPropertyTypes) - value.publicRangedNumberProperty != null -> - generator.writeObject(value.publicRangedNumberProperty) - value.publicMultiStringProperty != null -> - generator.writeObject(value.publicMultiStringProperty) - value.publicDateProperty != null -> - generator.writeObject(value.publicDateProperty) - value.publicCalendarDateProperty != null -> - generator.writeObject(value.publicCalendarDateProperty) - value.publicTimePoint != null -> generator.writeObject(value.publicTimePoint) - value.publicRangedTime != null -> generator.writeObject(value.publicRangedTime) + value.bool != null -> generator.writeObject(value.bool) + value.number != null -> generator.writeObject(value.number) + value.string != null -> generator.writeObject(value.string) + value.datetime != null -> generator.writeObject(value.datetime) + value.rangedDate != null -> generator.writeObject(value.rangedDate) + value.comparativePropertyUpdated != null -> + generator.writeObject(value.comparativePropertyUpdated) + value.comparativeDate != null -> generator.writeObject(value.comparativeDate) + value.rollingDateRange != null -> generator.writeObject(value.rollingDateRange) + value.rollingPropertyUpdated != null -> + generator.writeObject(value.rollingPropertyUpdated) + value.enumeration != null -> generator.writeObject(value.enumeration) + value.allProperty != null -> generator.writeObject(value.allProperty) + value.numberRanged != null -> generator.writeObject(value.numberRanged) + value.multistring != null -> generator.writeObject(value.multistring) + value.date != null -> generator.writeObject(value.date) + value.calendarDate != null -> generator.writeObject(value.calendarDate) + value.timePoint != null -> generator.writeObject(value.timePoint) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Operation") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicFormSubmissionFilter.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicFormSubmissionFilter.kt index d44acb59..da6487d2 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicFormSubmissionFilter.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicFormSubmissionFilter.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -226,72 +225,69 @@ private constructor( /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `CoalescingRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun coalescingRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun coalescingRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `CoalescingRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun coalescingRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun coalescingRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [coalescingRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun coalescingRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesCoalescingRefineBy(setType: String) = coalescingRefineBy( - CoalescingRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `CoalescingRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun coalescingRefineBy( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun coalescingRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `CoalescingRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun coalescingRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun coalescingRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `CoalescingRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun coalescingRefineBy( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun coalescingRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `CoalescingRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun coalescingRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicAllHistory(publicAllHistory)) + fun coalescingRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** + * Alias for calling [coalescingRefineBy] with + * `CoalescingRefineBy.ofAllHistory(allHistory)`. + */ + fun coalescingRefineBy(allHistory: PublicAllHistoryRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [coalescingRefineBy] with @@ -304,12 +300,10 @@ private constructor( /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. + * `CoalescingRefineBy.ofTimeRanged(timeRanged)`. */ - fun coalescingRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation) - ) + fun coalescingRefineBy(timeRanged: PublicRangedTimeOperation) = + coalescingRefineBy(CoalescingRefineBy.ofTimeRanged(timeRanged)) /** The ID of the form used in the filter. */ fun formId(formId: String) = formId(JsonField.of(formId)) @@ -339,68 +333,66 @@ private constructor( /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `PruningRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun pruningRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun pruningRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `PruningRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun pruningRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun pruningRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [pruningRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun pruningRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesPruningRefineBy(setType: String) = pruningRefineBy( - PruningRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `PruningRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun pruningRefineBy(publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun pruningRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `PruningRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun pruningRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun pruningRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `PruningRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun pruningRefineBy(publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun pruningRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `PruningRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun pruningRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicAllHistory(publicAllHistory)) + fun pruningRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofAllHistory(allHistory)`. */ + fun pruningRefineBy(allHistory: PublicAllHistoryRefineBy) = + pruningRefineBy(PruningRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [pruningRefineBy] with @@ -409,12 +401,9 @@ private constructor( fun pruningRefineBy(publicTimePointOperation: PublicTimePointOperation) = pruningRefineBy(PruningRefineBy.ofPublicTimePointOperation(publicTimePointOperation)) - /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. - */ - fun pruningRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - pruningRefineBy(PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)) + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofTimeRanged(timeRanged)`. */ + fun pruningRefineBy(timeRanged: PublicRangedTimeOperation) = + pruningRefineBy(PruningRefineBy.ofTimeRanged(timeRanged)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -774,97 +763,85 @@ private constructor( @JsonSerialize(using = CoalescingRefineBy.Serializer::class) class CoalescingRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -880,8 +857,8 @@ private constructor( * * Optional result = coalescingRefineBy.accept(new CoalescingRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -899,27 +876,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -941,46 +907,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -989,10 +949,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -1017,42 +975,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -1064,49 +1017,44 @@ private constructor( } return other is CoalescingRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "CoalescingRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "CoalescingRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "CoalescingRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "CoalescingRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "CoalescingRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "CoalescingRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "CoalescingRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "CoalescingRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "CoalescingRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "CoalescingRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "CoalescingRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "CoalescingRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "CoalescingRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "CoalescingRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "CoalescingRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "CoalescingRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "CoalescingRefineBy{timeRanged=$timeRanged}" _json != null -> "CoalescingRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid CoalescingRefineBy") } @@ -1114,50 +1062,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - CoalescingRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + CoalescingRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - CoalescingRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + CoalescingRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - CoalescingRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = CoalescingRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = CoalescingRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + CoalescingRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - CoalescingRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = CoalescingRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = CoalescingRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + CoalescingRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - CoalescingRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + CoalescingRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = CoalescingRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - CoalescingRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + CoalescingRefineBy(timeRanged = timeRanged) } /** @@ -1166,33 +1106,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [CoalescingRefineBy] to a value of type [T]. @@ -1214,80 +1148,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): CoalescingRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { - CoalescingRefineBy(publicNumOccurrences = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - CoalescingRefineBy(publicSetOccurrences = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> CoalescingRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(numOccurrences = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(setOccurrences = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(relativeComparative = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(relativeRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(absoluteComparative = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(absoluteRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(allHistory = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(timeRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + CoalescingRefineBy(publicTimePointOperation = it, _json = json) + } ?: CoalescingRefineBy(_json = json) } } @@ -1299,23 +1219,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid CoalescingRefineBy") } @@ -1328,97 +1243,85 @@ private constructor( @JsonSerialize(using = PruningRefineBy.Serializer::class) class PruningRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -1434,8 +1337,8 @@ private constructor( * * Optional result = pruningRefineBy.accept(new PruningRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -1453,27 +1356,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -1495,46 +1387,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -1543,10 +1429,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -1571,42 +1455,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -1618,49 +1497,44 @@ private constructor( } return other is PruningRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "PruningRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "PruningRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "PruningRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "PruningRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "PruningRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "PruningRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "PruningRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "PruningRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "PruningRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "PruningRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "PruningRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "PruningRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "PruningRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "PruningRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "PruningRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "PruningRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "PruningRefineBy{timeRanged=$timeRanged}" _json != null -> "PruningRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid PruningRefineBy") } @@ -1668,50 +1542,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - PruningRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + PruningRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - PruningRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + PruningRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = PruningRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = PruningRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + PruningRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = PruningRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = PruningRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + PruningRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - PruningRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + PruningRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = PruningRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - PruningRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + PruningRefineBy(timeRanged = timeRanged) } /** @@ -1720,33 +1586,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [PruningRefineBy] to a value of type [T]. @@ -1767,76 +1627,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): PruningRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicNumOccurrences = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicSetOccurrences = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> PruningRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(numOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(setOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(allHistory = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(timeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + PruningRefineBy(publicTimePointOperation = it, _json = json) + } ?: PruningRefineBy(_json = json) } } @@ -1848,23 +1698,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid PruningRefineBy") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicFormSubmissionOnPageFilter.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicFormSubmissionOnPageFilter.kt index 6879a976..c7a21182 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicFormSubmissionOnPageFilter.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicFormSubmissionOnPageFilter.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -268,72 +267,69 @@ private constructor( /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `CoalescingRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun coalescingRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun coalescingRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `CoalescingRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun coalescingRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun coalescingRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [coalescingRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun coalescingRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesCoalescingRefineBy(setType: String) = coalescingRefineBy( - CoalescingRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `CoalescingRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun coalescingRefineBy( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun coalescingRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `CoalescingRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun coalescingRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun coalescingRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `CoalescingRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun coalescingRefineBy( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun coalescingRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `CoalescingRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun coalescingRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicAllHistory(publicAllHistory)) + fun coalescingRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** + * Alias for calling [coalescingRefineBy] with + * `CoalescingRefineBy.ofAllHistory(allHistory)`. + */ + fun coalescingRefineBy(allHistory: PublicAllHistoryRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [coalescingRefineBy] with @@ -346,12 +342,10 @@ private constructor( /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. + * `CoalescingRefineBy.ofTimeRanged(timeRanged)`. */ - fun coalescingRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation) - ) + fun coalescingRefineBy(timeRanged: PublicRangedTimeOperation) = + coalescingRefineBy(CoalescingRefineBy.ofTimeRanged(timeRanged)) /** The ID of the form associated with the submission filter. */ fun formId(formId: String) = formId(JsonField.of(formId)) @@ -381,68 +375,66 @@ private constructor( /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `PruningRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun pruningRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun pruningRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `PruningRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun pruningRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun pruningRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [pruningRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun pruningRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesPruningRefineBy(setType: String) = pruningRefineBy( - PruningRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `PruningRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun pruningRefineBy(publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun pruningRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `PruningRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun pruningRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun pruningRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `PruningRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun pruningRefineBy(publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun pruningRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `PruningRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun pruningRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicAllHistory(publicAllHistory)) + fun pruningRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofAllHistory(allHistory)`. */ + fun pruningRefineBy(allHistory: PublicAllHistoryRefineBy) = + pruningRefineBy(PruningRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [pruningRefineBy] with @@ -451,12 +443,9 @@ private constructor( fun pruningRefineBy(publicTimePointOperation: PublicTimePointOperation) = pruningRefineBy(PruningRefineBy.ofPublicTimePointOperation(publicTimePointOperation)) - /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. - */ - fun pruningRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - pruningRefineBy(PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)) + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofTimeRanged(timeRanged)`. */ + fun pruningRefineBy(timeRanged: PublicRangedTimeOperation) = + pruningRefineBy(PruningRefineBy.ofTimeRanged(timeRanged)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -820,97 +809,85 @@ private constructor( @JsonSerialize(using = CoalescingRefineBy.Serializer::class) class CoalescingRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -926,8 +903,8 @@ private constructor( * * Optional result = coalescingRefineBy.accept(new CoalescingRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -945,27 +922,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -987,46 +953,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -1035,10 +995,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -1063,42 +1021,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -1110,49 +1063,44 @@ private constructor( } return other is CoalescingRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "CoalescingRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "CoalescingRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "CoalescingRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "CoalescingRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "CoalescingRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "CoalescingRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "CoalescingRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "CoalescingRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "CoalescingRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "CoalescingRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "CoalescingRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "CoalescingRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "CoalescingRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "CoalescingRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "CoalescingRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "CoalescingRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "CoalescingRefineBy{timeRanged=$timeRanged}" _json != null -> "CoalescingRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid CoalescingRefineBy") } @@ -1160,50 +1108,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - CoalescingRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + CoalescingRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - CoalescingRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + CoalescingRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - CoalescingRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = CoalescingRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = CoalescingRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + CoalescingRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - CoalescingRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = CoalescingRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = CoalescingRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + CoalescingRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - CoalescingRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + CoalescingRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = CoalescingRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - CoalescingRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + CoalescingRefineBy(timeRanged = timeRanged) } /** @@ -1212,33 +1152,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [CoalescingRefineBy] to a value of type [T]. @@ -1260,80 +1194,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): CoalescingRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { - CoalescingRefineBy(publicNumOccurrences = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - CoalescingRefineBy(publicSetOccurrences = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> CoalescingRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(numOccurrences = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(setOccurrences = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(relativeComparative = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(relativeRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(absoluteComparative = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(absoluteRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(allHistory = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(timeRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + CoalescingRefineBy(publicTimePointOperation = it, _json = json) + } ?: CoalescingRefineBy(_json = json) } } @@ -1345,23 +1265,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid CoalescingRefineBy") } @@ -1374,97 +1289,85 @@ private constructor( @JsonSerialize(using = PruningRefineBy.Serializer::class) class PruningRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -1480,8 +1383,8 @@ private constructor( * * Optional result = pruningRefineBy.accept(new PruningRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -1499,27 +1402,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -1541,46 +1433,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -1589,10 +1475,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -1617,42 +1501,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -1664,49 +1543,44 @@ private constructor( } return other is PruningRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "PruningRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "PruningRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "PruningRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "PruningRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "PruningRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "PruningRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "PruningRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "PruningRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "PruningRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "PruningRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "PruningRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "PruningRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "PruningRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "PruningRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "PruningRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "PruningRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "PruningRefineBy{timeRanged=$timeRanged}" _json != null -> "PruningRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid PruningRefineBy") } @@ -1714,50 +1588,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - PruningRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + PruningRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - PruningRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + PruningRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = PruningRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = PruningRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + PruningRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = PruningRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = PruningRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + PruningRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - PruningRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + PruningRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = PruningRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - PruningRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + PruningRefineBy(timeRanged = timeRanged) } /** @@ -1766,33 +1632,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [PruningRefineBy] to a value of type [T]. @@ -1813,76 +1673,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): PruningRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicNumOccurrences = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicSetOccurrences = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> PruningRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(numOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(setOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(allHistory = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(timeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + PruningRefineBy(publicTimePointOperation = it, _json = json) + } ?: PruningRefineBy(_json = json) } } @@ -1894,23 +1744,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid PruningRefineBy") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicIndexedTimePoint.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicIndexedTimePoint.kt index 8130bfde..0be286c6 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicIndexedTimePoint.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicIndexedTimePoint.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -195,45 +194,70 @@ private constructor( this.indexReference = indexReference } - /** Alias for calling [indexReference] with `IndexReference.ofPublicNow(publicNow)`. */ - fun indexReference(publicNow: PublicNowReference) = - indexReference(IndexReference.ofPublicNow(publicNow)) + /** Alias for calling [indexReference] with `IndexReference.ofNow(now)`. */ + fun indexReference(now: PublicNowReference) = indexReference(IndexReference.ofNow(now)) - /** Alias for calling [indexReference] with `IndexReference.ofPublicToday(publicToday)`. */ - fun indexReference(publicToday: PublicTodayReference) = - indexReference(IndexReference.ofPublicToday(publicToday)) + /** Alias for calling [indexReference] with `IndexReference.ofToday(today)`. */ + fun indexReference(today: PublicTodayReference) = + indexReference(IndexReference.ofToday(today)) - /** Alias for calling [indexReference] with `IndexReference.ofPublicWeek(publicWeek)`. */ - fun indexReference(publicWeek: PublicWeekReference) = - indexReference(IndexReference.ofPublicWeek(publicWeek)) + /** Alias for calling [indexReference] with `IndexReference.ofWeek(week)`. */ + fun indexReference(week: PublicWeekReference) = indexReference(IndexReference.ofWeek(week)) /** - * Alias for calling [indexReference] with - * `IndexReference.ofPublicFiscalQuarter(publicFiscalQuarter)`. + * Alias for calling [indexReference] with the following: + * ```java + * PublicWeekReference.builder() + * .referenceType(PublicWeekReference.ReferenceType.WEEK) + * .dayOfWeek(dayOfWeek) + * .build() + * ``` */ - fun indexReference(publicFiscalQuarter: PublicFiscalQuarterReference) = - indexReference(IndexReference.ofPublicFiscalQuarter(publicFiscalQuarter)) + fun weekIndexReference(dayOfWeek: PublicWeekReference.DayOfWeek) = + indexReference( + PublicWeekReference.builder() + .referenceType(PublicWeekReference.ReferenceType.WEEK) + .dayOfWeek(dayOfWeek) + .build() + ) /** - * Alias for calling [indexReference] with - * `IndexReference.ofPublicFiscalYear(publicFiscalYear)`. + * Alias for calling [indexReference] with `IndexReference.ofFiscalQuarter(fiscalQuarter)`. */ - fun indexReference(publicFiscalYear: PublicFiscalYearReference) = - indexReference(IndexReference.ofPublicFiscalYear(publicFiscalYear)) + fun indexReference(fiscalQuarter: PublicFiscalQuarterReference) = + indexReference(IndexReference.ofFiscalQuarter(fiscalQuarter)) + + /** Alias for calling [indexReference] with `IndexReference.ofFiscalYear(fiscalYear)`. */ + fun indexReference(fiscalYear: PublicFiscalYearReference) = + indexReference(IndexReference.ofFiscalYear(fiscalYear)) - /** Alias for calling [indexReference] with `IndexReference.ofPublicYear(publicYear)`. */ - fun indexReference(publicYear: PublicYearReference) = - indexReference(IndexReference.ofPublicYear(publicYear)) + /** Alias for calling [indexReference] with `IndexReference.ofYear(year)`. */ + fun indexReference(year: PublicYearReference) = indexReference(IndexReference.ofYear(year)) + + /** Alias for calling [indexReference] with `IndexReference.ofQuarter(quarter)`. */ + fun indexReference(quarter: PublicQuarterReference) = + indexReference(IndexReference.ofQuarter(quarter)) + + /** Alias for calling [indexReference] with `IndexReference.ofMonth(month)`. */ + fun indexReference(month: PublicMonthReference) = + indexReference(IndexReference.ofMonth(month)) /** - * Alias for calling [indexReference] with `IndexReference.ofPublicQuarter(publicQuarter)`. + * Alias for calling [indexReference] with the following: + * ```java + * PublicMonthReference.builder() + * .referenceType(PublicMonthReference.ReferenceType.MONTH) + * .day(day) + * .build() + * ``` */ - fun indexReference(publicQuarter: PublicQuarterReference) = - indexReference(IndexReference.ofPublicQuarter(publicQuarter)) - - /** Alias for calling [indexReference] with `IndexReference.ofPublicMonth(publicMonth)`. */ - fun indexReference(publicMonth: PublicMonthReference) = - indexReference(IndexReference.ofPublicMonth(publicMonth)) + fun monthIndexReference(day: Int) = + indexReference( + PublicMonthReference.builder() + .referenceType(PublicMonthReference.ReferenceType.MONTH) + .day(day) + .build() + ) /** Defines the type of time (INDEXED). */ fun timeType(timeType: TimeType) = timeType(JsonField.of(timeType)) @@ -379,68 +403,66 @@ private constructor( @JsonSerialize(using = IndexReference.Serializer::class) class IndexReference private constructor( - private val publicNow: PublicNowReference? = null, - private val publicToday: PublicTodayReference? = null, - private val publicWeek: PublicWeekReference? = null, - private val publicFiscalQuarter: PublicFiscalQuarterReference? = null, - private val publicFiscalYear: PublicFiscalYearReference? = null, - private val publicYear: PublicYearReference? = null, - private val publicQuarter: PublicQuarterReference? = null, - private val publicMonth: PublicMonthReference? = null, + private val now: PublicNowReference? = null, + private val today: PublicTodayReference? = null, + private val week: PublicWeekReference? = null, + private val fiscalQuarter: PublicFiscalQuarterReference? = null, + private val fiscalYear: PublicFiscalYearReference? = null, + private val year: PublicYearReference? = null, + private val quarter: PublicQuarterReference? = null, + private val month: PublicMonthReference? = null, private val _json: JsonValue? = null, ) { - fun publicNow(): Optional = Optional.ofNullable(publicNow) + fun now(): Optional = Optional.ofNullable(now) - fun publicToday(): Optional = Optional.ofNullable(publicToday) + fun today(): Optional = Optional.ofNullable(today) - fun publicWeek(): Optional = Optional.ofNullable(publicWeek) + fun week(): Optional = Optional.ofNullable(week) - fun publicFiscalQuarter(): Optional = - Optional.ofNullable(publicFiscalQuarter) + fun fiscalQuarter(): Optional = + Optional.ofNullable(fiscalQuarter) - fun publicFiscalYear(): Optional = - Optional.ofNullable(publicFiscalYear) + fun fiscalYear(): Optional = Optional.ofNullable(fiscalYear) - fun publicYear(): Optional = Optional.ofNullable(publicYear) + fun year(): Optional = Optional.ofNullable(year) - fun publicQuarter(): Optional = Optional.ofNullable(publicQuarter) + fun quarter(): Optional = Optional.ofNullable(quarter) - fun publicMonth(): Optional = Optional.ofNullable(publicMonth) + fun month(): Optional = Optional.ofNullable(month) - fun isPublicNow(): Boolean = publicNow != null + fun isNow(): Boolean = now != null - fun isPublicToday(): Boolean = publicToday != null + fun isToday(): Boolean = today != null - fun isPublicWeek(): Boolean = publicWeek != null + fun isWeek(): Boolean = week != null - fun isPublicFiscalQuarter(): Boolean = publicFiscalQuarter != null + fun isFiscalQuarter(): Boolean = fiscalQuarter != null - fun isPublicFiscalYear(): Boolean = publicFiscalYear != null + fun isFiscalYear(): Boolean = fiscalYear != null - fun isPublicYear(): Boolean = publicYear != null + fun isYear(): Boolean = year != null - fun isPublicQuarter(): Boolean = publicQuarter != null + fun isQuarter(): Boolean = quarter != null - fun isPublicMonth(): Boolean = publicMonth != null + fun isMonth(): Boolean = month != null - fun asPublicNow(): PublicNowReference = publicNow.getOrThrow("publicNow") + fun asNow(): PublicNowReference = now.getOrThrow("now") - fun asPublicToday(): PublicTodayReference = publicToday.getOrThrow("publicToday") + fun asToday(): PublicTodayReference = today.getOrThrow("today") - fun asPublicWeek(): PublicWeekReference = publicWeek.getOrThrow("publicWeek") + fun asWeek(): PublicWeekReference = week.getOrThrow("week") - fun asPublicFiscalQuarter(): PublicFiscalQuarterReference = - publicFiscalQuarter.getOrThrow("publicFiscalQuarter") + fun asFiscalQuarter(): PublicFiscalQuarterReference = + fiscalQuarter.getOrThrow("fiscalQuarter") - fun asPublicFiscalYear(): PublicFiscalYearReference = - publicFiscalYear.getOrThrow("publicFiscalYear") + fun asFiscalYear(): PublicFiscalYearReference = fiscalYear.getOrThrow("fiscalYear") - fun asPublicYear(): PublicYearReference = publicYear.getOrThrow("publicYear") + fun asYear(): PublicYearReference = year.getOrThrow("year") - fun asPublicQuarter(): PublicQuarterReference = publicQuarter.getOrThrow("publicQuarter") + fun asQuarter(): PublicQuarterReference = quarter.getOrThrow("quarter") - fun asPublicMonth(): PublicMonthReference = publicMonth.getOrThrow("publicMonth") + fun asMonth(): PublicMonthReference = month.getOrThrow("month") fun _json(): Optional = Optional.ofNullable(_json) @@ -456,8 +478,8 @@ private constructor( * * Optional result = indexReference.accept(new IndexReference.Visitor>() { * @Override - * public Optional visitPublicNow(PublicNowReference publicNow) { - * return Optional.of(publicNow.toString()); + * public Optional visitNow(PublicNowReference now) { + * return Optional.of(now.toString()); * } * * // ... @@ -475,14 +497,14 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNow != null -> visitor.visitPublicNow(publicNow) - publicToday != null -> visitor.visitPublicToday(publicToday) - publicWeek != null -> visitor.visitPublicWeek(publicWeek) - publicFiscalQuarter != null -> visitor.visitPublicFiscalQuarter(publicFiscalQuarter) - publicFiscalYear != null -> visitor.visitPublicFiscalYear(publicFiscalYear) - publicYear != null -> visitor.visitPublicYear(publicYear) - publicQuarter != null -> visitor.visitPublicQuarter(publicQuarter) - publicMonth != null -> visitor.visitPublicMonth(publicMonth) + now != null -> visitor.visitNow(now) + today != null -> visitor.visitToday(today) + week != null -> visitor.visitWeek(week) + fiscalQuarter != null -> visitor.visitFiscalQuarter(fiscalQuarter) + fiscalYear != null -> visitor.visitFiscalYear(fiscalYear) + year != null -> visitor.visitYear(year) + quarter != null -> visitor.visitQuarter(quarter) + month != null -> visitor.visitMonth(month) else -> visitor.unknown(_json) } @@ -504,40 +526,36 @@ private constructor( accept( object : Visitor { - override fun visitPublicNow(publicNow: PublicNowReference) { - publicNow.validate() + override fun visitNow(now: PublicNowReference) { + now.validate() } - override fun visitPublicToday(publicToday: PublicTodayReference) { - publicToday.validate() + override fun visitToday(today: PublicTodayReference) { + today.validate() } - override fun visitPublicWeek(publicWeek: PublicWeekReference) { - publicWeek.validate() + override fun visitWeek(week: PublicWeekReference) { + week.validate() } - override fun visitPublicFiscalQuarter( - publicFiscalQuarter: PublicFiscalQuarterReference - ) { - publicFiscalQuarter.validate() + override fun visitFiscalQuarter(fiscalQuarter: PublicFiscalQuarterReference) { + fiscalQuarter.validate() } - override fun visitPublicFiscalYear( - publicFiscalYear: PublicFiscalYearReference - ) { - publicFiscalYear.validate() + override fun visitFiscalYear(fiscalYear: PublicFiscalYearReference) { + fiscalYear.validate() } - override fun visitPublicYear(publicYear: PublicYearReference) { - publicYear.validate() + override fun visitYear(year: PublicYearReference) { + year.validate() } - override fun visitPublicQuarter(publicQuarter: PublicQuarterReference) { - publicQuarter.validate() + override fun visitQuarter(quarter: PublicQuarterReference) { + quarter.validate() } - override fun visitPublicMonth(publicMonth: PublicMonthReference) { - publicMonth.validate() + override fun visitMonth(month: PublicMonthReference) { + month.validate() } } ) @@ -562,31 +580,23 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNow(publicNow: PublicNowReference) = - publicNow.validity() + override fun visitNow(now: PublicNowReference) = now.validity() - override fun visitPublicToday(publicToday: PublicTodayReference) = - publicToday.validity() + override fun visitToday(today: PublicTodayReference) = today.validity() - override fun visitPublicWeek(publicWeek: PublicWeekReference) = - publicWeek.validity() + override fun visitWeek(week: PublicWeekReference) = week.validity() - override fun visitPublicFiscalQuarter( - publicFiscalQuarter: PublicFiscalQuarterReference - ) = publicFiscalQuarter.validity() + override fun visitFiscalQuarter(fiscalQuarter: PublicFiscalQuarterReference) = + fiscalQuarter.validity() - override fun visitPublicFiscalYear( - publicFiscalYear: PublicFiscalYearReference - ) = publicFiscalYear.validity() + override fun visitFiscalYear(fiscalYear: PublicFiscalYearReference) = + fiscalYear.validity() - override fun visitPublicYear(publicYear: PublicYearReference) = - publicYear.validity() + override fun visitYear(year: PublicYearReference) = year.validity() - override fun visitPublicQuarter(publicQuarter: PublicQuarterReference) = - publicQuarter.validity() + override fun visitQuarter(quarter: PublicQuarterReference) = quarter.validity() - override fun visitPublicMonth(publicMonth: PublicMonthReference) = - publicMonth.validity() + override fun visitMonth(month: PublicMonthReference) = month.validity() override fun unknown(json: JsonValue?) = 0 } @@ -598,75 +608,55 @@ private constructor( } return other is IndexReference && - publicNow == other.publicNow && - publicToday == other.publicToday && - publicWeek == other.publicWeek && - publicFiscalQuarter == other.publicFiscalQuarter && - publicFiscalYear == other.publicFiscalYear && - publicYear == other.publicYear && - publicQuarter == other.publicQuarter && - publicMonth == other.publicMonth + now == other.now && + today == other.today && + week == other.week && + fiscalQuarter == other.fiscalQuarter && + fiscalYear == other.fiscalYear && + year == other.year && + quarter == other.quarter && + month == other.month } override fun hashCode(): Int = - Objects.hash( - publicNow, - publicToday, - publicWeek, - publicFiscalQuarter, - publicFiscalYear, - publicYear, - publicQuarter, - publicMonth, - ) + Objects.hash(now, today, week, fiscalQuarter, fiscalYear, year, quarter, month) override fun toString(): String = when { - publicNow != null -> "IndexReference{publicNow=$publicNow}" - publicToday != null -> "IndexReference{publicToday=$publicToday}" - publicWeek != null -> "IndexReference{publicWeek=$publicWeek}" - publicFiscalQuarter != null -> - "IndexReference{publicFiscalQuarter=$publicFiscalQuarter}" - publicFiscalYear != null -> "IndexReference{publicFiscalYear=$publicFiscalYear}" - publicYear != null -> "IndexReference{publicYear=$publicYear}" - publicQuarter != null -> "IndexReference{publicQuarter=$publicQuarter}" - publicMonth != null -> "IndexReference{publicMonth=$publicMonth}" + now != null -> "IndexReference{now=$now}" + today != null -> "IndexReference{today=$today}" + week != null -> "IndexReference{week=$week}" + fiscalQuarter != null -> "IndexReference{fiscalQuarter=$fiscalQuarter}" + fiscalYear != null -> "IndexReference{fiscalYear=$fiscalYear}" + year != null -> "IndexReference{year=$year}" + quarter != null -> "IndexReference{quarter=$quarter}" + month != null -> "IndexReference{month=$month}" _json != null -> "IndexReference{_unknown=$_json}" else -> throw IllegalStateException("Invalid IndexReference") } companion object { - @JvmStatic - fun ofPublicNow(publicNow: PublicNowReference) = IndexReference(publicNow = publicNow) + @JvmStatic fun ofNow(now: PublicNowReference) = IndexReference(now = now) - @JvmStatic - fun ofPublicToday(publicToday: PublicTodayReference) = - IndexReference(publicToday = publicToday) + @JvmStatic fun ofToday(today: PublicTodayReference) = IndexReference(today = today) - @JvmStatic - fun ofPublicWeek(publicWeek: PublicWeekReference) = - IndexReference(publicWeek = publicWeek) + @JvmStatic fun ofWeek(week: PublicWeekReference) = IndexReference(week = week) @JvmStatic - fun ofPublicFiscalQuarter(publicFiscalQuarter: PublicFiscalQuarterReference) = - IndexReference(publicFiscalQuarter = publicFiscalQuarter) + fun ofFiscalQuarter(fiscalQuarter: PublicFiscalQuarterReference) = + IndexReference(fiscalQuarter = fiscalQuarter) @JvmStatic - fun ofPublicFiscalYear(publicFiscalYear: PublicFiscalYearReference) = - IndexReference(publicFiscalYear = publicFiscalYear) + fun ofFiscalYear(fiscalYear: PublicFiscalYearReference) = + IndexReference(fiscalYear = fiscalYear) - @JvmStatic - fun ofPublicYear(publicYear: PublicYearReference) = - IndexReference(publicYear = publicYear) + @JvmStatic fun ofYear(year: PublicYearReference) = IndexReference(year = year) @JvmStatic - fun ofPublicQuarter(publicQuarter: PublicQuarterReference) = - IndexReference(publicQuarter = publicQuarter) + fun ofQuarter(quarter: PublicQuarterReference) = IndexReference(quarter = quarter) - @JvmStatic - fun ofPublicMonth(publicMonth: PublicMonthReference) = - IndexReference(publicMonth = publicMonth) + @JvmStatic fun ofMonth(month: PublicMonthReference) = IndexReference(month = month) } /** @@ -675,21 +665,21 @@ private constructor( */ interface Visitor { - fun visitPublicNow(publicNow: PublicNowReference): T + fun visitNow(now: PublicNowReference): T - fun visitPublicToday(publicToday: PublicTodayReference): T + fun visitToday(today: PublicTodayReference): T - fun visitPublicWeek(publicWeek: PublicWeekReference): T + fun visitWeek(week: PublicWeekReference): T - fun visitPublicFiscalQuarter(publicFiscalQuarter: PublicFiscalQuarterReference): T + fun visitFiscalQuarter(fiscalQuarter: PublicFiscalQuarterReference): T - fun visitPublicFiscalYear(publicFiscalYear: PublicFiscalYearReference): T + fun visitFiscalYear(fiscalYear: PublicFiscalYearReference): T - fun visitPublicYear(publicYear: PublicYearReference): T + fun visitYear(year: PublicYearReference): T - fun visitPublicQuarter(publicQuarter: PublicQuarterReference): T + fun visitQuarter(quarter: PublicQuarterReference): T - fun visitPublicMonth(publicMonth: PublicMonthReference): T + fun visitMonth(month: PublicMonthReference): T /** * Maps an unknown variant of [IndexReference] to a value of type [T]. @@ -710,46 +700,53 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): IndexReference { val json = JsonValue.fromJsonNode(node) - - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - IndexReference(publicNow = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - IndexReference(publicToday = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - IndexReference(publicWeek = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { IndexReference(publicFiscalQuarter = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - IndexReference(publicFiscalYear = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - IndexReference(publicYear = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - IndexReference(publicQuarter = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - IndexReference(publicMonth = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> IndexReference(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + val referenceType = + json.asObject().getOrNull()?.get("referenceType")?.asString()?.getOrNull() + + when (referenceType) { + "NOW" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + IndexReference(now = it, _json = json) + } ?: IndexReference(_json = json) + } + "TODAY" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + IndexReference(today = it, _json = json) + } ?: IndexReference(_json = json) + } + "WEEK" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + IndexReference(week = it, _json = json) + } ?: IndexReference(_json = json) + } + "FISCAL_QUARTER" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { IndexReference(fiscalQuarter = it, _json = json) } + ?: IndexReference(_json = json) + } + "FISCAL_YEAR" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { IndexReference(fiscalYear = it, _json = json) } + ?: IndexReference(_json = json) + } + "YEAR" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + IndexReference(year = it, _json = json) + } ?: IndexReference(_json = json) + } + "QUARTER" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + IndexReference(quarter = it, _json = json) + } ?: IndexReference(_json = json) + } + "MONTH" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + IndexReference(month = it, _json = json) + } ?: IndexReference(_json = json) + } } + + return IndexReference(_json = json) } } @@ -761,15 +758,14 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNow != null -> generator.writeObject(value.publicNow) - value.publicToday != null -> generator.writeObject(value.publicToday) - value.publicWeek != null -> generator.writeObject(value.publicWeek) - value.publicFiscalQuarter != null -> - generator.writeObject(value.publicFiscalQuarter) - value.publicFiscalYear != null -> generator.writeObject(value.publicFiscalYear) - value.publicYear != null -> generator.writeObject(value.publicYear) - value.publicQuarter != null -> generator.writeObject(value.publicQuarter) - value.publicMonth != null -> generator.writeObject(value.publicMonth) + value.now != null -> generator.writeObject(value.now) + value.today != null -> generator.writeObject(value.today) + value.week != null -> generator.writeObject(value.week) + value.fiscalQuarter != null -> generator.writeObject(value.fiscalQuarter) + value.fiscalYear != null -> generator.writeObject(value.fiscalYear) + value.year != null -> generator.writeObject(value.year) + value.quarter != null -> generator.writeObject(value.quarter) + value.month != null -> generator.writeObject(value.month) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid IndexReference") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicListConversionResponse.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicListConversionResponse.kt index 8a8d7402..328f7412 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicListConversionResponse.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicListConversionResponse.kt @@ -19,7 +19,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -188,25 +187,17 @@ private constructor( /** * Alias for calling [requestedConversionTime] with - * `RequestedConversionTime.ofPublicListConversionDate(publicListConversionDate)`. + * `RequestedConversionTime.ofConversionDate(conversionDate)`. */ - fun requestedConversionTime(publicListConversionDate: PublicListConversionDate) = - requestedConversionTime( - RequestedConversionTime.ofPublicListConversionDate(publicListConversionDate) - ) + fun requestedConversionTime(conversionDate: PublicListConversionDate) = + requestedConversionTime(RequestedConversionTime.ofConversionDate(conversionDate)) /** * Alias for calling [requestedConversionTime] with - * `RequestedConversionTime.ofPublicListConversionInactivity(publicListConversionInactivity)`. + * `RequestedConversionTime.ofInactivity(inactivity)`. */ - fun requestedConversionTime( - publicListConversionInactivity: PublicListConversionInactivity - ) = - requestedConversionTime( - RequestedConversionTime.ofPublicListConversionInactivity( - publicListConversionInactivity - ) - ) + fun requestedConversionTime(inactivity: PublicListConversionInactivity) = + requestedConversionTime(RequestedConversionTime.ofInactivity(inactivity)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -296,26 +287,24 @@ private constructor( @JsonSerialize(using = RequestedConversionTime.Serializer::class) class RequestedConversionTime private constructor( - private val publicListConversionDate: PublicListConversionDate? = null, - private val publicListConversionInactivity: PublicListConversionInactivity? = null, + private val conversionDate: PublicListConversionDate? = null, + private val inactivity: PublicListConversionInactivity? = null, private val _json: JsonValue? = null, ) { - fun publicListConversionDate(): Optional = - Optional.ofNullable(publicListConversionDate) + fun conversionDate(): Optional = + Optional.ofNullable(conversionDate) - fun publicListConversionInactivity(): Optional = - Optional.ofNullable(publicListConversionInactivity) + fun inactivity(): Optional = Optional.ofNullable(inactivity) - fun isPublicListConversionDate(): Boolean = publicListConversionDate != null + fun isConversionDate(): Boolean = conversionDate != null - fun isPublicListConversionInactivity(): Boolean = publicListConversionInactivity != null + fun isInactivity(): Boolean = inactivity != null - fun asPublicListConversionDate(): PublicListConversionDate = - publicListConversionDate.getOrThrow("publicListConversionDate") + fun asConversionDate(): PublicListConversionDate = + conversionDate.getOrThrow("conversionDate") - fun asPublicListConversionInactivity(): PublicListConversionInactivity = - publicListConversionInactivity.getOrThrow("publicListConversionInactivity") + fun asInactivity(): PublicListConversionInactivity = inactivity.getOrThrow("inactivity") fun _json(): Optional = Optional.ofNullable(_json) @@ -331,8 +320,8 @@ private constructor( * * Optional result = requestedConversionTime.accept(new RequestedConversionTime.Visitor>() { * @Override - * public Optional visitPublicListConversionDate(PublicListConversionDate publicListConversionDate) { - * return Optional.of(publicListConversionDate.toString()); + * public Optional visitConversionDate(PublicListConversionDate conversionDate) { + * return Optional.of(conversionDate.toString()); * } * * // ... @@ -350,10 +339,8 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicListConversionDate != null -> - visitor.visitPublicListConversionDate(publicListConversionDate) - publicListConversionInactivity != null -> - visitor.visitPublicListConversionInactivity(publicListConversionInactivity) + conversionDate != null -> visitor.visitConversionDate(conversionDate) + inactivity != null -> visitor.visitInactivity(inactivity) else -> visitor.unknown(_json) } @@ -375,16 +362,12 @@ private constructor( accept( object : Visitor { - override fun visitPublicListConversionDate( - publicListConversionDate: PublicListConversionDate - ) { - publicListConversionDate.validate() + override fun visitConversionDate(conversionDate: PublicListConversionDate) { + conversionDate.validate() } - override fun visitPublicListConversionInactivity( - publicListConversionInactivity: PublicListConversionInactivity - ) { - publicListConversionInactivity.validate() + override fun visitInactivity(inactivity: PublicListConversionInactivity) { + inactivity.validate() } } ) @@ -409,13 +392,11 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicListConversionDate( - publicListConversionDate: PublicListConversionDate - ) = publicListConversionDate.validity() + override fun visitConversionDate(conversionDate: PublicListConversionDate) = + conversionDate.validity() - override fun visitPublicListConversionInactivity( - publicListConversionInactivity: PublicListConversionInactivity - ) = publicListConversionInactivity.validity() + override fun visitInactivity(inactivity: PublicListConversionInactivity) = + inactivity.validity() override fun unknown(json: JsonValue?) = 0 } @@ -427,19 +408,16 @@ private constructor( } return other is RequestedConversionTime && - publicListConversionDate == other.publicListConversionDate && - publicListConversionInactivity == other.publicListConversionInactivity + conversionDate == other.conversionDate && + inactivity == other.inactivity } - override fun hashCode(): Int = - Objects.hash(publicListConversionDate, publicListConversionInactivity) + override fun hashCode(): Int = Objects.hash(conversionDate, inactivity) override fun toString(): String = when { - publicListConversionDate != null -> - "RequestedConversionTime{publicListConversionDate=$publicListConversionDate}" - publicListConversionInactivity != null -> - "RequestedConversionTime{publicListConversionInactivity=$publicListConversionInactivity}" + conversionDate != null -> "RequestedConversionTime{conversionDate=$conversionDate}" + inactivity != null -> "RequestedConversionTime{inactivity=$inactivity}" _json != null -> "RequestedConversionTime{_unknown=$_json}" else -> throw IllegalStateException("Invalid RequestedConversionTime") } @@ -447,16 +425,12 @@ private constructor( companion object { @JvmStatic - fun ofPublicListConversionDate(publicListConversionDate: PublicListConversionDate) = - RequestedConversionTime(publicListConversionDate = publicListConversionDate) + fun ofConversionDate(conversionDate: PublicListConversionDate) = + RequestedConversionTime(conversionDate = conversionDate) @JvmStatic - fun ofPublicListConversionInactivity( - publicListConversionInactivity: PublicListConversionInactivity - ) = - RequestedConversionTime( - publicListConversionInactivity = publicListConversionInactivity - ) + fun ofInactivity(inactivity: PublicListConversionInactivity) = + RequestedConversionTime(inactivity = inactivity) } /** @@ -465,11 +439,9 @@ private constructor( */ interface Visitor { - fun visitPublicListConversionDate(publicListConversionDate: PublicListConversionDate): T + fun visitConversionDate(conversionDate: PublicListConversionDate): T - fun visitPublicListConversionInactivity( - publicListConversionInactivity: PublicListConversionInactivity - ): T + fun visitInactivity(inactivity: PublicListConversionInactivity): T /** * Maps an unknown variant of [RequestedConversionTime] to a value of type [T]. @@ -491,33 +463,26 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): RequestedConversionTime { val json = JsonValue.fromJsonNode(node) - - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - RequestedConversionTime(publicListConversionDate = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - RequestedConversionTime( - publicListConversionInactivity = it, - _json = json, - ) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> RequestedConversionTime(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + val conversionType = + json.asObject().getOrNull()?.get("conversionType")?.asString()?.getOrNull() + + when (conversionType) { + "CONVERSION_DATE" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { RequestedConversionTime(conversionDate = it, _json = json) } + ?: RequestedConversionTime(_json = json) + } + "INACTIVITY" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { RequestedConversionTime(inactivity = it, _json = json) } + ?: RequestedConversionTime(_json = json) + } } + + return RequestedConversionTime(_json = json) } } @@ -530,10 +495,8 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicListConversionDate != null -> - generator.writeObject(value.publicListConversionDate) - value.publicListConversionInactivity != null -> - generator.writeObject(value.publicListConversionInactivity) + value.conversionDate != null -> generator.writeObject(value.conversionDate) + value.inactivity != null -> generator.writeObject(value.inactivity) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid RequestedConversionTime") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicListConversionTime.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicListConversionTime.kt index 6b41639b..edd54960 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicListConversionTime.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicListConversionTime.kt @@ -12,30 +12,30 @@ import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import com.hubspot.sdk.core.BaseDeserializer import com.hubspot.sdk.core.BaseSerializer import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @JsonDeserialize(using = PublicListConversionTime.Deserializer::class) @JsonSerialize(using = PublicListConversionTime.Serializer::class) class PublicListConversionTime private constructor( - private val date: PublicListConversionDate? = null, + private val conversionDate: PublicListConversionDate? = null, private val inactivity: PublicListConversionInactivity? = null, private val _json: JsonValue? = null, ) { - fun date(): Optional = Optional.ofNullable(date) + fun conversionDate(): Optional = Optional.ofNullable(conversionDate) fun inactivity(): Optional = Optional.ofNullable(inactivity) - fun isDate(): Boolean = date != null + fun isConversionDate(): Boolean = conversionDate != null fun isInactivity(): Boolean = inactivity != null - fun asDate(): PublicListConversionDate = date.getOrThrow("date") + fun asConversionDate(): PublicListConversionDate = conversionDate.getOrThrow("conversionDate") fun asInactivity(): PublicListConversionInactivity = inactivity.getOrThrow("inactivity") @@ -53,8 +53,8 @@ private constructor( * * Optional result = publicListConversionTime.accept(new PublicListConversionTime.Visitor>() { * @Override - * public Optional visitDate(PublicListConversionDate date) { - * return Optional.of(date.toString()); + * public Optional visitConversionDate(PublicListConversionDate conversionDate) { + * return Optional.of(conversionDate.toString()); * } * * // ... @@ -72,7 +72,7 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - date != null -> visitor.visitDate(date) + conversionDate != null -> visitor.visitConversionDate(conversionDate) inactivity != null -> visitor.visitInactivity(inactivity) else -> visitor.unknown(_json) } @@ -94,8 +94,8 @@ private constructor( accept( object : Visitor { - override fun visitDate(date: PublicListConversionDate) { - date.validate() + override fun visitConversionDate(conversionDate: PublicListConversionDate) { + conversionDate.validate() } override fun visitInactivity(inactivity: PublicListConversionInactivity) { @@ -123,7 +123,8 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitDate(date: PublicListConversionDate) = date.validity() + override fun visitConversionDate(conversionDate: PublicListConversionDate) = + conversionDate.validity() override fun visitInactivity(inactivity: PublicListConversionInactivity) = inactivity.validity() @@ -138,15 +139,15 @@ private constructor( } return other is PublicListConversionTime && - date == other.date && + conversionDate == other.conversionDate && inactivity == other.inactivity } - override fun hashCode(): Int = Objects.hash(date, inactivity) + override fun hashCode(): Int = Objects.hash(conversionDate, inactivity) override fun toString(): String = when { - date != null -> "PublicListConversionTime{date=$date}" + conversionDate != null -> "PublicListConversionTime{conversionDate=$conversionDate}" inactivity != null -> "PublicListConversionTime{inactivity=$inactivity}" _json != null -> "PublicListConversionTime{_unknown=$_json}" else -> throw IllegalStateException("Invalid PublicListConversionTime") @@ -155,7 +156,8 @@ private constructor( companion object { @JvmStatic - fun ofDate(date: PublicListConversionDate) = PublicListConversionTime(date = date) + fun ofConversionDate(conversionDate: PublicListConversionDate) = + PublicListConversionTime(conversionDate = conversionDate) @JvmStatic fun ofInactivity(inactivity: PublicListConversionInactivity) = @@ -168,7 +170,7 @@ private constructor( */ interface Visitor { - fun visitDate(date: PublicListConversionDate): T + fun visitConversionDate(conversionDate: PublicListConversionDate): T fun visitInactivity(inactivity: PublicListConversionInactivity): T @@ -192,27 +194,23 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): PublicListConversionTime { val json = JsonValue.fromJsonNode(node) - - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - PublicListConversionTime(date = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { PublicListConversionTime(inactivity = it, _json = json) }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with all - // the possible variants (e.g. deserializing from boolean). - 0 -> PublicListConversionTime(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + val conversionType = + json.asObject().getOrNull()?.get("conversionType")?.asString()?.getOrNull() + + when (conversionType) { + "CONVERSION_DATE" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + PublicListConversionTime(conversionDate = it, _json = json) + } ?: PublicListConversionTime(_json = json) + } + "INACTIVITY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PublicListConversionTime(inactivity = it, _json = json) } + ?: PublicListConversionTime(_json = json) + } } + + return PublicListConversionTime(_json = json) } } @@ -225,7 +223,7 @@ private constructor( provider: SerializerProvider, ) { when { - value.date != null -> generator.writeObject(value.date) + value.conversionDate != null -> generator.writeObject(value.conversionDate) value.inactivity != null -> generator.writeObject(value.inactivity) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid PublicListConversionTime") diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicNotAllFilterBranch.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicNotAllFilterBranch.kt index a4c05ba8..961bc730 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicNotAllFilterBranch.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicNotAllFilterBranch.kt @@ -392,78 +392,73 @@ private constructor( /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun addAdsTimeFilter(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences) - ) + fun addAdsTimeFilter(numOccurrences: PublicNumOccurrencesRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun addAdsTimeFilter(publicSetOccurrences: PublicSetOccurrencesRefineBy) = + fun addAdsTimeFilter(setOccurrences: PublicSetOccurrencesRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofSetOccurrences(setOccurrences)) + + /** + * Alias for calling [addAdsTimeFilter] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` + */ + fun addSetOccurrencesAdsTimeFilter(setType: String) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun addAdsTimeFilter( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun addAdsTimeFilter(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicAdsTimeFilter.PruningRefineBy.ofRelativeComparative(relativeComparative) ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun addAdsTimeFilter(publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp - ) - ) + fun addAdsTimeFilter(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun addAdsTimeFilter( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = + fun addAdsTimeFilter(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) + PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteComparative(absoluteComparative) ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun addAdsTimeFilter(publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp - ) - ) + fun addAdsTimeFilter(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteRanged(absoluteRanged)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAllHistory(allHistory)`. */ - fun addAdsTimeFilter(publicAllHistory: PublicAllHistoryRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAllHistory(publicAllHistory) - ) + fun addAdsTimeFilter(allHistory: PublicAllHistoryRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [addAdsTimeFilter] with @@ -478,14 +473,10 @@ private constructor( /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofTimeRanged(timeRanged)`. */ - fun addAdsTimeFilter(publicRangedTimeOperation: PublicRangedTimeOperation) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRangedTimeOperation( - publicRangedTimeOperation - ) - ) + fun addAdsTimeFilter(timeRanged: PublicRangedTimeOperation) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofTimeRanged(timeRanged)) /** Alias for calling [addFilter] with `Filter.ofInList(inList)`. */ fun addFilter(inList: PublicInListFilter) = addFilter(Filter.ofInList(inList)) diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicNotAnyFilterBranch.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicNotAnyFilterBranch.kt index 56e3f2fc..2f41967b 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicNotAnyFilterBranch.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicNotAnyFilterBranch.kt @@ -392,78 +392,73 @@ private constructor( /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun addAdsTimeFilter(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences) - ) + fun addAdsTimeFilter(numOccurrences: PublicNumOccurrencesRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun addAdsTimeFilter(publicSetOccurrences: PublicSetOccurrencesRefineBy) = + fun addAdsTimeFilter(setOccurrences: PublicSetOccurrencesRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofSetOccurrences(setOccurrences)) + + /** + * Alias for calling [addAdsTimeFilter] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` + */ + fun addSetOccurrencesAdsTimeFilter(setType: String) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun addAdsTimeFilter( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun addAdsTimeFilter(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicAdsTimeFilter.PruningRefineBy.ofRelativeComparative(relativeComparative) ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun addAdsTimeFilter(publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp - ) - ) + fun addAdsTimeFilter(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun addAdsTimeFilter( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = + fun addAdsTimeFilter(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) + PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteComparative(absoluteComparative) ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun addAdsTimeFilter(publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp - ) - ) + fun addAdsTimeFilter(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteRanged(absoluteRanged)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAllHistory(allHistory)`. */ - fun addAdsTimeFilter(publicAllHistory: PublicAllHistoryRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAllHistory(publicAllHistory) - ) + fun addAdsTimeFilter(allHistory: PublicAllHistoryRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [addAdsTimeFilter] with @@ -478,14 +473,10 @@ private constructor( /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofTimeRanged(timeRanged)`. */ - fun addAdsTimeFilter(publicRangedTimeOperation: PublicRangedTimeOperation) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRangedTimeOperation( - publicRangedTimeOperation - ) - ) + fun addAdsTimeFilter(timeRanged: PublicRangedTimeOperation) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofTimeRanged(timeRanged)) /** Alias for calling [addFilter] with `Filter.ofInList(inList)`. */ fun addFilter(inList: PublicInListFilter) = addFilter(Filter.ofInList(inList)) diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicOrFilterBranch.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicOrFilterBranch.kt index dd6f155b..a92bd23b 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicOrFilterBranch.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicOrFilterBranch.kt @@ -392,78 +392,73 @@ private constructor( /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun addAdsTimeFilter(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences) - ) + fun addAdsTimeFilter(numOccurrences: PublicNumOccurrencesRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun addAdsTimeFilter(publicSetOccurrences: PublicSetOccurrencesRefineBy) = + fun addAdsTimeFilter(setOccurrences: PublicSetOccurrencesRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofSetOccurrences(setOccurrences)) + + /** + * Alias for calling [addAdsTimeFilter] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` + */ + fun addSetOccurrencesAdsTimeFilter(setType: String) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun addAdsTimeFilter( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun addAdsTimeFilter(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicAdsTimeFilter.PruningRefineBy.ofRelativeComparative(relativeComparative) ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun addAdsTimeFilter(publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp - ) - ) + fun addAdsTimeFilter(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun addAdsTimeFilter( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = + fun addAdsTimeFilter(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) + PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteComparative(absoluteComparative) ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun addAdsTimeFilter(publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp - ) - ) + fun addAdsTimeFilter(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteRanged(absoluteRanged)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAllHistory(allHistory)`. */ - fun addAdsTimeFilter(publicAllHistory: PublicAllHistoryRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAllHistory(publicAllHistory) - ) + fun addAdsTimeFilter(allHistory: PublicAllHistoryRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [addAdsTimeFilter] with @@ -478,14 +473,10 @@ private constructor( /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofTimeRanged(timeRanged)`. */ - fun addAdsTimeFilter(publicRangedTimeOperation: PublicRangedTimeOperation) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRangedTimeOperation( - publicRangedTimeOperation - ) - ) + fun addAdsTimeFilter(timeRanged: PublicRangedTimeOperation) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofTimeRanged(timeRanged)) /** Alias for calling [addFilter] with `Filter.ofInList(inList)`. */ fun addFilter(inList: PublicInListFilter) = addFilter(Filter.ofInList(inList)) diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicPageViewAnalyticsFilter.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicPageViewAnalyticsFilter.kt index cf07026d..4cd02399 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicPageViewAnalyticsFilter.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicPageViewAnalyticsFilter.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -275,72 +274,69 @@ private constructor( /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `CoalescingRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun coalescingRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun coalescingRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `CoalescingRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun coalescingRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun coalescingRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [coalescingRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun coalescingRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesCoalescingRefineBy(setType: String) = coalescingRefineBy( - CoalescingRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `CoalescingRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun coalescingRefineBy( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun coalescingRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `CoalescingRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun coalescingRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun coalescingRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `CoalescingRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun coalescingRefineBy( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun coalescingRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `CoalescingRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun coalescingRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicAllHistory(publicAllHistory)) + fun coalescingRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** + * Alias for calling [coalescingRefineBy] with + * `CoalescingRefineBy.ofAllHistory(allHistory)`. + */ + fun coalescingRefineBy(allHistory: PublicAllHistoryRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [coalescingRefineBy] with @@ -353,12 +349,10 @@ private constructor( /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. + * `CoalescingRefineBy.ofTimeRanged(timeRanged)`. */ - fun coalescingRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation) - ) + fun coalescingRefineBy(timeRanged: PublicRangedTimeOperation) = + coalescingRefineBy(CoalescingRefineBy.ofTimeRanged(timeRanged)) /** Indicates whether tracking is enabled for the page view. */ fun enableTracking(enableTracking: Boolean) = enableTracking(JsonField.of(enableTracking)) @@ -391,68 +385,66 @@ private constructor( /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `PruningRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun pruningRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun pruningRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `PruningRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun pruningRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun pruningRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [pruningRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun pruningRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesPruningRefineBy(setType: String) = pruningRefineBy( - PruningRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `PruningRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun pruningRefineBy(publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun pruningRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `PruningRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun pruningRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun pruningRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `PruningRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun pruningRefineBy(publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun pruningRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `PruningRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun pruningRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicAllHistory(publicAllHistory)) + fun pruningRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofAllHistory(allHistory)`. */ + fun pruningRefineBy(allHistory: PublicAllHistoryRefineBy) = + pruningRefineBy(PruningRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [pruningRefineBy] with @@ -461,12 +453,9 @@ private constructor( fun pruningRefineBy(publicTimePointOperation: PublicTimePointOperation) = pruningRefineBy(PruningRefineBy.ofPublicTimePointOperation(publicTimePointOperation)) - /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. - */ - fun pruningRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - pruningRefineBy(PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)) + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofTimeRanged(timeRanged)`. */ + fun pruningRefineBy(timeRanged: PublicRangedTimeOperation) = + pruningRefineBy(PruningRefineBy.ofTimeRanged(timeRanged)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -695,97 +684,85 @@ private constructor( @JsonSerialize(using = CoalescingRefineBy.Serializer::class) class CoalescingRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -801,8 +778,8 @@ private constructor( * * Optional result = coalescingRefineBy.accept(new CoalescingRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -820,27 +797,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -862,46 +828,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -910,10 +870,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -938,42 +896,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -985,49 +938,44 @@ private constructor( } return other is CoalescingRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "CoalescingRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "CoalescingRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "CoalescingRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "CoalescingRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "CoalescingRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "CoalescingRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "CoalescingRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "CoalescingRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "CoalescingRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "CoalescingRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "CoalescingRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "CoalescingRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "CoalescingRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "CoalescingRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "CoalescingRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "CoalescingRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "CoalescingRefineBy{timeRanged=$timeRanged}" _json != null -> "CoalescingRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid CoalescingRefineBy") } @@ -1035,50 +983,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - CoalescingRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + CoalescingRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - CoalescingRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + CoalescingRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - CoalescingRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = CoalescingRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = CoalescingRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + CoalescingRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - CoalescingRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = CoalescingRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = CoalescingRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + CoalescingRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - CoalescingRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + CoalescingRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = CoalescingRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - CoalescingRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + CoalescingRefineBy(timeRanged = timeRanged) } /** @@ -1087,33 +1027,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [CoalescingRefineBy] to a value of type [T]. @@ -1135,80 +1069,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): CoalescingRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { - CoalescingRefineBy(publicNumOccurrences = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - CoalescingRefineBy(publicSetOccurrences = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> CoalescingRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(numOccurrences = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(setOccurrences = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(relativeComparative = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(relativeRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(absoluteComparative = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(absoluteRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(allHistory = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(timeRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + CoalescingRefineBy(publicTimePointOperation = it, _json = json) + } ?: CoalescingRefineBy(_json = json) } } @@ -1220,23 +1140,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid CoalescingRefineBy") } @@ -1249,97 +1164,85 @@ private constructor( @JsonSerialize(using = PruningRefineBy.Serializer::class) class PruningRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -1355,8 +1258,8 @@ private constructor( * * Optional result = pruningRefineBy.accept(new PruningRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -1374,27 +1277,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -1416,46 +1308,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -1464,10 +1350,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -1492,42 +1376,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -1539,49 +1418,44 @@ private constructor( } return other is PruningRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "PruningRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "PruningRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "PruningRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "PruningRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "PruningRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "PruningRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "PruningRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "PruningRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "PruningRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "PruningRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "PruningRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "PruningRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "PruningRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "PruningRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "PruningRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "PruningRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "PruningRefineBy{timeRanged=$timeRanged}" _json != null -> "PruningRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid PruningRefineBy") } @@ -1589,50 +1463,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - PruningRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + PruningRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - PruningRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + PruningRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = PruningRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = PruningRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + PruningRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = PruningRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = PruningRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + PruningRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - PruningRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + PruningRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = PruningRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - PruningRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + PruningRefineBy(timeRanged = timeRanged) } /** @@ -1641,33 +1507,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [PruningRefineBy] to a value of type [T]. @@ -1688,76 +1548,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): PruningRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicNumOccurrences = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicSetOccurrences = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> PruningRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(numOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(setOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(allHistory = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(timeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + PruningRefineBy(publicTimePointOperation = it, _json = json) + } ?: PruningRefineBy(_json = json) } } @@ -1769,23 +1619,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid PruningRefineBy") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicRangedTimeOperation.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicRangedTimeOperation.kt index 3cf60de2..67e5edbb 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicRangedTimeOperation.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicRangedTimeOperation.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -333,28 +332,22 @@ private constructor( this.lowerBoundTimePoint = lowerBoundTimePoint } - /** - * Alias for calling [lowerBoundTimePoint] with - * `LowerBoundTimePoint.ofPublicDate(publicDate)`. - */ - fun lowerBoundTimePoint(publicDate: PublicDatePoint) = - lowerBoundTimePoint(LowerBoundTimePoint.ofPublicDate(publicDate)) + /** Alias for calling [lowerBoundTimePoint] with `LowerBoundTimePoint.ofDate(date)`. */ + fun lowerBoundTimePoint(date: PublicDatePoint) = + lowerBoundTimePoint(LowerBoundTimePoint.ofDate(date)) /** - * Alias for calling [lowerBoundTimePoint] with - * `LowerBoundTimePoint.ofPublicIndexed(publicIndexed)`. + * Alias for calling [lowerBoundTimePoint] with `LowerBoundTimePoint.ofIndexed(indexed)`. */ - fun lowerBoundTimePoint(publicIndexed: PublicIndexedTimePoint) = - lowerBoundTimePoint(LowerBoundTimePoint.ofPublicIndexed(publicIndexed)) + fun lowerBoundTimePoint(indexed: PublicIndexedTimePoint) = + lowerBoundTimePoint(LowerBoundTimePoint.ofIndexed(indexed)) /** * Alias for calling [lowerBoundTimePoint] with - * `LowerBoundTimePoint.ofPublicPropertyReferencedTime(publicPropertyReferencedTime)`. + * `LowerBoundTimePoint.ofPropertyReferenced(propertyReferenced)`. */ - fun lowerBoundTimePoint(publicPropertyReferencedTime: PublicPropertyReferencedTime) = - lowerBoundTimePoint( - LowerBoundTimePoint.ofPublicPropertyReferencedTime(publicPropertyReferencedTime) - ) + fun lowerBoundTimePoint(propertyReferenced: PublicPropertyReferencedTime) = + lowerBoundTimePoint(LowerBoundTimePoint.ofPropertyReferenced(propertyReferenced)) /** Specifies the type of operation (TIME_RANGED). */ fun operationType(operationType: OperationType) = operationType(JsonField.of(operationType)) @@ -409,28 +402,22 @@ private constructor( this.upperBoundTimePoint = upperBoundTimePoint } - /** - * Alias for calling [upperBoundTimePoint] with - * `UpperBoundTimePoint.ofPublicDate(publicDate)`. - */ - fun upperBoundTimePoint(publicDate: PublicDatePoint) = - upperBoundTimePoint(UpperBoundTimePoint.ofPublicDate(publicDate)) + /** Alias for calling [upperBoundTimePoint] with `UpperBoundTimePoint.ofDate(date)`. */ + fun upperBoundTimePoint(date: PublicDatePoint) = + upperBoundTimePoint(UpperBoundTimePoint.ofDate(date)) /** - * Alias for calling [upperBoundTimePoint] with - * `UpperBoundTimePoint.ofPublicIndexed(publicIndexed)`. + * Alias for calling [upperBoundTimePoint] with `UpperBoundTimePoint.ofIndexed(indexed)`. */ - fun upperBoundTimePoint(publicIndexed: PublicIndexedTimePoint) = - upperBoundTimePoint(UpperBoundTimePoint.ofPublicIndexed(publicIndexed)) + fun upperBoundTimePoint(indexed: PublicIndexedTimePoint) = + upperBoundTimePoint(UpperBoundTimePoint.ofIndexed(indexed)) /** * Alias for calling [upperBoundTimePoint] with - * `UpperBoundTimePoint.ofPublicPropertyReferencedTime(publicPropertyReferencedTime)`. + * `UpperBoundTimePoint.ofPropertyReferenced(propertyReferenced)`. */ - fun upperBoundTimePoint(publicPropertyReferencedTime: PublicPropertyReferencedTime) = - upperBoundTimePoint( - UpperBoundTimePoint.ofPublicPropertyReferencedTime(publicPropertyReferencedTime) - ) + fun upperBoundTimePoint(propertyReferenced: PublicPropertyReferencedTime) = + upperBoundTimePoint(UpperBoundTimePoint.ofPropertyReferenced(propertyReferenced)) /** Describes the behavior at the lower bound endpoint of the time range. */ fun lowerBoundEndpointBehavior(lowerBoundEndpointBehavior: String) = @@ -584,31 +571,31 @@ private constructor( @JsonSerialize(using = LowerBoundTimePoint.Serializer::class) class LowerBoundTimePoint private constructor( - private val publicDate: PublicDatePoint? = null, - private val publicIndexed: PublicIndexedTimePoint? = null, - private val publicPropertyReferencedTime: PublicPropertyReferencedTime? = null, + private val date: PublicDatePoint? = null, + private val indexed: PublicIndexedTimePoint? = null, + private val propertyReferenced: PublicPropertyReferencedTime? = null, private val _json: JsonValue? = null, ) { - fun publicDate(): Optional = Optional.ofNullable(publicDate) + fun date(): Optional = Optional.ofNullable(date) - fun publicIndexed(): Optional = Optional.ofNullable(publicIndexed) + fun indexed(): Optional = Optional.ofNullable(indexed) - fun publicPropertyReferencedTime(): Optional = - Optional.ofNullable(publicPropertyReferencedTime) + fun propertyReferenced(): Optional = + Optional.ofNullable(propertyReferenced) - fun isPublicDate(): Boolean = publicDate != null + fun isDate(): Boolean = date != null - fun isPublicIndexed(): Boolean = publicIndexed != null + fun isIndexed(): Boolean = indexed != null - fun isPublicPropertyReferencedTime(): Boolean = publicPropertyReferencedTime != null + fun isPropertyReferenced(): Boolean = propertyReferenced != null - fun asPublicDate(): PublicDatePoint = publicDate.getOrThrow("publicDate") + fun asDate(): PublicDatePoint = date.getOrThrow("date") - fun asPublicIndexed(): PublicIndexedTimePoint = publicIndexed.getOrThrow("publicIndexed") + fun asIndexed(): PublicIndexedTimePoint = indexed.getOrThrow("indexed") - fun asPublicPropertyReferencedTime(): PublicPropertyReferencedTime = - publicPropertyReferencedTime.getOrThrow("publicPropertyReferencedTime") + fun asPropertyReferenced(): PublicPropertyReferencedTime = + propertyReferenced.getOrThrow("propertyReferenced") fun _json(): Optional = Optional.ofNullable(_json) @@ -624,8 +611,8 @@ private constructor( * * Optional result = lowerBoundTimePoint.accept(new LowerBoundTimePoint.Visitor>() { * @Override - * public Optional visitPublicDate(PublicDatePoint publicDate) { - * return Optional.of(publicDate.toString()); + * public Optional visitDate(PublicDatePoint date) { + * return Optional.of(date.toString()); * } * * // ... @@ -643,10 +630,9 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicDate != null -> visitor.visitPublicDate(publicDate) - publicIndexed != null -> visitor.visitPublicIndexed(publicIndexed) - publicPropertyReferencedTime != null -> - visitor.visitPublicPropertyReferencedTime(publicPropertyReferencedTime) + date != null -> visitor.visitDate(date) + indexed != null -> visitor.visitIndexed(indexed) + propertyReferenced != null -> visitor.visitPropertyReferenced(propertyReferenced) else -> visitor.unknown(_json) } @@ -668,18 +654,18 @@ private constructor( accept( object : Visitor { - override fun visitPublicDate(publicDate: PublicDatePoint) { - publicDate.validate() + override fun visitDate(date: PublicDatePoint) { + date.validate() } - override fun visitPublicIndexed(publicIndexed: PublicIndexedTimePoint) { - publicIndexed.validate() + override fun visitIndexed(indexed: PublicIndexedTimePoint) { + indexed.validate() } - override fun visitPublicPropertyReferencedTime( - publicPropertyReferencedTime: PublicPropertyReferencedTime + override fun visitPropertyReferenced( + propertyReferenced: PublicPropertyReferencedTime ) { - publicPropertyReferencedTime.validate() + propertyReferenced.validate() } } ) @@ -704,15 +690,13 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicDate(publicDate: PublicDatePoint) = - publicDate.validity() + override fun visitDate(date: PublicDatePoint) = date.validity() - override fun visitPublicIndexed(publicIndexed: PublicIndexedTimePoint) = - publicIndexed.validity() + override fun visitIndexed(indexed: PublicIndexedTimePoint) = indexed.validity() - override fun visitPublicPropertyReferencedTime( - publicPropertyReferencedTime: PublicPropertyReferencedTime - ) = publicPropertyReferencedTime.validity() + override fun visitPropertyReferenced( + propertyReferenced: PublicPropertyReferencedTime + ) = propertyReferenced.validity() override fun unknown(json: JsonValue?) = 0 } @@ -724,38 +708,33 @@ private constructor( } return other is LowerBoundTimePoint && - publicDate == other.publicDate && - publicIndexed == other.publicIndexed && - publicPropertyReferencedTime == other.publicPropertyReferencedTime + date == other.date && + indexed == other.indexed && + propertyReferenced == other.propertyReferenced } - override fun hashCode(): Int = - Objects.hash(publicDate, publicIndexed, publicPropertyReferencedTime) + override fun hashCode(): Int = Objects.hash(date, indexed, propertyReferenced) override fun toString(): String = when { - publicDate != null -> "LowerBoundTimePoint{publicDate=$publicDate}" - publicIndexed != null -> "LowerBoundTimePoint{publicIndexed=$publicIndexed}" - publicPropertyReferencedTime != null -> - "LowerBoundTimePoint{publicPropertyReferencedTime=$publicPropertyReferencedTime}" + date != null -> "LowerBoundTimePoint{date=$date}" + indexed != null -> "LowerBoundTimePoint{indexed=$indexed}" + propertyReferenced != null -> + "LowerBoundTimePoint{propertyReferenced=$propertyReferenced}" _json != null -> "LowerBoundTimePoint{_unknown=$_json}" else -> throw IllegalStateException("Invalid LowerBoundTimePoint") } companion object { - @JvmStatic - fun ofPublicDate(publicDate: PublicDatePoint) = - LowerBoundTimePoint(publicDate = publicDate) + @JvmStatic fun ofDate(date: PublicDatePoint) = LowerBoundTimePoint(date = date) @JvmStatic - fun ofPublicIndexed(publicIndexed: PublicIndexedTimePoint) = - LowerBoundTimePoint(publicIndexed = publicIndexed) + fun ofIndexed(indexed: PublicIndexedTimePoint) = LowerBoundTimePoint(indexed = indexed) @JvmStatic - fun ofPublicPropertyReferencedTime( - publicPropertyReferencedTime: PublicPropertyReferencedTime - ) = LowerBoundTimePoint(publicPropertyReferencedTime = publicPropertyReferencedTime) + fun ofPropertyReferenced(propertyReferenced: PublicPropertyReferencedTime) = + LowerBoundTimePoint(propertyReferenced = propertyReferenced) } /** @@ -764,13 +743,11 @@ private constructor( */ interface Visitor { - fun visitPublicDate(publicDate: PublicDatePoint): T + fun visitDate(date: PublicDatePoint): T - fun visitPublicIndexed(publicIndexed: PublicIndexedTimePoint): T + fun visitIndexed(indexed: PublicIndexedTimePoint): T - fun visitPublicPropertyReferencedTime( - publicPropertyReferencedTime: PublicPropertyReferencedTime - ): T + fun visitPropertyReferenced(propertyReferenced: PublicPropertyReferencedTime): T /** * Maps an unknown variant of [LowerBoundTimePoint] to a value of type [T]. @@ -792,36 +769,27 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): LowerBoundTimePoint { val json = JsonValue.fromJsonNode(node) + val timeType = json.asObject().getOrNull()?.get("timeType")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - LowerBoundTimePoint(publicDate = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - LowerBoundTimePoint(publicIndexed = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - LowerBoundTimePoint( - publicPropertyReferencedTime = it, - _json = json, - ) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> LowerBoundTimePoint(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (timeType) { + "DATE" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + LowerBoundTimePoint(date = it, _json = json) + } ?: LowerBoundTimePoint(_json = json) + } + "INDEXED" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + LowerBoundTimePoint(indexed = it, _json = json) + } ?: LowerBoundTimePoint(_json = json) + } + "PROPERTY_REFERENCED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { LowerBoundTimePoint(propertyReferenced = it, _json = json) } + ?: LowerBoundTimePoint(_json = json) + } } + + return LowerBoundTimePoint(_json = json) } } @@ -834,10 +802,10 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicDate != null -> generator.writeObject(value.publicDate) - value.publicIndexed != null -> generator.writeObject(value.publicIndexed) - value.publicPropertyReferencedTime != null -> - generator.writeObject(value.publicPropertyReferencedTime) + value.date != null -> generator.writeObject(value.date) + value.indexed != null -> generator.writeObject(value.indexed) + value.propertyReferenced != null -> + generator.writeObject(value.propertyReferenced) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid LowerBoundTimePoint") } @@ -1112,31 +1080,31 @@ private constructor( @JsonSerialize(using = UpperBoundTimePoint.Serializer::class) class UpperBoundTimePoint private constructor( - private val publicDate: PublicDatePoint? = null, - private val publicIndexed: PublicIndexedTimePoint? = null, - private val publicPropertyReferencedTime: PublicPropertyReferencedTime? = null, + private val date: PublicDatePoint? = null, + private val indexed: PublicIndexedTimePoint? = null, + private val propertyReferenced: PublicPropertyReferencedTime? = null, private val _json: JsonValue? = null, ) { - fun publicDate(): Optional = Optional.ofNullable(publicDate) + fun date(): Optional = Optional.ofNullable(date) - fun publicIndexed(): Optional = Optional.ofNullable(publicIndexed) + fun indexed(): Optional = Optional.ofNullable(indexed) - fun publicPropertyReferencedTime(): Optional = - Optional.ofNullable(publicPropertyReferencedTime) + fun propertyReferenced(): Optional = + Optional.ofNullable(propertyReferenced) - fun isPublicDate(): Boolean = publicDate != null + fun isDate(): Boolean = date != null - fun isPublicIndexed(): Boolean = publicIndexed != null + fun isIndexed(): Boolean = indexed != null - fun isPublicPropertyReferencedTime(): Boolean = publicPropertyReferencedTime != null + fun isPropertyReferenced(): Boolean = propertyReferenced != null - fun asPublicDate(): PublicDatePoint = publicDate.getOrThrow("publicDate") + fun asDate(): PublicDatePoint = date.getOrThrow("date") - fun asPublicIndexed(): PublicIndexedTimePoint = publicIndexed.getOrThrow("publicIndexed") + fun asIndexed(): PublicIndexedTimePoint = indexed.getOrThrow("indexed") - fun asPublicPropertyReferencedTime(): PublicPropertyReferencedTime = - publicPropertyReferencedTime.getOrThrow("publicPropertyReferencedTime") + fun asPropertyReferenced(): PublicPropertyReferencedTime = + propertyReferenced.getOrThrow("propertyReferenced") fun _json(): Optional = Optional.ofNullable(_json) @@ -1152,8 +1120,8 @@ private constructor( * * Optional result = upperBoundTimePoint.accept(new UpperBoundTimePoint.Visitor>() { * @Override - * public Optional visitPublicDate(PublicDatePoint publicDate) { - * return Optional.of(publicDate.toString()); + * public Optional visitDate(PublicDatePoint date) { + * return Optional.of(date.toString()); * } * * // ... @@ -1171,10 +1139,9 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicDate != null -> visitor.visitPublicDate(publicDate) - publicIndexed != null -> visitor.visitPublicIndexed(publicIndexed) - publicPropertyReferencedTime != null -> - visitor.visitPublicPropertyReferencedTime(publicPropertyReferencedTime) + date != null -> visitor.visitDate(date) + indexed != null -> visitor.visitIndexed(indexed) + propertyReferenced != null -> visitor.visitPropertyReferenced(propertyReferenced) else -> visitor.unknown(_json) } @@ -1196,18 +1163,18 @@ private constructor( accept( object : Visitor { - override fun visitPublicDate(publicDate: PublicDatePoint) { - publicDate.validate() + override fun visitDate(date: PublicDatePoint) { + date.validate() } - override fun visitPublicIndexed(publicIndexed: PublicIndexedTimePoint) { - publicIndexed.validate() + override fun visitIndexed(indexed: PublicIndexedTimePoint) { + indexed.validate() } - override fun visitPublicPropertyReferencedTime( - publicPropertyReferencedTime: PublicPropertyReferencedTime + override fun visitPropertyReferenced( + propertyReferenced: PublicPropertyReferencedTime ) { - publicPropertyReferencedTime.validate() + propertyReferenced.validate() } } ) @@ -1232,15 +1199,13 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicDate(publicDate: PublicDatePoint) = - publicDate.validity() + override fun visitDate(date: PublicDatePoint) = date.validity() - override fun visitPublicIndexed(publicIndexed: PublicIndexedTimePoint) = - publicIndexed.validity() + override fun visitIndexed(indexed: PublicIndexedTimePoint) = indexed.validity() - override fun visitPublicPropertyReferencedTime( - publicPropertyReferencedTime: PublicPropertyReferencedTime - ) = publicPropertyReferencedTime.validity() + override fun visitPropertyReferenced( + propertyReferenced: PublicPropertyReferencedTime + ) = propertyReferenced.validity() override fun unknown(json: JsonValue?) = 0 } @@ -1252,38 +1217,33 @@ private constructor( } return other is UpperBoundTimePoint && - publicDate == other.publicDate && - publicIndexed == other.publicIndexed && - publicPropertyReferencedTime == other.publicPropertyReferencedTime + date == other.date && + indexed == other.indexed && + propertyReferenced == other.propertyReferenced } - override fun hashCode(): Int = - Objects.hash(publicDate, publicIndexed, publicPropertyReferencedTime) + override fun hashCode(): Int = Objects.hash(date, indexed, propertyReferenced) override fun toString(): String = when { - publicDate != null -> "UpperBoundTimePoint{publicDate=$publicDate}" - publicIndexed != null -> "UpperBoundTimePoint{publicIndexed=$publicIndexed}" - publicPropertyReferencedTime != null -> - "UpperBoundTimePoint{publicPropertyReferencedTime=$publicPropertyReferencedTime}" + date != null -> "UpperBoundTimePoint{date=$date}" + indexed != null -> "UpperBoundTimePoint{indexed=$indexed}" + propertyReferenced != null -> + "UpperBoundTimePoint{propertyReferenced=$propertyReferenced}" _json != null -> "UpperBoundTimePoint{_unknown=$_json}" else -> throw IllegalStateException("Invalid UpperBoundTimePoint") } companion object { - @JvmStatic - fun ofPublicDate(publicDate: PublicDatePoint) = - UpperBoundTimePoint(publicDate = publicDate) + @JvmStatic fun ofDate(date: PublicDatePoint) = UpperBoundTimePoint(date = date) @JvmStatic - fun ofPublicIndexed(publicIndexed: PublicIndexedTimePoint) = - UpperBoundTimePoint(publicIndexed = publicIndexed) + fun ofIndexed(indexed: PublicIndexedTimePoint) = UpperBoundTimePoint(indexed = indexed) @JvmStatic - fun ofPublicPropertyReferencedTime( - publicPropertyReferencedTime: PublicPropertyReferencedTime - ) = UpperBoundTimePoint(publicPropertyReferencedTime = publicPropertyReferencedTime) + fun ofPropertyReferenced(propertyReferenced: PublicPropertyReferencedTime) = + UpperBoundTimePoint(propertyReferenced = propertyReferenced) } /** @@ -1292,13 +1252,11 @@ private constructor( */ interface Visitor { - fun visitPublicDate(publicDate: PublicDatePoint): T + fun visitDate(date: PublicDatePoint): T - fun visitPublicIndexed(publicIndexed: PublicIndexedTimePoint): T + fun visitIndexed(indexed: PublicIndexedTimePoint): T - fun visitPublicPropertyReferencedTime( - publicPropertyReferencedTime: PublicPropertyReferencedTime - ): T + fun visitPropertyReferenced(propertyReferenced: PublicPropertyReferencedTime): T /** * Maps an unknown variant of [UpperBoundTimePoint] to a value of type [T]. @@ -1320,36 +1278,27 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): UpperBoundTimePoint { val json = JsonValue.fromJsonNode(node) + val timeType = json.asObject().getOrNull()?.get("timeType")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - UpperBoundTimePoint(publicDate = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - UpperBoundTimePoint(publicIndexed = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - UpperBoundTimePoint( - publicPropertyReferencedTime = it, - _json = json, - ) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> UpperBoundTimePoint(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (timeType) { + "DATE" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + UpperBoundTimePoint(date = it, _json = json) + } ?: UpperBoundTimePoint(_json = json) + } + "INDEXED" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + UpperBoundTimePoint(indexed = it, _json = json) + } ?: UpperBoundTimePoint(_json = json) + } + "PROPERTY_REFERENCED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { UpperBoundTimePoint(propertyReferenced = it, _json = json) } + ?: UpperBoundTimePoint(_json = json) + } } + + return UpperBoundTimePoint(_json = json) } } @@ -1362,10 +1311,10 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicDate != null -> generator.writeObject(value.publicDate) - value.publicIndexed != null -> generator.writeObject(value.publicIndexed) - value.publicPropertyReferencedTime != null -> - generator.writeObject(value.publicPropertyReferencedTime) + value.date != null -> generator.writeObject(value.date) + value.indexed != null -> generator.writeObject(value.indexed) + value.propertyReferenced != null -> + generator.writeObject(value.propertyReferenced) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid UpperBoundTimePoint") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicRestrictedFilterBranch.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicRestrictedFilterBranch.kt index 18c246e4..45469896 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicRestrictedFilterBranch.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicRestrictedFilterBranch.kt @@ -392,78 +392,73 @@ private constructor( /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun addAdsTimeFilter(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences) - ) + fun addAdsTimeFilter(numOccurrences: PublicNumOccurrencesRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun addAdsTimeFilter(publicSetOccurrences: PublicSetOccurrencesRefineBy) = + fun addAdsTimeFilter(setOccurrences: PublicSetOccurrencesRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofSetOccurrences(setOccurrences)) + + /** + * Alias for calling [addAdsTimeFilter] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` + */ + fun addSetOccurrencesAdsTimeFilter(setType: String) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun addAdsTimeFilter( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun addAdsTimeFilter(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicAdsTimeFilter.PruningRefineBy.ofRelativeComparative(relativeComparative) ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun addAdsTimeFilter(publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp - ) - ) + fun addAdsTimeFilter(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun addAdsTimeFilter( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = + fun addAdsTimeFilter(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) + PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteComparative(absoluteComparative) ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun addAdsTimeFilter(publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp - ) - ) + fun addAdsTimeFilter(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteRanged(absoluteRanged)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAllHistory(allHistory)`. */ - fun addAdsTimeFilter(publicAllHistory: PublicAllHistoryRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAllHistory(publicAllHistory) - ) + fun addAdsTimeFilter(allHistory: PublicAllHistoryRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [addAdsTimeFilter] with @@ -478,14 +473,10 @@ private constructor( /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofTimeRanged(timeRanged)`. */ - fun addAdsTimeFilter(publicRangedTimeOperation: PublicRangedTimeOperation) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRangedTimeOperation( - publicRangedTimeOperation - ) - ) + fun addAdsTimeFilter(timeRanged: PublicRangedTimeOperation) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofTimeRanged(timeRanged)) /** Alias for calling [addFilter] with `Filter.ofInList(inList)`. */ fun addFilter(inList: PublicInListFilter) = addFilter(Filter.ofInList(inList)) diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicSurveyMonkeyValueFilter.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicSurveyMonkeyValueFilter.kt index 38edecf0..80ab5c88 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicSurveyMonkeyValueFilter.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicSurveyMonkeyValueFilter.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -310,188 +309,97 @@ private constructor( this.valueComparison = valueComparison } - /** - * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicBoolPropertyOperation(publicBoolPropertyOperation)`. - */ - fun valueComparison(publicBoolPropertyOperation: PublicBoolPropertyOperation) = - valueComparison( - ValueComparison.ofPublicBoolPropertyOperation(publicBoolPropertyOperation) - ) + /** Alias for calling [valueComparison] with `ValueComparison.ofBool(bool)`. */ + fun valueComparison(bool: PublicBoolPropertyOperation) = + valueComparison(ValueComparison.ofBool(bool)) - /** - * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicNumberPropertyOperation(publicNumberPropertyOperation)`. - */ - fun valueComparison(publicNumberPropertyOperation: PublicNumberPropertyOperation) = - valueComparison( - ValueComparison.ofPublicNumberPropertyOperation(publicNumberPropertyOperation) - ) + /** Alias for calling [valueComparison] with `ValueComparison.ofNumber(number)`. */ + fun valueComparison(number: PublicNumberPropertyOperation) = + valueComparison(ValueComparison.ofNumber(number)) - /** - * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicStringPropertyOperation(publicStringPropertyOperation)`. - */ - fun valueComparison(publicStringPropertyOperation: PublicStringPropertyOperation) = - valueComparison( - ValueComparison.ofPublicStringPropertyOperation(publicStringPropertyOperation) - ) + /** Alias for calling [valueComparison] with `ValueComparison.ofString(string)`. */ + fun valueComparison(string: PublicStringPropertyOperation) = + valueComparison(ValueComparison.ofString(string)) - /** - * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicDateTimePropertyOperation(publicDateTimePropertyOperation)`. - */ - fun valueComparison(publicDateTimePropertyOperation: PublicDateTimePropertyOperation) = - valueComparison( - ValueComparison.ofPublicDateTimePropertyOperation(publicDateTimePropertyOperation) - ) + /** Alias for calling [valueComparison] with `ValueComparison.ofDatetime(datetime)`. */ + fun valueComparison(datetime: PublicDateTimePropertyOperation) = + valueComparison(ValueComparison.ofDatetime(datetime)) - /** - * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicRangedDatePropertyOperation(publicRangedDatePropertyOperation)`. - */ - fun valueComparison(publicRangedDatePropertyOperation: PublicRangedDatePropertyOperation) = - valueComparison( - ValueComparison.ofPublicRangedDatePropertyOperation( - publicRangedDatePropertyOperation - ) - ) + /** Alias for calling [valueComparison] with `ValueComparison.ofRangedDate(rangedDate)`. */ + fun valueComparison(rangedDate: PublicRangedDatePropertyOperation) = + valueComparison(ValueComparison.ofRangedDate(rangedDate)) /** * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicComparativePropertyUpdatedOperation(publicComparativePropertyUpdatedOperation)`. + * `ValueComparison.ofComparativePropertyUpdated(comparativePropertyUpdated)`. */ - fun valueComparison( - publicComparativePropertyUpdatedOperation: PublicComparativePropertyUpdatedOperation - ) = + fun valueComparison(comparativePropertyUpdated: PublicComparativePropertyUpdatedOperation) = valueComparison( - ValueComparison.ofPublicComparativePropertyUpdatedOperation( - publicComparativePropertyUpdatedOperation - ) + ValueComparison.ofComparativePropertyUpdated(comparativePropertyUpdated) ) /** * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicComparativeDatePropertyOperation(publicComparativeDatePropertyOperation)`. + * `ValueComparison.ofComparativeDate(comparativeDate)`. */ - fun valueComparison( - publicComparativeDatePropertyOperation: PublicComparativeDatePropertyOperation - ) = - valueComparison( - ValueComparison.ofPublicComparativeDatePropertyOperation( - publicComparativeDatePropertyOperation - ) - ) + fun valueComparison(comparativeDate: PublicComparativeDatePropertyOperation) = + valueComparison(ValueComparison.ofComparativeDate(comparativeDate)) /** * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicRollingDateRangePropertyOperation(publicRollingDateRangePropertyOperation)`. + * `ValueComparison.ofRollingDateRange(rollingDateRange)`. */ - fun valueComparison( - publicRollingDateRangePropertyOperation: PublicRollingDateRangePropertyOperation - ) = - valueComparison( - ValueComparison.ofPublicRollingDateRangePropertyOperation( - publicRollingDateRangePropertyOperation - ) - ) + fun valueComparison(rollingDateRange: PublicRollingDateRangePropertyOperation) = + valueComparison(ValueComparison.ofRollingDateRange(rollingDateRange)) /** * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicRollingPropertyUpdatedOperation(publicRollingPropertyUpdatedOperation)`. + * `ValueComparison.ofRollingPropertyUpdated(rollingPropertyUpdated)`. */ - fun valueComparison( - publicRollingPropertyUpdatedOperation: PublicRollingPropertyUpdatedOperation - ) = - valueComparison( - ValueComparison.ofPublicRollingPropertyUpdatedOperation( - publicRollingPropertyUpdatedOperation - ) - ) + fun valueComparison(rollingPropertyUpdated: PublicRollingPropertyUpdatedOperation) = + valueComparison(ValueComparison.ofRollingPropertyUpdated(rollingPropertyUpdated)) /** - * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicEnumerationPropertyOperation(publicEnumerationPropertyOperation)`. + * Alias for calling [valueComparison] with `ValueComparison.ofEnumeration(enumeration)`. */ - fun valueComparison( - publicEnumerationPropertyOperation: PublicEnumerationPropertyOperation - ) = - valueComparison( - ValueComparison.ofPublicEnumerationPropertyOperation( - publicEnumerationPropertyOperation - ) - ) + fun valueComparison(enumeration: PublicEnumerationPropertyOperation) = + valueComparison(ValueComparison.ofEnumeration(enumeration)) /** - * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicAllPropertyTypesOperation(publicAllPropertyTypesOperation)`. + * Alias for calling [valueComparison] with `ValueComparison.ofAllProperty(allProperty)`. */ - fun valueComparison(publicAllPropertyTypesOperation: PublicAllPropertyTypesOperation) = - valueComparison( - ValueComparison.ofPublicAllPropertyTypesOperation(publicAllPropertyTypesOperation) - ) + fun valueComparison(allProperty: PublicAllPropertyTypesOperation) = + valueComparison(ValueComparison.ofAllProperty(allProperty)) /** - * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicRangedNumberPropertyOperation(publicRangedNumberPropertyOperation)`. + * Alias for calling [valueComparison] with `ValueComparison.ofNumberRanged(numberRanged)`. */ - fun valueComparison( - publicRangedNumberPropertyOperation: PublicRangedNumberPropertyOperation - ) = - valueComparison( - ValueComparison.ofPublicRangedNumberPropertyOperation( - publicRangedNumberPropertyOperation - ) - ) + fun valueComparison(numberRanged: PublicRangedNumberPropertyOperation) = + valueComparison(ValueComparison.ofNumberRanged(numberRanged)) /** - * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicMultiStringPropertyOperation(publicMultiStringPropertyOperation)`. + * Alias for calling [valueComparison] with `ValueComparison.ofMultistring(multistring)`. */ - fun valueComparison( - publicMultiStringPropertyOperation: PublicMultiStringPropertyOperation - ) = - valueComparison( - ValueComparison.ofPublicMultiStringPropertyOperation( - publicMultiStringPropertyOperation - ) - ) + fun valueComparison(multistring: PublicMultiStringPropertyOperation) = + valueComparison(ValueComparison.ofMultistring(multistring)) - /** - * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicDatePropertyOperation(publicDatePropertyOperation)`. - */ - fun valueComparison(publicDatePropertyOperation: PublicDatePropertyOperation) = - valueComparison( - ValueComparison.ofPublicDatePropertyOperation(publicDatePropertyOperation) - ) + /** Alias for calling [valueComparison] with `ValueComparison.ofDate(date)`. */ + fun valueComparison(date: PublicDatePropertyOperation) = + valueComparison(ValueComparison.ofDate(date)) /** - * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicCalendarDatePropertyOperation(publicCalendarDatePropertyOperation)`. + * Alias for calling [valueComparison] with `ValueComparison.ofCalendarDate(calendarDate)`. */ - fun valueComparison( - publicCalendarDatePropertyOperation: PublicCalendarDatePropertyOperation - ) = - valueComparison( - ValueComparison.ofPublicCalendarDatePropertyOperation( - publicCalendarDatePropertyOperation - ) - ) + fun valueComparison(calendarDate: PublicCalendarDatePropertyOperation) = + valueComparison(ValueComparison.ofCalendarDate(calendarDate)) - /** - * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicTimePointOperation(publicTimePointOperation)`. - */ - fun valueComparison(publicTimePointOperation: PublicTimePointOperation) = - valueComparison(ValueComparison.ofPublicTimePointOperation(publicTimePointOperation)) + /** Alias for calling [valueComparison] with `ValueComparison.ofTimePoint(timePoint)`. */ + fun valueComparison(timePoint: PublicTimePointOperation) = + valueComparison(ValueComparison.ofTimePoint(timePoint)) - /** - * Alias for calling [valueComparison] with - * `ValueComparison.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. - */ - fun valueComparison(publicRangedTimeOperation: PublicRangedTimeOperation) = - valueComparison(ValueComparison.ofPublicRangedTimeOperation(publicRangedTimeOperation)) + /** Alias for calling [valueComparison] with `ValueComparison.ofTimeRanged(timeRanged)`. */ + fun valueComparison(timeRanged: PublicRangedTimeOperation) = + valueComparison(ValueComparison.ofTimeRanged(timeRanged)) /** The column ID of the survey answer used in the filter. */ fun surveyAnswerColId(surveyAnswerColId: String) = @@ -755,192 +663,145 @@ private constructor( @JsonSerialize(using = ValueComparison.Serializer::class) class ValueComparison private constructor( - private val publicBoolPropertyOperation: PublicBoolPropertyOperation? = null, - private val publicNumberPropertyOperation: PublicNumberPropertyOperation? = null, - private val publicStringPropertyOperation: PublicStringPropertyOperation? = null, - private val publicDateTimePropertyOperation: PublicDateTimePropertyOperation? = null, - private val publicRangedDatePropertyOperation: PublicRangedDatePropertyOperation? = null, - private val publicComparativePropertyUpdatedOperation: - PublicComparativePropertyUpdatedOperation? = - null, - private val publicComparativeDatePropertyOperation: - PublicComparativeDatePropertyOperation? = - null, - private val publicRollingDateRangePropertyOperation: - PublicRollingDateRangePropertyOperation? = - null, - private val publicRollingPropertyUpdatedOperation: PublicRollingPropertyUpdatedOperation? = - null, - private val publicEnumerationPropertyOperation: PublicEnumerationPropertyOperation? = null, - private val publicAllPropertyTypesOperation: PublicAllPropertyTypesOperation? = null, - private val publicRangedNumberPropertyOperation: PublicRangedNumberPropertyOperation? = - null, - private val publicMultiStringPropertyOperation: PublicMultiStringPropertyOperation? = null, - private val publicDatePropertyOperation: PublicDatePropertyOperation? = null, - private val publicCalendarDatePropertyOperation: PublicCalendarDatePropertyOperation? = - null, - private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val bool: PublicBoolPropertyOperation? = null, + private val number: PublicNumberPropertyOperation? = null, + private val string: PublicStringPropertyOperation? = null, + private val datetime: PublicDateTimePropertyOperation? = null, + private val rangedDate: PublicRangedDatePropertyOperation? = null, + private val comparativePropertyUpdated: PublicComparativePropertyUpdatedOperation? = null, + private val comparativeDate: PublicComparativeDatePropertyOperation? = null, + private val rollingDateRange: PublicRollingDateRangePropertyOperation? = null, + private val rollingPropertyUpdated: PublicRollingPropertyUpdatedOperation? = null, + private val enumeration: PublicEnumerationPropertyOperation? = null, + private val allProperty: PublicAllPropertyTypesOperation? = null, + private val numberRanged: PublicRangedNumberPropertyOperation? = null, + private val multistring: PublicMultiStringPropertyOperation? = null, + private val date: PublicDatePropertyOperation? = null, + private val calendarDate: PublicCalendarDatePropertyOperation? = null, + private val timePoint: PublicTimePointOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicBoolPropertyOperation(): Optional = - Optional.ofNullable(publicBoolPropertyOperation) + fun bool(): Optional = Optional.ofNullable(bool) - fun publicNumberPropertyOperation(): Optional = - Optional.ofNullable(publicNumberPropertyOperation) + fun number(): Optional = Optional.ofNullable(number) - fun publicStringPropertyOperation(): Optional = - Optional.ofNullable(publicStringPropertyOperation) + fun string(): Optional = Optional.ofNullable(string) - fun publicDateTimePropertyOperation(): Optional = - Optional.ofNullable(publicDateTimePropertyOperation) + fun datetime(): Optional = Optional.ofNullable(datetime) - fun publicRangedDatePropertyOperation(): Optional = - Optional.ofNullable(publicRangedDatePropertyOperation) + fun rangedDate(): Optional = + Optional.ofNullable(rangedDate) - fun publicComparativePropertyUpdatedOperation(): - Optional = - Optional.ofNullable(publicComparativePropertyUpdatedOperation) + fun comparativePropertyUpdated(): Optional = + Optional.ofNullable(comparativePropertyUpdated) - fun publicComparativeDatePropertyOperation(): - Optional = - Optional.ofNullable(publicComparativeDatePropertyOperation) + fun comparativeDate(): Optional = + Optional.ofNullable(comparativeDate) - fun publicRollingDateRangePropertyOperation(): - Optional = - Optional.ofNullable(publicRollingDateRangePropertyOperation) + fun rollingDateRange(): Optional = + Optional.ofNullable(rollingDateRange) - fun publicRollingPropertyUpdatedOperation(): - Optional = - Optional.ofNullable(publicRollingPropertyUpdatedOperation) + fun rollingPropertyUpdated(): Optional = + Optional.ofNullable(rollingPropertyUpdated) - fun publicEnumerationPropertyOperation(): Optional = - Optional.ofNullable(publicEnumerationPropertyOperation) + fun enumeration(): Optional = + Optional.ofNullable(enumeration) - fun publicAllPropertyTypesOperation(): Optional = - Optional.ofNullable(publicAllPropertyTypesOperation) + fun allProperty(): Optional = + Optional.ofNullable(allProperty) - fun publicRangedNumberPropertyOperation(): Optional = - Optional.ofNullable(publicRangedNumberPropertyOperation) + fun numberRanged(): Optional = + Optional.ofNullable(numberRanged) - fun publicMultiStringPropertyOperation(): Optional = - Optional.ofNullable(publicMultiStringPropertyOperation) + fun multistring(): Optional = + Optional.ofNullable(multistring) - fun publicDatePropertyOperation(): Optional = - Optional.ofNullable(publicDatePropertyOperation) + fun date(): Optional = Optional.ofNullable(date) - fun publicCalendarDatePropertyOperation(): Optional = - Optional.ofNullable(publicCalendarDatePropertyOperation) + fun calendarDate(): Optional = + Optional.ofNullable(calendarDate) - fun publicTimePointOperation(): Optional = - Optional.ofNullable(publicTimePointOperation) + fun timePoint(): Optional = Optional.ofNullable(timePoint) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicBoolPropertyOperation(): Boolean = publicBoolPropertyOperation != null + fun isBool(): Boolean = bool != null - fun isPublicNumberPropertyOperation(): Boolean = publicNumberPropertyOperation != null + fun isNumber(): Boolean = number != null - fun isPublicStringPropertyOperation(): Boolean = publicStringPropertyOperation != null + fun isString(): Boolean = string != null - fun isPublicDateTimePropertyOperation(): Boolean = publicDateTimePropertyOperation != null + fun isDatetime(): Boolean = datetime != null - fun isPublicRangedDatePropertyOperation(): Boolean = - publicRangedDatePropertyOperation != null + fun isRangedDate(): Boolean = rangedDate != null - fun isPublicComparativePropertyUpdatedOperation(): Boolean = - publicComparativePropertyUpdatedOperation != null + fun isComparativePropertyUpdated(): Boolean = comparativePropertyUpdated != null - fun isPublicComparativeDatePropertyOperation(): Boolean = - publicComparativeDatePropertyOperation != null + fun isComparativeDate(): Boolean = comparativeDate != null - fun isPublicRollingDateRangePropertyOperation(): Boolean = - publicRollingDateRangePropertyOperation != null + fun isRollingDateRange(): Boolean = rollingDateRange != null - fun isPublicRollingPropertyUpdatedOperation(): Boolean = - publicRollingPropertyUpdatedOperation != null + fun isRollingPropertyUpdated(): Boolean = rollingPropertyUpdated != null - fun isPublicEnumerationPropertyOperation(): Boolean = - publicEnumerationPropertyOperation != null + fun isEnumeration(): Boolean = enumeration != null - fun isPublicAllPropertyTypesOperation(): Boolean = publicAllPropertyTypesOperation != null + fun isAllProperty(): Boolean = allProperty != null - fun isPublicRangedNumberPropertyOperation(): Boolean = - publicRangedNumberPropertyOperation != null + fun isNumberRanged(): Boolean = numberRanged != null - fun isPublicMultiStringPropertyOperation(): Boolean = - publicMultiStringPropertyOperation != null + fun isMultistring(): Boolean = multistring != null - fun isPublicDatePropertyOperation(): Boolean = publicDatePropertyOperation != null + fun isDate(): Boolean = date != null - fun isPublicCalendarDatePropertyOperation(): Boolean = - publicCalendarDatePropertyOperation != null + fun isCalendarDate(): Boolean = calendarDate != null - fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null + fun isTimePoint(): Boolean = timePoint != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicBoolPropertyOperation(): PublicBoolPropertyOperation = - publicBoolPropertyOperation.getOrThrow("publicBoolPropertyOperation") + fun asBool(): PublicBoolPropertyOperation = bool.getOrThrow("bool") - fun asPublicNumberPropertyOperation(): PublicNumberPropertyOperation = - publicNumberPropertyOperation.getOrThrow("publicNumberPropertyOperation") + fun asNumber(): PublicNumberPropertyOperation = number.getOrThrow("number") - fun asPublicStringPropertyOperation(): PublicStringPropertyOperation = - publicStringPropertyOperation.getOrThrow("publicStringPropertyOperation") + fun asString(): PublicStringPropertyOperation = string.getOrThrow("string") - fun asPublicDateTimePropertyOperation(): PublicDateTimePropertyOperation = - publicDateTimePropertyOperation.getOrThrow("publicDateTimePropertyOperation") + fun asDatetime(): PublicDateTimePropertyOperation = datetime.getOrThrow("datetime") - fun asPublicRangedDatePropertyOperation(): PublicRangedDatePropertyOperation = - publicRangedDatePropertyOperation.getOrThrow("publicRangedDatePropertyOperation") + fun asRangedDate(): PublicRangedDatePropertyOperation = rangedDate.getOrThrow("rangedDate") - fun asPublicComparativePropertyUpdatedOperation(): - PublicComparativePropertyUpdatedOperation = - publicComparativePropertyUpdatedOperation.getOrThrow( - "publicComparativePropertyUpdatedOperation" - ) + fun asComparativePropertyUpdated(): PublicComparativePropertyUpdatedOperation = + comparativePropertyUpdated.getOrThrow("comparativePropertyUpdated") - fun asPublicComparativeDatePropertyOperation(): PublicComparativeDatePropertyOperation = - publicComparativeDatePropertyOperation.getOrThrow( - "publicComparativeDatePropertyOperation" - ) + fun asComparativeDate(): PublicComparativeDatePropertyOperation = + comparativeDate.getOrThrow("comparativeDate") - fun asPublicRollingDateRangePropertyOperation(): PublicRollingDateRangePropertyOperation = - publicRollingDateRangePropertyOperation.getOrThrow( - "publicRollingDateRangePropertyOperation" - ) + fun asRollingDateRange(): PublicRollingDateRangePropertyOperation = + rollingDateRange.getOrThrow("rollingDateRange") - fun asPublicRollingPropertyUpdatedOperation(): PublicRollingPropertyUpdatedOperation = - publicRollingPropertyUpdatedOperation.getOrThrow( - "publicRollingPropertyUpdatedOperation" - ) + fun asRollingPropertyUpdated(): PublicRollingPropertyUpdatedOperation = + rollingPropertyUpdated.getOrThrow("rollingPropertyUpdated") - fun asPublicEnumerationPropertyOperation(): PublicEnumerationPropertyOperation = - publicEnumerationPropertyOperation.getOrThrow("publicEnumerationPropertyOperation") + fun asEnumeration(): PublicEnumerationPropertyOperation = + enumeration.getOrThrow("enumeration") - fun asPublicAllPropertyTypesOperation(): PublicAllPropertyTypesOperation = - publicAllPropertyTypesOperation.getOrThrow("publicAllPropertyTypesOperation") + fun asAllProperty(): PublicAllPropertyTypesOperation = allProperty.getOrThrow("allProperty") - fun asPublicRangedNumberPropertyOperation(): PublicRangedNumberPropertyOperation = - publicRangedNumberPropertyOperation.getOrThrow("publicRangedNumberPropertyOperation") + fun asNumberRanged(): PublicRangedNumberPropertyOperation = + numberRanged.getOrThrow("numberRanged") - fun asPublicMultiStringPropertyOperation(): PublicMultiStringPropertyOperation = - publicMultiStringPropertyOperation.getOrThrow("publicMultiStringPropertyOperation") + fun asMultistring(): PublicMultiStringPropertyOperation = + multistring.getOrThrow("multistring") - fun asPublicDatePropertyOperation(): PublicDatePropertyOperation = - publicDatePropertyOperation.getOrThrow("publicDatePropertyOperation") + fun asDate(): PublicDatePropertyOperation = date.getOrThrow("date") - fun asPublicCalendarDatePropertyOperation(): PublicCalendarDatePropertyOperation = - publicCalendarDatePropertyOperation.getOrThrow("publicCalendarDatePropertyOperation") + fun asCalendarDate(): PublicCalendarDatePropertyOperation = + calendarDate.getOrThrow("calendarDate") - fun asPublicTimePointOperation(): PublicTimePointOperation = - publicTimePointOperation.getOrThrow("publicTimePointOperation") + fun asTimePoint(): PublicTimePointOperation = timePoint.getOrThrow("timePoint") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -956,8 +817,8 @@ private constructor( * * Optional result = valueComparison.accept(new ValueComparison.Visitor>() { * @Override - * public Optional visitPublicBoolPropertyOperation(PublicBoolPropertyOperation publicBoolPropertyOperation) { - * return Optional.of(publicBoolPropertyOperation.toString()); + * public Optional visitBool(PublicBoolPropertyOperation bool) { + * return Optional.of(bool.toString()); * } * * // ... @@ -975,58 +836,25 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicBoolPropertyOperation != null -> - visitor.visitPublicBoolPropertyOperation(publicBoolPropertyOperation) - publicNumberPropertyOperation != null -> - visitor.visitPublicNumberPropertyOperation(publicNumberPropertyOperation) - publicStringPropertyOperation != null -> - visitor.visitPublicStringPropertyOperation(publicStringPropertyOperation) - publicDateTimePropertyOperation != null -> - visitor.visitPublicDateTimePropertyOperation(publicDateTimePropertyOperation) - publicRangedDatePropertyOperation != null -> - visitor.visitPublicRangedDatePropertyOperation( - publicRangedDatePropertyOperation - ) - publicComparativePropertyUpdatedOperation != null -> - visitor.visitPublicComparativePropertyUpdatedOperation( - publicComparativePropertyUpdatedOperation - ) - publicComparativeDatePropertyOperation != null -> - visitor.visitPublicComparativeDatePropertyOperation( - publicComparativeDatePropertyOperation - ) - publicRollingDateRangePropertyOperation != null -> - visitor.visitPublicRollingDateRangePropertyOperation( - publicRollingDateRangePropertyOperation - ) - publicRollingPropertyUpdatedOperation != null -> - visitor.visitPublicRollingPropertyUpdatedOperation( - publicRollingPropertyUpdatedOperation - ) - publicEnumerationPropertyOperation != null -> - visitor.visitPublicEnumerationPropertyOperation( - publicEnumerationPropertyOperation - ) - publicAllPropertyTypesOperation != null -> - visitor.visitPublicAllPropertyTypesOperation(publicAllPropertyTypesOperation) - publicRangedNumberPropertyOperation != null -> - visitor.visitPublicRangedNumberPropertyOperation( - publicRangedNumberPropertyOperation - ) - publicMultiStringPropertyOperation != null -> - visitor.visitPublicMultiStringPropertyOperation( - publicMultiStringPropertyOperation - ) - publicDatePropertyOperation != null -> - visitor.visitPublicDatePropertyOperation(publicDatePropertyOperation) - publicCalendarDatePropertyOperation != null -> - visitor.visitPublicCalendarDatePropertyOperation( - publicCalendarDatePropertyOperation - ) - publicTimePointOperation != null -> - visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + bool != null -> visitor.visitBool(bool) + number != null -> visitor.visitNumber(number) + string != null -> visitor.visitString(string) + datetime != null -> visitor.visitDatetime(datetime) + rangedDate != null -> visitor.visitRangedDate(rangedDate) + comparativePropertyUpdated != null -> + visitor.visitComparativePropertyUpdated(comparativePropertyUpdated) + comparativeDate != null -> visitor.visitComparativeDate(comparativeDate) + rollingDateRange != null -> visitor.visitRollingDateRange(rollingDateRange) + rollingPropertyUpdated != null -> + visitor.visitRollingPropertyUpdated(rollingPropertyUpdated) + enumeration != null -> visitor.visitEnumeration(enumeration) + allProperty != null -> visitor.visitAllProperty(allProperty) + numberRanged != null -> visitor.visitNumberRanged(numberRanged) + multistring != null -> visitor.visitMultistring(multistring) + date != null -> visitor.visitDate(date) + calendarDate != null -> visitor.visitCalendarDate(calendarDate) + timePoint != null -> visitor.visitTimePoint(timePoint) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -1048,109 +876,84 @@ private constructor( accept( object : Visitor { - override fun visitPublicBoolPropertyOperation( - publicBoolPropertyOperation: PublicBoolPropertyOperation - ) { - publicBoolPropertyOperation.validate() + override fun visitBool(bool: PublicBoolPropertyOperation) { + bool.validate() } - override fun visitPublicNumberPropertyOperation( - publicNumberPropertyOperation: PublicNumberPropertyOperation - ) { - publicNumberPropertyOperation.validate() + override fun visitNumber(number: PublicNumberPropertyOperation) { + number.validate() } - override fun visitPublicStringPropertyOperation( - publicStringPropertyOperation: PublicStringPropertyOperation - ) { - publicStringPropertyOperation.validate() + override fun visitString(string: PublicStringPropertyOperation) { + string.validate() } - override fun visitPublicDateTimePropertyOperation( - publicDateTimePropertyOperation: PublicDateTimePropertyOperation - ) { - publicDateTimePropertyOperation.validate() + override fun visitDatetime(datetime: PublicDateTimePropertyOperation) { + datetime.validate() } - override fun visitPublicRangedDatePropertyOperation( - publicRangedDatePropertyOperation: PublicRangedDatePropertyOperation - ) { - publicRangedDatePropertyOperation.validate() + override fun visitRangedDate(rangedDate: PublicRangedDatePropertyOperation) { + rangedDate.validate() } - override fun visitPublicComparativePropertyUpdatedOperation( - publicComparativePropertyUpdatedOperation: - PublicComparativePropertyUpdatedOperation + override fun visitComparativePropertyUpdated( + comparativePropertyUpdated: PublicComparativePropertyUpdatedOperation ) { - publicComparativePropertyUpdatedOperation.validate() + comparativePropertyUpdated.validate() } - override fun visitPublicComparativeDatePropertyOperation( - publicComparativeDatePropertyOperation: - PublicComparativeDatePropertyOperation + override fun visitComparativeDate( + comparativeDate: PublicComparativeDatePropertyOperation ) { - publicComparativeDatePropertyOperation.validate() + comparativeDate.validate() } - override fun visitPublicRollingDateRangePropertyOperation( - publicRollingDateRangePropertyOperation: - PublicRollingDateRangePropertyOperation + override fun visitRollingDateRange( + rollingDateRange: PublicRollingDateRangePropertyOperation ) { - publicRollingDateRangePropertyOperation.validate() + rollingDateRange.validate() } - override fun visitPublicRollingPropertyUpdatedOperation( - publicRollingPropertyUpdatedOperation: PublicRollingPropertyUpdatedOperation + override fun visitRollingPropertyUpdated( + rollingPropertyUpdated: PublicRollingPropertyUpdatedOperation ) { - publicRollingPropertyUpdatedOperation.validate() + rollingPropertyUpdated.validate() } - override fun visitPublicEnumerationPropertyOperation( - publicEnumerationPropertyOperation: PublicEnumerationPropertyOperation - ) { - publicEnumerationPropertyOperation.validate() + override fun visitEnumeration(enumeration: PublicEnumerationPropertyOperation) { + enumeration.validate() } - override fun visitPublicAllPropertyTypesOperation( - publicAllPropertyTypesOperation: PublicAllPropertyTypesOperation - ) { - publicAllPropertyTypesOperation.validate() + override fun visitAllProperty(allProperty: PublicAllPropertyTypesOperation) { + allProperty.validate() } - override fun visitPublicRangedNumberPropertyOperation( - publicRangedNumberPropertyOperation: PublicRangedNumberPropertyOperation + override fun visitNumberRanged( + numberRanged: PublicRangedNumberPropertyOperation ) { - publicRangedNumberPropertyOperation.validate() + numberRanged.validate() } - override fun visitPublicMultiStringPropertyOperation( - publicMultiStringPropertyOperation: PublicMultiStringPropertyOperation - ) { - publicMultiStringPropertyOperation.validate() + override fun visitMultistring(multistring: PublicMultiStringPropertyOperation) { + multistring.validate() } - override fun visitPublicDatePropertyOperation( - publicDatePropertyOperation: PublicDatePropertyOperation - ) { - publicDatePropertyOperation.validate() + override fun visitDate(date: PublicDatePropertyOperation) { + date.validate() } - override fun visitPublicCalendarDatePropertyOperation( - publicCalendarDatePropertyOperation: PublicCalendarDatePropertyOperation + override fun visitCalendarDate( + calendarDate: PublicCalendarDatePropertyOperation ) { - publicCalendarDatePropertyOperation.validate() + calendarDate.validate() } - override fun visitPublicTimePointOperation( - publicTimePointOperation: PublicTimePointOperation - ) { - publicTimePointOperation.validate() + override fun visitTimePoint(timePoint: PublicTimePointOperation) { + timePoint.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -1175,76 +978,60 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicBoolPropertyOperation( - publicBoolPropertyOperation: PublicBoolPropertyOperation - ) = publicBoolPropertyOperation.validity() + override fun visitBool(bool: PublicBoolPropertyOperation) = bool.validity() - override fun visitPublicNumberPropertyOperation( - publicNumberPropertyOperation: PublicNumberPropertyOperation - ) = publicNumberPropertyOperation.validity() + override fun visitNumber(number: PublicNumberPropertyOperation) = + number.validity() - override fun visitPublicStringPropertyOperation( - publicStringPropertyOperation: PublicStringPropertyOperation - ) = publicStringPropertyOperation.validity() + override fun visitString(string: PublicStringPropertyOperation) = + string.validity() - override fun visitPublicDateTimePropertyOperation( - publicDateTimePropertyOperation: PublicDateTimePropertyOperation - ) = publicDateTimePropertyOperation.validity() + override fun visitDatetime(datetime: PublicDateTimePropertyOperation) = + datetime.validity() - override fun visitPublicRangedDatePropertyOperation( - publicRangedDatePropertyOperation: PublicRangedDatePropertyOperation - ) = publicRangedDatePropertyOperation.validity() + override fun visitRangedDate(rangedDate: PublicRangedDatePropertyOperation) = + rangedDate.validity() - override fun visitPublicComparativePropertyUpdatedOperation( - publicComparativePropertyUpdatedOperation: - PublicComparativePropertyUpdatedOperation - ) = publicComparativePropertyUpdatedOperation.validity() + override fun visitComparativePropertyUpdated( + comparativePropertyUpdated: PublicComparativePropertyUpdatedOperation + ) = comparativePropertyUpdated.validity() - override fun visitPublicComparativeDatePropertyOperation( - publicComparativeDatePropertyOperation: - PublicComparativeDatePropertyOperation - ) = publicComparativeDatePropertyOperation.validity() + override fun visitComparativeDate( + comparativeDate: PublicComparativeDatePropertyOperation + ) = comparativeDate.validity() - override fun visitPublicRollingDateRangePropertyOperation( - publicRollingDateRangePropertyOperation: - PublicRollingDateRangePropertyOperation - ) = publicRollingDateRangePropertyOperation.validity() + override fun visitRollingDateRange( + rollingDateRange: PublicRollingDateRangePropertyOperation + ) = rollingDateRange.validity() - override fun visitPublicRollingPropertyUpdatedOperation( - publicRollingPropertyUpdatedOperation: PublicRollingPropertyUpdatedOperation - ) = publicRollingPropertyUpdatedOperation.validity() + override fun visitRollingPropertyUpdated( + rollingPropertyUpdated: PublicRollingPropertyUpdatedOperation + ) = rollingPropertyUpdated.validity() - override fun visitPublicEnumerationPropertyOperation( - publicEnumerationPropertyOperation: PublicEnumerationPropertyOperation - ) = publicEnumerationPropertyOperation.validity() + override fun visitEnumeration(enumeration: PublicEnumerationPropertyOperation) = + enumeration.validity() - override fun visitPublicAllPropertyTypesOperation( - publicAllPropertyTypesOperation: PublicAllPropertyTypesOperation - ) = publicAllPropertyTypesOperation.validity() + override fun visitAllProperty(allProperty: PublicAllPropertyTypesOperation) = + allProperty.validity() - override fun visitPublicRangedNumberPropertyOperation( - publicRangedNumberPropertyOperation: PublicRangedNumberPropertyOperation - ) = publicRangedNumberPropertyOperation.validity() + override fun visitNumberRanged( + numberRanged: PublicRangedNumberPropertyOperation + ) = numberRanged.validity() - override fun visitPublicMultiStringPropertyOperation( - publicMultiStringPropertyOperation: PublicMultiStringPropertyOperation - ) = publicMultiStringPropertyOperation.validity() + override fun visitMultistring(multistring: PublicMultiStringPropertyOperation) = + multistring.validity() - override fun visitPublicDatePropertyOperation( - publicDatePropertyOperation: PublicDatePropertyOperation - ) = publicDatePropertyOperation.validity() + override fun visitDate(date: PublicDatePropertyOperation) = date.validity() - override fun visitPublicCalendarDatePropertyOperation( - publicCalendarDatePropertyOperation: PublicCalendarDatePropertyOperation - ) = publicCalendarDatePropertyOperation.validity() + override fun visitCalendarDate( + calendarDate: PublicCalendarDatePropertyOperation + ) = calendarDate.validity() - override fun visitPublicTimePointOperation( - publicTimePointOperation: PublicTimePointOperation - ) = publicTimePointOperation.validity() + override fun visitTimePoint(timePoint: PublicTimePointOperation) = + timePoint.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -1256,203 +1043,136 @@ private constructor( } return other is ValueComparison && - publicBoolPropertyOperation == other.publicBoolPropertyOperation && - publicNumberPropertyOperation == other.publicNumberPropertyOperation && - publicStringPropertyOperation == other.publicStringPropertyOperation && - publicDateTimePropertyOperation == other.publicDateTimePropertyOperation && - publicRangedDatePropertyOperation == other.publicRangedDatePropertyOperation && - publicComparativePropertyUpdatedOperation == - other.publicComparativePropertyUpdatedOperation && - publicComparativeDatePropertyOperation == - other.publicComparativeDatePropertyOperation && - publicRollingDateRangePropertyOperation == - other.publicRollingDateRangePropertyOperation && - publicRollingPropertyUpdatedOperation == - other.publicRollingPropertyUpdatedOperation && - publicEnumerationPropertyOperation == other.publicEnumerationPropertyOperation && - publicAllPropertyTypesOperation == other.publicAllPropertyTypesOperation && - publicRangedNumberPropertyOperation == other.publicRangedNumberPropertyOperation && - publicMultiStringPropertyOperation == other.publicMultiStringPropertyOperation && - publicDatePropertyOperation == other.publicDatePropertyOperation && - publicCalendarDatePropertyOperation == other.publicCalendarDatePropertyOperation && - publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + bool == other.bool && + number == other.number && + string == other.string && + datetime == other.datetime && + rangedDate == other.rangedDate && + comparativePropertyUpdated == other.comparativePropertyUpdated && + comparativeDate == other.comparativeDate && + rollingDateRange == other.rollingDateRange && + rollingPropertyUpdated == other.rollingPropertyUpdated && + enumeration == other.enumeration && + allProperty == other.allProperty && + numberRanged == other.numberRanged && + multistring == other.multistring && + date == other.date && + calendarDate == other.calendarDate && + timePoint == other.timePoint && + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicBoolPropertyOperation, - publicNumberPropertyOperation, - publicStringPropertyOperation, - publicDateTimePropertyOperation, - publicRangedDatePropertyOperation, - publicComparativePropertyUpdatedOperation, - publicComparativeDatePropertyOperation, - publicRollingDateRangePropertyOperation, - publicRollingPropertyUpdatedOperation, - publicEnumerationPropertyOperation, - publicAllPropertyTypesOperation, - publicRangedNumberPropertyOperation, - publicMultiStringPropertyOperation, - publicDatePropertyOperation, - publicCalendarDatePropertyOperation, - publicTimePointOperation, - publicRangedTimeOperation, + bool, + number, + string, + datetime, + rangedDate, + comparativePropertyUpdated, + comparativeDate, + rollingDateRange, + rollingPropertyUpdated, + enumeration, + allProperty, + numberRanged, + multistring, + date, + calendarDate, + timePoint, + timeRanged, ) override fun toString(): String = when { - publicBoolPropertyOperation != null -> - "ValueComparison{publicBoolPropertyOperation=$publicBoolPropertyOperation}" - publicNumberPropertyOperation != null -> - "ValueComparison{publicNumberPropertyOperation=$publicNumberPropertyOperation}" - publicStringPropertyOperation != null -> - "ValueComparison{publicStringPropertyOperation=$publicStringPropertyOperation}" - publicDateTimePropertyOperation != null -> - "ValueComparison{publicDateTimePropertyOperation=$publicDateTimePropertyOperation}" - publicRangedDatePropertyOperation != null -> - "ValueComparison{publicRangedDatePropertyOperation=$publicRangedDatePropertyOperation}" - publicComparativePropertyUpdatedOperation != null -> - "ValueComparison{publicComparativePropertyUpdatedOperation=$publicComparativePropertyUpdatedOperation}" - publicComparativeDatePropertyOperation != null -> - "ValueComparison{publicComparativeDatePropertyOperation=$publicComparativeDatePropertyOperation}" - publicRollingDateRangePropertyOperation != null -> - "ValueComparison{publicRollingDateRangePropertyOperation=$publicRollingDateRangePropertyOperation}" - publicRollingPropertyUpdatedOperation != null -> - "ValueComparison{publicRollingPropertyUpdatedOperation=$publicRollingPropertyUpdatedOperation}" - publicEnumerationPropertyOperation != null -> - "ValueComparison{publicEnumerationPropertyOperation=$publicEnumerationPropertyOperation}" - publicAllPropertyTypesOperation != null -> - "ValueComparison{publicAllPropertyTypesOperation=$publicAllPropertyTypesOperation}" - publicRangedNumberPropertyOperation != null -> - "ValueComparison{publicRangedNumberPropertyOperation=$publicRangedNumberPropertyOperation}" - publicMultiStringPropertyOperation != null -> - "ValueComparison{publicMultiStringPropertyOperation=$publicMultiStringPropertyOperation}" - publicDatePropertyOperation != null -> - "ValueComparison{publicDatePropertyOperation=$publicDatePropertyOperation}" - publicCalendarDatePropertyOperation != null -> - "ValueComparison{publicCalendarDatePropertyOperation=$publicCalendarDatePropertyOperation}" - publicTimePointOperation != null -> - "ValueComparison{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "ValueComparison{publicRangedTimeOperation=$publicRangedTimeOperation}" + bool != null -> "ValueComparison{bool=$bool}" + number != null -> "ValueComparison{number=$number}" + string != null -> "ValueComparison{string=$string}" + datetime != null -> "ValueComparison{datetime=$datetime}" + rangedDate != null -> "ValueComparison{rangedDate=$rangedDate}" + comparativePropertyUpdated != null -> + "ValueComparison{comparativePropertyUpdated=$comparativePropertyUpdated}" + comparativeDate != null -> "ValueComparison{comparativeDate=$comparativeDate}" + rollingDateRange != null -> "ValueComparison{rollingDateRange=$rollingDateRange}" + rollingPropertyUpdated != null -> + "ValueComparison{rollingPropertyUpdated=$rollingPropertyUpdated}" + enumeration != null -> "ValueComparison{enumeration=$enumeration}" + allProperty != null -> "ValueComparison{allProperty=$allProperty}" + numberRanged != null -> "ValueComparison{numberRanged=$numberRanged}" + multistring != null -> "ValueComparison{multistring=$multistring}" + date != null -> "ValueComparison{date=$date}" + calendarDate != null -> "ValueComparison{calendarDate=$calendarDate}" + timePoint != null -> "ValueComparison{timePoint=$timePoint}" + timeRanged != null -> "ValueComparison{timeRanged=$timeRanged}" _json != null -> "ValueComparison{_unknown=$_json}" else -> throw IllegalStateException("Invalid ValueComparison") } companion object { - @JvmStatic - fun ofPublicBoolPropertyOperation( - publicBoolPropertyOperation: PublicBoolPropertyOperation - ) = ValueComparison(publicBoolPropertyOperation = publicBoolPropertyOperation) + @JvmStatic fun ofBool(bool: PublicBoolPropertyOperation) = ValueComparison(bool = bool) @JvmStatic - fun ofPublicNumberPropertyOperation( - publicNumberPropertyOperation: PublicNumberPropertyOperation - ) = ValueComparison(publicNumberPropertyOperation = publicNumberPropertyOperation) + fun ofNumber(number: PublicNumberPropertyOperation) = ValueComparison(number = number) @JvmStatic - fun ofPublicStringPropertyOperation( - publicStringPropertyOperation: PublicStringPropertyOperation - ) = ValueComparison(publicStringPropertyOperation = publicStringPropertyOperation) + fun ofString(string: PublicStringPropertyOperation) = ValueComparison(string = string) @JvmStatic - fun ofPublicDateTimePropertyOperation( - publicDateTimePropertyOperation: PublicDateTimePropertyOperation - ) = ValueComparison(publicDateTimePropertyOperation = publicDateTimePropertyOperation) + fun ofDatetime(datetime: PublicDateTimePropertyOperation) = + ValueComparison(datetime = datetime) @JvmStatic - fun ofPublicRangedDatePropertyOperation( - publicRangedDatePropertyOperation: PublicRangedDatePropertyOperation - ) = - ValueComparison( - publicRangedDatePropertyOperation = publicRangedDatePropertyOperation - ) + fun ofRangedDate(rangedDate: PublicRangedDatePropertyOperation) = + ValueComparison(rangedDate = rangedDate) @JvmStatic - fun ofPublicComparativePropertyUpdatedOperation( - publicComparativePropertyUpdatedOperation: PublicComparativePropertyUpdatedOperation - ) = - ValueComparison( - publicComparativePropertyUpdatedOperation = - publicComparativePropertyUpdatedOperation - ) + fun ofComparativePropertyUpdated( + comparativePropertyUpdated: PublicComparativePropertyUpdatedOperation + ) = ValueComparison(comparativePropertyUpdated = comparativePropertyUpdated) @JvmStatic - fun ofPublicComparativeDatePropertyOperation( - publicComparativeDatePropertyOperation: PublicComparativeDatePropertyOperation - ) = - ValueComparison( - publicComparativeDatePropertyOperation = publicComparativeDatePropertyOperation - ) + fun ofComparativeDate(comparativeDate: PublicComparativeDatePropertyOperation) = + ValueComparison(comparativeDate = comparativeDate) @JvmStatic - fun ofPublicRollingDateRangePropertyOperation( - publicRollingDateRangePropertyOperation: PublicRollingDateRangePropertyOperation - ) = - ValueComparison( - publicRollingDateRangePropertyOperation = - publicRollingDateRangePropertyOperation - ) + fun ofRollingDateRange(rollingDateRange: PublicRollingDateRangePropertyOperation) = + ValueComparison(rollingDateRange = rollingDateRange) @JvmStatic - fun ofPublicRollingPropertyUpdatedOperation( - publicRollingPropertyUpdatedOperation: PublicRollingPropertyUpdatedOperation - ) = - ValueComparison( - publicRollingPropertyUpdatedOperation = publicRollingPropertyUpdatedOperation - ) + fun ofRollingPropertyUpdated( + rollingPropertyUpdated: PublicRollingPropertyUpdatedOperation + ) = ValueComparison(rollingPropertyUpdated = rollingPropertyUpdated) @JvmStatic - fun ofPublicEnumerationPropertyOperation( - publicEnumerationPropertyOperation: PublicEnumerationPropertyOperation - ) = - ValueComparison( - publicEnumerationPropertyOperation = publicEnumerationPropertyOperation - ) + fun ofEnumeration(enumeration: PublicEnumerationPropertyOperation) = + ValueComparison(enumeration = enumeration) @JvmStatic - fun ofPublicAllPropertyTypesOperation( - publicAllPropertyTypesOperation: PublicAllPropertyTypesOperation - ) = ValueComparison(publicAllPropertyTypesOperation = publicAllPropertyTypesOperation) + fun ofAllProperty(allProperty: PublicAllPropertyTypesOperation) = + ValueComparison(allProperty = allProperty) @JvmStatic - fun ofPublicRangedNumberPropertyOperation( - publicRangedNumberPropertyOperation: PublicRangedNumberPropertyOperation - ) = - ValueComparison( - publicRangedNumberPropertyOperation = publicRangedNumberPropertyOperation - ) + fun ofNumberRanged(numberRanged: PublicRangedNumberPropertyOperation) = + ValueComparison(numberRanged = numberRanged) @JvmStatic - fun ofPublicMultiStringPropertyOperation( - publicMultiStringPropertyOperation: PublicMultiStringPropertyOperation - ) = - ValueComparison( - publicMultiStringPropertyOperation = publicMultiStringPropertyOperation - ) + fun ofMultistring(multistring: PublicMultiStringPropertyOperation) = + ValueComparison(multistring = multistring) - @JvmStatic - fun ofPublicDatePropertyOperation( - publicDatePropertyOperation: PublicDatePropertyOperation - ) = ValueComparison(publicDatePropertyOperation = publicDatePropertyOperation) + @JvmStatic fun ofDate(date: PublicDatePropertyOperation) = ValueComparison(date = date) @JvmStatic - fun ofPublicCalendarDatePropertyOperation( - publicCalendarDatePropertyOperation: PublicCalendarDatePropertyOperation - ) = - ValueComparison( - publicCalendarDatePropertyOperation = publicCalendarDatePropertyOperation - ) + fun ofCalendarDate(calendarDate: PublicCalendarDatePropertyOperation) = + ValueComparison(calendarDate = calendarDate) @JvmStatic - fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = - ValueComparison(publicTimePointOperation = publicTimePointOperation) + fun ofTimePoint(timePoint: PublicTimePointOperation) = + ValueComparison(timePoint = timePoint) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - ValueComparison(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + ValueComparison(timeRanged = timeRanged) } /** @@ -1461,71 +1181,43 @@ private constructor( */ interface Visitor { - fun visitPublicBoolPropertyOperation( - publicBoolPropertyOperation: PublicBoolPropertyOperation - ): T + fun visitBool(bool: PublicBoolPropertyOperation): T - fun visitPublicNumberPropertyOperation( - publicNumberPropertyOperation: PublicNumberPropertyOperation - ): T + fun visitNumber(number: PublicNumberPropertyOperation): T - fun visitPublicStringPropertyOperation( - publicStringPropertyOperation: PublicStringPropertyOperation - ): T + fun visitString(string: PublicStringPropertyOperation): T - fun visitPublicDateTimePropertyOperation( - publicDateTimePropertyOperation: PublicDateTimePropertyOperation - ): T + fun visitDatetime(datetime: PublicDateTimePropertyOperation): T - fun visitPublicRangedDatePropertyOperation( - publicRangedDatePropertyOperation: PublicRangedDatePropertyOperation - ): T + fun visitRangedDate(rangedDate: PublicRangedDatePropertyOperation): T - fun visitPublicComparativePropertyUpdatedOperation( - publicComparativePropertyUpdatedOperation: PublicComparativePropertyUpdatedOperation + fun visitComparativePropertyUpdated( + comparativePropertyUpdated: PublicComparativePropertyUpdatedOperation ): T - fun visitPublicComparativeDatePropertyOperation( - publicComparativeDatePropertyOperation: PublicComparativeDatePropertyOperation - ): T + fun visitComparativeDate(comparativeDate: PublicComparativeDatePropertyOperation): T - fun visitPublicRollingDateRangePropertyOperation( - publicRollingDateRangePropertyOperation: PublicRollingDateRangePropertyOperation - ): T + fun visitRollingDateRange(rollingDateRange: PublicRollingDateRangePropertyOperation): T - fun visitPublicRollingPropertyUpdatedOperation( - publicRollingPropertyUpdatedOperation: PublicRollingPropertyUpdatedOperation + fun visitRollingPropertyUpdated( + rollingPropertyUpdated: PublicRollingPropertyUpdatedOperation ): T - fun visitPublicEnumerationPropertyOperation( - publicEnumerationPropertyOperation: PublicEnumerationPropertyOperation - ): T + fun visitEnumeration(enumeration: PublicEnumerationPropertyOperation): T - fun visitPublicAllPropertyTypesOperation( - publicAllPropertyTypesOperation: PublicAllPropertyTypesOperation - ): T + fun visitAllProperty(allProperty: PublicAllPropertyTypesOperation): T - fun visitPublicRangedNumberPropertyOperation( - publicRangedNumberPropertyOperation: PublicRangedNumberPropertyOperation - ): T + fun visitNumberRanged(numberRanged: PublicRangedNumberPropertyOperation): T - fun visitPublicMultiStringPropertyOperation( - publicMultiStringPropertyOperation: PublicMultiStringPropertyOperation - ): T + fun visitMultistring(multistring: PublicMultiStringPropertyOperation): T - fun visitPublicDatePropertyOperation( - publicDatePropertyOperation: PublicDatePropertyOperation - ): T + fun visitDate(date: PublicDatePropertyOperation): T - fun visitPublicCalendarDatePropertyOperation( - publicCalendarDatePropertyOperation: PublicCalendarDatePropertyOperation - ): T + fun visitCalendarDate(calendarDate: PublicCalendarDatePropertyOperation): T - fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T + fun visitTimePoint(timePoint: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [ValueComparison] to a value of type [T]. @@ -1546,155 +1238,131 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): ValueComparison { val json = JsonValue.fromJsonNode(node) - - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { - ValueComparison(publicBoolPropertyOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - ValueComparison( - publicNumberPropertyOperation = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - ValueComparison( - publicStringPropertyOperation = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - ValueComparison( - publicDateTimePropertyOperation = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - ValueComparison( - publicRangedDatePropertyOperation = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - ValueComparison( - publicComparativePropertyUpdatedOperation = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - ValueComparison( - publicComparativeDatePropertyOperation = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - ValueComparison( - publicRollingDateRangePropertyOperation = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - ValueComparison( - publicRollingPropertyUpdatedOperation = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - ValueComparison( - publicEnumerationPropertyOperation = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - ValueComparison( - publicAllPropertyTypesOperation = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - ValueComparison( - publicRangedNumberPropertyOperation = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - ValueComparison( - publicMultiStringPropertyOperation = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - ValueComparison(publicDatePropertyOperation = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - ValueComparison( - publicCalendarDatePropertyOperation = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - ValueComparison(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - ValueComparison(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> ValueComparison(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + val operationType = + json.asObject().getOrNull()?.get("operationType")?.asString()?.getOrNull() + + when (operationType) { + "BOOL" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { ValueComparison(bool = it, _json = json) } + ?: ValueComparison(_json = json) + } + "NUMBER" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { ValueComparison(number = it, _json = json) } + ?: ValueComparison(_json = json) + } + "STRING" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { ValueComparison(string = it, _json = json) } + ?: ValueComparison(_json = json) + } + "DATETIME" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { ValueComparison(datetime = it, _json = json) } + ?: ValueComparison(_json = json) + } + "RANGED_DATE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { ValueComparison(rangedDate = it, _json = json) } + ?: ValueComparison(_json = json) + } + "COMPARATIVE_PROPERTY_UPDATED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { ValueComparison(comparativePropertyUpdated = it, _json = json) } + ?: ValueComparison(_json = json) + } + "COMPARATIVE_DATE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { ValueComparison(comparativeDate = it, _json = json) } + ?: ValueComparison(_json = json) + } + "ROLLING_DATE_RANGE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { ValueComparison(rollingDateRange = it, _json = json) } + ?: ValueComparison(_json = json) + } + "ROLLING_PROPERTY_UPDATED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { ValueComparison(rollingPropertyUpdated = it, _json = json) } + ?: ValueComparison(_json = json) + } + "ENUMERATION" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { ValueComparison(enumeration = it, _json = json) } + ?: ValueComparison(_json = json) + } + "ALL_PROPERTY" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { ValueComparison(allProperty = it, _json = json) } + ?: ValueComparison(_json = json) + } + "NUMBER_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { ValueComparison(numberRanged = it, _json = json) } + ?: ValueComparison(_json = json) + } + "MULTISTRING" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { ValueComparison(multistring = it, _json = json) } + ?: ValueComparison(_json = json) + } + "DATE" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { ValueComparison(date = it, _json = json) } + ?: ValueComparison(_json = json) + } + "CALENDAR_DATE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { ValueComparison(calendarDate = it, _json = json) } + ?: ValueComparison(_json = json) + } + "TIME_POINT" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { ValueComparison(timePoint = it, _json = json) } + ?: ValueComparison(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { ValueComparison(timeRanged = it, _json = json) } + ?: ValueComparison(_json = json) + } } + + return ValueComparison(_json = json) } } @@ -1706,40 +1374,25 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicBoolPropertyOperation != null -> - generator.writeObject(value.publicBoolPropertyOperation) - value.publicNumberPropertyOperation != null -> - generator.writeObject(value.publicNumberPropertyOperation) - value.publicStringPropertyOperation != null -> - generator.writeObject(value.publicStringPropertyOperation) - value.publicDateTimePropertyOperation != null -> - generator.writeObject(value.publicDateTimePropertyOperation) - value.publicRangedDatePropertyOperation != null -> - generator.writeObject(value.publicRangedDatePropertyOperation) - value.publicComparativePropertyUpdatedOperation != null -> - generator.writeObject(value.publicComparativePropertyUpdatedOperation) - value.publicComparativeDatePropertyOperation != null -> - generator.writeObject(value.publicComparativeDatePropertyOperation) - value.publicRollingDateRangePropertyOperation != null -> - generator.writeObject(value.publicRollingDateRangePropertyOperation) - value.publicRollingPropertyUpdatedOperation != null -> - generator.writeObject(value.publicRollingPropertyUpdatedOperation) - value.publicEnumerationPropertyOperation != null -> - generator.writeObject(value.publicEnumerationPropertyOperation) - value.publicAllPropertyTypesOperation != null -> - generator.writeObject(value.publicAllPropertyTypesOperation) - value.publicRangedNumberPropertyOperation != null -> - generator.writeObject(value.publicRangedNumberPropertyOperation) - value.publicMultiStringPropertyOperation != null -> - generator.writeObject(value.publicMultiStringPropertyOperation) - value.publicDatePropertyOperation != null -> - generator.writeObject(value.publicDatePropertyOperation) - value.publicCalendarDatePropertyOperation != null -> - generator.writeObject(value.publicCalendarDatePropertyOperation) - value.publicTimePointOperation != null -> - generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.bool != null -> generator.writeObject(value.bool) + value.number != null -> generator.writeObject(value.number) + value.string != null -> generator.writeObject(value.string) + value.datetime != null -> generator.writeObject(value.datetime) + value.rangedDate != null -> generator.writeObject(value.rangedDate) + value.comparativePropertyUpdated != null -> + generator.writeObject(value.comparativePropertyUpdated) + value.comparativeDate != null -> generator.writeObject(value.comparativeDate) + value.rollingDateRange != null -> generator.writeObject(value.rollingDateRange) + value.rollingPropertyUpdated != null -> + generator.writeObject(value.rollingPropertyUpdated) + value.enumeration != null -> generator.writeObject(value.enumeration) + value.allProperty != null -> generator.writeObject(value.allProperty) + value.numberRanged != null -> generator.writeObject(value.numberRanged) + value.multistring != null -> generator.writeObject(value.multistring) + value.date != null -> generator.writeObject(value.date) + value.calendarDate != null -> generator.writeObject(value.calendarDate) + value.timePoint != null -> generator.writeObject(value.timePoint) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid ValueComparison") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicTimePointOperation.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicTimePointOperation.kt index f2313be9..a1661f84 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicTimePointOperation.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicTimePointOperation.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -304,19 +303,17 @@ private constructor( */ fun timePoint(timePoint: JsonField) = apply { this.timePoint = timePoint } - /** Alias for calling [timePoint] with `TimePoint.ofPublicDate(publicDate)`. */ - fun timePoint(publicDate: PublicDatePoint) = timePoint(TimePoint.ofPublicDate(publicDate)) + /** Alias for calling [timePoint] with `TimePoint.ofDate(date)`. */ + fun timePoint(date: PublicDatePoint) = timePoint(TimePoint.ofDate(date)) - /** Alias for calling [timePoint] with `TimePoint.ofPublicIndexed(publicIndexed)`. */ - fun timePoint(publicIndexed: PublicIndexedTimePoint) = - timePoint(TimePoint.ofPublicIndexed(publicIndexed)) + /** Alias for calling [timePoint] with `TimePoint.ofIndexed(indexed)`. */ + fun timePoint(indexed: PublicIndexedTimePoint) = timePoint(TimePoint.ofIndexed(indexed)) /** - * Alias for calling [timePoint] with - * `TimePoint.ofPublicPropertyReferencedTime(publicPropertyReferencedTime)`. + * Alias for calling [timePoint] with `TimePoint.ofPropertyReferenced(propertyReferenced)`. */ - fun timePoint(publicPropertyReferencedTime: PublicPropertyReferencedTime) = - timePoint(TimePoint.ofPublicPropertyReferencedTime(publicPropertyReferencedTime)) + fun timePoint(propertyReferenced: PublicPropertyReferencedTime) = + timePoint(TimePoint.ofPropertyReferenced(propertyReferenced)) /** Defines the type of operation being performed. */ fun type(type: String) = type(JsonField.of(type)) @@ -595,31 +592,31 @@ private constructor( @JsonSerialize(using = TimePoint.Serializer::class) class TimePoint private constructor( - private val publicDate: PublicDatePoint? = null, - private val publicIndexed: PublicIndexedTimePoint? = null, - private val publicPropertyReferencedTime: PublicPropertyReferencedTime? = null, + private val date: PublicDatePoint? = null, + private val indexed: PublicIndexedTimePoint? = null, + private val propertyReferenced: PublicPropertyReferencedTime? = null, private val _json: JsonValue? = null, ) { - fun publicDate(): Optional = Optional.ofNullable(publicDate) + fun date(): Optional = Optional.ofNullable(date) - fun publicIndexed(): Optional = Optional.ofNullable(publicIndexed) + fun indexed(): Optional = Optional.ofNullable(indexed) - fun publicPropertyReferencedTime(): Optional = - Optional.ofNullable(publicPropertyReferencedTime) + fun propertyReferenced(): Optional = + Optional.ofNullable(propertyReferenced) - fun isPublicDate(): Boolean = publicDate != null + fun isDate(): Boolean = date != null - fun isPublicIndexed(): Boolean = publicIndexed != null + fun isIndexed(): Boolean = indexed != null - fun isPublicPropertyReferencedTime(): Boolean = publicPropertyReferencedTime != null + fun isPropertyReferenced(): Boolean = propertyReferenced != null - fun asPublicDate(): PublicDatePoint = publicDate.getOrThrow("publicDate") + fun asDate(): PublicDatePoint = date.getOrThrow("date") - fun asPublicIndexed(): PublicIndexedTimePoint = publicIndexed.getOrThrow("publicIndexed") + fun asIndexed(): PublicIndexedTimePoint = indexed.getOrThrow("indexed") - fun asPublicPropertyReferencedTime(): PublicPropertyReferencedTime = - publicPropertyReferencedTime.getOrThrow("publicPropertyReferencedTime") + fun asPropertyReferenced(): PublicPropertyReferencedTime = + propertyReferenced.getOrThrow("propertyReferenced") fun _json(): Optional = Optional.ofNullable(_json) @@ -635,8 +632,8 @@ private constructor( * * Optional result = timePoint.accept(new TimePoint.Visitor>() { * @Override - * public Optional visitPublicDate(PublicDatePoint publicDate) { - * return Optional.of(publicDate.toString()); + * public Optional visitDate(PublicDatePoint date) { + * return Optional.of(date.toString()); * } * * // ... @@ -654,10 +651,9 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicDate != null -> visitor.visitPublicDate(publicDate) - publicIndexed != null -> visitor.visitPublicIndexed(publicIndexed) - publicPropertyReferencedTime != null -> - visitor.visitPublicPropertyReferencedTime(publicPropertyReferencedTime) + date != null -> visitor.visitDate(date) + indexed != null -> visitor.visitIndexed(indexed) + propertyReferenced != null -> visitor.visitPropertyReferenced(propertyReferenced) else -> visitor.unknown(_json) } @@ -679,18 +675,18 @@ private constructor( accept( object : Visitor { - override fun visitPublicDate(publicDate: PublicDatePoint) { - publicDate.validate() + override fun visitDate(date: PublicDatePoint) { + date.validate() } - override fun visitPublicIndexed(publicIndexed: PublicIndexedTimePoint) { - publicIndexed.validate() + override fun visitIndexed(indexed: PublicIndexedTimePoint) { + indexed.validate() } - override fun visitPublicPropertyReferencedTime( - publicPropertyReferencedTime: PublicPropertyReferencedTime + override fun visitPropertyReferenced( + propertyReferenced: PublicPropertyReferencedTime ) { - publicPropertyReferencedTime.validate() + propertyReferenced.validate() } } ) @@ -715,15 +711,13 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicDate(publicDate: PublicDatePoint) = - publicDate.validity() + override fun visitDate(date: PublicDatePoint) = date.validity() - override fun visitPublicIndexed(publicIndexed: PublicIndexedTimePoint) = - publicIndexed.validity() + override fun visitIndexed(indexed: PublicIndexedTimePoint) = indexed.validity() - override fun visitPublicPropertyReferencedTime( - publicPropertyReferencedTime: PublicPropertyReferencedTime - ) = publicPropertyReferencedTime.validity() + override fun visitPropertyReferenced( + propertyReferenced: PublicPropertyReferencedTime + ) = propertyReferenced.validity() override fun unknown(json: JsonValue?) = 0 } @@ -735,37 +729,31 @@ private constructor( } return other is TimePoint && - publicDate == other.publicDate && - publicIndexed == other.publicIndexed && - publicPropertyReferencedTime == other.publicPropertyReferencedTime + date == other.date && + indexed == other.indexed && + propertyReferenced == other.propertyReferenced } - override fun hashCode(): Int = - Objects.hash(publicDate, publicIndexed, publicPropertyReferencedTime) + override fun hashCode(): Int = Objects.hash(date, indexed, propertyReferenced) override fun toString(): String = when { - publicDate != null -> "TimePoint{publicDate=$publicDate}" - publicIndexed != null -> "TimePoint{publicIndexed=$publicIndexed}" - publicPropertyReferencedTime != null -> - "TimePoint{publicPropertyReferencedTime=$publicPropertyReferencedTime}" + date != null -> "TimePoint{date=$date}" + indexed != null -> "TimePoint{indexed=$indexed}" + propertyReferenced != null -> "TimePoint{propertyReferenced=$propertyReferenced}" _json != null -> "TimePoint{_unknown=$_json}" else -> throw IllegalStateException("Invalid TimePoint") } companion object { - @JvmStatic - fun ofPublicDate(publicDate: PublicDatePoint) = TimePoint(publicDate = publicDate) + @JvmStatic fun ofDate(date: PublicDatePoint) = TimePoint(date = date) - @JvmStatic - fun ofPublicIndexed(publicIndexed: PublicIndexedTimePoint) = - TimePoint(publicIndexed = publicIndexed) + @JvmStatic fun ofIndexed(indexed: PublicIndexedTimePoint) = TimePoint(indexed = indexed) @JvmStatic - fun ofPublicPropertyReferencedTime( - publicPropertyReferencedTime: PublicPropertyReferencedTime - ) = TimePoint(publicPropertyReferencedTime = publicPropertyReferencedTime) + fun ofPropertyReferenced(propertyReferenced: PublicPropertyReferencedTime) = + TimePoint(propertyReferenced = propertyReferenced) } /** @@ -773,13 +761,11 @@ private constructor( */ interface Visitor { - fun visitPublicDate(publicDate: PublicDatePoint): T + fun visitDate(date: PublicDatePoint): T - fun visitPublicIndexed(publicIndexed: PublicIndexedTimePoint): T + fun visitIndexed(indexed: PublicIndexedTimePoint): T - fun visitPublicPropertyReferencedTime( - publicPropertyReferencedTime: PublicPropertyReferencedTime - ): T + fun visitPropertyReferenced(propertyReferenced: PublicPropertyReferencedTime): T /** * Maps an unknown variant of [TimePoint] to a value of type [T]. @@ -800,31 +786,27 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): TimePoint { val json = JsonValue.fromJsonNode(node) + val timeType = json.asObject().getOrNull()?.get("timeType")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - TimePoint(publicDate = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - TimePoint(publicIndexed = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { TimePoint(publicPropertyReferencedTime = it, _json = json) }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> TimePoint(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (timeType) { + "DATE" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + TimePoint(date = it, _json = json) + } ?: TimePoint(_json = json) + } + "INDEXED" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + TimePoint(indexed = it, _json = json) + } ?: TimePoint(_json = json) + } + "PROPERTY_REFERENCED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { TimePoint(propertyReferenced = it, _json = json) } + ?: TimePoint(_json = json) + } } + + return TimePoint(_json = json) } } @@ -836,10 +818,10 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicDate != null -> generator.writeObject(value.publicDate) - value.publicIndexed != null -> generator.writeObject(value.publicIndexed) - value.publicPropertyReferencedTime != null -> - generator.writeObject(value.publicPropertyReferencedTime) + value.date != null -> generator.writeObject(value.date) + value.indexed != null -> generator.writeObject(value.indexed) + value.propertyReferenced != null -> + generator.writeObject(value.propertyReferenced) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid TimePoint") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicUnifiedEventsFilter.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicUnifiedEventsFilter.kt index edee6207..7367357e 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicUnifiedEventsFilter.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicUnifiedEventsFilter.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkKnown import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow @@ -253,72 +252,69 @@ private constructor( /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `CoalescingRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun coalescingRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun coalescingRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `CoalescingRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun coalescingRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun coalescingRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [coalescingRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun coalescingRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesCoalescingRefineBy(setType: String) = coalescingRefineBy( - CoalescingRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `CoalescingRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun coalescingRefineBy( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun coalescingRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `CoalescingRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun coalescingRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun coalescingRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `CoalescingRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun coalescingRefineBy( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun coalescingRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `CoalescingRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun coalescingRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicAllHistory(publicAllHistory)) + fun coalescingRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** + * Alias for calling [coalescingRefineBy] with + * `CoalescingRefineBy.ofAllHistory(allHistory)`. + */ + fun coalescingRefineBy(allHistory: PublicAllHistoryRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [coalescingRefineBy] with @@ -331,12 +327,10 @@ private constructor( /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. + * `CoalescingRefineBy.ofTimeRanged(timeRanged)`. */ - fun coalescingRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation) - ) + fun coalescingRefineBy(timeRanged: PublicRangedTimeOperation) = + coalescingRefineBy(CoalescingRefineBy.ofTimeRanged(timeRanged)) /** The identifier for the type of event in the unified events filter. */ fun eventTypeId(eventTypeId: String) = eventTypeId(JsonField.of(eventTypeId)) @@ -367,68 +361,66 @@ private constructor( /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `PruningRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun pruningRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun pruningRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `PruningRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun pruningRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun pruningRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [pruningRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun pruningRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesPruningRefineBy(setType: String) = pruningRefineBy( - PruningRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `PruningRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun pruningRefineBy(publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun pruningRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `PruningRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun pruningRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun pruningRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `PruningRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun pruningRefineBy(publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun pruningRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `PruningRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun pruningRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicAllHistory(publicAllHistory)) + fun pruningRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofAllHistory(allHistory)`. */ + fun pruningRefineBy(allHistory: PublicAllHistoryRefineBy) = + pruningRefineBy(PruningRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [pruningRefineBy] with @@ -437,12 +429,9 @@ private constructor( fun pruningRefineBy(publicTimePointOperation: PublicTimePointOperation) = pruningRefineBy(PruningRefineBy.ofPublicTimePointOperation(publicTimePointOperation)) - /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. - */ - fun pruningRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - pruningRefineBy(PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)) + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofTimeRanged(timeRanged)`. */ + fun pruningRefineBy(timeRanged: PublicRangedTimeOperation) = + pruningRefineBy(PruningRefineBy.ofTimeRanged(timeRanged)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -667,97 +656,85 @@ private constructor( @JsonSerialize(using = CoalescingRefineBy.Serializer::class) class CoalescingRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -773,8 +750,8 @@ private constructor( * * Optional result = coalescingRefineBy.accept(new CoalescingRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -792,27 +769,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -834,46 +800,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -882,10 +842,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -910,42 +868,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -957,49 +910,44 @@ private constructor( } return other is CoalescingRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "CoalescingRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "CoalescingRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "CoalescingRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "CoalescingRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "CoalescingRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "CoalescingRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "CoalescingRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "CoalescingRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "CoalescingRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "CoalescingRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "CoalescingRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "CoalescingRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "CoalescingRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "CoalescingRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "CoalescingRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "CoalescingRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "CoalescingRefineBy{timeRanged=$timeRanged}" _json != null -> "CoalescingRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid CoalescingRefineBy") } @@ -1007,50 +955,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - CoalescingRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + CoalescingRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - CoalescingRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + CoalescingRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - CoalescingRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = CoalescingRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = CoalescingRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + CoalescingRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - CoalescingRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = CoalescingRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = CoalescingRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + CoalescingRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - CoalescingRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + CoalescingRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = CoalescingRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - CoalescingRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + CoalescingRefineBy(timeRanged = timeRanged) } /** @@ -1059,33 +999,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [CoalescingRefineBy] to a value of type [T]. @@ -1107,80 +1041,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): CoalescingRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { - CoalescingRefineBy(publicNumOccurrences = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - CoalescingRefineBy(publicSetOccurrences = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> CoalescingRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(numOccurrences = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(setOccurrences = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(relativeComparative = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(relativeRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(absoluteComparative = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(absoluteRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(allHistory = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(timeRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + CoalescingRefineBy(publicTimePointOperation = it, _json = json) + } ?: CoalescingRefineBy(_json = json) } } @@ -1192,23 +1112,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid CoalescingRefineBy") } @@ -1221,97 +1136,85 @@ private constructor( @JsonSerialize(using = PruningRefineBy.Serializer::class) class PruningRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -1327,8 +1230,8 @@ private constructor( * * Optional result = pruningRefineBy.accept(new PruningRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -1346,27 +1249,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -1388,46 +1280,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -1436,10 +1322,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -1464,42 +1348,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -1511,49 +1390,44 @@ private constructor( } return other is PruningRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "PruningRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "PruningRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "PruningRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "PruningRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "PruningRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "PruningRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "PruningRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "PruningRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "PruningRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "PruningRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "PruningRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "PruningRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "PruningRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "PruningRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "PruningRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "PruningRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "PruningRefineBy{timeRanged=$timeRanged}" _json != null -> "PruningRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid PruningRefineBy") } @@ -1561,50 +1435,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - PruningRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + PruningRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - PruningRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + PruningRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = PruningRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = PruningRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + PruningRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = PruningRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = PruningRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + PruningRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - PruningRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + PruningRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = PruningRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - PruningRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + PruningRefineBy(timeRanged = timeRanged) } /** @@ -1613,33 +1479,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [PruningRefineBy] to a value of type [T]. @@ -1660,76 +1520,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): PruningRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicNumOccurrences = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicSetOccurrences = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> PruningRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(numOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(setOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(allHistory = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(timeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + PruningRefineBy(publicTimePointOperation = it, _json = json) + } ?: PruningRefineBy(_json = json) } } @@ -1741,23 +1591,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid PruningRefineBy") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicUnifiedEventsFilterBranch.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicUnifiedEventsFilterBranch.kt index 6822abfe..ac2b2935 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicUnifiedEventsFilterBranch.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/lists/PublicUnifiedEventsFilterBranch.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkKnown import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow @@ -511,78 +510,73 @@ private constructor( /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun addAdsTimeFilter(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences) - ) + fun addAdsTimeFilter(numOccurrences: PublicNumOccurrencesRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofSetOccurrences(setOccurrences)`. + */ + fun addAdsTimeFilter(setOccurrences: PublicSetOccurrencesRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofSetOccurrences(setOccurrences)) + + /** + * Alias for calling [addAdsTimeFilter] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun addAdsTimeFilter(publicSetOccurrences: PublicSetOccurrencesRefineBy) = + fun addSetOccurrencesAdsTimeFilter(setType: String) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun addAdsTimeFilter( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun addAdsTimeFilter(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicAdsTimeFilter.PruningRefineBy.ofRelativeComparative(relativeComparative) ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun addAdsTimeFilter(publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp - ) - ) + fun addAdsTimeFilter(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun addAdsTimeFilter( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = + fun addAdsTimeFilter(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) + PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteComparative(absoluteComparative) ) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun addAdsTimeFilter(publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp - ) - ) + fun addAdsTimeFilter(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofAbsoluteRanged(absoluteRanged)) /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofAllHistory(allHistory)`. */ - fun addAdsTimeFilter(publicAllHistory: PublicAllHistoryRefineBy) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicAllHistory(publicAllHistory) - ) + fun addAdsTimeFilter(allHistory: PublicAllHistoryRefineBy) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [addAdsTimeFilter] with @@ -597,14 +591,10 @@ private constructor( /** * Alias for calling [addAdsTimeFilter] with - * `PublicAdsTimeFilter.PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. + * `PublicAdsTimeFilter.PruningRefineBy.ofTimeRanged(timeRanged)`. */ - fun addAdsTimeFilter(publicRangedTimeOperation: PublicRangedTimeOperation) = - addAdsTimeFilter( - PublicAdsTimeFilter.PruningRefineBy.ofPublicRangedTimeOperation( - publicRangedTimeOperation - ) - ) + fun addAdsTimeFilter(timeRanged: PublicRangedTimeOperation) = + addAdsTimeFilter(PublicAdsTimeFilter.PruningRefineBy.ofTimeRanged(timeRanged)) /** Alias for calling [addFilter] with `Filter.ofInList(inList)`. */ fun addFilter(inList: PublicInListFilter) = addFilter(Filter.ofInList(inList)) @@ -682,72 +672,69 @@ private constructor( /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `CoalescingRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun coalescingRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun coalescingRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `CoalescingRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun coalescingRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun coalescingRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [coalescingRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun coalescingRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesCoalescingRefineBy(setType: String) = coalescingRefineBy( - CoalescingRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `CoalescingRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun coalescingRefineBy( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun coalescingRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `CoalescingRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun coalescingRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun coalescingRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `CoalescingRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun coalescingRefineBy( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun coalescingRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `CoalescingRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun coalescingRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - coalescingRefineBy(CoalescingRefineBy.ofPublicAllHistory(publicAllHistory)) + fun coalescingRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** + * Alias for calling [coalescingRefineBy] with + * `CoalescingRefineBy.ofAllHistory(allHistory)`. + */ + fun coalescingRefineBy(allHistory: PublicAllHistoryRefineBy) = + coalescingRefineBy(CoalescingRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [coalescingRefineBy] with @@ -760,12 +747,10 @@ private constructor( /** * Alias for calling [coalescingRefineBy] with - * `CoalescingRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. + * `CoalescingRefineBy.ofTimeRanged(timeRanged)`. */ - fun coalescingRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - coalescingRefineBy( - CoalescingRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation) - ) + fun coalescingRefineBy(timeRanged: PublicRangedTimeOperation) = + coalescingRefineBy(CoalescingRefineBy.ofTimeRanged(timeRanged)) fun pruningRefineBy(pruningRefineBy: PruningRefineBy) = pruningRefineBy(JsonField.of(pruningRefineBy)) @@ -783,68 +768,66 @@ private constructor( /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)`. + * `PruningRefineBy.ofNumOccurrences(numOccurrences)`. */ - fun pruningRefineBy(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicNumOccurrences(publicNumOccurrences)) + fun pruningRefineBy(numOccurrences: PublicNumOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofNumOccurrences(numOccurrences)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)`. + * `PruningRefineBy.ofSetOccurrences(setOccurrences)`. */ - fun pruningRefineBy(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicSetOccurrences(publicSetOccurrences)) + fun pruningRefineBy(setOccurrences: PublicSetOccurrencesRefineBy) = + pruningRefineBy(PruningRefineBy.ofSetOccurrences(setOccurrences)) /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeComparativeTimestamp(publicRelativeComparativeTimestamp)`. + * Alias for calling [pruningRefineBy] with the following: + * ```java + * PublicSetOccurrencesRefineBy.builder() + * .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + * .setType(setType) + * .build() + * ``` */ - fun pruningRefineBy( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = + fun setOccurrencesPruningRefineBy(setType: String) = pruningRefineBy( - PruningRefineBy.ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) + PublicSetOccurrencesRefineBy.builder() + .type(PublicSetOccurrencesRefineBy.Type.SET_OCCURRENCES) + .setType(setType) + .build() ) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp)`. + * `PruningRefineBy.ofRelativeComparative(relativeComparative)`. */ - fun pruningRefineBy(publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - ) + fun pruningRefineBy(relativeComparative: PublicRelativeComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeComparative(relativeComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteComparativeTimestamp(publicAbsoluteComparativeTimestamp)`. + * `PruningRefineBy.ofRelativeRanged(relativeRanged)`. */ - fun pruningRefineBy( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - ) + fun pruningRefineBy(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofRelativeRanged(relativeRanged)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp)`. + * `PruningRefineBy.ofAbsoluteComparative(absoluteComparative)`. */ - fun pruningRefineBy(publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy) = - pruningRefineBy( - PruningRefineBy.ofPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - ) + fun pruningRefineBy(absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteComparative(absoluteComparative)) /** * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicAllHistory(publicAllHistory)`. + * `PruningRefineBy.ofAbsoluteRanged(absoluteRanged)`. */ - fun pruningRefineBy(publicAllHistory: PublicAllHistoryRefineBy) = - pruningRefineBy(PruningRefineBy.ofPublicAllHistory(publicAllHistory)) + fun pruningRefineBy(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + pruningRefineBy(PruningRefineBy.ofAbsoluteRanged(absoluteRanged)) + + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofAllHistory(allHistory)`. */ + fun pruningRefineBy(allHistory: PublicAllHistoryRefineBy) = + pruningRefineBy(PruningRefineBy.ofAllHistory(allHistory)) /** * Alias for calling [pruningRefineBy] with @@ -853,12 +836,9 @@ private constructor( fun pruningRefineBy(publicTimePointOperation: PublicTimePointOperation) = pruningRefineBy(PruningRefineBy.ofPublicTimePointOperation(publicTimePointOperation)) - /** - * Alias for calling [pruningRefineBy] with - * `PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)`. - */ - fun pruningRefineBy(publicRangedTimeOperation: PublicRangedTimeOperation) = - pruningRefineBy(PruningRefineBy.ofPublicRangedTimeOperation(publicRangedTimeOperation)) + /** Alias for calling [pruningRefineBy] with `PruningRefineBy.ofTimeRanged(timeRanged)`. */ + fun pruningRefineBy(timeRanged: PublicRangedTimeOperation) = + pruningRefineBy(PruningRefineBy.ofTimeRanged(timeRanged)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -2365,97 +2345,85 @@ private constructor( @JsonSerialize(using = CoalescingRefineBy.Serializer::class) class CoalescingRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -2471,8 +2439,8 @@ private constructor( * * Optional result = coalescingRefineBy.accept(new CoalescingRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -2490,27 +2458,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -2532,46 +2489,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -2580,10 +2531,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -2608,42 +2557,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -2655,49 +2599,44 @@ private constructor( } return other is CoalescingRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "CoalescingRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "CoalescingRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "CoalescingRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "CoalescingRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "CoalescingRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "CoalescingRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "CoalescingRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "CoalescingRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "CoalescingRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "CoalescingRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "CoalescingRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "CoalescingRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "CoalescingRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "CoalescingRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "CoalescingRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "CoalescingRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "CoalescingRefineBy{timeRanged=$timeRanged}" _json != null -> "CoalescingRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid CoalescingRefineBy") } @@ -2705,50 +2644,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - CoalescingRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + CoalescingRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - CoalescingRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + CoalescingRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - CoalescingRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = CoalescingRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = CoalescingRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + CoalescingRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - CoalescingRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = CoalescingRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = CoalescingRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + CoalescingRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - CoalescingRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + CoalescingRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = CoalescingRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - CoalescingRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + CoalescingRefineBy(timeRanged = timeRanged) } /** @@ -2757,33 +2688,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [CoalescingRefineBy] to a value of type [T]. @@ -2805,80 +2730,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): CoalescingRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { - CoalescingRefineBy(publicNumOccurrences = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - CoalescingRefineBy(publicSetOccurrences = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - CoalescingRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> CoalescingRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(numOccurrences = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(setOccurrences = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(relativeComparative = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(relativeRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(absoluteComparative = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { CoalescingRefineBy(absoluteRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(allHistory = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { CoalescingRefineBy(timeRanged = it, _json = json) } + ?: CoalescingRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + CoalescingRefineBy(publicTimePointOperation = it, _json = json) + } ?: CoalescingRefineBy(_json = json) } } @@ -2890,23 +2801,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid CoalescingRefineBy") } @@ -2918,97 +2824,85 @@ private constructor( @JsonSerialize(using = PruningRefineBy.Serializer::class) class PruningRefineBy private constructor( - private val publicNumOccurrences: PublicNumOccurrencesRefineBy? = null, - private val publicSetOccurrences: PublicSetOccurrencesRefineBy? = null, - private val publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy? = - null, - private val publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy? = null, - private val publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy? = - null, - private val publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy? = null, - private val publicAllHistory: PublicAllHistoryRefineBy? = null, + private val numOccurrences: PublicNumOccurrencesRefineBy? = null, + private val setOccurrences: PublicSetOccurrencesRefineBy? = null, + private val relativeComparative: PublicRelativeComparativeTimestampRefineBy? = null, + private val relativeRanged: PublicRelativeRangedTimestampRefineBy? = null, + private val absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy? = null, + private val absoluteRanged: PublicAbsoluteRangedTimestampRefineBy? = null, + private val allHistory: PublicAllHistoryRefineBy? = null, private val publicTimePointOperation: PublicTimePointOperation? = null, - private val publicRangedTimeOperation: PublicRangedTimeOperation? = null, + private val timeRanged: PublicRangedTimeOperation? = null, private val _json: JsonValue? = null, ) { - fun publicNumOccurrences(): Optional = - Optional.ofNullable(publicNumOccurrences) + fun numOccurrences(): Optional = + Optional.ofNullable(numOccurrences) - fun publicSetOccurrences(): Optional = - Optional.ofNullable(publicSetOccurrences) + fun setOccurrences(): Optional = + Optional.ofNullable(setOccurrences) - fun publicRelativeComparativeTimestamp(): - Optional = - Optional.ofNullable(publicRelativeComparativeTimestamp) + fun relativeComparative(): Optional = + Optional.ofNullable(relativeComparative) - fun publicRelativeRangedTimestamp(): Optional = - Optional.ofNullable(publicRelativeRangedTimestamp) + fun relativeRanged(): Optional = + Optional.ofNullable(relativeRanged) - fun publicAbsoluteComparativeTimestamp(): - Optional = - Optional.ofNullable(publicAbsoluteComparativeTimestamp) + fun absoluteComparative(): Optional = + Optional.ofNullable(absoluteComparative) - fun publicAbsoluteRangedTimestamp(): Optional = - Optional.ofNullable(publicAbsoluteRangedTimestamp) + fun absoluteRanged(): Optional = + Optional.ofNullable(absoluteRanged) - fun publicAllHistory(): Optional = - Optional.ofNullable(publicAllHistory) + fun allHistory(): Optional = Optional.ofNullable(allHistory) fun publicTimePointOperation(): Optional = Optional.ofNullable(publicTimePointOperation) - fun publicRangedTimeOperation(): Optional = - Optional.ofNullable(publicRangedTimeOperation) + fun timeRanged(): Optional = Optional.ofNullable(timeRanged) - fun isPublicNumOccurrences(): Boolean = publicNumOccurrences != null + fun isNumOccurrences(): Boolean = numOccurrences != null - fun isPublicSetOccurrences(): Boolean = publicSetOccurrences != null + fun isSetOccurrences(): Boolean = setOccurrences != null - fun isPublicRelativeComparativeTimestamp(): Boolean = - publicRelativeComparativeTimestamp != null + fun isRelativeComparative(): Boolean = relativeComparative != null - fun isPublicRelativeRangedTimestamp(): Boolean = publicRelativeRangedTimestamp != null + fun isRelativeRanged(): Boolean = relativeRanged != null - fun isPublicAbsoluteComparativeTimestamp(): Boolean = - publicAbsoluteComparativeTimestamp != null + fun isAbsoluteComparative(): Boolean = absoluteComparative != null - fun isPublicAbsoluteRangedTimestamp(): Boolean = publicAbsoluteRangedTimestamp != null + fun isAbsoluteRanged(): Boolean = absoluteRanged != null - fun isPublicAllHistory(): Boolean = publicAllHistory != null + fun isAllHistory(): Boolean = allHistory != null fun isPublicTimePointOperation(): Boolean = publicTimePointOperation != null - fun isPublicRangedTimeOperation(): Boolean = publicRangedTimeOperation != null + fun isTimeRanged(): Boolean = timeRanged != null - fun asPublicNumOccurrences(): PublicNumOccurrencesRefineBy = - publicNumOccurrences.getOrThrow("publicNumOccurrences") + fun asNumOccurrences(): PublicNumOccurrencesRefineBy = + numOccurrences.getOrThrow("numOccurrences") - fun asPublicSetOccurrences(): PublicSetOccurrencesRefineBy = - publicSetOccurrences.getOrThrow("publicSetOccurrences") + fun asSetOccurrences(): PublicSetOccurrencesRefineBy = + setOccurrences.getOrThrow("setOccurrences") - fun asPublicRelativeComparativeTimestamp(): PublicRelativeComparativeTimestampRefineBy = - publicRelativeComparativeTimestamp.getOrThrow("publicRelativeComparativeTimestamp") + fun asRelativeComparative(): PublicRelativeComparativeTimestampRefineBy = + relativeComparative.getOrThrow("relativeComparative") - fun asPublicRelativeRangedTimestamp(): PublicRelativeRangedTimestampRefineBy = - publicRelativeRangedTimestamp.getOrThrow("publicRelativeRangedTimestamp") + fun asRelativeRanged(): PublicRelativeRangedTimestampRefineBy = + relativeRanged.getOrThrow("relativeRanged") - fun asPublicAbsoluteComparativeTimestamp(): PublicAbsoluteComparativeTimestampRefineBy = - publicAbsoluteComparativeTimestamp.getOrThrow("publicAbsoluteComparativeTimestamp") + fun asAbsoluteComparative(): PublicAbsoluteComparativeTimestampRefineBy = + absoluteComparative.getOrThrow("absoluteComparative") - fun asPublicAbsoluteRangedTimestamp(): PublicAbsoluteRangedTimestampRefineBy = - publicAbsoluteRangedTimestamp.getOrThrow("publicAbsoluteRangedTimestamp") + fun asAbsoluteRanged(): PublicAbsoluteRangedTimestampRefineBy = + absoluteRanged.getOrThrow("absoluteRanged") - fun asPublicAllHistory(): PublicAllHistoryRefineBy = - publicAllHistory.getOrThrow("publicAllHistory") + fun asAllHistory(): PublicAllHistoryRefineBy = allHistory.getOrThrow("allHistory") fun asPublicTimePointOperation(): PublicTimePointOperation = publicTimePointOperation.getOrThrow("publicTimePointOperation") - fun asPublicRangedTimeOperation(): PublicRangedTimeOperation = - publicRangedTimeOperation.getOrThrow("publicRangedTimeOperation") + fun asTimeRanged(): PublicRangedTimeOperation = timeRanged.getOrThrow("timeRanged") fun _json(): Optional = Optional.ofNullable(_json) @@ -3024,8 +2918,8 @@ private constructor( * * Optional result = pruningRefineBy.accept(new PruningRefineBy.Visitor>() { * @Override - * public Optional visitPublicNumOccurrences(PublicNumOccurrencesRefineBy publicNumOccurrences) { - * return Optional.of(publicNumOccurrences.toString()); + * public Optional visitNumOccurrences(PublicNumOccurrencesRefineBy numOccurrences) { + * return Optional.of(numOccurrences.toString()); * } * * // ... @@ -3043,27 +2937,16 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - publicNumOccurrences != null -> - visitor.visitPublicNumOccurrences(publicNumOccurrences) - publicSetOccurrences != null -> - visitor.visitPublicSetOccurrences(publicSetOccurrences) - publicRelativeComparativeTimestamp != null -> - visitor.visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp - ) - publicRelativeRangedTimestamp != null -> - visitor.visitPublicRelativeRangedTimestamp(publicRelativeRangedTimestamp) - publicAbsoluteComparativeTimestamp != null -> - visitor.visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp - ) - publicAbsoluteRangedTimestamp != null -> - visitor.visitPublicAbsoluteRangedTimestamp(publicAbsoluteRangedTimestamp) - publicAllHistory != null -> visitor.visitPublicAllHistory(publicAllHistory) + numOccurrences != null -> visitor.visitNumOccurrences(numOccurrences) + setOccurrences != null -> visitor.visitSetOccurrences(setOccurrences) + relativeComparative != null -> visitor.visitRelativeComparative(relativeComparative) + relativeRanged != null -> visitor.visitRelativeRanged(relativeRanged) + absoluteComparative != null -> visitor.visitAbsoluteComparative(absoluteComparative) + absoluteRanged != null -> visitor.visitAbsoluteRanged(absoluteRanged) + allHistory != null -> visitor.visitAllHistory(allHistory) publicTimePointOperation != null -> visitor.visitPublicTimePointOperation(publicTimePointOperation) - publicRangedTimeOperation != null -> - visitor.visitPublicRangedTimeOperation(publicRangedTimeOperation) + timeRanged != null -> visitor.visitTimeRanged(timeRanged) else -> visitor.unknown(_json) } @@ -3085,46 +2968,40 @@ private constructor( accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) { - publicNumOccurrences.validate() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) { + numOccurrences.validate() } - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) { - publicSetOccurrences.validate() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) { + setOccurrences.validate() } - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ) { - publicRelativeComparativeTimestamp.validate() + relativeComparative.validate() } - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy ) { - publicRelativeRangedTimestamp.validate() + relativeRanged.validate() } - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ) { - publicAbsoluteComparativeTimestamp.validate() + absoluteComparative.validate() } - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy ) { - publicAbsoluteRangedTimestamp.validate() + absoluteRanged.validate() } - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) { - publicAllHistory.validate() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) { + allHistory.validate() } override fun visitPublicTimePointOperation( @@ -3133,10 +3010,8 @@ private constructor( publicTimePointOperation.validate() } - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) { - publicRangedTimeOperation.validate() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) { + timeRanged.validate() } } ) @@ -3161,42 +3036,37 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitPublicNumOccurrences( - publicNumOccurrences: PublicNumOccurrencesRefineBy - ) = publicNumOccurrences.validity() + override fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + numOccurrences.validity() - override fun visitPublicSetOccurrences( - publicSetOccurrences: PublicSetOccurrencesRefineBy - ) = publicSetOccurrences.validity() + override fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + setOccurrences.validity() - override fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: - PublicRelativeComparativeTimestampRefineBy - ) = publicRelativeComparativeTimestamp.validity() + override fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = relativeComparative.validity() - override fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = publicRelativeRangedTimestamp.validity() + override fun visitRelativeRanged( + relativeRanged: PublicRelativeRangedTimestampRefineBy + ) = relativeRanged.validity() - override fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: - PublicAbsoluteComparativeTimestampRefineBy - ) = publicAbsoluteComparativeTimestamp.validity() + override fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = absoluteComparative.validity() - override fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = publicAbsoluteRangedTimestamp.validity() + override fun visitAbsoluteRanged( + absoluteRanged: PublicAbsoluteRangedTimestampRefineBy + ) = absoluteRanged.validity() - override fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - publicAllHistory.validity() + override fun visitAllHistory(allHistory: PublicAllHistoryRefineBy) = + allHistory.validity() override fun visitPublicTimePointOperation( publicTimePointOperation: PublicTimePointOperation ) = publicTimePointOperation.validity() - override fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ) = publicRangedTimeOperation.validity() + override fun visitTimeRanged(timeRanged: PublicRangedTimeOperation) = + timeRanged.validity() override fun unknown(json: JsonValue?) = 0 } @@ -3208,49 +3078,44 @@ private constructor( } return other is PruningRefineBy && - publicNumOccurrences == other.publicNumOccurrences && - publicSetOccurrences == other.publicSetOccurrences && - publicRelativeComparativeTimestamp == other.publicRelativeComparativeTimestamp && - publicRelativeRangedTimestamp == other.publicRelativeRangedTimestamp && - publicAbsoluteComparativeTimestamp == other.publicAbsoluteComparativeTimestamp && - publicAbsoluteRangedTimestamp == other.publicAbsoluteRangedTimestamp && - publicAllHistory == other.publicAllHistory && + numOccurrences == other.numOccurrences && + setOccurrences == other.setOccurrences && + relativeComparative == other.relativeComparative && + relativeRanged == other.relativeRanged && + absoluteComparative == other.absoluteComparative && + absoluteRanged == other.absoluteRanged && + allHistory == other.allHistory && publicTimePointOperation == other.publicTimePointOperation && - publicRangedTimeOperation == other.publicRangedTimeOperation + timeRanged == other.timeRanged } override fun hashCode(): Int = Objects.hash( - publicNumOccurrences, - publicSetOccurrences, - publicRelativeComparativeTimestamp, - publicRelativeRangedTimestamp, - publicAbsoluteComparativeTimestamp, - publicAbsoluteRangedTimestamp, - publicAllHistory, + numOccurrences, + setOccurrences, + relativeComparative, + relativeRanged, + absoluteComparative, + absoluteRanged, + allHistory, publicTimePointOperation, - publicRangedTimeOperation, + timeRanged, ) override fun toString(): String = when { - publicNumOccurrences != null -> - "PruningRefineBy{publicNumOccurrences=$publicNumOccurrences}" - publicSetOccurrences != null -> - "PruningRefineBy{publicSetOccurrences=$publicSetOccurrences}" - publicRelativeComparativeTimestamp != null -> - "PruningRefineBy{publicRelativeComparativeTimestamp=$publicRelativeComparativeTimestamp}" - publicRelativeRangedTimestamp != null -> - "PruningRefineBy{publicRelativeRangedTimestamp=$publicRelativeRangedTimestamp}" - publicAbsoluteComparativeTimestamp != null -> - "PruningRefineBy{publicAbsoluteComparativeTimestamp=$publicAbsoluteComparativeTimestamp}" - publicAbsoluteRangedTimestamp != null -> - "PruningRefineBy{publicAbsoluteRangedTimestamp=$publicAbsoluteRangedTimestamp}" - publicAllHistory != null -> "PruningRefineBy{publicAllHistory=$publicAllHistory}" + numOccurrences != null -> "PruningRefineBy{numOccurrences=$numOccurrences}" + setOccurrences != null -> "PruningRefineBy{setOccurrences=$setOccurrences}" + relativeComparative != null -> + "PruningRefineBy{relativeComparative=$relativeComparative}" + relativeRanged != null -> "PruningRefineBy{relativeRanged=$relativeRanged}" + absoluteComparative != null -> + "PruningRefineBy{absoluteComparative=$absoluteComparative}" + absoluteRanged != null -> "PruningRefineBy{absoluteRanged=$absoluteRanged}" + allHistory != null -> "PruningRefineBy{allHistory=$allHistory}" publicTimePointOperation != null -> "PruningRefineBy{publicTimePointOperation=$publicTimePointOperation}" - publicRangedTimeOperation != null -> - "PruningRefineBy{publicRangedTimeOperation=$publicRangedTimeOperation}" + timeRanged != null -> "PruningRefineBy{timeRanged=$timeRanged}" _json != null -> "PruningRefineBy{_unknown=$_json}" else -> throw IllegalStateException("Invalid PruningRefineBy") } @@ -3258,50 +3123,42 @@ private constructor( companion object { @JvmStatic - fun ofPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy) = - PruningRefineBy(publicNumOccurrences = publicNumOccurrences) + fun ofNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy) = + PruningRefineBy(numOccurrences = numOccurrences) @JvmStatic - fun ofPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy) = - PruningRefineBy(publicSetOccurrences = publicSetOccurrences) + fun ofSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy) = + PruningRefineBy(setOccurrences = setOccurrences) @JvmStatic - fun ofPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicRelativeComparativeTimestamp = publicRelativeComparativeTimestamp - ) + fun ofRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy + ) = PruningRefineBy(relativeComparative = relativeComparative) @JvmStatic - fun ofPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ) = PruningRefineBy(publicRelativeRangedTimestamp = publicRelativeRangedTimestamp) + fun ofRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy) = + PruningRefineBy(relativeRanged = relativeRanged) @JvmStatic - fun ofPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy - ) = - PruningRefineBy( - publicAbsoluteComparativeTimestamp = publicAbsoluteComparativeTimestamp - ) + fun ofAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy + ) = PruningRefineBy(absoluteComparative = absoluteComparative) @JvmStatic - fun ofPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ) = PruningRefineBy(publicAbsoluteRangedTimestamp = publicAbsoluteRangedTimestamp) + fun ofAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy) = + PruningRefineBy(absoluteRanged = absoluteRanged) @JvmStatic - fun ofPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy) = - PruningRefineBy(publicAllHistory = publicAllHistory) + fun ofAllHistory(allHistory: PublicAllHistoryRefineBy) = + PruningRefineBy(allHistory = allHistory) @JvmStatic fun ofPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation) = PruningRefineBy(publicTimePointOperation = publicTimePointOperation) @JvmStatic - fun ofPublicRangedTimeOperation(publicRangedTimeOperation: PublicRangedTimeOperation) = - PruningRefineBy(publicRangedTimeOperation = publicRangedTimeOperation) + fun ofTimeRanged(timeRanged: PublicRangedTimeOperation) = + PruningRefineBy(timeRanged = timeRanged) } /** @@ -3310,33 +3167,27 @@ private constructor( */ interface Visitor { - fun visitPublicNumOccurrences(publicNumOccurrences: PublicNumOccurrencesRefineBy): T + fun visitNumOccurrences(numOccurrences: PublicNumOccurrencesRefineBy): T - fun visitPublicSetOccurrences(publicSetOccurrences: PublicSetOccurrencesRefineBy): T + fun visitSetOccurrences(setOccurrences: PublicSetOccurrencesRefineBy): T - fun visitPublicRelativeComparativeTimestamp( - publicRelativeComparativeTimestamp: PublicRelativeComparativeTimestampRefineBy + fun visitRelativeComparative( + relativeComparative: PublicRelativeComparativeTimestampRefineBy ): T - fun visitPublicRelativeRangedTimestamp( - publicRelativeRangedTimestamp: PublicRelativeRangedTimestampRefineBy - ): T + fun visitRelativeRanged(relativeRanged: PublicRelativeRangedTimestampRefineBy): T - fun visitPublicAbsoluteComparativeTimestamp( - publicAbsoluteComparativeTimestamp: PublicAbsoluteComparativeTimestampRefineBy + fun visitAbsoluteComparative( + absoluteComparative: PublicAbsoluteComparativeTimestampRefineBy ): T - fun visitPublicAbsoluteRangedTimestamp( - publicAbsoluteRangedTimestamp: PublicAbsoluteRangedTimestampRefineBy - ): T + fun visitAbsoluteRanged(absoluteRanged: PublicAbsoluteRangedTimestampRefineBy): T - fun visitPublicAllHistory(publicAllHistory: PublicAllHistoryRefineBy): T + fun visitAllHistory(allHistory: PublicAllHistoryRefineBy): T fun visitPublicTimePointOperation(publicTimePointOperation: PublicTimePointOperation): T - fun visitPublicRangedTimeOperation( - publicRangedTimeOperation: PublicRangedTimeOperation - ): T + fun visitTimeRanged(timeRanged: PublicRangedTimeOperation): T /** * Maps an unknown variant of [PruningRefineBy] to a value of type [T]. @@ -3357,76 +3208,66 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): PruningRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicNumOccurrences = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { PruningRefineBy(publicSetOccurrences = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicRelativeRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteComparativeTimestamp = it, - _json = json, - ) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy( - publicAbsoluteRangedTimestamp = it, - _json = json, - ) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicAllHistory = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicTimePointOperation = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(publicRangedTimeOperation = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> PruningRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NUM_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(numOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "SET_OCCURRENCES" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(setOccurrences = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "RELATIVE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_COMPARATIVE" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteComparative = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ABSOLUTE_RANGED" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "ALL_HISTORY" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(allHistory = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "TIME_RANGED" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { PruningRefineBy(timeRanged = it, _json = json) } + ?: PruningRefineBy(_json = json) + } } + + return tryDeserialize(node, jacksonTypeRef())?.let { + PruningRefineBy(publicTimePointOperation = it, _json = json) + } ?: PruningRefineBy(_json = json) } } @@ -3438,23 +3279,18 @@ private constructor( provider: SerializerProvider, ) { when { - value.publicNumOccurrences != null -> - generator.writeObject(value.publicNumOccurrences) - value.publicSetOccurrences != null -> - generator.writeObject(value.publicSetOccurrences) - value.publicRelativeComparativeTimestamp != null -> - generator.writeObject(value.publicRelativeComparativeTimestamp) - value.publicRelativeRangedTimestamp != null -> - generator.writeObject(value.publicRelativeRangedTimestamp) - value.publicAbsoluteComparativeTimestamp != null -> - generator.writeObject(value.publicAbsoluteComparativeTimestamp) - value.publicAbsoluteRangedTimestamp != null -> - generator.writeObject(value.publicAbsoluteRangedTimestamp) - value.publicAllHistory != null -> generator.writeObject(value.publicAllHistory) + value.numOccurrences != null -> generator.writeObject(value.numOccurrences) + value.setOccurrences != null -> generator.writeObject(value.setOccurrences) + value.relativeComparative != null -> + generator.writeObject(value.relativeComparative) + value.relativeRanged != null -> generator.writeObject(value.relativeRanged) + value.absoluteComparative != null -> + generator.writeObject(value.absoluteComparative) + value.absoluteRanged != null -> generator.writeObject(value.absoluteRanged) + value.allHistory != null -> generator.writeObject(value.allHistory) value.publicTimePointOperation != null -> generator.writeObject(value.publicTimePointOperation) - value.publicRangedTimeOperation != null -> - generator.writeObject(value.publicRangedTimeOperation) + value.timeRanged != null -> generator.writeObject(value.timeRanged) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid PruningRefineBy") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/properties/PropertyUpdate.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/properties/PropertyUpdate.kt index 4dd45cbd..1cde4c63 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/properties/PropertyUpdate.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/crm/properties/PropertyUpdate.kt @@ -35,6 +35,7 @@ private constructor( private val numberDisplayHint: JsonField, private val options: JsonField>, private val showCurrencySymbol: JsonField, + private val textDisplayHint: JsonField, private val type: JsonField, private val additionalProperties: MutableMap, ) { @@ -69,6 +70,9 @@ private constructor( @JsonProperty("showCurrencySymbol") @ExcludeMissing showCurrencySymbol: JsonField = JsonMissing.of(), + @JsonProperty("textDisplayHint") + @ExcludeMissing + textDisplayHint: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), ) : this( calculationFormula, @@ -83,6 +87,7 @@ private constructor( numberDisplayHint, options, showCurrencySymbol, + textDisplayHint, type, mutableMapOf(), ) @@ -182,6 +187,13 @@ private constructor( fun showCurrencySymbol(): Optional = showCurrencySymbol.getOptional("showCurrencySymbol") + /** + * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun textDisplayHint(): Optional = + textDisplayHint.getOptional("textDisplayHint") + /** * The data type of the property. * @@ -286,6 +298,15 @@ private constructor( @ExcludeMissing fun _showCurrencySymbol(): JsonField = showCurrencySymbol + /** + * Returns the raw JSON value of [textDisplayHint]. + * + * Unlike [textDisplayHint], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("textDisplayHint") + @ExcludeMissing + fun _textDisplayHint(): JsonField = textDisplayHint + /** * Returns the raw JSON value of [type]. * @@ -326,6 +347,7 @@ private constructor( private var numberDisplayHint: JsonField = JsonMissing.of() private var options: JsonField>? = null private var showCurrencySymbol: JsonField = JsonMissing.of() + private var textDisplayHint: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -343,6 +365,7 @@ private constructor( numberDisplayHint = propertyUpdate.numberDisplayHint options = propertyUpdate.options.map { it.toMutableList() } showCurrencySymbol = propertyUpdate.showCurrencySymbol + textDisplayHint = propertyUpdate.textDisplayHint type = propertyUpdate.type additionalProperties = propertyUpdate.additionalProperties.toMutableMap() } @@ -515,6 +538,20 @@ private constructor( this.showCurrencySymbol = showCurrencySymbol } + fun textDisplayHint(textDisplayHint: TextDisplayHint) = + textDisplayHint(JsonField.of(textDisplayHint)) + + /** + * Sets [Builder.textDisplayHint] to an arbitrary JSON value. + * + * You should usually call [Builder.textDisplayHint] with a well-typed [TextDisplayHint] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun textDisplayHint(textDisplayHint: JsonField) = apply { + this.textDisplayHint = textDisplayHint + } + /** The data type of the property. */ fun type(type: Type) = type(JsonField.of(type)) @@ -564,6 +601,7 @@ private constructor( numberDisplayHint, (options ?: JsonMissing.of()).map { it.toImmutable() }, showCurrencySymbol, + textDisplayHint, type, additionalProperties.toMutableMap(), ) @@ -596,6 +634,7 @@ private constructor( numberDisplayHint().ifPresent { it.validate() } options().ifPresent { it.forEach { it.validate() } } showCurrencySymbol() + textDisplayHint().ifPresent { it.validate() } type().ifPresent { it.validate() } validated = true } @@ -627,6 +666,7 @@ private constructor( (numberDisplayHint.asKnown().getOrNull()?.validity() ?: 0) + (options.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (showCurrencySymbol.asKnown().isPresent) 1 else 0) + + (textDisplayHint.asKnown().getOrNull()?.validity() ?: 0) + (type.asKnown().getOrNull()?.validity() ?: 0) /** Controls how the property appears in HubSpot. */ @@ -988,6 +1028,180 @@ private constructor( override fun toString() = value.toString() } + class TextDisplayHint @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val DOMAIN_NAME = of("domain_name") + + @JvmField val EMAIL = of("email") + + @JvmField val IP_ADDRESS = of("ip_address") + + @JvmField val MULTI_LINE = of("multi_line") + + @JvmField val PHONE_NUMBER = of("phone_number") + + @JvmField val PHYSICAL_ADDRESS = of("physical_address") + + @JvmField val POSTAL_CODE = of("postal_code") + + @JvmField val UNFORMATTED_SINGLE_LINE = of("unformatted_single_line") + + @JvmStatic fun of(value: String) = TextDisplayHint(JsonField.of(value)) + } + + /** An enum containing [TextDisplayHint]'s known values. */ + enum class Known { + DOMAIN_NAME, + EMAIL, + IP_ADDRESS, + MULTI_LINE, + PHONE_NUMBER, + PHYSICAL_ADDRESS, + POSTAL_CODE, + UNFORMATTED_SINGLE_LINE, + } + + /** + * An enum containing [TextDisplayHint]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [TextDisplayHint] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DOMAIN_NAME, + EMAIL, + IP_ADDRESS, + MULTI_LINE, + PHONE_NUMBER, + PHYSICAL_ADDRESS, + POSTAL_CODE, + UNFORMATTED_SINGLE_LINE, + /** + * An enum member indicating that [TextDisplayHint] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DOMAIN_NAME -> Value.DOMAIN_NAME + EMAIL -> Value.EMAIL + IP_ADDRESS -> Value.IP_ADDRESS + MULTI_LINE -> Value.MULTI_LINE + PHONE_NUMBER -> Value.PHONE_NUMBER + PHYSICAL_ADDRESS -> Value.PHYSICAL_ADDRESS + POSTAL_CODE -> Value.POSTAL_CODE + UNFORMATTED_SINGLE_LINE -> Value.UNFORMATTED_SINGLE_LINE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws HubSpotInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + DOMAIN_NAME -> Known.DOMAIN_NAME + EMAIL -> Known.EMAIL + IP_ADDRESS -> Known.IP_ADDRESS + MULTI_LINE -> Known.MULTI_LINE + PHONE_NUMBER -> Known.PHONE_NUMBER + PHYSICAL_ADDRESS -> Known.PHYSICAL_ADDRESS + POSTAL_CODE -> Known.POSTAL_CODE + UNFORMATTED_SINGLE_LINE -> Known.UNFORMATTED_SINGLE_LINE + else -> throw HubSpotInvalidDataException("Unknown TextDisplayHint: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws HubSpotInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { HubSpotInvalidDataException("Value is not a String") } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws HubSpotInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): TextDisplayHint = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: HubSpotInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TextDisplayHint && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** The data type of the property. */ class Type @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -1171,6 +1385,7 @@ private constructor( numberDisplayHint == other.numberDisplayHint && options == other.options && showCurrencySymbol == other.showCurrencySymbol && + textDisplayHint == other.textDisplayHint && type == other.type && additionalProperties == other.additionalProperties } @@ -1189,6 +1404,7 @@ private constructor( numberDisplayHint, options, showCurrencySymbol, + textDisplayHint, type, additionalProperties, ) @@ -1197,5 +1413,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PropertyUpdate{calculationFormula=$calculationFormula, currencyPropertyName=$currencyPropertyName, description=$description, displayOrder=$displayOrder, fieldType=$fieldType, formField=$formField, groupName=$groupName, hidden=$hidden, label=$label, numberDisplayHint=$numberDisplayHint, options=$options, showCurrencySymbol=$showCurrencySymbol, type=$type, additionalProperties=$additionalProperties}" + "PropertyUpdate{calculationFormula=$calculationFormula, currencyPropertyName=$currencyPropertyName, description=$description, displayOrder=$displayOrder, fieldType=$fieldType, formField=$formField, groupName=$groupName, hidden=$hidden, label=$label, numberDisplayHint=$numberDisplayHint, options=$options, showCurrencySymbol=$showCurrencySymbol, textDisplayHint=$textDisplayHint, type=$type, additionalProperties=$additionalProperties}" } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/AllPropertyTypesOperation.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/AllPropertyTypesOperation.kt index 94ba0560..9a8ead2c 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/AllPropertyTypesOperation.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/AllPropertyTypesOperation.kt @@ -304,6 +304,23 @@ private constructor( fun coalescingRefineBy(setOccurrences: SetOccurrencesRefineBy) = coalescingRefineBy(CoalescingRefineBy.ofSetOccurrences(setOccurrences)) + /** + * Alias for calling [coalescingRefineBy] with the following: + * ```java + * SetOccurrencesRefineBy.builder() + * .type(SetOccurrencesRefineBy.Type.SET_OCCURRENCES_REFINE_BY) + * .setType(setType) + * .build() + * ``` + */ + fun setOccurrencesCoalescingRefineBy(setType: SetOccurrencesRefineBy.SetType) = + coalescingRefineBy( + SetOccurrencesRefineBy.builder() + .type(SetOccurrencesRefineBy.Type.SET_OCCURRENCES_REFINE_BY) + .setType(setType) + .build() + ) + fun includeObjectsWithNoValueSet(includeObjectsWithNoValueSet: Boolean) = includeObjectsWithNoValueSet(JsonField.of(includeObjectsWithNoValueSet)) @@ -737,29 +754,22 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): CoalescingRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(numOccurrences = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(setOccurrences = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> CoalescingRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NumOccurrencesRefineBy" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + CoalescingRefineBy(numOccurrences = it, _json = json) + } ?: CoalescingRefineBy(_json = json) + } + "SetOccurrencesRefineBy" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + CoalescingRefineBy(setOccurrences = it, _json = json) + } ?: CoalescingRefineBy(_json = json) + } } + + return CoalescingRefineBy(_json = json) } } @@ -1407,34 +1417,52 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): PruningRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() + + when (type) { + "RelativeComparativeTimestampRefineBy" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { + PruningRefineBy(relativeComparativeTimestamp = it, _json = json) + } ?: PruningRefineBy(_json = json) + } + "RelativeRangedTimestampRefineBy" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeRangedTimestamp = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "AbsoluteComparativeTimestampRefineBy" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { + PruningRefineBy(absoluteComparativeTimestamp = it, _json = json) + } ?: PruningRefineBy(_json = json) + } + "AbsoluteRangedTimestampRefineBy" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteRangedTimestamp = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "AllHistoryRefineBy" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + PruningRefineBy(allHistory = it, _json = json) + } ?: PruningRefineBy(_json = json) + } + } val bestMatches = sequenceOf( - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy(relativeComparativeTimestamp = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - PruningRefineBy(relativeRangedTimestamp = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy(absoluteComparativeTimestamp = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - PruningRefineBy(absoluteRangedTimestamp = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(allHistory = it, _json = json) - }, tryDeserialize(node, jacksonTypeRef())?.let { PruningRefineBy(timePointOperation = it, _json = json) }, diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/IndexedTimePoint.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/IndexedTimePoint.kt index db9d80c8..7f2629b7 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/IndexedTimePoint.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/IndexedTimePoint.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -224,9 +223,43 @@ private constructor( /** Alias for calling [indexReference] with `IndexReference.ofWeek(week)`. */ fun indexReference(week: WeekReference) = indexReference(IndexReference.ofWeek(week)) + /** + * Alias for calling [indexReference] with the following: + * ```java + * WeekReference.builder() + * .referenceType(WeekReference.ReferenceType.WEEK) + * .dayOfWeek(dayOfWeek) + * .build() + * ``` + */ + fun weekIndexReference(dayOfWeek: WeekReference.DayOfWeek) = + indexReference( + WeekReference.builder() + .referenceType(WeekReference.ReferenceType.WEEK) + .dayOfWeek(dayOfWeek) + .build() + ) + /** Alias for calling [indexReference] with `IndexReference.ofMonth(month)`. */ fun indexReference(month: MonthReference) = indexReference(IndexReference.ofMonth(month)) + /** + * Alias for calling [indexReference] with the following: + * ```java + * MonthReference.builder() + * .referenceType(MonthReference.ReferenceType.MONTH) + * .day(day) + * .build() + * ``` + */ + fun monthIndexReference(day: Int) = + indexReference( + MonthReference.builder() + .referenceType(MonthReference.ReferenceType.MONTH) + .day(day) + .build() + ) + /** Alias for calling [indexReference] with `IndexReference.ofQuarter(quarter)`. */ fun indexReference(quarter: QuarterReference) = indexReference(IndexReference.ofQuarter(quarter)) @@ -692,47 +725,53 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): IndexReference { val json = JsonValue.fromJsonNode(node) - - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - IndexReference(now = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - IndexReference(today = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - IndexReference(week = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - IndexReference(month = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - IndexReference(quarter = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - IndexReference(fiscalQuarter = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - IndexReference(year = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - IndexReference(fiscalYear = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> IndexReference(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + val referenceType = + json.asObject().getOrNull()?.get("referenceType")?.asString()?.getOrNull() + + when (referenceType) { + "NOW" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + IndexReference(now = it, _json = json) + } ?: IndexReference(_json = json) + } + "TODAY" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + IndexReference(today = it, _json = json) + } ?: IndexReference(_json = json) + } + "WEEK" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + IndexReference(week = it, _json = json) + } ?: IndexReference(_json = json) + } + "MONTH" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + IndexReference(month = it, _json = json) + } ?: IndexReference(_json = json) + } + "QUARTER" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + IndexReference(quarter = it, _json = json) + } ?: IndexReference(_json = json) + } + "FISCAL_QUARTER" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + IndexReference(fiscalQuarter = it, _json = json) + } ?: IndexReference(_json = json) + } + "YEAR" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + IndexReference(year = it, _json = json) + } ?: IndexReference(_json = json) + } + "FISCAL_YEAR" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + IndexReference(fiscalYear = it, _json = json) + } ?: IndexReference(_json = json) + } } + + return IndexReference(_json = json) } } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/MultiStringPropertyOperation.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/MultiStringPropertyOperation.kt index 32b4d6cf..779585d1 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/MultiStringPropertyOperation.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/MultiStringPropertyOperation.kt @@ -325,6 +325,23 @@ private constructor( fun coalescingRefineBy(setOccurrences: SetOccurrencesRefineBy) = coalescingRefineBy(CoalescingRefineBy.ofSetOccurrences(setOccurrences)) + /** + * Alias for calling [coalescingRefineBy] with the following: + * ```java + * SetOccurrencesRefineBy.builder() + * .type(SetOccurrencesRefineBy.Type.SET_OCCURRENCES_REFINE_BY) + * .setType(setType) + * .build() + * ``` + */ + fun setOccurrencesCoalescingRefineBy(setType: SetOccurrencesRefineBy.SetType) = + coalescingRefineBy( + SetOccurrencesRefineBy.builder() + .type(SetOccurrencesRefineBy.Type.SET_OCCURRENCES_REFINE_BY) + .setType(setType) + .build() + ) + fun includeObjectsWithNoValueSet(includeObjectsWithNoValueSet: Boolean) = includeObjectsWithNoValueSet(JsonField.of(includeObjectsWithNoValueSet)) @@ -787,29 +804,22 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): CoalescingRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(numOccurrences = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - CoalescingRefineBy(setOccurrences = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> CoalescingRefineBy(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (type) { + "NumOccurrencesRefineBy" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + CoalescingRefineBy(numOccurrences = it, _json = json) + } ?: CoalescingRefineBy(_json = json) + } + "SetOccurrencesRefineBy" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + CoalescingRefineBy(setOccurrences = it, _json = json) + } ?: CoalescingRefineBy(_json = json) + } } + + return CoalescingRefineBy(_json = json) } } @@ -1481,34 +1491,52 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): PruningRefineBy { val json = JsonValue.fromJsonNode(node) + val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() + + when (type) { + "RelativeComparativeTimestampRefineBy" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { + PruningRefineBy(relativeComparativeTimestamp = it, _json = json) + } ?: PruningRefineBy(_json = json) + } + "RelativeRangedTimestampRefineBy" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(relativeRangedTimestamp = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "AbsoluteComparativeTimestampRefineBy" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { + PruningRefineBy(absoluteComparativeTimestamp = it, _json = json) + } ?: PruningRefineBy(_json = json) + } + "AbsoluteRangedTimestampRefineBy" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { PruningRefineBy(absoluteRangedTimestamp = it, _json = json) } + ?: PruningRefineBy(_json = json) + } + "AllHistoryRefineBy" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + PruningRefineBy(allHistory = it, _json = json) + } ?: PruningRefineBy(_json = json) + } + } val bestMatches = sequenceOf( - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy(relativeComparativeTimestamp = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - PruningRefineBy(relativeRangedTimestamp = it, _json = json) - }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { - PruningRefineBy(absoluteComparativeTimestamp = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { - PruningRefineBy(absoluteRangedTimestamp = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - PruningRefineBy(allHistory = it, _json = json) - }, tryDeserialize(node, jacksonTypeRef())?.let { PruningRefineBy(timePointOperation = it, _json = json) }, diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/PropertyFilter.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/PropertyFilter.kt index af1e450a..20fd13bd 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/PropertyFilter.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/PropertyFilter.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -228,69 +227,56 @@ private constructor( */ fun operation(operation: JsonField) = apply { this.operation = operation } - /** Alias for calling [operation] with `Operation.ofBoolProperty(boolProperty)`. */ - fun operation(boolProperty: BoolPropertyOperation) = - operation(Operation.ofBoolProperty(boolProperty)) + /** Alias for calling [operation] with `Operation.ofBool(bool)`. */ + fun operation(bool: BoolPropertyOperation) = operation(Operation.ofBool(bool)) - /** Alias for calling [operation] with `Operation.ofNumberProperty(numberProperty)`. */ - fun operation(numberProperty: NumberPropertyOperation) = - operation(Operation.ofNumberProperty(numberProperty)) + /** Alias for calling [operation] with `Operation.ofNumber(number)`. */ + fun operation(number: NumberPropertyOperation) = operation(Operation.ofNumber(number)) - /** Alias for calling [operation] with `Operation.ofStringProperty(stringProperty)`. */ - fun operation(stringProperty: StringPropertyOperation) = - operation(Operation.ofStringProperty(stringProperty)) + /** Alias for calling [operation] with `Operation.ofString(string)`. */ + fun operation(string: StringPropertyOperation) = operation(Operation.ofString(string)) - /** Alias for calling [operation] with `Operation.ofDateTimeProperty(dateTimeProperty)`. */ - fun operation(dateTimeProperty: DateTimePropertyOperation) = - operation(Operation.ofDateTimeProperty(dateTimeProperty)) + /** Alias for calling [operation] with `Operation.ofDatetime(datetime)`. */ + fun operation(datetime: DateTimePropertyOperation) = + operation(Operation.ofDatetime(datetime)) - /** - * Alias for calling [operation] with `Operation.ofRangedDateProperty(rangedDateProperty)`. - */ - fun operation(rangedDateProperty: RangedDatePropertyOperation) = - operation(Operation.ofRangedDateProperty(rangedDateProperty)) + /** Alias for calling [operation] with `Operation.ofDatetimeRanged(datetimeRanged)`. */ + fun operation(datetimeRanged: RangedDatePropertyOperation) = + operation(Operation.ofDatetimeRanged(datetimeRanged)) /** * Alias for calling [operation] with - * `Operation.ofComparativeDateProperty(comparativeDateProperty)`. + * `Operation.ofDatetimeComparative(datetimeComparative)`. */ - fun operation(comparativeDateProperty: ComparativeDatePropertyOperation) = - operation(Operation.ofComparativeDateProperty(comparativeDateProperty)) + fun operation(datetimeComparative: ComparativeDatePropertyOperation) = + operation(Operation.ofDatetimeComparative(datetimeComparative)) - /** - * Alias for calling [operation] with - * `Operation.ofComparativeBoolProperty(comparativeBoolProperty)`. - */ - fun operation(comparativeBoolProperty: ComparativeBoolPropertyOperation) = - operation(Operation.ofComparativeBoolProperty(comparativeBoolProperty)) + /** Alias for calling [operation] with `Operation.ofBoolComparative(boolComparative)`. */ + fun operation(boolComparative: ComparativeBoolPropertyOperation) = + operation(Operation.ofBoolComparative(boolComparative)) /** - * Alias for calling [operation] with - * `Operation.ofComparativeNumberProperty(comparativeNumberProperty)`. + * Alias for calling [operation] with `Operation.ofNumberComparative(numberComparative)`. */ - fun operation(comparativeNumberProperty: ComparativeNumberPropertyOperation) = - operation(Operation.ofComparativeNumberProperty(comparativeNumberProperty)) + fun operation(numberComparative: ComparativeNumberPropertyOperation) = + operation(Operation.ofNumberComparative(numberComparative)) /** - * Alias for calling [operation] with - * `Operation.ofComparativeStringProperty(comparativeStringProperty)`. + * Alias for calling [operation] with `Operation.ofStringComparative(stringComparative)`. */ - fun operation(comparativeStringProperty: ComparativeStringPropertyOperation) = - operation(Operation.ofComparativeStringProperty(comparativeStringProperty)) + fun operation(stringComparative: ComparativeStringPropertyOperation) = + operation(Operation.ofStringComparative(stringComparative)) /** * Alias for calling [operation] with - * `Operation.ofComparativePropertyUpdated(comparativePropertyUpdated)`. + * `Operation.ofPropertyUpdatedComparative(propertyUpdatedComparative)`. */ - fun operation(comparativePropertyUpdated: ComparativePropertyUpdatedOperation) = - operation(Operation.ofComparativePropertyUpdated(comparativePropertyUpdated)) + fun operation(propertyUpdatedComparative: ComparativePropertyUpdatedOperation) = + operation(Operation.ofPropertyUpdatedComparative(propertyUpdatedComparative)) - /** - * Alias for calling [operation] with - * `Operation.ofRollingDateRangeProperty(rollingDateRangeProperty)`. - */ - fun operation(rollingDateRangeProperty: RollingDateRangePropertyOperation) = - operation(Operation.ofRollingDateRangeProperty(rollingDateRangeProperty)) + /** Alias for calling [operation] with `Operation.ofDatetimeRolling(datetimeRolling)`. */ + fun operation(datetimeRolling: RollingDateRangePropertyOperation) = + operation(Operation.ofDatetimeRolling(datetimeRolling)) /** * Alias for calling [operation] with @@ -299,52 +285,38 @@ private constructor( fun operation(rollingPropertyUpdated: RollingPropertyUpdatedOperation) = operation(Operation.ofRollingPropertyUpdated(rollingPropertyUpdated)) - /** - * Alias for calling [operation] with - * `Operation.ofEnumerationProperty(enumerationProperty)`. - */ - fun operation(enumerationProperty: EnumerationPropertyOperation) = - operation(Operation.ofEnumerationProperty(enumerationProperty)) + /** Alias for calling [operation] with `Operation.ofEnumeration(enumeration)`. */ + fun operation(enumeration: EnumerationPropertyOperation) = + operation(Operation.ofEnumeration(enumeration)) - /** Alias for calling [operation] with `Operation.ofAllPropertyTypes(allPropertyTypes)`. */ - fun operation(allPropertyTypes: AllPropertyTypesOperation) = - operation(Operation.ofAllPropertyTypes(allPropertyTypes)) + /** Alias for calling [operation] with `Operation.ofAlltypes(alltypes)`. */ + fun operation(alltypes: AllPropertyTypesOperation) = + operation(Operation.ofAlltypes(alltypes)) - /** - * Alias for calling [operation] with - * `Operation.ofRangedNumberProperty(rangedNumberProperty)`. - */ - fun operation(rangedNumberProperty: RangedNumberPropertyOperation) = - operation(Operation.ofRangedNumberProperty(rangedNumberProperty)) + /** Alias for calling [operation] with `Operation.ofNumberRanged(numberRanged)`. */ + fun operation(numberRanged: RangedNumberPropertyOperation) = + operation(Operation.ofNumberRanged(numberRanged)) - /** - * Alias for calling [operation] with - * `Operation.ofMultiStringProperty(multiStringProperty)`. - */ - fun operation(multiStringProperty: MultiStringPropertyOperation) = - operation(Operation.ofMultiStringProperty(multiStringProperty)) + /** Alias for calling [operation] with `Operation.ofMultistring(multistring)`. */ + fun operation(multistring: MultiStringPropertyOperation) = + operation(Operation.ofMultistring(multistring)) - /** Alias for calling [operation] with `Operation.ofDateProperty(dateProperty)`. */ - fun operation(dateProperty: DatePropertyOperation) = - operation(Operation.ofDateProperty(dateProperty)) + /** Alias for calling [operation] with `Operation.ofDate(date)`. */ + fun operation(date: DatePropertyOperation) = operation(Operation.ofDate(date)) - /** - * Alias for calling [operation] with - * `Operation.ofCalendarDateProperty(calendarDateProperty)`. - */ - fun operation(calendarDateProperty: CalendarDatePropertyOperation) = - operation(Operation.ofCalendarDateProperty(calendarDateProperty)) + /** Alias for calling [operation] with `Operation.ofCalendarDate(calendarDate)`. */ + fun operation(calendarDate: CalendarDatePropertyOperation) = + operation(Operation.ofCalendarDate(calendarDate)) - /** Alias for calling [operation] with `Operation.ofTimePoint(timePoint)`. */ - fun operation(timePoint: TimePointOperation) = operation(Operation.ofTimePoint(timePoint)) + /** Alias for calling [operation] with `Operation.ofTimepoint(timepoint)`. */ + fun operation(timepoint: TimePointOperation) = operation(Operation.ofTimepoint(timepoint)) - /** Alias for calling [operation] with `Operation.ofRangedTime(rangedTime)`. */ - fun operation(rangedTime: RangedTimeOperation) = - operation(Operation.ofRangedTime(rangedTime)) + /** Alias for calling [operation] with `Operation.ofRangedtime(rangedtime)`. */ + fun operation(rangedtime: RangedTimeOperation) = + operation(Operation.ofRangedtime(rangedtime)) - /** Alias for calling [operation] with `Operation.ofRegexProperty(regexProperty)`. */ - fun operation(regexProperty: RegexPropertyOperation) = - operation(Operation.ofRegexProperty(regexProperty)) + /** Alias for calling [operation] with `Operation.ofRegex(regex)`. */ + fun operation(regex: RegexPropertyOperation) = operation(Operation.ofRegex(regex)) fun property(property: String) = property(JsonField.of(property)) @@ -620,187 +592,175 @@ private constructor( @JsonSerialize(using = Operation.Serializer::class) class Operation private constructor( - private val boolProperty: BoolPropertyOperation? = null, - private val numberProperty: NumberPropertyOperation? = null, - private val stringProperty: StringPropertyOperation? = null, - private val dateTimeProperty: DateTimePropertyOperation? = null, - private val rangedDateProperty: RangedDatePropertyOperation? = null, - private val comparativeDateProperty: ComparativeDatePropertyOperation? = null, - private val comparativeBoolProperty: ComparativeBoolPropertyOperation? = null, - private val comparativeNumberProperty: ComparativeNumberPropertyOperation? = null, - private val comparativeStringProperty: ComparativeStringPropertyOperation? = null, - private val comparativePropertyUpdated: ComparativePropertyUpdatedOperation? = null, - private val rollingDateRangeProperty: RollingDateRangePropertyOperation? = null, + private val bool: BoolPropertyOperation? = null, + private val number: NumberPropertyOperation? = null, + private val string: StringPropertyOperation? = null, + private val datetime: DateTimePropertyOperation? = null, + private val datetimeRanged: RangedDatePropertyOperation? = null, + private val datetimeComparative: ComparativeDatePropertyOperation? = null, + private val boolComparative: ComparativeBoolPropertyOperation? = null, + private val numberComparative: ComparativeNumberPropertyOperation? = null, + private val stringComparative: ComparativeStringPropertyOperation? = null, + private val propertyUpdatedComparative: ComparativePropertyUpdatedOperation? = null, + private val datetimeRolling: RollingDateRangePropertyOperation? = null, private val rollingPropertyUpdated: RollingPropertyUpdatedOperation? = null, - private val enumerationProperty: EnumerationPropertyOperation? = null, - private val allPropertyTypes: AllPropertyTypesOperation? = null, - private val rangedNumberProperty: RangedNumberPropertyOperation? = null, - private val multiStringProperty: MultiStringPropertyOperation? = null, - private val dateProperty: DatePropertyOperation? = null, - private val calendarDateProperty: CalendarDatePropertyOperation? = null, - private val timePoint: TimePointOperation? = null, - private val rangedTime: RangedTimeOperation? = null, - private val regexProperty: RegexPropertyOperation? = null, + private val enumeration: EnumerationPropertyOperation? = null, + private val alltypes: AllPropertyTypesOperation? = null, + private val numberRanged: RangedNumberPropertyOperation? = null, + private val multistring: MultiStringPropertyOperation? = null, + private val date: DatePropertyOperation? = null, + private val calendarDate: CalendarDatePropertyOperation? = null, + private val timepoint: TimePointOperation? = null, + private val rangedtime: RangedTimeOperation? = null, + private val regex: RegexPropertyOperation? = null, private val _json: JsonValue? = null, ) { - fun boolProperty(): Optional = Optional.ofNullable(boolProperty) + fun bool(): Optional = Optional.ofNullable(bool) - fun numberProperty(): Optional = - Optional.ofNullable(numberProperty) + fun number(): Optional = Optional.ofNullable(number) - fun stringProperty(): Optional = - Optional.ofNullable(stringProperty) + fun string(): Optional = Optional.ofNullable(string) - fun dateTimeProperty(): Optional = - Optional.ofNullable(dateTimeProperty) + fun datetime(): Optional = Optional.ofNullable(datetime) - fun rangedDateProperty(): Optional = - Optional.ofNullable(rangedDateProperty) + fun datetimeRanged(): Optional = + Optional.ofNullable(datetimeRanged) - fun comparativeDateProperty(): Optional = - Optional.ofNullable(comparativeDateProperty) + fun datetimeComparative(): Optional = + Optional.ofNullable(datetimeComparative) - fun comparativeBoolProperty(): Optional = - Optional.ofNullable(comparativeBoolProperty) + fun boolComparative(): Optional = + Optional.ofNullable(boolComparative) - fun comparativeNumberProperty(): Optional = - Optional.ofNullable(comparativeNumberProperty) + fun numberComparative(): Optional = + Optional.ofNullable(numberComparative) - fun comparativeStringProperty(): Optional = - Optional.ofNullable(comparativeStringProperty) + fun stringComparative(): Optional = + Optional.ofNullable(stringComparative) - fun comparativePropertyUpdated(): Optional = - Optional.ofNullable(comparativePropertyUpdated) + fun propertyUpdatedComparative(): Optional = + Optional.ofNullable(propertyUpdatedComparative) - fun rollingDateRangeProperty(): Optional = - Optional.ofNullable(rollingDateRangeProperty) + fun datetimeRolling(): Optional = + Optional.ofNullable(datetimeRolling) fun rollingPropertyUpdated(): Optional = Optional.ofNullable(rollingPropertyUpdated) - fun enumerationProperty(): Optional = - Optional.ofNullable(enumerationProperty) + fun enumeration(): Optional = Optional.ofNullable(enumeration) - fun allPropertyTypes(): Optional = - Optional.ofNullable(allPropertyTypes) + fun alltypes(): Optional = Optional.ofNullable(alltypes) - fun rangedNumberProperty(): Optional = - Optional.ofNullable(rangedNumberProperty) + fun numberRanged(): Optional = + Optional.ofNullable(numberRanged) - fun multiStringProperty(): Optional = - Optional.ofNullable(multiStringProperty) + fun multistring(): Optional = Optional.ofNullable(multistring) - fun dateProperty(): Optional = Optional.ofNullable(dateProperty) + fun date(): Optional = Optional.ofNullable(date) - fun calendarDateProperty(): Optional = - Optional.ofNullable(calendarDateProperty) + fun calendarDate(): Optional = + Optional.ofNullable(calendarDate) - fun timePoint(): Optional = Optional.ofNullable(timePoint) + fun timepoint(): Optional = Optional.ofNullable(timepoint) - fun rangedTime(): Optional = Optional.ofNullable(rangedTime) + fun rangedtime(): Optional = Optional.ofNullable(rangedtime) - fun regexProperty(): Optional = Optional.ofNullable(regexProperty) + fun regex(): Optional = Optional.ofNullable(regex) - fun isBoolProperty(): Boolean = boolProperty != null + fun isBool(): Boolean = bool != null - fun isNumberProperty(): Boolean = numberProperty != null + fun isNumber(): Boolean = number != null - fun isStringProperty(): Boolean = stringProperty != null + fun isString(): Boolean = string != null - fun isDateTimeProperty(): Boolean = dateTimeProperty != null + fun isDatetime(): Boolean = datetime != null - fun isRangedDateProperty(): Boolean = rangedDateProperty != null + fun isDatetimeRanged(): Boolean = datetimeRanged != null - fun isComparativeDateProperty(): Boolean = comparativeDateProperty != null + fun isDatetimeComparative(): Boolean = datetimeComparative != null - fun isComparativeBoolProperty(): Boolean = comparativeBoolProperty != null + fun isBoolComparative(): Boolean = boolComparative != null - fun isComparativeNumberProperty(): Boolean = comparativeNumberProperty != null + fun isNumberComparative(): Boolean = numberComparative != null - fun isComparativeStringProperty(): Boolean = comparativeStringProperty != null + fun isStringComparative(): Boolean = stringComparative != null - fun isComparativePropertyUpdated(): Boolean = comparativePropertyUpdated != null + fun isPropertyUpdatedComparative(): Boolean = propertyUpdatedComparative != null - fun isRollingDateRangeProperty(): Boolean = rollingDateRangeProperty != null + fun isDatetimeRolling(): Boolean = datetimeRolling != null fun isRollingPropertyUpdated(): Boolean = rollingPropertyUpdated != null - fun isEnumerationProperty(): Boolean = enumerationProperty != null + fun isEnumeration(): Boolean = enumeration != null - fun isAllPropertyTypes(): Boolean = allPropertyTypes != null + fun isAlltypes(): Boolean = alltypes != null - fun isRangedNumberProperty(): Boolean = rangedNumberProperty != null + fun isNumberRanged(): Boolean = numberRanged != null - fun isMultiStringProperty(): Boolean = multiStringProperty != null + fun isMultistring(): Boolean = multistring != null - fun isDateProperty(): Boolean = dateProperty != null + fun isDate(): Boolean = date != null - fun isCalendarDateProperty(): Boolean = calendarDateProperty != null + fun isCalendarDate(): Boolean = calendarDate != null - fun isTimePoint(): Boolean = timePoint != null + fun isTimepoint(): Boolean = timepoint != null - fun isRangedTime(): Boolean = rangedTime != null + fun isRangedtime(): Boolean = rangedtime != null - fun isRegexProperty(): Boolean = regexProperty != null + fun isRegex(): Boolean = regex != null - fun asBoolProperty(): BoolPropertyOperation = boolProperty.getOrThrow("boolProperty") + fun asBool(): BoolPropertyOperation = bool.getOrThrow("bool") - fun asNumberProperty(): NumberPropertyOperation = - numberProperty.getOrThrow("numberProperty") + fun asNumber(): NumberPropertyOperation = number.getOrThrow("number") - fun asStringProperty(): StringPropertyOperation = - stringProperty.getOrThrow("stringProperty") + fun asString(): StringPropertyOperation = string.getOrThrow("string") - fun asDateTimeProperty(): DateTimePropertyOperation = - dateTimeProperty.getOrThrow("dateTimeProperty") + fun asDatetime(): DateTimePropertyOperation = datetime.getOrThrow("datetime") - fun asRangedDateProperty(): RangedDatePropertyOperation = - rangedDateProperty.getOrThrow("rangedDateProperty") + fun asDatetimeRanged(): RangedDatePropertyOperation = + datetimeRanged.getOrThrow("datetimeRanged") - fun asComparativeDateProperty(): ComparativeDatePropertyOperation = - comparativeDateProperty.getOrThrow("comparativeDateProperty") + fun asDatetimeComparative(): ComparativeDatePropertyOperation = + datetimeComparative.getOrThrow("datetimeComparative") - fun asComparativeBoolProperty(): ComparativeBoolPropertyOperation = - comparativeBoolProperty.getOrThrow("comparativeBoolProperty") + fun asBoolComparative(): ComparativeBoolPropertyOperation = + boolComparative.getOrThrow("boolComparative") - fun asComparativeNumberProperty(): ComparativeNumberPropertyOperation = - comparativeNumberProperty.getOrThrow("comparativeNumberProperty") + fun asNumberComparative(): ComparativeNumberPropertyOperation = + numberComparative.getOrThrow("numberComparative") - fun asComparativeStringProperty(): ComparativeStringPropertyOperation = - comparativeStringProperty.getOrThrow("comparativeStringProperty") + fun asStringComparative(): ComparativeStringPropertyOperation = + stringComparative.getOrThrow("stringComparative") - fun asComparativePropertyUpdated(): ComparativePropertyUpdatedOperation = - comparativePropertyUpdated.getOrThrow("comparativePropertyUpdated") + fun asPropertyUpdatedComparative(): ComparativePropertyUpdatedOperation = + propertyUpdatedComparative.getOrThrow("propertyUpdatedComparative") - fun asRollingDateRangeProperty(): RollingDateRangePropertyOperation = - rollingDateRangeProperty.getOrThrow("rollingDateRangeProperty") + fun asDatetimeRolling(): RollingDateRangePropertyOperation = + datetimeRolling.getOrThrow("datetimeRolling") fun asRollingPropertyUpdated(): RollingPropertyUpdatedOperation = rollingPropertyUpdated.getOrThrow("rollingPropertyUpdated") - fun asEnumerationProperty(): EnumerationPropertyOperation = - enumerationProperty.getOrThrow("enumerationProperty") + fun asEnumeration(): EnumerationPropertyOperation = enumeration.getOrThrow("enumeration") - fun asAllPropertyTypes(): AllPropertyTypesOperation = - allPropertyTypes.getOrThrow("allPropertyTypes") + fun asAlltypes(): AllPropertyTypesOperation = alltypes.getOrThrow("alltypes") - fun asRangedNumberProperty(): RangedNumberPropertyOperation = - rangedNumberProperty.getOrThrow("rangedNumberProperty") + fun asNumberRanged(): RangedNumberPropertyOperation = + numberRanged.getOrThrow("numberRanged") - fun asMultiStringProperty(): MultiStringPropertyOperation = - multiStringProperty.getOrThrow("multiStringProperty") + fun asMultistring(): MultiStringPropertyOperation = multistring.getOrThrow("multistring") - fun asDateProperty(): DatePropertyOperation = dateProperty.getOrThrow("dateProperty") + fun asDate(): DatePropertyOperation = date.getOrThrow("date") - fun asCalendarDateProperty(): CalendarDatePropertyOperation = - calendarDateProperty.getOrThrow("calendarDateProperty") + fun asCalendarDate(): CalendarDatePropertyOperation = + calendarDate.getOrThrow("calendarDate") - fun asTimePoint(): TimePointOperation = timePoint.getOrThrow("timePoint") + fun asTimepoint(): TimePointOperation = timepoint.getOrThrow("timepoint") - fun asRangedTime(): RangedTimeOperation = rangedTime.getOrThrow("rangedTime") + fun asRangedtime(): RangedTimeOperation = rangedtime.getOrThrow("rangedtime") - fun asRegexProperty(): RegexPropertyOperation = regexProperty.getOrThrow("regexProperty") + fun asRegex(): RegexPropertyOperation = regex.getOrThrow("regex") fun _json(): Optional = Optional.ofNullable(_json) @@ -816,8 +776,8 @@ private constructor( * * Optional result = operation.accept(new Operation.Visitor>() { * @Override - * public Optional visitBoolProperty(BoolPropertyOperation boolProperty) { - * return Optional.of(boolProperty.toString()); + * public Optional visitBool(BoolPropertyOperation bool) { + * return Optional.of(bool.toString()); * } * * // ... @@ -835,36 +795,29 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - boolProperty != null -> visitor.visitBoolProperty(boolProperty) - numberProperty != null -> visitor.visitNumberProperty(numberProperty) - stringProperty != null -> visitor.visitStringProperty(stringProperty) - dateTimeProperty != null -> visitor.visitDateTimeProperty(dateTimeProperty) - rangedDateProperty != null -> visitor.visitRangedDateProperty(rangedDateProperty) - comparativeDateProperty != null -> - visitor.visitComparativeDateProperty(comparativeDateProperty) - comparativeBoolProperty != null -> - visitor.visitComparativeBoolProperty(comparativeBoolProperty) - comparativeNumberProperty != null -> - visitor.visitComparativeNumberProperty(comparativeNumberProperty) - comparativeStringProperty != null -> - visitor.visitComparativeStringProperty(comparativeStringProperty) - comparativePropertyUpdated != null -> - visitor.visitComparativePropertyUpdated(comparativePropertyUpdated) - rollingDateRangeProperty != null -> - visitor.visitRollingDateRangeProperty(rollingDateRangeProperty) + bool != null -> visitor.visitBool(bool) + number != null -> visitor.visitNumber(number) + string != null -> visitor.visitString(string) + datetime != null -> visitor.visitDatetime(datetime) + datetimeRanged != null -> visitor.visitDatetimeRanged(datetimeRanged) + datetimeComparative != null -> visitor.visitDatetimeComparative(datetimeComparative) + boolComparative != null -> visitor.visitBoolComparative(boolComparative) + numberComparative != null -> visitor.visitNumberComparative(numberComparative) + stringComparative != null -> visitor.visitStringComparative(stringComparative) + propertyUpdatedComparative != null -> + visitor.visitPropertyUpdatedComparative(propertyUpdatedComparative) + datetimeRolling != null -> visitor.visitDatetimeRolling(datetimeRolling) rollingPropertyUpdated != null -> visitor.visitRollingPropertyUpdated(rollingPropertyUpdated) - enumerationProperty != null -> visitor.visitEnumerationProperty(enumerationProperty) - allPropertyTypes != null -> visitor.visitAllPropertyTypes(allPropertyTypes) - rangedNumberProperty != null -> - visitor.visitRangedNumberProperty(rangedNumberProperty) - multiStringProperty != null -> visitor.visitMultiStringProperty(multiStringProperty) - dateProperty != null -> visitor.visitDateProperty(dateProperty) - calendarDateProperty != null -> - visitor.visitCalendarDateProperty(calendarDateProperty) - timePoint != null -> visitor.visitTimePoint(timePoint) - rangedTime != null -> visitor.visitRangedTime(rangedTime) - regexProperty != null -> visitor.visitRegexProperty(regexProperty) + enumeration != null -> visitor.visitEnumeration(enumeration) + alltypes != null -> visitor.visitAlltypes(alltypes) + numberRanged != null -> visitor.visitNumberRanged(numberRanged) + multistring != null -> visitor.visitMultistring(multistring) + date != null -> visitor.visitDate(date) + calendarDate != null -> visitor.visitCalendarDate(calendarDate) + timepoint != null -> visitor.visitTimepoint(timepoint) + rangedtime != null -> visitor.visitRangedtime(rangedtime) + regex != null -> visitor.visitRegex(regex) else -> visitor.unknown(_json) } @@ -886,64 +839,60 @@ private constructor( accept( object : Visitor { - override fun visitBoolProperty(boolProperty: BoolPropertyOperation) { - boolProperty.validate() + override fun visitBool(bool: BoolPropertyOperation) { + bool.validate() } - override fun visitNumberProperty(numberProperty: NumberPropertyOperation) { - numberProperty.validate() + override fun visitNumber(number: NumberPropertyOperation) { + number.validate() } - override fun visitStringProperty(stringProperty: StringPropertyOperation) { - stringProperty.validate() + override fun visitString(string: StringPropertyOperation) { + string.validate() } - override fun visitDateTimeProperty( - dateTimeProperty: DateTimePropertyOperation - ) { - dateTimeProperty.validate() + override fun visitDatetime(datetime: DateTimePropertyOperation) { + datetime.validate() } - override fun visitRangedDateProperty( - rangedDateProperty: RangedDatePropertyOperation - ) { - rangedDateProperty.validate() + override fun visitDatetimeRanged(datetimeRanged: RangedDatePropertyOperation) { + datetimeRanged.validate() } - override fun visitComparativeDateProperty( - comparativeDateProperty: ComparativeDatePropertyOperation + override fun visitDatetimeComparative( + datetimeComparative: ComparativeDatePropertyOperation ) { - comparativeDateProperty.validate() + datetimeComparative.validate() } - override fun visitComparativeBoolProperty( - comparativeBoolProperty: ComparativeBoolPropertyOperation + override fun visitBoolComparative( + boolComparative: ComparativeBoolPropertyOperation ) { - comparativeBoolProperty.validate() + boolComparative.validate() } - override fun visitComparativeNumberProperty( - comparativeNumberProperty: ComparativeNumberPropertyOperation + override fun visitNumberComparative( + numberComparative: ComparativeNumberPropertyOperation ) { - comparativeNumberProperty.validate() + numberComparative.validate() } - override fun visitComparativeStringProperty( - comparativeStringProperty: ComparativeStringPropertyOperation + override fun visitStringComparative( + stringComparative: ComparativeStringPropertyOperation ) { - comparativeStringProperty.validate() + stringComparative.validate() } - override fun visitComparativePropertyUpdated( - comparativePropertyUpdated: ComparativePropertyUpdatedOperation + override fun visitPropertyUpdatedComparative( + propertyUpdatedComparative: ComparativePropertyUpdatedOperation ) { - comparativePropertyUpdated.validate() + propertyUpdatedComparative.validate() } - override fun visitRollingDateRangeProperty( - rollingDateRangeProperty: RollingDateRangePropertyOperation + override fun visitDatetimeRolling( + datetimeRolling: RollingDateRangePropertyOperation ) { - rollingDateRangeProperty.validate() + datetimeRolling.validate() } override fun visitRollingPropertyUpdated( @@ -952,50 +901,40 @@ private constructor( rollingPropertyUpdated.validate() } - override fun visitEnumerationProperty( - enumerationProperty: EnumerationPropertyOperation - ) { - enumerationProperty.validate() + override fun visitEnumeration(enumeration: EnumerationPropertyOperation) { + enumeration.validate() } - override fun visitAllPropertyTypes( - allPropertyTypes: AllPropertyTypesOperation - ) { - allPropertyTypes.validate() + override fun visitAlltypes(alltypes: AllPropertyTypesOperation) { + alltypes.validate() } - override fun visitRangedNumberProperty( - rangedNumberProperty: RangedNumberPropertyOperation - ) { - rangedNumberProperty.validate() + override fun visitNumberRanged(numberRanged: RangedNumberPropertyOperation) { + numberRanged.validate() } - override fun visitMultiStringProperty( - multiStringProperty: MultiStringPropertyOperation - ) { - multiStringProperty.validate() + override fun visitMultistring(multistring: MultiStringPropertyOperation) { + multistring.validate() } - override fun visitDateProperty(dateProperty: DatePropertyOperation) { - dateProperty.validate() + override fun visitDate(date: DatePropertyOperation) { + date.validate() } - override fun visitCalendarDateProperty( - calendarDateProperty: CalendarDatePropertyOperation - ) { - calendarDateProperty.validate() + override fun visitCalendarDate(calendarDate: CalendarDatePropertyOperation) { + calendarDate.validate() } - override fun visitTimePoint(timePoint: TimePointOperation) { - timePoint.validate() + override fun visitTimepoint(timepoint: TimePointOperation) { + timepoint.validate() } - override fun visitRangedTime(rangedTime: RangedTimeOperation) { - rangedTime.validate() + override fun visitRangedtime(rangedtime: RangedTimeOperation) { + rangedtime.validate() } - override fun visitRegexProperty(regexProperty: RegexPropertyOperation) { - regexProperty.validate() + override fun visitRegex(regex: RegexPropertyOperation) { + regex.validate() } } ) @@ -1020,82 +959,70 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitBoolProperty(boolProperty: BoolPropertyOperation) = - boolProperty.validity() + override fun visitBool(bool: BoolPropertyOperation) = bool.validity() - override fun visitNumberProperty(numberProperty: NumberPropertyOperation) = - numberProperty.validity() + override fun visitNumber(number: NumberPropertyOperation) = number.validity() - override fun visitStringProperty(stringProperty: StringPropertyOperation) = - stringProperty.validity() + override fun visitString(string: StringPropertyOperation) = string.validity() - override fun visitDateTimeProperty( - dateTimeProperty: DateTimePropertyOperation - ) = dateTimeProperty.validity() + override fun visitDatetime(datetime: DateTimePropertyOperation) = + datetime.validity() - override fun visitRangedDateProperty( - rangedDateProperty: RangedDatePropertyOperation - ) = rangedDateProperty.validity() + override fun visitDatetimeRanged(datetimeRanged: RangedDatePropertyOperation) = + datetimeRanged.validity() - override fun visitComparativeDateProperty( - comparativeDateProperty: ComparativeDatePropertyOperation - ) = comparativeDateProperty.validity() + override fun visitDatetimeComparative( + datetimeComparative: ComparativeDatePropertyOperation + ) = datetimeComparative.validity() - override fun visitComparativeBoolProperty( - comparativeBoolProperty: ComparativeBoolPropertyOperation - ) = comparativeBoolProperty.validity() + override fun visitBoolComparative( + boolComparative: ComparativeBoolPropertyOperation + ) = boolComparative.validity() - override fun visitComparativeNumberProperty( - comparativeNumberProperty: ComparativeNumberPropertyOperation - ) = comparativeNumberProperty.validity() + override fun visitNumberComparative( + numberComparative: ComparativeNumberPropertyOperation + ) = numberComparative.validity() - override fun visitComparativeStringProperty( - comparativeStringProperty: ComparativeStringPropertyOperation - ) = comparativeStringProperty.validity() + override fun visitStringComparative( + stringComparative: ComparativeStringPropertyOperation + ) = stringComparative.validity() - override fun visitComparativePropertyUpdated( - comparativePropertyUpdated: ComparativePropertyUpdatedOperation - ) = comparativePropertyUpdated.validity() + override fun visitPropertyUpdatedComparative( + propertyUpdatedComparative: ComparativePropertyUpdatedOperation + ) = propertyUpdatedComparative.validity() - override fun visitRollingDateRangeProperty( - rollingDateRangeProperty: RollingDateRangePropertyOperation - ) = rollingDateRangeProperty.validity() + override fun visitDatetimeRolling( + datetimeRolling: RollingDateRangePropertyOperation + ) = datetimeRolling.validity() override fun visitRollingPropertyUpdated( rollingPropertyUpdated: RollingPropertyUpdatedOperation ) = rollingPropertyUpdated.validity() - override fun visitEnumerationProperty( - enumerationProperty: EnumerationPropertyOperation - ) = enumerationProperty.validity() + override fun visitEnumeration(enumeration: EnumerationPropertyOperation) = + enumeration.validity() - override fun visitAllPropertyTypes( - allPropertyTypes: AllPropertyTypesOperation - ) = allPropertyTypes.validity() + override fun visitAlltypes(alltypes: AllPropertyTypesOperation) = + alltypes.validity() - override fun visitRangedNumberProperty( - rangedNumberProperty: RangedNumberPropertyOperation - ) = rangedNumberProperty.validity() + override fun visitNumberRanged(numberRanged: RangedNumberPropertyOperation) = + numberRanged.validity() - override fun visitMultiStringProperty( - multiStringProperty: MultiStringPropertyOperation - ) = multiStringProperty.validity() + override fun visitMultistring(multistring: MultiStringPropertyOperation) = + multistring.validity() - override fun visitDateProperty(dateProperty: DatePropertyOperation) = - dateProperty.validity() + override fun visitDate(date: DatePropertyOperation) = date.validity() - override fun visitCalendarDateProperty( - calendarDateProperty: CalendarDatePropertyOperation - ) = calendarDateProperty.validity() + override fun visitCalendarDate(calendarDate: CalendarDatePropertyOperation) = + calendarDate.validity() - override fun visitTimePoint(timePoint: TimePointOperation) = - timePoint.validity() + override fun visitTimepoint(timepoint: TimePointOperation) = + timepoint.validity() - override fun visitRangedTime(rangedTime: RangedTimeOperation) = - rangedTime.validity() + override fun visitRangedtime(rangedtime: RangedTimeOperation) = + rangedtime.validity() - override fun visitRegexProperty(regexProperty: RegexPropertyOperation) = - regexProperty.validity() + override fun visitRegex(regex: RegexPropertyOperation) = regex.validity() override fun unknown(json: JsonValue?) = 0 } @@ -1107,179 +1034,155 @@ private constructor( } return other is Operation && - boolProperty == other.boolProperty && - numberProperty == other.numberProperty && - stringProperty == other.stringProperty && - dateTimeProperty == other.dateTimeProperty && - rangedDateProperty == other.rangedDateProperty && - comparativeDateProperty == other.comparativeDateProperty && - comparativeBoolProperty == other.comparativeBoolProperty && - comparativeNumberProperty == other.comparativeNumberProperty && - comparativeStringProperty == other.comparativeStringProperty && - comparativePropertyUpdated == other.comparativePropertyUpdated && - rollingDateRangeProperty == other.rollingDateRangeProperty && + bool == other.bool && + number == other.number && + string == other.string && + datetime == other.datetime && + datetimeRanged == other.datetimeRanged && + datetimeComparative == other.datetimeComparative && + boolComparative == other.boolComparative && + numberComparative == other.numberComparative && + stringComparative == other.stringComparative && + propertyUpdatedComparative == other.propertyUpdatedComparative && + datetimeRolling == other.datetimeRolling && rollingPropertyUpdated == other.rollingPropertyUpdated && - enumerationProperty == other.enumerationProperty && - allPropertyTypes == other.allPropertyTypes && - rangedNumberProperty == other.rangedNumberProperty && - multiStringProperty == other.multiStringProperty && - dateProperty == other.dateProperty && - calendarDateProperty == other.calendarDateProperty && - timePoint == other.timePoint && - rangedTime == other.rangedTime && - regexProperty == other.regexProperty + enumeration == other.enumeration && + alltypes == other.alltypes && + numberRanged == other.numberRanged && + multistring == other.multistring && + date == other.date && + calendarDate == other.calendarDate && + timepoint == other.timepoint && + rangedtime == other.rangedtime && + regex == other.regex } override fun hashCode(): Int = Objects.hash( - boolProperty, - numberProperty, - stringProperty, - dateTimeProperty, - rangedDateProperty, - comparativeDateProperty, - comparativeBoolProperty, - comparativeNumberProperty, - comparativeStringProperty, - comparativePropertyUpdated, - rollingDateRangeProperty, + bool, + number, + string, + datetime, + datetimeRanged, + datetimeComparative, + boolComparative, + numberComparative, + stringComparative, + propertyUpdatedComparative, + datetimeRolling, rollingPropertyUpdated, - enumerationProperty, - allPropertyTypes, - rangedNumberProperty, - multiStringProperty, - dateProperty, - calendarDateProperty, - timePoint, - rangedTime, - regexProperty, + enumeration, + alltypes, + numberRanged, + multistring, + date, + calendarDate, + timepoint, + rangedtime, + regex, ) override fun toString(): String = when { - boolProperty != null -> "Operation{boolProperty=$boolProperty}" - numberProperty != null -> "Operation{numberProperty=$numberProperty}" - stringProperty != null -> "Operation{stringProperty=$stringProperty}" - dateTimeProperty != null -> "Operation{dateTimeProperty=$dateTimeProperty}" - rangedDateProperty != null -> "Operation{rangedDateProperty=$rangedDateProperty}" - comparativeDateProperty != null -> - "Operation{comparativeDateProperty=$comparativeDateProperty}" - comparativeBoolProperty != null -> - "Operation{comparativeBoolProperty=$comparativeBoolProperty}" - comparativeNumberProperty != null -> - "Operation{comparativeNumberProperty=$comparativeNumberProperty}" - comparativeStringProperty != null -> - "Operation{comparativeStringProperty=$comparativeStringProperty}" - comparativePropertyUpdated != null -> - "Operation{comparativePropertyUpdated=$comparativePropertyUpdated}" - rollingDateRangeProperty != null -> - "Operation{rollingDateRangeProperty=$rollingDateRangeProperty}" + bool != null -> "Operation{bool=$bool}" + number != null -> "Operation{number=$number}" + string != null -> "Operation{string=$string}" + datetime != null -> "Operation{datetime=$datetime}" + datetimeRanged != null -> "Operation{datetimeRanged=$datetimeRanged}" + datetimeComparative != null -> "Operation{datetimeComparative=$datetimeComparative}" + boolComparative != null -> "Operation{boolComparative=$boolComparative}" + numberComparative != null -> "Operation{numberComparative=$numberComparative}" + stringComparative != null -> "Operation{stringComparative=$stringComparative}" + propertyUpdatedComparative != null -> + "Operation{propertyUpdatedComparative=$propertyUpdatedComparative}" + datetimeRolling != null -> "Operation{datetimeRolling=$datetimeRolling}" rollingPropertyUpdated != null -> "Operation{rollingPropertyUpdated=$rollingPropertyUpdated}" - enumerationProperty != null -> "Operation{enumerationProperty=$enumerationProperty}" - allPropertyTypes != null -> "Operation{allPropertyTypes=$allPropertyTypes}" - rangedNumberProperty != null -> - "Operation{rangedNumberProperty=$rangedNumberProperty}" - multiStringProperty != null -> "Operation{multiStringProperty=$multiStringProperty}" - dateProperty != null -> "Operation{dateProperty=$dateProperty}" - calendarDateProperty != null -> - "Operation{calendarDateProperty=$calendarDateProperty}" - timePoint != null -> "Operation{timePoint=$timePoint}" - rangedTime != null -> "Operation{rangedTime=$rangedTime}" - regexProperty != null -> "Operation{regexProperty=$regexProperty}" + enumeration != null -> "Operation{enumeration=$enumeration}" + alltypes != null -> "Operation{alltypes=$alltypes}" + numberRanged != null -> "Operation{numberRanged=$numberRanged}" + multistring != null -> "Operation{multistring=$multistring}" + date != null -> "Operation{date=$date}" + calendarDate != null -> "Operation{calendarDate=$calendarDate}" + timepoint != null -> "Operation{timepoint=$timepoint}" + rangedtime != null -> "Operation{rangedtime=$rangedtime}" + regex != null -> "Operation{regex=$regex}" _json != null -> "Operation{_unknown=$_json}" else -> throw IllegalStateException("Invalid Operation") } companion object { - @JvmStatic - fun ofBoolProperty(boolProperty: BoolPropertyOperation) = - Operation(boolProperty = boolProperty) + @JvmStatic fun ofBool(bool: BoolPropertyOperation) = Operation(bool = bool) - @JvmStatic - fun ofNumberProperty(numberProperty: NumberPropertyOperation) = - Operation(numberProperty = numberProperty) + @JvmStatic fun ofNumber(number: NumberPropertyOperation) = Operation(number = number) - @JvmStatic - fun ofStringProperty(stringProperty: StringPropertyOperation) = - Operation(stringProperty = stringProperty) + @JvmStatic fun ofString(string: StringPropertyOperation) = Operation(string = string) @JvmStatic - fun ofDateTimeProperty(dateTimeProperty: DateTimePropertyOperation) = - Operation(dateTimeProperty = dateTimeProperty) + fun ofDatetime(datetime: DateTimePropertyOperation) = Operation(datetime = datetime) @JvmStatic - fun ofRangedDateProperty(rangedDateProperty: RangedDatePropertyOperation) = - Operation(rangedDateProperty = rangedDateProperty) + fun ofDatetimeRanged(datetimeRanged: RangedDatePropertyOperation) = + Operation(datetimeRanged = datetimeRanged) @JvmStatic - fun ofComparativeDateProperty( - comparativeDateProperty: ComparativeDatePropertyOperation - ) = Operation(comparativeDateProperty = comparativeDateProperty) + fun ofDatetimeComparative(datetimeComparative: ComparativeDatePropertyOperation) = + Operation(datetimeComparative = datetimeComparative) @JvmStatic - fun ofComparativeBoolProperty( - comparativeBoolProperty: ComparativeBoolPropertyOperation - ) = Operation(comparativeBoolProperty = comparativeBoolProperty) + fun ofBoolComparative(boolComparative: ComparativeBoolPropertyOperation) = + Operation(boolComparative = boolComparative) @JvmStatic - fun ofComparativeNumberProperty( - comparativeNumberProperty: ComparativeNumberPropertyOperation - ) = Operation(comparativeNumberProperty = comparativeNumberProperty) + fun ofNumberComparative(numberComparative: ComparativeNumberPropertyOperation) = + Operation(numberComparative = numberComparative) @JvmStatic - fun ofComparativeStringProperty( - comparativeStringProperty: ComparativeStringPropertyOperation - ) = Operation(comparativeStringProperty = comparativeStringProperty) + fun ofStringComparative(stringComparative: ComparativeStringPropertyOperation) = + Operation(stringComparative = stringComparative) @JvmStatic - fun ofComparativePropertyUpdated( - comparativePropertyUpdated: ComparativePropertyUpdatedOperation - ) = Operation(comparativePropertyUpdated = comparativePropertyUpdated) + fun ofPropertyUpdatedComparative( + propertyUpdatedComparative: ComparativePropertyUpdatedOperation + ) = Operation(propertyUpdatedComparative = propertyUpdatedComparative) @JvmStatic - fun ofRollingDateRangeProperty( - rollingDateRangeProperty: RollingDateRangePropertyOperation - ) = Operation(rollingDateRangeProperty = rollingDateRangeProperty) + fun ofDatetimeRolling(datetimeRolling: RollingDateRangePropertyOperation) = + Operation(datetimeRolling = datetimeRolling) @JvmStatic fun ofRollingPropertyUpdated(rollingPropertyUpdated: RollingPropertyUpdatedOperation) = Operation(rollingPropertyUpdated = rollingPropertyUpdated) @JvmStatic - fun ofEnumerationProperty(enumerationProperty: EnumerationPropertyOperation) = - Operation(enumerationProperty = enumerationProperty) + fun ofEnumeration(enumeration: EnumerationPropertyOperation) = + Operation(enumeration = enumeration) @JvmStatic - fun ofAllPropertyTypes(allPropertyTypes: AllPropertyTypesOperation) = - Operation(allPropertyTypes = allPropertyTypes) + fun ofAlltypes(alltypes: AllPropertyTypesOperation) = Operation(alltypes = alltypes) @JvmStatic - fun ofRangedNumberProperty(rangedNumberProperty: RangedNumberPropertyOperation) = - Operation(rangedNumberProperty = rangedNumberProperty) + fun ofNumberRanged(numberRanged: RangedNumberPropertyOperation) = + Operation(numberRanged = numberRanged) @JvmStatic - fun ofMultiStringProperty(multiStringProperty: MultiStringPropertyOperation) = - Operation(multiStringProperty = multiStringProperty) + fun ofMultistring(multistring: MultiStringPropertyOperation) = + Operation(multistring = multistring) - @JvmStatic - fun ofDateProperty(dateProperty: DatePropertyOperation) = - Operation(dateProperty = dateProperty) + @JvmStatic fun ofDate(date: DatePropertyOperation) = Operation(date = date) @JvmStatic - fun ofCalendarDateProperty(calendarDateProperty: CalendarDatePropertyOperation) = - Operation(calendarDateProperty = calendarDateProperty) + fun ofCalendarDate(calendarDate: CalendarDatePropertyOperation) = + Operation(calendarDate = calendarDate) @JvmStatic - fun ofTimePoint(timePoint: TimePointOperation) = Operation(timePoint = timePoint) + fun ofTimepoint(timepoint: TimePointOperation) = Operation(timepoint = timepoint) @JvmStatic - fun ofRangedTime(rangedTime: RangedTimeOperation) = Operation(rangedTime = rangedTime) + fun ofRangedtime(rangedtime: RangedTimeOperation) = Operation(rangedtime = rangedtime) - @JvmStatic - fun ofRegexProperty(regexProperty: RegexPropertyOperation) = - Operation(regexProperty = regexProperty) + @JvmStatic fun ofRegex(regex: RegexPropertyOperation) = Operation(regex = regex) } /** @@ -1287,61 +1190,51 @@ private constructor( */ interface Visitor { - fun visitBoolProperty(boolProperty: BoolPropertyOperation): T + fun visitBool(bool: BoolPropertyOperation): T - fun visitNumberProperty(numberProperty: NumberPropertyOperation): T + fun visitNumber(number: NumberPropertyOperation): T - fun visitStringProperty(stringProperty: StringPropertyOperation): T + fun visitString(string: StringPropertyOperation): T - fun visitDateTimeProperty(dateTimeProperty: DateTimePropertyOperation): T + fun visitDatetime(datetime: DateTimePropertyOperation): T - fun visitRangedDateProperty(rangedDateProperty: RangedDatePropertyOperation): T + fun visitDatetimeRanged(datetimeRanged: RangedDatePropertyOperation): T - fun visitComparativeDateProperty( - comparativeDateProperty: ComparativeDatePropertyOperation - ): T + fun visitDatetimeComparative(datetimeComparative: ComparativeDatePropertyOperation): T - fun visitComparativeBoolProperty( - comparativeBoolProperty: ComparativeBoolPropertyOperation - ): T + fun visitBoolComparative(boolComparative: ComparativeBoolPropertyOperation): T - fun visitComparativeNumberProperty( - comparativeNumberProperty: ComparativeNumberPropertyOperation - ): T + fun visitNumberComparative(numberComparative: ComparativeNumberPropertyOperation): T - fun visitComparativeStringProperty( - comparativeStringProperty: ComparativeStringPropertyOperation - ): T + fun visitStringComparative(stringComparative: ComparativeStringPropertyOperation): T - fun visitComparativePropertyUpdated( - comparativePropertyUpdated: ComparativePropertyUpdatedOperation + fun visitPropertyUpdatedComparative( + propertyUpdatedComparative: ComparativePropertyUpdatedOperation ): T - fun visitRollingDateRangeProperty( - rollingDateRangeProperty: RollingDateRangePropertyOperation - ): T + fun visitDatetimeRolling(datetimeRolling: RollingDateRangePropertyOperation): T fun visitRollingPropertyUpdated( rollingPropertyUpdated: RollingPropertyUpdatedOperation ): T - fun visitEnumerationProperty(enumerationProperty: EnumerationPropertyOperation): T + fun visitEnumeration(enumeration: EnumerationPropertyOperation): T - fun visitAllPropertyTypes(allPropertyTypes: AllPropertyTypesOperation): T + fun visitAlltypes(alltypes: AllPropertyTypesOperation): T - fun visitRangedNumberProperty(rangedNumberProperty: RangedNumberPropertyOperation): T + fun visitNumberRanged(numberRanged: RangedNumberPropertyOperation): T - fun visitMultiStringProperty(multiStringProperty: MultiStringPropertyOperation): T + fun visitMultistring(multistring: MultiStringPropertyOperation): T - fun visitDateProperty(dateProperty: DatePropertyOperation): T + fun visitDate(date: DatePropertyOperation): T - fun visitCalendarDateProperty(calendarDateProperty: CalendarDatePropertyOperation): T + fun visitCalendarDate(calendarDate: CalendarDatePropertyOperation): T - fun visitTimePoint(timePoint: TimePointOperation): T + fun visitTimepoint(timepoint: TimePointOperation): T - fun visitRangedTime(rangedTime: RangedTimeOperation): T + fun visitRangedtime(rangedtime: RangedTimeOperation): T - fun visitRegexProperty(regexProperty: RegexPropertyOperation): T + fun visitRegex(regex: RegexPropertyOperation): T /** * Maps an unknown variant of [Operation] to a value of type [T]. @@ -1362,86 +1255,139 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Operation { val json = JsonValue.fromJsonNode(node) - - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - Operation(boolProperty = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Operation(numberProperty = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Operation(stringProperty = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Operation(dateTimeProperty = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Operation(rangedDateProperty = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Operation(comparativeDateProperty = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Operation(comparativeBoolProperty = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { Operation(comparativeNumberProperty = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { Operation(comparativeStringProperty = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { Operation(comparativePropertyUpdated = it, _json = json) }, - tryDeserialize( - node, - jacksonTypeRef(), - ) - ?.let { Operation(rollingDateRangeProperty = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Operation(rollingPropertyUpdated = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Operation(enumerationProperty = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - Operation(allPropertyTypes = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Operation(rangedNumberProperty = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Operation(multiStringProperty = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - Operation(dateProperty = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef()) - ?.let { Operation(calendarDateProperty = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - Operation(timePoint = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Operation(rangedTime = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - Operation(regexProperty = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> Operation(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + val propertyType = + json.asObject().getOrNull()?.get("propertyType")?.asString()?.getOrNull() + + when (propertyType) { + "bool" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Operation(bool = it, _json = json) + } ?: Operation(_json = json) + } + "number" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Operation(number = it, _json = json) } + ?: Operation(_json = json) + } + "string" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Operation(string = it, _json = json) } + ?: Operation(_json = json) + } + "datetime" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Operation(datetime = it, _json = json) } + ?: Operation(_json = json) + } + "datetime-ranged" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Operation(datetimeRanged = it, _json = json) } + ?: Operation(_json = json) + } + "datetime-comparative" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(datetimeComparative = it, _json = json) } + ?: Operation(_json = json) + } + "bool-comparative" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(boolComparative = it, _json = json) } + ?: Operation(_json = json) + } + "number-comparative" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(numberComparative = it, _json = json) } + ?: Operation(_json = json) + } + "string-comparative" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(stringComparative = it, _json = json) } + ?: Operation(_json = json) + } + "property-updated-comparative" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(propertyUpdatedComparative = it, _json = json) } + ?: Operation(_json = json) + } + "datetime-rolling" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(datetimeRolling = it, _json = json) } + ?: Operation(_json = json) + } + "rolling-property-updated" -> { + return tryDeserialize( + node, + jacksonTypeRef(), + ) + ?.let { Operation(rollingPropertyUpdated = it, _json = json) } + ?: Operation(_json = json) + } + "enumeration" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Operation(enumeration = it, _json = json) } + ?: Operation(_json = json) + } + "alltypes" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Operation(alltypes = it, _json = json) } + ?: Operation(_json = json) + } + "number-ranged" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Operation(numberRanged = it, _json = json) } + ?: Operation(_json = json) + } + "multistring" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Operation(multistring = it, _json = json) } + ?: Operation(_json = json) + } + "date" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Operation(date = it, _json = json) + } ?: Operation(_json = json) + } + "calendar-date" -> { + return tryDeserialize(node, jacksonTypeRef()) + ?.let { Operation(calendarDate = it, _json = json) } + ?: Operation(_json = json) + } + "timepoint" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Operation(timepoint = it, _json = json) + } ?: Operation(_json = json) + } + "rangedtime" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Operation(rangedtime = it, _json = json) + } ?: Operation(_json = json) + } + "regex" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + Operation(regex = it, _json = json) + } ?: Operation(_json = json) + } } + + return Operation(_json = json) } } @@ -1453,39 +1399,32 @@ private constructor( provider: SerializerProvider, ) { when { - value.boolProperty != null -> generator.writeObject(value.boolProperty) - value.numberProperty != null -> generator.writeObject(value.numberProperty) - value.stringProperty != null -> generator.writeObject(value.stringProperty) - value.dateTimeProperty != null -> generator.writeObject(value.dateTimeProperty) - value.rangedDateProperty != null -> - generator.writeObject(value.rangedDateProperty) - value.comparativeDateProperty != null -> - generator.writeObject(value.comparativeDateProperty) - value.comparativeBoolProperty != null -> - generator.writeObject(value.comparativeBoolProperty) - value.comparativeNumberProperty != null -> - generator.writeObject(value.comparativeNumberProperty) - value.comparativeStringProperty != null -> - generator.writeObject(value.comparativeStringProperty) - value.comparativePropertyUpdated != null -> - generator.writeObject(value.comparativePropertyUpdated) - value.rollingDateRangeProperty != null -> - generator.writeObject(value.rollingDateRangeProperty) + value.bool != null -> generator.writeObject(value.bool) + value.number != null -> generator.writeObject(value.number) + value.string != null -> generator.writeObject(value.string) + value.datetime != null -> generator.writeObject(value.datetime) + value.datetimeRanged != null -> generator.writeObject(value.datetimeRanged) + value.datetimeComparative != null -> + generator.writeObject(value.datetimeComparative) + value.boolComparative != null -> generator.writeObject(value.boolComparative) + value.numberComparative != null -> + generator.writeObject(value.numberComparative) + value.stringComparative != null -> + generator.writeObject(value.stringComparative) + value.propertyUpdatedComparative != null -> + generator.writeObject(value.propertyUpdatedComparative) + value.datetimeRolling != null -> generator.writeObject(value.datetimeRolling) value.rollingPropertyUpdated != null -> generator.writeObject(value.rollingPropertyUpdated) - value.enumerationProperty != null -> - generator.writeObject(value.enumerationProperty) - value.allPropertyTypes != null -> generator.writeObject(value.allPropertyTypes) - value.rangedNumberProperty != null -> - generator.writeObject(value.rangedNumberProperty) - value.multiStringProperty != null -> - generator.writeObject(value.multiStringProperty) - value.dateProperty != null -> generator.writeObject(value.dateProperty) - value.calendarDateProperty != null -> - generator.writeObject(value.calendarDateProperty) - value.timePoint != null -> generator.writeObject(value.timePoint) - value.rangedTime != null -> generator.writeObject(value.rangedTime) - value.regexProperty != null -> generator.writeObject(value.regexProperty) + value.enumeration != null -> generator.writeObject(value.enumeration) + value.alltypes != null -> generator.writeObject(value.alltypes) + value.numberRanged != null -> generator.writeObject(value.numberRanged) + value.multistring != null -> generator.writeObject(value.multistring) + value.date != null -> generator.writeObject(value.date) + value.calendarDate != null -> generator.writeObject(value.calendarDate) + value.timepoint != null -> generator.writeObject(value.timepoint) + value.rangedtime != null -> generator.writeObject(value.rangedtime) + value.regex != null -> generator.writeObject(value.regex) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Operation") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/RangedTimeOperation.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/RangedTimeOperation.kt index 458e19d4..58d0cd76 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/RangedTimeOperation.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/RangedTimeOperation.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -426,12 +425,10 @@ private constructor( /** * Alias for calling [lowerBoundTimePoint] with - * `LowerBoundTimePoint.ofPropertyReferencedTime(propertyReferencedTime)`. + * `LowerBoundTimePoint.ofPropertyReferenced(propertyReferenced)`. */ - fun lowerBoundTimePoint(propertyReferencedTime: PropertyReferencedTime) = - lowerBoundTimePoint( - LowerBoundTimePoint.ofPropertyReferencedTime(propertyReferencedTime) - ) + fun lowerBoundTimePoint(propertyReferenced: PropertyReferencedTime) = + lowerBoundTimePoint(LowerBoundTimePoint.ofPropertyReferenced(propertyReferenced)) fun operationType(operationType: String) = operationType(JsonField.of(operationType)) @@ -547,12 +544,10 @@ private constructor( /** * Alias for calling [upperBoundTimePoint] with - * `UpperBoundTimePoint.ofPropertyReferencedTime(propertyReferencedTime)`. + * `UpperBoundTimePoint.ofPropertyReferenced(propertyReferenced)`. */ - fun upperBoundTimePoint(propertyReferencedTime: PropertyReferencedTime) = - upperBoundTimePoint( - UpperBoundTimePoint.ofPropertyReferencedTime(propertyReferencedTime) - ) + fun upperBoundTimePoint(propertyReferenced: PropertyReferencedTime) = + upperBoundTimePoint(UpperBoundTimePoint.ofPropertyReferenced(propertyReferenced)) fun defaultValue(defaultValue: String) = defaultValue(JsonField.of(defaultValue)) @@ -846,7 +841,7 @@ private constructor( private constructor( private val date: DatePoint? = null, private val indexed: IndexedTimePoint? = null, - private val propertyReferencedTime: PropertyReferencedTime? = null, + private val propertyReferenced: PropertyReferencedTime? = null, private val _json: JsonValue? = null, ) { @@ -854,21 +849,21 @@ private constructor( fun indexed(): Optional = Optional.ofNullable(indexed) - fun propertyReferencedTime(): Optional = - Optional.ofNullable(propertyReferencedTime) + fun propertyReferenced(): Optional = + Optional.ofNullable(propertyReferenced) fun isDate(): Boolean = date != null fun isIndexed(): Boolean = indexed != null - fun isPropertyReferencedTime(): Boolean = propertyReferencedTime != null + fun isPropertyReferenced(): Boolean = propertyReferenced != null fun asDate(): DatePoint = date.getOrThrow("date") fun asIndexed(): IndexedTimePoint = indexed.getOrThrow("indexed") - fun asPropertyReferencedTime(): PropertyReferencedTime = - propertyReferencedTime.getOrThrow("propertyReferencedTime") + fun asPropertyReferenced(): PropertyReferencedTime = + propertyReferenced.getOrThrow("propertyReferenced") fun _json(): Optional = Optional.ofNullable(_json) @@ -905,8 +900,7 @@ private constructor( when { date != null -> visitor.visitDate(date) indexed != null -> visitor.visitIndexed(indexed) - propertyReferencedTime != null -> - visitor.visitPropertyReferencedTime(propertyReferencedTime) + propertyReferenced != null -> visitor.visitPropertyReferenced(propertyReferenced) else -> visitor.unknown(_json) } @@ -936,10 +930,10 @@ private constructor( indexed.validate() } - override fun visitPropertyReferencedTime( - propertyReferencedTime: PropertyReferencedTime + override fun visitPropertyReferenced( + propertyReferenced: PropertyReferencedTime ) { - propertyReferencedTime.validate() + propertyReferenced.validate() } } ) @@ -968,9 +962,9 @@ private constructor( override fun visitIndexed(indexed: IndexedTimePoint) = indexed.validity() - override fun visitPropertyReferencedTime( - propertyReferencedTime: PropertyReferencedTime - ) = propertyReferencedTime.validity() + override fun visitPropertyReferenced( + propertyReferenced: PropertyReferencedTime + ) = propertyReferenced.validity() override fun unknown(json: JsonValue?) = 0 } @@ -984,17 +978,17 @@ private constructor( return other is LowerBoundTimePoint && date == other.date && indexed == other.indexed && - propertyReferencedTime == other.propertyReferencedTime + propertyReferenced == other.propertyReferenced } - override fun hashCode(): Int = Objects.hash(date, indexed, propertyReferencedTime) + override fun hashCode(): Int = Objects.hash(date, indexed, propertyReferenced) override fun toString(): String = when { date != null -> "LowerBoundTimePoint{date=$date}" indexed != null -> "LowerBoundTimePoint{indexed=$indexed}" - propertyReferencedTime != null -> - "LowerBoundTimePoint{propertyReferencedTime=$propertyReferencedTime}" + propertyReferenced != null -> + "LowerBoundTimePoint{propertyReferenced=$propertyReferenced}" _json != null -> "LowerBoundTimePoint{_unknown=$_json}" else -> throw IllegalStateException("Invalid LowerBoundTimePoint") } @@ -1007,8 +1001,8 @@ private constructor( fun ofIndexed(indexed: IndexedTimePoint) = LowerBoundTimePoint(indexed = indexed) @JvmStatic - fun ofPropertyReferencedTime(propertyReferencedTime: PropertyReferencedTime) = - LowerBoundTimePoint(propertyReferencedTime = propertyReferencedTime) + fun ofPropertyReferenced(propertyReferenced: PropertyReferencedTime) = + LowerBoundTimePoint(propertyReferenced = propertyReferenced) } /** @@ -1021,7 +1015,7 @@ private constructor( fun visitIndexed(indexed: IndexedTimePoint): T - fun visitPropertyReferencedTime(propertyReferencedTime: PropertyReferencedTime): T + fun visitPropertyReferenced(propertyReferenced: PropertyReferencedTime): T /** * Maps an unknown variant of [LowerBoundTimePoint] to a value of type [T]. @@ -1043,32 +1037,27 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): LowerBoundTimePoint { val json = JsonValue.fromJsonNode(node) + val timeType = json.asObject().getOrNull()?.get("timeType")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - LowerBoundTimePoint(date = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - LowerBoundTimePoint(indexed = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - LowerBoundTimePoint(propertyReferencedTime = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> LowerBoundTimePoint(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (timeType) { + "DATE" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + LowerBoundTimePoint(date = it, _json = json) + } ?: LowerBoundTimePoint(_json = json) + } + "INDEXED" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + LowerBoundTimePoint(indexed = it, _json = json) + } ?: LowerBoundTimePoint(_json = json) + } + "PROPERTY_REFERENCED" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + LowerBoundTimePoint(propertyReferenced = it, _json = json) + } ?: LowerBoundTimePoint(_json = json) + } } + + return LowerBoundTimePoint(_json = json) } } @@ -1083,8 +1072,8 @@ private constructor( when { value.date != null -> generator.writeObject(value.date) value.indexed != null -> generator.writeObject(value.indexed) - value.propertyReferencedTime != null -> - generator.writeObject(value.propertyReferencedTime) + value.propertyReferenced != null -> + generator.writeObject(value.propertyReferenced) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid LowerBoundTimePoint") } @@ -1666,7 +1655,7 @@ private constructor( private constructor( private val date: DatePoint? = null, private val indexed: IndexedTimePoint? = null, - private val propertyReferencedTime: PropertyReferencedTime? = null, + private val propertyReferenced: PropertyReferencedTime? = null, private val _json: JsonValue? = null, ) { @@ -1674,21 +1663,21 @@ private constructor( fun indexed(): Optional = Optional.ofNullable(indexed) - fun propertyReferencedTime(): Optional = - Optional.ofNullable(propertyReferencedTime) + fun propertyReferenced(): Optional = + Optional.ofNullable(propertyReferenced) fun isDate(): Boolean = date != null fun isIndexed(): Boolean = indexed != null - fun isPropertyReferencedTime(): Boolean = propertyReferencedTime != null + fun isPropertyReferenced(): Boolean = propertyReferenced != null fun asDate(): DatePoint = date.getOrThrow("date") fun asIndexed(): IndexedTimePoint = indexed.getOrThrow("indexed") - fun asPropertyReferencedTime(): PropertyReferencedTime = - propertyReferencedTime.getOrThrow("propertyReferencedTime") + fun asPropertyReferenced(): PropertyReferencedTime = + propertyReferenced.getOrThrow("propertyReferenced") fun _json(): Optional = Optional.ofNullable(_json) @@ -1725,8 +1714,7 @@ private constructor( when { date != null -> visitor.visitDate(date) indexed != null -> visitor.visitIndexed(indexed) - propertyReferencedTime != null -> - visitor.visitPropertyReferencedTime(propertyReferencedTime) + propertyReferenced != null -> visitor.visitPropertyReferenced(propertyReferenced) else -> visitor.unknown(_json) } @@ -1756,10 +1744,10 @@ private constructor( indexed.validate() } - override fun visitPropertyReferencedTime( - propertyReferencedTime: PropertyReferencedTime + override fun visitPropertyReferenced( + propertyReferenced: PropertyReferencedTime ) { - propertyReferencedTime.validate() + propertyReferenced.validate() } } ) @@ -1788,9 +1776,9 @@ private constructor( override fun visitIndexed(indexed: IndexedTimePoint) = indexed.validity() - override fun visitPropertyReferencedTime( - propertyReferencedTime: PropertyReferencedTime - ) = propertyReferencedTime.validity() + override fun visitPropertyReferenced( + propertyReferenced: PropertyReferencedTime + ) = propertyReferenced.validity() override fun unknown(json: JsonValue?) = 0 } @@ -1804,17 +1792,17 @@ private constructor( return other is UpperBoundTimePoint && date == other.date && indexed == other.indexed && - propertyReferencedTime == other.propertyReferencedTime + propertyReferenced == other.propertyReferenced } - override fun hashCode(): Int = Objects.hash(date, indexed, propertyReferencedTime) + override fun hashCode(): Int = Objects.hash(date, indexed, propertyReferenced) override fun toString(): String = when { date != null -> "UpperBoundTimePoint{date=$date}" indexed != null -> "UpperBoundTimePoint{indexed=$indexed}" - propertyReferencedTime != null -> - "UpperBoundTimePoint{propertyReferencedTime=$propertyReferencedTime}" + propertyReferenced != null -> + "UpperBoundTimePoint{propertyReferenced=$propertyReferenced}" _json != null -> "UpperBoundTimePoint{_unknown=$_json}" else -> throw IllegalStateException("Invalid UpperBoundTimePoint") } @@ -1827,8 +1815,8 @@ private constructor( fun ofIndexed(indexed: IndexedTimePoint) = UpperBoundTimePoint(indexed = indexed) @JvmStatic - fun ofPropertyReferencedTime(propertyReferencedTime: PropertyReferencedTime) = - UpperBoundTimePoint(propertyReferencedTime = propertyReferencedTime) + fun ofPropertyReferenced(propertyReferenced: PropertyReferencedTime) = + UpperBoundTimePoint(propertyReferenced = propertyReferenced) } /** @@ -1841,7 +1829,7 @@ private constructor( fun visitIndexed(indexed: IndexedTimePoint): T - fun visitPropertyReferencedTime(propertyReferencedTime: PropertyReferencedTime): T + fun visitPropertyReferenced(propertyReferenced: PropertyReferencedTime): T /** * Maps an unknown variant of [UpperBoundTimePoint] to a value of type [T]. @@ -1863,32 +1851,27 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): UpperBoundTimePoint { val json = JsonValue.fromJsonNode(node) + val timeType = json.asObject().getOrNull()?.get("timeType")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - UpperBoundTimePoint(date = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - UpperBoundTimePoint(indexed = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - UpperBoundTimePoint(propertyReferencedTime = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> UpperBoundTimePoint(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (timeType) { + "DATE" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + UpperBoundTimePoint(date = it, _json = json) + } ?: UpperBoundTimePoint(_json = json) + } + "INDEXED" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + UpperBoundTimePoint(indexed = it, _json = json) + } ?: UpperBoundTimePoint(_json = json) + } + "PROPERTY_REFERENCED" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + UpperBoundTimePoint(propertyReferenced = it, _json = json) + } ?: UpperBoundTimePoint(_json = json) + } } + + return UpperBoundTimePoint(_json = json) } } @@ -1903,8 +1886,8 @@ private constructor( when { value.date != null -> generator.writeObject(value.date) value.indexed != null -> generator.writeObject(value.indexed) - value.propertyReferencedTime != null -> - generator.writeObject(value.propertyReferencedTime) + value.propertyReferenced != null -> + generator.writeObject(value.propertyReferenced) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid UpperBoundTimePoint") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/TimePointOperation.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/TimePointOperation.kt index e10b5190..4840d939 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/TimePointOperation.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/events/definitions/TimePointOperation.kt @@ -20,7 +20,6 @@ import com.hubspot.sdk.core.ExcludeMissing import com.hubspot.sdk.core.JsonField import com.hubspot.sdk.core.JsonMissing import com.hubspot.sdk.core.JsonValue -import com.hubspot.sdk.core.allMaxBy import com.hubspot.sdk.core.checkRequired import com.hubspot.sdk.core.getOrThrow import com.hubspot.sdk.errors.HubSpotInvalidDataException @@ -425,11 +424,10 @@ private constructor( fun timePoint(indexed: IndexedTimePoint) = timePoint(TimePoint.ofIndexed(indexed)) /** - * Alias for calling [timePoint] with - * `TimePoint.ofPropertyReferencedTime(propertyReferencedTime)`. + * Alias for calling [timePoint] with `TimePoint.ofPropertyReferenced(propertyReferenced)`. */ - fun timePoint(propertyReferencedTime: PropertyReferencedTime) = - timePoint(TimePoint.ofPropertyReferencedTime(propertyReferencedTime)) + fun timePoint(propertyReferenced: PropertyReferencedTime) = + timePoint(TimePoint.ofPropertyReferenced(propertyReferenced)) fun type(type: String) = type(JsonField.of(type)) @@ -1147,7 +1145,7 @@ private constructor( private constructor( private val date: DatePoint? = null, private val indexed: IndexedTimePoint? = null, - private val propertyReferencedTime: PropertyReferencedTime? = null, + private val propertyReferenced: PropertyReferencedTime? = null, private val _json: JsonValue? = null, ) { @@ -1155,21 +1153,21 @@ private constructor( fun indexed(): Optional = Optional.ofNullable(indexed) - fun propertyReferencedTime(): Optional = - Optional.ofNullable(propertyReferencedTime) + fun propertyReferenced(): Optional = + Optional.ofNullable(propertyReferenced) fun isDate(): Boolean = date != null fun isIndexed(): Boolean = indexed != null - fun isPropertyReferencedTime(): Boolean = propertyReferencedTime != null + fun isPropertyReferenced(): Boolean = propertyReferenced != null fun asDate(): DatePoint = date.getOrThrow("date") fun asIndexed(): IndexedTimePoint = indexed.getOrThrow("indexed") - fun asPropertyReferencedTime(): PropertyReferencedTime = - propertyReferencedTime.getOrThrow("propertyReferencedTime") + fun asPropertyReferenced(): PropertyReferencedTime = + propertyReferenced.getOrThrow("propertyReferenced") fun _json(): Optional = Optional.ofNullable(_json) @@ -1206,8 +1204,7 @@ private constructor( when { date != null -> visitor.visitDate(date) indexed != null -> visitor.visitIndexed(indexed) - propertyReferencedTime != null -> - visitor.visitPropertyReferencedTime(propertyReferencedTime) + propertyReferenced != null -> visitor.visitPropertyReferenced(propertyReferenced) else -> visitor.unknown(_json) } @@ -1237,10 +1234,10 @@ private constructor( indexed.validate() } - override fun visitPropertyReferencedTime( - propertyReferencedTime: PropertyReferencedTime + override fun visitPropertyReferenced( + propertyReferenced: PropertyReferencedTime ) { - propertyReferencedTime.validate() + propertyReferenced.validate() } } ) @@ -1269,9 +1266,9 @@ private constructor( override fun visitIndexed(indexed: IndexedTimePoint) = indexed.validity() - override fun visitPropertyReferencedTime( - propertyReferencedTime: PropertyReferencedTime - ) = propertyReferencedTime.validity() + override fun visitPropertyReferenced( + propertyReferenced: PropertyReferencedTime + ) = propertyReferenced.validity() override fun unknown(json: JsonValue?) = 0 } @@ -1285,17 +1282,16 @@ private constructor( return other is TimePoint && date == other.date && indexed == other.indexed && - propertyReferencedTime == other.propertyReferencedTime + propertyReferenced == other.propertyReferenced } - override fun hashCode(): Int = Objects.hash(date, indexed, propertyReferencedTime) + override fun hashCode(): Int = Objects.hash(date, indexed, propertyReferenced) override fun toString(): String = when { date != null -> "TimePoint{date=$date}" indexed != null -> "TimePoint{indexed=$indexed}" - propertyReferencedTime != null -> - "TimePoint{propertyReferencedTime=$propertyReferencedTime}" + propertyReferenced != null -> "TimePoint{propertyReferenced=$propertyReferenced}" _json != null -> "TimePoint{_unknown=$_json}" else -> throw IllegalStateException("Invalid TimePoint") } @@ -1307,8 +1303,8 @@ private constructor( @JvmStatic fun ofIndexed(indexed: IndexedTimePoint) = TimePoint(indexed = indexed) @JvmStatic - fun ofPropertyReferencedTime(propertyReferencedTime: PropertyReferencedTime) = - TimePoint(propertyReferencedTime = propertyReferencedTime) + fun ofPropertyReferenced(propertyReferenced: PropertyReferencedTime) = + TimePoint(propertyReferenced = propertyReferenced) } /** @@ -1320,7 +1316,7 @@ private constructor( fun visitIndexed(indexed: IndexedTimePoint): T - fun visitPropertyReferencedTime(propertyReferencedTime: PropertyReferencedTime): T + fun visitPropertyReferenced(propertyReferenced: PropertyReferencedTime): T /** * Maps an unknown variant of [TimePoint] to a value of type [T]. @@ -1341,32 +1337,27 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): TimePoint { val json = JsonValue.fromJsonNode(node) + val timeType = json.asObject().getOrNull()?.get("timeType")?.asString()?.getOrNull() - val bestMatches = - sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - TimePoint(date = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - TimePoint(indexed = it, _json = json) - }, - tryDeserialize(node, jacksonTypeRef())?.let { - TimePoint(propertyReferencedTime = it, _json = json) - }, - ) - .filterNotNull() - .allMaxBy { it.validity() } - .toList() - return when (bestMatches.size) { - // This can happen if what we're deserializing is completely incompatible with - // all the possible variants (e.g. deserializing from boolean). - 0 -> TimePoint(_json = json) - 1 -> bestMatches.single() - // If there's more than one match with the highest validity, then use the first - // completely valid match, or simply the first match if none are completely - // valid. - else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + when (timeType) { + "DATE" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + TimePoint(date = it, _json = json) + } ?: TimePoint(_json = json) + } + "INDEXED" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + TimePoint(indexed = it, _json = json) + } ?: TimePoint(_json = json) + } + "PROPERTY_REFERENCED" -> { + return tryDeserialize(node, jacksonTypeRef())?.let { + TimePoint(propertyReferenced = it, _json = json) + } ?: TimePoint(_json = json) + } } + + return TimePoint(_json = json) } } @@ -1380,8 +1371,8 @@ private constructor( when { value.date != null -> generator.writeObject(value.date) value.indexed != null -> generator.writeObject(value.indexed) - value.propertyReferencedTime != null -> - generator.writeObject(value.propertyReferencedTime) + value.propertyReferenced != null -> + generator.writeObject(value.propertyReferenced) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid TimePoint") } diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/marketing/emails/EmailCreateRequest.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/marketing/emails/EmailCreateRequest.kt index fcbc710e..6a8a738f 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/marketing/emails/EmailCreateRequest.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/marketing/emails/EmailCreateRequest.kt @@ -1039,6 +1039,10 @@ private constructor( @JvmField val BA = of("ba") + @JvmField val BAL = of("bal") + + @JvmField val BAL_PK = of("bal-pk") + @JvmField val BAS = of("bas") @JvmField val BAS_CM = of("bas-cm") @@ -1069,6 +1073,10 @@ private constructor( @JvmField val BI = of("bi") + @JvmField val BLO = of("blo") + + @JvmField val BLO_BJ = of("blo-bj") + @JvmField val BM = of("bm") @JvmField val BM_ML = of("bm-ml") @@ -1145,6 +1153,10 @@ private constructor( @JvmField val CS_CZ = of("cs-cz") + @JvmField val CSW = of("csw") + + @JvmField val CSW_CA = of("csw-ca") + @JvmField val CU = of("cu") @JvmField val CU_RU = of("cu-ru") @@ -1275,6 +1287,8 @@ private constructor( @JvmField val EN_CY = of("en-cy") + @JvmField val EN_CZ = of("en-cz") + @JvmField val EN_DE = of("en-de") @JvmField val EN_DG = of("en-dg") @@ -1313,12 +1327,16 @@ private constructor( @JvmField val EN_GM = of("en-gm") + @JvmField val EN_GS = of("en-gs") + @JvmField val EN_GU = of("en-gu") @JvmField val EN_GY = of("en-gy") @JvmField val EN_HK = of("en-hk") + @JvmField val EN_HU = of("en-hu") + @JvmField val EN_ID = of("en-id") @JvmField val EN_IE = of("en-ie") @@ -1331,6 +1349,8 @@ private constructor( @JvmField val EN_IO = of("en-io") + @JvmField val EN_IT = of("en-it") + @JvmField val EN_JE = of("en-je") @JvmField val EN_JM = of("en-jm") @@ -1381,6 +1401,8 @@ private constructor( @JvmField val EN_NL = of("en-nl") + @JvmField val EN_NO = of("en-no") + @JvmField val EN_NR = of("en-nr") @JvmField val EN_NU = of("en-nu") @@ -1393,6 +1415,8 @@ private constructor( @JvmField val EN_PK = of("en-pk") + @JvmField val EN_PL = of("en-pl") + @JvmField val EN_PN = of("en-pn") @JvmField val EN_PR = of("en-pr") @@ -1401,6 +1425,8 @@ private constructor( @JvmField val EN_PW = of("en-pw") + @JvmField val EN_RO = of("en-ro") + @JvmField val EN_RW = of("en-rw") @JvmField val EN_SB = of("en-sb") @@ -1417,6 +1443,8 @@ private constructor( @JvmField val EN_SI = of("en-si") + @JvmField val EN_SK = of("en-sk") + @JvmField val EN_SL = of("en-sl") @JvmField val EN_SS = of("en-ss") @@ -1699,6 +1727,10 @@ private constructor( @JvmField val GA_IE = of("ga-ie") + @JvmField val GAA = of("gaa") + + @JvmField val GAA_GH = of("gaa-gh") + @JvmField val GD = of("gd") @JvmField val GD_GB = of("gd-gb") @@ -1765,6 +1797,8 @@ private constructor( @JvmField val HT = of("ht") + @JvmField val HT_HT = of("ht-ht") + @JvmField val HU = of("hu") @JvmField val HU_HU = of("hu-hu") @@ -1785,6 +1819,8 @@ private constructor( @JvmField val IE = of("ie") + @JvmField val IE_EE = of("ie-ee") + @JvmField val IG = of("ig") @JvmField val IG_NG = of("ig-ng") @@ -1895,6 +1931,8 @@ private constructor( @JvmField val KO = of("ko") + @JvmField val KO_CN = of("ko-cn") + @JvmField val KO_KP = of("ko-kp") @JvmField val KO_KR = of("ko-kr") @@ -1931,6 +1969,10 @@ private constructor( @JvmField val KW_GB = of("kw-gb") + @JvmField val KXV = of("kxv") + + @JvmField val KXV_IN = of("kxv-in") + @JvmField val KY = of("ky") @JvmField val KY_KG = of("ky-kg") @@ -1951,10 +1993,18 @@ private constructor( @JvmField val LI = of("li") + @JvmField val LIJ = of("lij") + + @JvmField val LIJ_IT = of("lij-it") + @JvmField val LKT = of("lkt") @JvmField val LKT_US = of("lkt-us") + @JvmField val LMO = of("lmo") + + @JvmField val LMO_IT = of("lmo-it") + @JvmField val LN = of("ln") @JvmField val LN_AO = of("ln-ao") @@ -2147,8 +2197,16 @@ private constructor( @JvmField val NO_NO = of("no-no") + @JvmField val NQO = of("nqo") + + @JvmField val NQO_GN = of("nqo-gn") + @JvmField val NR = of("nr") + @JvmField val NSO = of("nso") + + @JvmField val NSO_ZA = of("nso-za") + @JvmField val NUS = of("nus") @JvmField val NUS_SS = of("nus-ss") @@ -2407,6 +2465,10 @@ private constructor( @JvmField val ST = of("st") + @JvmField val ST_LS = of("st-ls") + + @JvmField val ST_ZA = of("st-za") + @JvmField val SU = of("su") @JvmField val SU_ID = of("su-id") @@ -2431,6 +2493,16 @@ private constructor( @JvmField val SY = of("sy") + @JvmField val SYR = of("syr") + + @JvmField val SYR_IQ = of("syr-iq") + + @JvmField val SYR_SY = of("syr-sy") + + @JvmField val SZL = of("szl") + + @JvmField val SZL_PL = of("szl-pl") + @JvmField val TA = of("ta") @JvmField val TA_IN = of("ta-in") @@ -2473,6 +2545,10 @@ private constructor( @JvmField val TN = of("tn") + @JvmField val TN_BW = of("tn-bw") + + @JvmField val TN_ZA = of("tn-za") + @JvmField val TO = of("to") @JvmField val TO_TO = of("to-to") @@ -2531,10 +2607,18 @@ private constructor( @JvmField val VE = of("ve") + @JvmField val VEC = of("vec") + + @JvmField val VEC_IT = of("vec-it") + @JvmField val VI = of("vi") @JvmField val VI_VN = of("vi-vn") + @JvmField val VMW = of("vmw") + + @JvmField val VMW_MZ = of("vmw-mz") + @JvmField val VO = of("vo") @JvmField val VO_001 = of("vo-001") @@ -2557,6 +2641,10 @@ private constructor( @JvmField val XH_ZA = of("xh-za") + @JvmField val XNR = of("xnr") + + @JvmField val XNR_IN = of("xnr-in") + @JvmField val XOG = of("xog") @JvmField val XOG_UG = of("xog-ug") @@ -2569,6 +2657,8 @@ private constructor( @JvmField val YI_001 = of("yi-001") + @JvmField val YI_UA = of("yi-ua") + @JvmField val YO = of("yo") @JvmField val YO_BJ = of("yo-bj") @@ -2589,8 +2679,12 @@ private constructor( @JvmField val YUE_HK = of("yue-hk") + @JvmField val YUE_MO = of("yue-mo") + @JvmField val ZA = of("za") + @JvmField val ZA_CN = of("za-cn") + @JvmField val ZGH = of("zgh") @JvmField val ZGH_MA = of("zgh-ma") @@ -2607,6 +2701,8 @@ private constructor( @JvmField val ZH_MO = of("zh-mo") + @JvmField val ZH_MY = of("zh-my") + @JvmField val ZH_SG = of("zh-sg") @JvmField val ZH_TW = of("zh-tw") @@ -2675,6 +2771,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -2690,6 +2788,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -2728,6 +2828,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -2793,6 +2895,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -2812,15 +2915,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -2846,16 +2952,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -2864,6 +2973,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -3005,6 +3115,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -3038,6 +3150,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -3048,6 +3161,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -3103,6 +3217,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -3121,6 +3236,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -3131,8 +3248,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -3229,7 +3350,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -3359,6 +3484,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -3371,6 +3498,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -3392,6 +3524,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -3421,8 +3555,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -3434,12 +3572,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -3450,7 +3591,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -3459,6 +3602,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -3530,6 +3674,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -3545,6 +3691,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -3583,6 +3731,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -3648,6 +3798,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -3667,15 +3818,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -3701,16 +3855,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -3719,6 +3876,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -3860,6 +4018,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -3893,6 +4053,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -3903,6 +4064,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -3958,6 +4120,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -3976,6 +4139,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -3986,8 +4151,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -4084,7 +4253,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -4214,6 +4387,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -4226,6 +4401,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -4247,6 +4427,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -4276,8 +4458,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -4289,12 +4475,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -4305,7 +4494,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -4314,6 +4505,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -4386,6 +4578,8 @@ private constructor( AZ -> Value.AZ AZ_AZ -> Value.AZ_AZ BA -> Value.BA + BAL -> Value.BAL + BAL_PK -> Value.BAL_PK BAS -> Value.BAS BAS_CM -> Value.BAS_CM BE -> Value.BE @@ -4401,6 +4595,8 @@ private constructor( BHO -> Value.BHO BHO_IN -> Value.BHO_IN BI -> Value.BI + BLO -> Value.BLO + BLO_BJ -> Value.BLO_BJ BM -> Value.BM BM_ML -> Value.BM_ML BN -> Value.BN @@ -4439,6 +4635,8 @@ private constructor( CR -> Value.CR CS -> Value.CS CS_CZ -> Value.CS_CZ + CSW -> Value.CSW + CSW_CA -> Value.CSW_CA CU -> Value.CU CU_RU -> Value.CU_RU CV -> Value.CV @@ -4504,6 +4702,7 @@ private constructor( EN_CN -> Value.EN_CN EN_CX -> Value.EN_CX EN_CY -> Value.EN_CY + EN_CZ -> Value.EN_CZ EN_DE -> Value.EN_DE EN_DG -> Value.EN_DG EN_DK -> Value.EN_DK @@ -4523,15 +4722,18 @@ private constructor( EN_GH -> Value.EN_GH EN_GI -> Value.EN_GI EN_GM -> Value.EN_GM + EN_GS -> Value.EN_GS EN_GU -> Value.EN_GU EN_GY -> Value.EN_GY EN_HK -> Value.EN_HK + EN_HU -> Value.EN_HU EN_ID -> Value.EN_ID EN_IE -> Value.EN_IE EN_IL -> Value.EN_IL EN_IM -> Value.EN_IM EN_IN -> Value.EN_IN EN_IO -> Value.EN_IO + EN_IT -> Value.EN_IT EN_JE -> Value.EN_JE EN_JM -> Value.EN_JM EN_KE -> Value.EN_KE @@ -4557,16 +4759,19 @@ private constructor( EN_NF -> Value.EN_NF EN_NG -> Value.EN_NG EN_NL -> Value.EN_NL + EN_NO -> Value.EN_NO EN_NR -> Value.EN_NR EN_NU -> Value.EN_NU EN_NZ -> Value.EN_NZ EN_PG -> Value.EN_PG EN_PH -> Value.EN_PH EN_PK -> Value.EN_PK + EN_PL -> Value.EN_PL EN_PN -> Value.EN_PN EN_PR -> Value.EN_PR EN_PT -> Value.EN_PT EN_PW -> Value.EN_PW + EN_RO -> Value.EN_RO EN_RW -> Value.EN_RW EN_SB -> Value.EN_SB EN_SC -> Value.EN_SC @@ -4575,6 +4780,7 @@ private constructor( EN_SG -> Value.EN_SG EN_SH -> Value.EN_SH EN_SI -> Value.EN_SI + EN_SK -> Value.EN_SK EN_SL -> Value.EN_SL EN_SS -> Value.EN_SS EN_SX -> Value.EN_SX @@ -4716,6 +4922,8 @@ private constructor( GA -> Value.GA GA_GB -> Value.GA_GB GA_IE -> Value.GA_IE + GAA -> Value.GAA + GAA_GH -> Value.GAA_GH GD -> Value.GD GD_GB -> Value.GD_GB GL -> Value.GL @@ -4749,6 +4957,7 @@ private constructor( HSB -> Value.HSB HSB_DE -> Value.HSB_DE HT -> Value.HT + HT_HT -> Value.HT_HT HU -> Value.HU HU_HU -> Value.HU_HU HY -> Value.HY @@ -4759,6 +4968,7 @@ private constructor( ID -> Value.ID ID_ID -> Value.ID_ID IE -> Value.IE + IE_EE -> Value.IE_EE IG -> Value.IG IG_NG -> Value.IG_NG II -> Value.II @@ -4814,6 +5024,7 @@ private constructor( KN -> Value.KN KN_IN -> Value.KN_IN KO -> Value.KO + KO_CN -> Value.KO_CN KO_KP -> Value.KO_KP KO_KR -> Value.KO_KR KOK -> Value.KOK @@ -4832,6 +5043,8 @@ private constructor( KV -> Value.KV KW -> Value.KW KW_GB -> Value.KW_GB + KXV -> Value.KXV + KXV_IN -> Value.KXV_IN KY -> Value.KY KY_KG -> Value.KY_KG LA -> Value.LA @@ -4842,8 +5055,12 @@ private constructor( LG -> Value.LG LG_UG -> Value.LG_UG LI -> Value.LI + LIJ -> Value.LIJ + LIJ_IT -> Value.LIJ_IT LKT -> Value.LKT LKT_US -> Value.LKT_US + LMO -> Value.LMO + LMO_IT -> Value.LMO_IT LN -> Value.LN LN_AO -> Value.LN_AO LN_CD -> Value.LN_CD @@ -4940,7 +5157,11 @@ private constructor( NNH_CM -> Value.NNH_CM NO -> Value.NO NO_NO -> Value.NO_NO + NQO -> Value.NQO + NQO_GN -> Value.NQO_GN NR -> Value.NR + NSO -> Value.NSO + NSO_ZA -> Value.NSO_ZA NUS -> Value.NUS NUS_SS -> Value.NUS_SS NV -> Value.NV @@ -5070,6 +5291,8 @@ private constructor( SR_XK -> Value.SR_XK SS -> Value.SS ST -> Value.ST + ST_LS -> Value.ST_LS + ST_ZA -> Value.ST_ZA SU -> Value.SU SU_ID -> Value.SU_ID SV -> Value.SV @@ -5082,6 +5305,11 @@ private constructor( SW_TZ -> Value.SW_TZ SW_UG -> Value.SW_UG SY -> Value.SY + SYR -> Value.SYR + SYR_IQ -> Value.SYR_IQ + SYR_SY -> Value.SYR_SY + SZL -> Value.SZL + SZL_PL -> Value.SZL_PL TA -> Value.TA TA_IN -> Value.TA_IN TA_LK -> Value.TA_LK @@ -5103,6 +5331,8 @@ private constructor( TK_TM -> Value.TK_TM TL -> Value.TL TN -> Value.TN + TN_BW -> Value.TN_BW + TN_ZA -> Value.TN_ZA TO -> Value.TO TO_TO -> Value.TO_TO TOK -> Value.TOK @@ -5132,8 +5362,12 @@ private constructor( VAI -> Value.VAI VAI_LR -> Value.VAI_LR VE -> Value.VE + VEC -> Value.VEC + VEC_IT -> Value.VEC_IT VI -> Value.VI VI_VN -> Value.VI_VN + VMW -> Value.VMW + VMW_MZ -> Value.VMW_MZ VO -> Value.VO VO_001 -> Value.VO_001 VUN -> Value.VUN @@ -5145,12 +5379,15 @@ private constructor( WO_SN -> Value.WO_SN XH -> Value.XH XH_ZA -> Value.XH_ZA + XNR -> Value.XNR + XNR_IN -> Value.XNR_IN XOG -> Value.XOG XOG_UG -> Value.XOG_UG YAV -> Value.YAV YAV_CM -> Value.YAV_CM YI -> Value.YI YI_001 -> Value.YI_001 + YI_UA -> Value.YI_UA YO -> Value.YO YO_BJ -> Value.YO_BJ YO_NG -> Value.YO_NG @@ -5161,7 +5398,9 @@ private constructor( YUE -> Value.YUE YUE_CN -> Value.YUE_CN YUE_HK -> Value.YUE_HK + YUE_MO -> Value.YUE_MO ZA -> Value.ZA + ZA_CN -> Value.ZA_CN ZGH -> Value.ZGH ZGH_MA -> Value.ZGH_MA ZH -> Value.ZH @@ -5170,6 +5409,7 @@ private constructor( ZH_HANT -> Value.ZH_HANT ZH_HK -> Value.ZH_HK ZH_MO -> Value.ZH_MO + ZH_MY -> Value.ZH_MY ZH_SG -> Value.ZH_SG ZH_TW -> Value.ZH_TW ZU -> Value.ZU @@ -5243,6 +5483,8 @@ private constructor( AZ -> Known.AZ AZ_AZ -> Known.AZ_AZ BA -> Known.BA + BAL -> Known.BAL + BAL_PK -> Known.BAL_PK BAS -> Known.BAS BAS_CM -> Known.BAS_CM BE -> Known.BE @@ -5258,6 +5500,8 @@ private constructor( BHO -> Known.BHO BHO_IN -> Known.BHO_IN BI -> Known.BI + BLO -> Known.BLO + BLO_BJ -> Known.BLO_BJ BM -> Known.BM BM_ML -> Known.BM_ML BN -> Known.BN @@ -5296,6 +5540,8 @@ private constructor( CR -> Known.CR CS -> Known.CS CS_CZ -> Known.CS_CZ + CSW -> Known.CSW + CSW_CA -> Known.CSW_CA CU -> Known.CU CU_RU -> Known.CU_RU CV -> Known.CV @@ -5361,6 +5607,7 @@ private constructor( EN_CN -> Known.EN_CN EN_CX -> Known.EN_CX EN_CY -> Known.EN_CY + EN_CZ -> Known.EN_CZ EN_DE -> Known.EN_DE EN_DG -> Known.EN_DG EN_DK -> Known.EN_DK @@ -5380,15 +5627,18 @@ private constructor( EN_GH -> Known.EN_GH EN_GI -> Known.EN_GI EN_GM -> Known.EN_GM + EN_GS -> Known.EN_GS EN_GU -> Known.EN_GU EN_GY -> Known.EN_GY EN_HK -> Known.EN_HK + EN_HU -> Known.EN_HU EN_ID -> Known.EN_ID EN_IE -> Known.EN_IE EN_IL -> Known.EN_IL EN_IM -> Known.EN_IM EN_IN -> Known.EN_IN EN_IO -> Known.EN_IO + EN_IT -> Known.EN_IT EN_JE -> Known.EN_JE EN_JM -> Known.EN_JM EN_KE -> Known.EN_KE @@ -5414,16 +5664,19 @@ private constructor( EN_NF -> Known.EN_NF EN_NG -> Known.EN_NG EN_NL -> Known.EN_NL + EN_NO -> Known.EN_NO EN_NR -> Known.EN_NR EN_NU -> Known.EN_NU EN_NZ -> Known.EN_NZ EN_PG -> Known.EN_PG EN_PH -> Known.EN_PH EN_PK -> Known.EN_PK + EN_PL -> Known.EN_PL EN_PN -> Known.EN_PN EN_PR -> Known.EN_PR EN_PT -> Known.EN_PT EN_PW -> Known.EN_PW + EN_RO -> Known.EN_RO EN_RW -> Known.EN_RW EN_SB -> Known.EN_SB EN_SC -> Known.EN_SC @@ -5432,6 +5685,7 @@ private constructor( EN_SG -> Known.EN_SG EN_SH -> Known.EN_SH EN_SI -> Known.EN_SI + EN_SK -> Known.EN_SK EN_SL -> Known.EN_SL EN_SS -> Known.EN_SS EN_SX -> Known.EN_SX @@ -5573,6 +5827,8 @@ private constructor( GA -> Known.GA GA_GB -> Known.GA_GB GA_IE -> Known.GA_IE + GAA -> Known.GAA + GAA_GH -> Known.GAA_GH GD -> Known.GD GD_GB -> Known.GD_GB GL -> Known.GL @@ -5606,6 +5862,7 @@ private constructor( HSB -> Known.HSB HSB_DE -> Known.HSB_DE HT -> Known.HT + HT_HT -> Known.HT_HT HU -> Known.HU HU_HU -> Known.HU_HU HY -> Known.HY @@ -5616,6 +5873,7 @@ private constructor( ID -> Known.ID ID_ID -> Known.ID_ID IE -> Known.IE + IE_EE -> Known.IE_EE IG -> Known.IG IG_NG -> Known.IG_NG II -> Known.II @@ -5671,6 +5929,7 @@ private constructor( KN -> Known.KN KN_IN -> Known.KN_IN KO -> Known.KO + KO_CN -> Known.KO_CN KO_KP -> Known.KO_KP KO_KR -> Known.KO_KR KOK -> Known.KOK @@ -5689,6 +5948,8 @@ private constructor( KV -> Known.KV KW -> Known.KW KW_GB -> Known.KW_GB + KXV -> Known.KXV + KXV_IN -> Known.KXV_IN KY -> Known.KY KY_KG -> Known.KY_KG LA -> Known.LA @@ -5699,8 +5960,12 @@ private constructor( LG -> Known.LG LG_UG -> Known.LG_UG LI -> Known.LI + LIJ -> Known.LIJ + LIJ_IT -> Known.LIJ_IT LKT -> Known.LKT LKT_US -> Known.LKT_US + LMO -> Known.LMO + LMO_IT -> Known.LMO_IT LN -> Known.LN LN_AO -> Known.LN_AO LN_CD -> Known.LN_CD @@ -5797,7 +6062,11 @@ private constructor( NNH_CM -> Known.NNH_CM NO -> Known.NO NO_NO -> Known.NO_NO + NQO -> Known.NQO + NQO_GN -> Known.NQO_GN NR -> Known.NR + NSO -> Known.NSO + NSO_ZA -> Known.NSO_ZA NUS -> Known.NUS NUS_SS -> Known.NUS_SS NV -> Known.NV @@ -5927,6 +6196,8 @@ private constructor( SR_XK -> Known.SR_XK SS -> Known.SS ST -> Known.ST + ST_LS -> Known.ST_LS + ST_ZA -> Known.ST_ZA SU -> Known.SU SU_ID -> Known.SU_ID SV -> Known.SV @@ -5939,6 +6210,11 @@ private constructor( SW_TZ -> Known.SW_TZ SW_UG -> Known.SW_UG SY -> Known.SY + SYR -> Known.SYR + SYR_IQ -> Known.SYR_IQ + SYR_SY -> Known.SYR_SY + SZL -> Known.SZL + SZL_PL -> Known.SZL_PL TA -> Known.TA TA_IN -> Known.TA_IN TA_LK -> Known.TA_LK @@ -5960,6 +6236,8 @@ private constructor( TK_TM -> Known.TK_TM TL -> Known.TL TN -> Known.TN + TN_BW -> Known.TN_BW + TN_ZA -> Known.TN_ZA TO -> Known.TO TO_TO -> Known.TO_TO TOK -> Known.TOK @@ -5989,8 +6267,12 @@ private constructor( VAI -> Known.VAI VAI_LR -> Known.VAI_LR VE -> Known.VE + VEC -> Known.VEC + VEC_IT -> Known.VEC_IT VI -> Known.VI VI_VN -> Known.VI_VN + VMW -> Known.VMW + VMW_MZ -> Known.VMW_MZ VO -> Known.VO VO_001 -> Known.VO_001 VUN -> Known.VUN @@ -6002,12 +6284,15 @@ private constructor( WO_SN -> Known.WO_SN XH -> Known.XH XH_ZA -> Known.XH_ZA + XNR -> Known.XNR + XNR_IN -> Known.XNR_IN XOG -> Known.XOG XOG_UG -> Known.XOG_UG YAV -> Known.YAV YAV_CM -> Known.YAV_CM YI -> Known.YI YI_001 -> Known.YI_001 + YI_UA -> Known.YI_UA YO -> Known.YO YO_BJ -> Known.YO_BJ YO_NG -> Known.YO_NG @@ -6018,7 +6303,9 @@ private constructor( YUE -> Known.YUE YUE_CN -> Known.YUE_CN YUE_HK -> Known.YUE_HK + YUE_MO -> Known.YUE_MO ZA -> Known.ZA + ZA_CN -> Known.ZA_CN ZGH -> Known.ZGH ZGH_MA -> Known.ZGH_MA ZH -> Known.ZH @@ -6027,6 +6314,7 @@ private constructor( ZH_HANT -> Known.ZH_HANT ZH_HK -> Known.ZH_HK ZH_MO -> Known.ZH_MO + ZH_MY -> Known.ZH_MY ZH_SG -> Known.ZH_SG ZH_TW -> Known.ZH_TW ZU -> Known.ZU diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/marketing/emails/EmailUpdateRequest.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/marketing/emails/EmailUpdateRequest.kt index 483963d7..41ebea69 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/marketing/emails/EmailUpdateRequest.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/marketing/emails/EmailUpdateRequest.kt @@ -996,6 +996,10 @@ private constructor( @JvmField val BA = of("ba") + @JvmField val BAL = of("bal") + + @JvmField val BAL_PK = of("bal-pk") + @JvmField val BAS = of("bas") @JvmField val BAS_CM = of("bas-cm") @@ -1026,6 +1030,10 @@ private constructor( @JvmField val BI = of("bi") + @JvmField val BLO = of("blo") + + @JvmField val BLO_BJ = of("blo-bj") + @JvmField val BM = of("bm") @JvmField val BM_ML = of("bm-ml") @@ -1102,6 +1110,10 @@ private constructor( @JvmField val CS_CZ = of("cs-cz") + @JvmField val CSW = of("csw") + + @JvmField val CSW_CA = of("csw-ca") + @JvmField val CU = of("cu") @JvmField val CU_RU = of("cu-ru") @@ -1232,6 +1244,8 @@ private constructor( @JvmField val EN_CY = of("en-cy") + @JvmField val EN_CZ = of("en-cz") + @JvmField val EN_DE = of("en-de") @JvmField val EN_DG = of("en-dg") @@ -1270,12 +1284,16 @@ private constructor( @JvmField val EN_GM = of("en-gm") + @JvmField val EN_GS = of("en-gs") + @JvmField val EN_GU = of("en-gu") @JvmField val EN_GY = of("en-gy") @JvmField val EN_HK = of("en-hk") + @JvmField val EN_HU = of("en-hu") + @JvmField val EN_ID = of("en-id") @JvmField val EN_IE = of("en-ie") @@ -1288,6 +1306,8 @@ private constructor( @JvmField val EN_IO = of("en-io") + @JvmField val EN_IT = of("en-it") + @JvmField val EN_JE = of("en-je") @JvmField val EN_JM = of("en-jm") @@ -1338,6 +1358,8 @@ private constructor( @JvmField val EN_NL = of("en-nl") + @JvmField val EN_NO = of("en-no") + @JvmField val EN_NR = of("en-nr") @JvmField val EN_NU = of("en-nu") @@ -1350,6 +1372,8 @@ private constructor( @JvmField val EN_PK = of("en-pk") + @JvmField val EN_PL = of("en-pl") + @JvmField val EN_PN = of("en-pn") @JvmField val EN_PR = of("en-pr") @@ -1358,6 +1382,8 @@ private constructor( @JvmField val EN_PW = of("en-pw") + @JvmField val EN_RO = of("en-ro") + @JvmField val EN_RW = of("en-rw") @JvmField val EN_SB = of("en-sb") @@ -1374,6 +1400,8 @@ private constructor( @JvmField val EN_SI = of("en-si") + @JvmField val EN_SK = of("en-sk") + @JvmField val EN_SL = of("en-sl") @JvmField val EN_SS = of("en-ss") @@ -1656,6 +1684,10 @@ private constructor( @JvmField val GA_IE = of("ga-ie") + @JvmField val GAA = of("gaa") + + @JvmField val GAA_GH = of("gaa-gh") + @JvmField val GD = of("gd") @JvmField val GD_GB = of("gd-gb") @@ -1722,6 +1754,8 @@ private constructor( @JvmField val HT = of("ht") + @JvmField val HT_HT = of("ht-ht") + @JvmField val HU = of("hu") @JvmField val HU_HU = of("hu-hu") @@ -1742,6 +1776,8 @@ private constructor( @JvmField val IE = of("ie") + @JvmField val IE_EE = of("ie-ee") + @JvmField val IG = of("ig") @JvmField val IG_NG = of("ig-ng") @@ -1852,6 +1888,8 @@ private constructor( @JvmField val KO = of("ko") + @JvmField val KO_CN = of("ko-cn") + @JvmField val KO_KP = of("ko-kp") @JvmField val KO_KR = of("ko-kr") @@ -1888,6 +1926,10 @@ private constructor( @JvmField val KW_GB = of("kw-gb") + @JvmField val KXV = of("kxv") + + @JvmField val KXV_IN = of("kxv-in") + @JvmField val KY = of("ky") @JvmField val KY_KG = of("ky-kg") @@ -1908,10 +1950,18 @@ private constructor( @JvmField val LI = of("li") + @JvmField val LIJ = of("lij") + + @JvmField val LIJ_IT = of("lij-it") + @JvmField val LKT = of("lkt") @JvmField val LKT_US = of("lkt-us") + @JvmField val LMO = of("lmo") + + @JvmField val LMO_IT = of("lmo-it") + @JvmField val LN = of("ln") @JvmField val LN_AO = of("ln-ao") @@ -2104,8 +2154,16 @@ private constructor( @JvmField val NO_NO = of("no-no") + @JvmField val NQO = of("nqo") + + @JvmField val NQO_GN = of("nqo-gn") + @JvmField val NR = of("nr") + @JvmField val NSO = of("nso") + + @JvmField val NSO_ZA = of("nso-za") + @JvmField val NUS = of("nus") @JvmField val NUS_SS = of("nus-ss") @@ -2364,6 +2422,10 @@ private constructor( @JvmField val ST = of("st") + @JvmField val ST_LS = of("st-ls") + + @JvmField val ST_ZA = of("st-za") + @JvmField val SU = of("su") @JvmField val SU_ID = of("su-id") @@ -2388,6 +2450,16 @@ private constructor( @JvmField val SY = of("sy") + @JvmField val SYR = of("syr") + + @JvmField val SYR_IQ = of("syr-iq") + + @JvmField val SYR_SY = of("syr-sy") + + @JvmField val SZL = of("szl") + + @JvmField val SZL_PL = of("szl-pl") + @JvmField val TA = of("ta") @JvmField val TA_IN = of("ta-in") @@ -2430,6 +2502,10 @@ private constructor( @JvmField val TN = of("tn") + @JvmField val TN_BW = of("tn-bw") + + @JvmField val TN_ZA = of("tn-za") + @JvmField val TO = of("to") @JvmField val TO_TO = of("to-to") @@ -2488,10 +2564,18 @@ private constructor( @JvmField val VE = of("ve") + @JvmField val VEC = of("vec") + + @JvmField val VEC_IT = of("vec-it") + @JvmField val VI = of("vi") @JvmField val VI_VN = of("vi-vn") + @JvmField val VMW = of("vmw") + + @JvmField val VMW_MZ = of("vmw-mz") + @JvmField val VO = of("vo") @JvmField val VO_001 = of("vo-001") @@ -2514,6 +2598,10 @@ private constructor( @JvmField val XH_ZA = of("xh-za") + @JvmField val XNR = of("xnr") + + @JvmField val XNR_IN = of("xnr-in") + @JvmField val XOG = of("xog") @JvmField val XOG_UG = of("xog-ug") @@ -2526,6 +2614,8 @@ private constructor( @JvmField val YI_001 = of("yi-001") + @JvmField val YI_UA = of("yi-ua") + @JvmField val YO = of("yo") @JvmField val YO_BJ = of("yo-bj") @@ -2546,8 +2636,12 @@ private constructor( @JvmField val YUE_HK = of("yue-hk") + @JvmField val YUE_MO = of("yue-mo") + @JvmField val ZA = of("za") + @JvmField val ZA_CN = of("za-cn") + @JvmField val ZGH = of("zgh") @JvmField val ZGH_MA = of("zgh-ma") @@ -2564,6 +2658,8 @@ private constructor( @JvmField val ZH_MO = of("zh-mo") + @JvmField val ZH_MY = of("zh-my") + @JvmField val ZH_SG = of("zh-sg") @JvmField val ZH_TW = of("zh-tw") @@ -2632,6 +2728,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -2647,6 +2745,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -2685,6 +2785,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -2750,6 +2852,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -2769,15 +2872,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -2803,16 +2909,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -2821,6 +2930,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -2962,6 +3072,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -2995,6 +3107,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -3005,6 +3118,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -3060,6 +3174,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -3078,6 +3193,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -3088,8 +3205,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -3186,7 +3307,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -3316,6 +3441,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -3328,6 +3455,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -3349,6 +3481,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -3378,8 +3512,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -3391,12 +3529,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -3407,7 +3548,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -3416,6 +3559,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -3487,6 +3631,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -3502,6 +3648,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -3540,6 +3688,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -3605,6 +3755,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -3624,15 +3775,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -3658,16 +3812,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -3676,6 +3833,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -3817,6 +3975,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -3850,6 +4010,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -3860,6 +4021,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -3915,6 +4077,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -3933,6 +4096,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -3943,8 +4108,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -4041,7 +4210,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -4171,6 +4344,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -4183,6 +4358,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -4204,6 +4384,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -4233,8 +4415,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -4246,12 +4432,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -4262,7 +4451,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -4271,6 +4462,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -4343,6 +4535,8 @@ private constructor( AZ -> Value.AZ AZ_AZ -> Value.AZ_AZ BA -> Value.BA + BAL -> Value.BAL + BAL_PK -> Value.BAL_PK BAS -> Value.BAS BAS_CM -> Value.BAS_CM BE -> Value.BE @@ -4358,6 +4552,8 @@ private constructor( BHO -> Value.BHO BHO_IN -> Value.BHO_IN BI -> Value.BI + BLO -> Value.BLO + BLO_BJ -> Value.BLO_BJ BM -> Value.BM BM_ML -> Value.BM_ML BN -> Value.BN @@ -4396,6 +4592,8 @@ private constructor( CR -> Value.CR CS -> Value.CS CS_CZ -> Value.CS_CZ + CSW -> Value.CSW + CSW_CA -> Value.CSW_CA CU -> Value.CU CU_RU -> Value.CU_RU CV -> Value.CV @@ -4461,6 +4659,7 @@ private constructor( EN_CN -> Value.EN_CN EN_CX -> Value.EN_CX EN_CY -> Value.EN_CY + EN_CZ -> Value.EN_CZ EN_DE -> Value.EN_DE EN_DG -> Value.EN_DG EN_DK -> Value.EN_DK @@ -4480,15 +4679,18 @@ private constructor( EN_GH -> Value.EN_GH EN_GI -> Value.EN_GI EN_GM -> Value.EN_GM + EN_GS -> Value.EN_GS EN_GU -> Value.EN_GU EN_GY -> Value.EN_GY EN_HK -> Value.EN_HK + EN_HU -> Value.EN_HU EN_ID -> Value.EN_ID EN_IE -> Value.EN_IE EN_IL -> Value.EN_IL EN_IM -> Value.EN_IM EN_IN -> Value.EN_IN EN_IO -> Value.EN_IO + EN_IT -> Value.EN_IT EN_JE -> Value.EN_JE EN_JM -> Value.EN_JM EN_KE -> Value.EN_KE @@ -4514,16 +4716,19 @@ private constructor( EN_NF -> Value.EN_NF EN_NG -> Value.EN_NG EN_NL -> Value.EN_NL + EN_NO -> Value.EN_NO EN_NR -> Value.EN_NR EN_NU -> Value.EN_NU EN_NZ -> Value.EN_NZ EN_PG -> Value.EN_PG EN_PH -> Value.EN_PH EN_PK -> Value.EN_PK + EN_PL -> Value.EN_PL EN_PN -> Value.EN_PN EN_PR -> Value.EN_PR EN_PT -> Value.EN_PT EN_PW -> Value.EN_PW + EN_RO -> Value.EN_RO EN_RW -> Value.EN_RW EN_SB -> Value.EN_SB EN_SC -> Value.EN_SC @@ -4532,6 +4737,7 @@ private constructor( EN_SG -> Value.EN_SG EN_SH -> Value.EN_SH EN_SI -> Value.EN_SI + EN_SK -> Value.EN_SK EN_SL -> Value.EN_SL EN_SS -> Value.EN_SS EN_SX -> Value.EN_SX @@ -4673,6 +4879,8 @@ private constructor( GA -> Value.GA GA_GB -> Value.GA_GB GA_IE -> Value.GA_IE + GAA -> Value.GAA + GAA_GH -> Value.GAA_GH GD -> Value.GD GD_GB -> Value.GD_GB GL -> Value.GL @@ -4706,6 +4914,7 @@ private constructor( HSB -> Value.HSB HSB_DE -> Value.HSB_DE HT -> Value.HT + HT_HT -> Value.HT_HT HU -> Value.HU HU_HU -> Value.HU_HU HY -> Value.HY @@ -4716,6 +4925,7 @@ private constructor( ID -> Value.ID ID_ID -> Value.ID_ID IE -> Value.IE + IE_EE -> Value.IE_EE IG -> Value.IG IG_NG -> Value.IG_NG II -> Value.II @@ -4771,6 +4981,7 @@ private constructor( KN -> Value.KN KN_IN -> Value.KN_IN KO -> Value.KO + KO_CN -> Value.KO_CN KO_KP -> Value.KO_KP KO_KR -> Value.KO_KR KOK -> Value.KOK @@ -4789,6 +5000,8 @@ private constructor( KV -> Value.KV KW -> Value.KW KW_GB -> Value.KW_GB + KXV -> Value.KXV + KXV_IN -> Value.KXV_IN KY -> Value.KY KY_KG -> Value.KY_KG LA -> Value.LA @@ -4799,8 +5012,12 @@ private constructor( LG -> Value.LG LG_UG -> Value.LG_UG LI -> Value.LI + LIJ -> Value.LIJ + LIJ_IT -> Value.LIJ_IT LKT -> Value.LKT LKT_US -> Value.LKT_US + LMO -> Value.LMO + LMO_IT -> Value.LMO_IT LN -> Value.LN LN_AO -> Value.LN_AO LN_CD -> Value.LN_CD @@ -4897,7 +5114,11 @@ private constructor( NNH_CM -> Value.NNH_CM NO -> Value.NO NO_NO -> Value.NO_NO + NQO -> Value.NQO + NQO_GN -> Value.NQO_GN NR -> Value.NR + NSO -> Value.NSO + NSO_ZA -> Value.NSO_ZA NUS -> Value.NUS NUS_SS -> Value.NUS_SS NV -> Value.NV @@ -5027,6 +5248,8 @@ private constructor( SR_XK -> Value.SR_XK SS -> Value.SS ST -> Value.ST + ST_LS -> Value.ST_LS + ST_ZA -> Value.ST_ZA SU -> Value.SU SU_ID -> Value.SU_ID SV -> Value.SV @@ -5039,6 +5262,11 @@ private constructor( SW_TZ -> Value.SW_TZ SW_UG -> Value.SW_UG SY -> Value.SY + SYR -> Value.SYR + SYR_IQ -> Value.SYR_IQ + SYR_SY -> Value.SYR_SY + SZL -> Value.SZL + SZL_PL -> Value.SZL_PL TA -> Value.TA TA_IN -> Value.TA_IN TA_LK -> Value.TA_LK @@ -5060,6 +5288,8 @@ private constructor( TK_TM -> Value.TK_TM TL -> Value.TL TN -> Value.TN + TN_BW -> Value.TN_BW + TN_ZA -> Value.TN_ZA TO -> Value.TO TO_TO -> Value.TO_TO TOK -> Value.TOK @@ -5089,8 +5319,12 @@ private constructor( VAI -> Value.VAI VAI_LR -> Value.VAI_LR VE -> Value.VE + VEC -> Value.VEC + VEC_IT -> Value.VEC_IT VI -> Value.VI VI_VN -> Value.VI_VN + VMW -> Value.VMW + VMW_MZ -> Value.VMW_MZ VO -> Value.VO VO_001 -> Value.VO_001 VUN -> Value.VUN @@ -5102,12 +5336,15 @@ private constructor( WO_SN -> Value.WO_SN XH -> Value.XH XH_ZA -> Value.XH_ZA + XNR -> Value.XNR + XNR_IN -> Value.XNR_IN XOG -> Value.XOG XOG_UG -> Value.XOG_UG YAV -> Value.YAV YAV_CM -> Value.YAV_CM YI -> Value.YI YI_001 -> Value.YI_001 + YI_UA -> Value.YI_UA YO -> Value.YO YO_BJ -> Value.YO_BJ YO_NG -> Value.YO_NG @@ -5118,7 +5355,9 @@ private constructor( YUE -> Value.YUE YUE_CN -> Value.YUE_CN YUE_HK -> Value.YUE_HK + YUE_MO -> Value.YUE_MO ZA -> Value.ZA + ZA_CN -> Value.ZA_CN ZGH -> Value.ZGH ZGH_MA -> Value.ZGH_MA ZH -> Value.ZH @@ -5127,6 +5366,7 @@ private constructor( ZH_HANT -> Value.ZH_HANT ZH_HK -> Value.ZH_HK ZH_MO -> Value.ZH_MO + ZH_MY -> Value.ZH_MY ZH_SG -> Value.ZH_SG ZH_TW -> Value.ZH_TW ZU -> Value.ZU @@ -5200,6 +5440,8 @@ private constructor( AZ -> Known.AZ AZ_AZ -> Known.AZ_AZ BA -> Known.BA + BAL -> Known.BAL + BAL_PK -> Known.BAL_PK BAS -> Known.BAS BAS_CM -> Known.BAS_CM BE -> Known.BE @@ -5215,6 +5457,8 @@ private constructor( BHO -> Known.BHO BHO_IN -> Known.BHO_IN BI -> Known.BI + BLO -> Known.BLO + BLO_BJ -> Known.BLO_BJ BM -> Known.BM BM_ML -> Known.BM_ML BN -> Known.BN @@ -5253,6 +5497,8 @@ private constructor( CR -> Known.CR CS -> Known.CS CS_CZ -> Known.CS_CZ + CSW -> Known.CSW + CSW_CA -> Known.CSW_CA CU -> Known.CU CU_RU -> Known.CU_RU CV -> Known.CV @@ -5318,6 +5564,7 @@ private constructor( EN_CN -> Known.EN_CN EN_CX -> Known.EN_CX EN_CY -> Known.EN_CY + EN_CZ -> Known.EN_CZ EN_DE -> Known.EN_DE EN_DG -> Known.EN_DG EN_DK -> Known.EN_DK @@ -5337,15 +5584,18 @@ private constructor( EN_GH -> Known.EN_GH EN_GI -> Known.EN_GI EN_GM -> Known.EN_GM + EN_GS -> Known.EN_GS EN_GU -> Known.EN_GU EN_GY -> Known.EN_GY EN_HK -> Known.EN_HK + EN_HU -> Known.EN_HU EN_ID -> Known.EN_ID EN_IE -> Known.EN_IE EN_IL -> Known.EN_IL EN_IM -> Known.EN_IM EN_IN -> Known.EN_IN EN_IO -> Known.EN_IO + EN_IT -> Known.EN_IT EN_JE -> Known.EN_JE EN_JM -> Known.EN_JM EN_KE -> Known.EN_KE @@ -5371,16 +5621,19 @@ private constructor( EN_NF -> Known.EN_NF EN_NG -> Known.EN_NG EN_NL -> Known.EN_NL + EN_NO -> Known.EN_NO EN_NR -> Known.EN_NR EN_NU -> Known.EN_NU EN_NZ -> Known.EN_NZ EN_PG -> Known.EN_PG EN_PH -> Known.EN_PH EN_PK -> Known.EN_PK + EN_PL -> Known.EN_PL EN_PN -> Known.EN_PN EN_PR -> Known.EN_PR EN_PT -> Known.EN_PT EN_PW -> Known.EN_PW + EN_RO -> Known.EN_RO EN_RW -> Known.EN_RW EN_SB -> Known.EN_SB EN_SC -> Known.EN_SC @@ -5389,6 +5642,7 @@ private constructor( EN_SG -> Known.EN_SG EN_SH -> Known.EN_SH EN_SI -> Known.EN_SI + EN_SK -> Known.EN_SK EN_SL -> Known.EN_SL EN_SS -> Known.EN_SS EN_SX -> Known.EN_SX @@ -5530,6 +5784,8 @@ private constructor( GA -> Known.GA GA_GB -> Known.GA_GB GA_IE -> Known.GA_IE + GAA -> Known.GAA + GAA_GH -> Known.GAA_GH GD -> Known.GD GD_GB -> Known.GD_GB GL -> Known.GL @@ -5563,6 +5819,7 @@ private constructor( HSB -> Known.HSB HSB_DE -> Known.HSB_DE HT -> Known.HT + HT_HT -> Known.HT_HT HU -> Known.HU HU_HU -> Known.HU_HU HY -> Known.HY @@ -5573,6 +5830,7 @@ private constructor( ID -> Known.ID ID_ID -> Known.ID_ID IE -> Known.IE + IE_EE -> Known.IE_EE IG -> Known.IG IG_NG -> Known.IG_NG II -> Known.II @@ -5628,6 +5886,7 @@ private constructor( KN -> Known.KN KN_IN -> Known.KN_IN KO -> Known.KO + KO_CN -> Known.KO_CN KO_KP -> Known.KO_KP KO_KR -> Known.KO_KR KOK -> Known.KOK @@ -5646,6 +5905,8 @@ private constructor( KV -> Known.KV KW -> Known.KW KW_GB -> Known.KW_GB + KXV -> Known.KXV + KXV_IN -> Known.KXV_IN KY -> Known.KY KY_KG -> Known.KY_KG LA -> Known.LA @@ -5656,8 +5917,12 @@ private constructor( LG -> Known.LG LG_UG -> Known.LG_UG LI -> Known.LI + LIJ -> Known.LIJ + LIJ_IT -> Known.LIJ_IT LKT -> Known.LKT LKT_US -> Known.LKT_US + LMO -> Known.LMO + LMO_IT -> Known.LMO_IT LN -> Known.LN LN_AO -> Known.LN_AO LN_CD -> Known.LN_CD @@ -5754,7 +6019,11 @@ private constructor( NNH_CM -> Known.NNH_CM NO -> Known.NO NO_NO -> Known.NO_NO + NQO -> Known.NQO + NQO_GN -> Known.NQO_GN NR -> Known.NR + NSO -> Known.NSO + NSO_ZA -> Known.NSO_ZA NUS -> Known.NUS NUS_SS -> Known.NUS_SS NV -> Known.NV @@ -5884,6 +6153,8 @@ private constructor( SR_XK -> Known.SR_XK SS -> Known.SS ST -> Known.ST + ST_LS -> Known.ST_LS + ST_ZA -> Known.ST_ZA SU -> Known.SU SU_ID -> Known.SU_ID SV -> Known.SV @@ -5896,6 +6167,11 @@ private constructor( SW_TZ -> Known.SW_TZ SW_UG -> Known.SW_UG SY -> Known.SY + SYR -> Known.SYR + SYR_IQ -> Known.SYR_IQ + SYR_SY -> Known.SYR_SY + SZL -> Known.SZL + SZL_PL -> Known.SZL_PL TA -> Known.TA TA_IN -> Known.TA_IN TA_LK -> Known.TA_LK @@ -5917,6 +6193,8 @@ private constructor( TK_TM -> Known.TK_TM TL -> Known.TL TN -> Known.TN + TN_BW -> Known.TN_BW + TN_ZA -> Known.TN_ZA TO -> Known.TO TO_TO -> Known.TO_TO TOK -> Known.TOK @@ -5946,8 +6224,12 @@ private constructor( VAI -> Known.VAI VAI_LR -> Known.VAI_LR VE -> Known.VE + VEC -> Known.VEC + VEC_IT -> Known.VEC_IT VI -> Known.VI VI_VN -> Known.VI_VN + VMW -> Known.VMW + VMW_MZ -> Known.VMW_MZ VO -> Known.VO VO_001 -> Known.VO_001 VUN -> Known.VUN @@ -5959,12 +6241,15 @@ private constructor( WO_SN -> Known.WO_SN XH -> Known.XH XH_ZA -> Known.XH_ZA + XNR -> Known.XNR + XNR_IN -> Known.XNR_IN XOG -> Known.XOG XOG_UG -> Known.XOG_UG YAV -> Known.YAV YAV_CM -> Known.YAV_CM YI -> Known.YI YI_001 -> Known.YI_001 + YI_UA -> Known.YI_UA YO -> Known.YO YO_BJ -> Known.YO_BJ YO_NG -> Known.YO_NG @@ -5975,7 +6260,9 @@ private constructor( YUE -> Known.YUE YUE_CN -> Known.YUE_CN YUE_HK -> Known.YUE_HK + YUE_MO -> Known.YUE_MO ZA -> Known.ZA + ZA_CN -> Known.ZA_CN ZGH -> Known.ZGH ZGH_MA -> Known.ZGH_MA ZH -> Known.ZH @@ -5984,6 +6271,7 @@ private constructor( ZH_HANT -> Known.ZH_HANT ZH_HK -> Known.ZH_HK ZH_MO -> Known.ZH_MO + ZH_MY -> Known.ZH_MY ZH_SG -> Known.ZH_SG ZH_TW -> Known.ZH_TW ZU -> Known.ZU diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/marketing/emails/PublicEmail.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/marketing/emails/PublicEmail.kt index cb38c518..e6bd8e04 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/marketing/emails/PublicEmail.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/marketing/emails/PublicEmail.kt @@ -2297,6 +2297,10 @@ private constructor( @JvmField val BA = of("ba") + @JvmField val BAL = of("bal") + + @JvmField val BAL_PK = of("bal-pk") + @JvmField val BAS = of("bas") @JvmField val BAS_CM = of("bas-cm") @@ -2327,6 +2331,10 @@ private constructor( @JvmField val BI = of("bi") + @JvmField val BLO = of("blo") + + @JvmField val BLO_BJ = of("blo-bj") + @JvmField val BM = of("bm") @JvmField val BM_ML = of("bm-ml") @@ -2403,6 +2411,10 @@ private constructor( @JvmField val CS_CZ = of("cs-cz") + @JvmField val CSW = of("csw") + + @JvmField val CSW_CA = of("csw-ca") + @JvmField val CU = of("cu") @JvmField val CU_RU = of("cu-ru") @@ -2533,6 +2545,8 @@ private constructor( @JvmField val EN_CY = of("en-cy") + @JvmField val EN_CZ = of("en-cz") + @JvmField val EN_DE = of("en-de") @JvmField val EN_DG = of("en-dg") @@ -2571,12 +2585,16 @@ private constructor( @JvmField val EN_GM = of("en-gm") + @JvmField val EN_GS = of("en-gs") + @JvmField val EN_GU = of("en-gu") @JvmField val EN_GY = of("en-gy") @JvmField val EN_HK = of("en-hk") + @JvmField val EN_HU = of("en-hu") + @JvmField val EN_ID = of("en-id") @JvmField val EN_IE = of("en-ie") @@ -2589,6 +2607,8 @@ private constructor( @JvmField val EN_IO = of("en-io") + @JvmField val EN_IT = of("en-it") + @JvmField val EN_JE = of("en-je") @JvmField val EN_JM = of("en-jm") @@ -2639,6 +2659,8 @@ private constructor( @JvmField val EN_NL = of("en-nl") + @JvmField val EN_NO = of("en-no") + @JvmField val EN_NR = of("en-nr") @JvmField val EN_NU = of("en-nu") @@ -2651,6 +2673,8 @@ private constructor( @JvmField val EN_PK = of("en-pk") + @JvmField val EN_PL = of("en-pl") + @JvmField val EN_PN = of("en-pn") @JvmField val EN_PR = of("en-pr") @@ -2659,6 +2683,8 @@ private constructor( @JvmField val EN_PW = of("en-pw") + @JvmField val EN_RO = of("en-ro") + @JvmField val EN_RW = of("en-rw") @JvmField val EN_SB = of("en-sb") @@ -2675,6 +2701,8 @@ private constructor( @JvmField val EN_SI = of("en-si") + @JvmField val EN_SK = of("en-sk") + @JvmField val EN_SL = of("en-sl") @JvmField val EN_SS = of("en-ss") @@ -2957,6 +2985,10 @@ private constructor( @JvmField val GA_IE = of("ga-ie") + @JvmField val GAA = of("gaa") + + @JvmField val GAA_GH = of("gaa-gh") + @JvmField val GD = of("gd") @JvmField val GD_GB = of("gd-gb") @@ -3023,6 +3055,8 @@ private constructor( @JvmField val HT = of("ht") + @JvmField val HT_HT = of("ht-ht") + @JvmField val HU = of("hu") @JvmField val HU_HU = of("hu-hu") @@ -3043,6 +3077,8 @@ private constructor( @JvmField val IE = of("ie") + @JvmField val IE_EE = of("ie-ee") + @JvmField val IG = of("ig") @JvmField val IG_NG = of("ig-ng") @@ -3153,6 +3189,8 @@ private constructor( @JvmField val KO = of("ko") + @JvmField val KO_CN = of("ko-cn") + @JvmField val KO_KP = of("ko-kp") @JvmField val KO_KR = of("ko-kr") @@ -3189,6 +3227,10 @@ private constructor( @JvmField val KW_GB = of("kw-gb") + @JvmField val KXV = of("kxv") + + @JvmField val KXV_IN = of("kxv-in") + @JvmField val KY = of("ky") @JvmField val KY_KG = of("ky-kg") @@ -3209,10 +3251,18 @@ private constructor( @JvmField val LI = of("li") + @JvmField val LIJ = of("lij") + + @JvmField val LIJ_IT = of("lij-it") + @JvmField val LKT = of("lkt") @JvmField val LKT_US = of("lkt-us") + @JvmField val LMO = of("lmo") + + @JvmField val LMO_IT = of("lmo-it") + @JvmField val LN = of("ln") @JvmField val LN_AO = of("ln-ao") @@ -3405,8 +3455,16 @@ private constructor( @JvmField val NO_NO = of("no-no") + @JvmField val NQO = of("nqo") + + @JvmField val NQO_GN = of("nqo-gn") + @JvmField val NR = of("nr") + @JvmField val NSO = of("nso") + + @JvmField val NSO_ZA = of("nso-za") + @JvmField val NUS = of("nus") @JvmField val NUS_SS = of("nus-ss") @@ -3665,6 +3723,10 @@ private constructor( @JvmField val ST = of("st") + @JvmField val ST_LS = of("st-ls") + + @JvmField val ST_ZA = of("st-za") + @JvmField val SU = of("su") @JvmField val SU_ID = of("su-id") @@ -3689,6 +3751,16 @@ private constructor( @JvmField val SY = of("sy") + @JvmField val SYR = of("syr") + + @JvmField val SYR_IQ = of("syr-iq") + + @JvmField val SYR_SY = of("syr-sy") + + @JvmField val SZL = of("szl") + + @JvmField val SZL_PL = of("szl-pl") + @JvmField val TA = of("ta") @JvmField val TA_IN = of("ta-in") @@ -3731,6 +3803,10 @@ private constructor( @JvmField val TN = of("tn") + @JvmField val TN_BW = of("tn-bw") + + @JvmField val TN_ZA = of("tn-za") + @JvmField val TO = of("to") @JvmField val TO_TO = of("to-to") @@ -3789,10 +3865,18 @@ private constructor( @JvmField val VE = of("ve") + @JvmField val VEC = of("vec") + + @JvmField val VEC_IT = of("vec-it") + @JvmField val VI = of("vi") @JvmField val VI_VN = of("vi-vn") + @JvmField val VMW = of("vmw") + + @JvmField val VMW_MZ = of("vmw-mz") + @JvmField val VO = of("vo") @JvmField val VO_001 = of("vo-001") @@ -3815,6 +3899,10 @@ private constructor( @JvmField val XH_ZA = of("xh-za") + @JvmField val XNR = of("xnr") + + @JvmField val XNR_IN = of("xnr-in") + @JvmField val XOG = of("xog") @JvmField val XOG_UG = of("xog-ug") @@ -3827,6 +3915,8 @@ private constructor( @JvmField val YI_001 = of("yi-001") + @JvmField val YI_UA = of("yi-ua") + @JvmField val YO = of("yo") @JvmField val YO_BJ = of("yo-bj") @@ -3847,8 +3937,12 @@ private constructor( @JvmField val YUE_HK = of("yue-hk") + @JvmField val YUE_MO = of("yue-mo") + @JvmField val ZA = of("za") + @JvmField val ZA_CN = of("za-cn") + @JvmField val ZGH = of("zgh") @JvmField val ZGH_MA = of("zgh-ma") @@ -3865,6 +3959,8 @@ private constructor( @JvmField val ZH_MO = of("zh-mo") + @JvmField val ZH_MY = of("zh-my") + @JvmField val ZH_SG = of("zh-sg") @JvmField val ZH_TW = of("zh-tw") @@ -3933,6 +4029,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -3948,6 +4046,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -3986,6 +4086,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -4051,6 +4153,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -4070,15 +4173,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -4104,16 +4210,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -4122,6 +4231,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -4263,6 +4373,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -4296,6 +4408,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -4306,6 +4419,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -4361,6 +4475,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -4379,6 +4494,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -4389,8 +4506,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -4487,7 +4608,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -4617,6 +4742,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -4629,6 +4756,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -4650,6 +4782,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -4679,8 +4813,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -4692,12 +4830,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -4708,7 +4849,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -4717,6 +4860,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -4788,6 +4932,8 @@ private constructor( AZ, AZ_AZ, BA, + BAL, + BAL_PK, BAS, BAS_CM, BE, @@ -4803,6 +4949,8 @@ private constructor( BHO, BHO_IN, BI, + BLO, + BLO_BJ, BM, BM_ML, BN, @@ -4841,6 +4989,8 @@ private constructor( CR, CS, CS_CZ, + CSW, + CSW_CA, CU, CU_RU, CV, @@ -4906,6 +5056,7 @@ private constructor( EN_CN, EN_CX, EN_CY, + EN_CZ, EN_DE, EN_DG, EN_DK, @@ -4925,15 +5076,18 @@ private constructor( EN_GH, EN_GI, EN_GM, + EN_GS, EN_GU, EN_GY, EN_HK, + EN_HU, EN_ID, EN_IE, EN_IL, EN_IM, EN_IN, EN_IO, + EN_IT, EN_JE, EN_JM, EN_KE, @@ -4959,16 +5113,19 @@ private constructor( EN_NF, EN_NG, EN_NL, + EN_NO, EN_NR, EN_NU, EN_NZ, EN_PG, EN_PH, EN_PK, + EN_PL, EN_PN, EN_PR, EN_PT, EN_PW, + EN_RO, EN_RW, EN_SB, EN_SC, @@ -4977,6 +5134,7 @@ private constructor( EN_SG, EN_SH, EN_SI, + EN_SK, EN_SL, EN_SS, EN_SX, @@ -5118,6 +5276,8 @@ private constructor( GA, GA_GB, GA_IE, + GAA, + GAA_GH, GD, GD_GB, GL, @@ -5151,6 +5311,7 @@ private constructor( HSB, HSB_DE, HT, + HT_HT, HU, HU_HU, HY, @@ -5161,6 +5322,7 @@ private constructor( ID, ID_ID, IE, + IE_EE, IG, IG_NG, II, @@ -5216,6 +5378,7 @@ private constructor( KN, KN_IN, KO, + KO_CN, KO_KP, KO_KR, KOK, @@ -5234,6 +5397,8 @@ private constructor( KV, KW, KW_GB, + KXV, + KXV_IN, KY, KY_KG, LA, @@ -5244,8 +5409,12 @@ private constructor( LG, LG_UG, LI, + LIJ, + LIJ_IT, LKT, LKT_US, + LMO, + LMO_IT, LN, LN_AO, LN_CD, @@ -5342,7 +5511,11 @@ private constructor( NNH_CM, NO, NO_NO, + NQO, + NQO_GN, NR, + NSO, + NSO_ZA, NUS, NUS_SS, NV, @@ -5472,6 +5645,8 @@ private constructor( SR_XK, SS, ST, + ST_LS, + ST_ZA, SU, SU_ID, SV, @@ -5484,6 +5659,11 @@ private constructor( SW_TZ, SW_UG, SY, + SYR, + SYR_IQ, + SYR_SY, + SZL, + SZL_PL, TA, TA_IN, TA_LK, @@ -5505,6 +5685,8 @@ private constructor( TK_TM, TL, TN, + TN_BW, + TN_ZA, TO, TO_TO, TOK, @@ -5534,8 +5716,12 @@ private constructor( VAI, VAI_LR, VE, + VEC, + VEC_IT, VI, VI_VN, + VMW, + VMW_MZ, VO, VO_001, VUN, @@ -5547,12 +5733,15 @@ private constructor( WO_SN, XH, XH_ZA, + XNR, + XNR_IN, XOG, XOG_UG, YAV, YAV_CM, YI, YI_001, + YI_UA, YO, YO_BJ, YO_NG, @@ -5563,7 +5752,9 @@ private constructor( YUE, YUE_CN, YUE_HK, + YUE_MO, ZA, + ZA_CN, ZGH, ZGH_MA, ZH, @@ -5572,6 +5763,7 @@ private constructor( ZH_HANT, ZH_HK, ZH_MO, + ZH_MY, ZH_SG, ZH_TW, ZU, @@ -5644,6 +5836,8 @@ private constructor( AZ -> Value.AZ AZ_AZ -> Value.AZ_AZ BA -> Value.BA + BAL -> Value.BAL + BAL_PK -> Value.BAL_PK BAS -> Value.BAS BAS_CM -> Value.BAS_CM BE -> Value.BE @@ -5659,6 +5853,8 @@ private constructor( BHO -> Value.BHO BHO_IN -> Value.BHO_IN BI -> Value.BI + BLO -> Value.BLO + BLO_BJ -> Value.BLO_BJ BM -> Value.BM BM_ML -> Value.BM_ML BN -> Value.BN @@ -5697,6 +5893,8 @@ private constructor( CR -> Value.CR CS -> Value.CS CS_CZ -> Value.CS_CZ + CSW -> Value.CSW + CSW_CA -> Value.CSW_CA CU -> Value.CU CU_RU -> Value.CU_RU CV -> Value.CV @@ -5762,6 +5960,7 @@ private constructor( EN_CN -> Value.EN_CN EN_CX -> Value.EN_CX EN_CY -> Value.EN_CY + EN_CZ -> Value.EN_CZ EN_DE -> Value.EN_DE EN_DG -> Value.EN_DG EN_DK -> Value.EN_DK @@ -5781,15 +5980,18 @@ private constructor( EN_GH -> Value.EN_GH EN_GI -> Value.EN_GI EN_GM -> Value.EN_GM + EN_GS -> Value.EN_GS EN_GU -> Value.EN_GU EN_GY -> Value.EN_GY EN_HK -> Value.EN_HK + EN_HU -> Value.EN_HU EN_ID -> Value.EN_ID EN_IE -> Value.EN_IE EN_IL -> Value.EN_IL EN_IM -> Value.EN_IM EN_IN -> Value.EN_IN EN_IO -> Value.EN_IO + EN_IT -> Value.EN_IT EN_JE -> Value.EN_JE EN_JM -> Value.EN_JM EN_KE -> Value.EN_KE @@ -5815,16 +6017,19 @@ private constructor( EN_NF -> Value.EN_NF EN_NG -> Value.EN_NG EN_NL -> Value.EN_NL + EN_NO -> Value.EN_NO EN_NR -> Value.EN_NR EN_NU -> Value.EN_NU EN_NZ -> Value.EN_NZ EN_PG -> Value.EN_PG EN_PH -> Value.EN_PH EN_PK -> Value.EN_PK + EN_PL -> Value.EN_PL EN_PN -> Value.EN_PN EN_PR -> Value.EN_PR EN_PT -> Value.EN_PT EN_PW -> Value.EN_PW + EN_RO -> Value.EN_RO EN_RW -> Value.EN_RW EN_SB -> Value.EN_SB EN_SC -> Value.EN_SC @@ -5833,6 +6038,7 @@ private constructor( EN_SG -> Value.EN_SG EN_SH -> Value.EN_SH EN_SI -> Value.EN_SI + EN_SK -> Value.EN_SK EN_SL -> Value.EN_SL EN_SS -> Value.EN_SS EN_SX -> Value.EN_SX @@ -5974,6 +6180,8 @@ private constructor( GA -> Value.GA GA_GB -> Value.GA_GB GA_IE -> Value.GA_IE + GAA -> Value.GAA + GAA_GH -> Value.GAA_GH GD -> Value.GD GD_GB -> Value.GD_GB GL -> Value.GL @@ -6007,6 +6215,7 @@ private constructor( HSB -> Value.HSB HSB_DE -> Value.HSB_DE HT -> Value.HT + HT_HT -> Value.HT_HT HU -> Value.HU HU_HU -> Value.HU_HU HY -> Value.HY @@ -6017,6 +6226,7 @@ private constructor( ID -> Value.ID ID_ID -> Value.ID_ID IE -> Value.IE + IE_EE -> Value.IE_EE IG -> Value.IG IG_NG -> Value.IG_NG II -> Value.II @@ -6072,6 +6282,7 @@ private constructor( KN -> Value.KN KN_IN -> Value.KN_IN KO -> Value.KO + KO_CN -> Value.KO_CN KO_KP -> Value.KO_KP KO_KR -> Value.KO_KR KOK -> Value.KOK @@ -6090,6 +6301,8 @@ private constructor( KV -> Value.KV KW -> Value.KW KW_GB -> Value.KW_GB + KXV -> Value.KXV + KXV_IN -> Value.KXV_IN KY -> Value.KY KY_KG -> Value.KY_KG LA -> Value.LA @@ -6100,8 +6313,12 @@ private constructor( LG -> Value.LG LG_UG -> Value.LG_UG LI -> Value.LI + LIJ -> Value.LIJ + LIJ_IT -> Value.LIJ_IT LKT -> Value.LKT LKT_US -> Value.LKT_US + LMO -> Value.LMO + LMO_IT -> Value.LMO_IT LN -> Value.LN LN_AO -> Value.LN_AO LN_CD -> Value.LN_CD @@ -6198,7 +6415,11 @@ private constructor( NNH_CM -> Value.NNH_CM NO -> Value.NO NO_NO -> Value.NO_NO + NQO -> Value.NQO + NQO_GN -> Value.NQO_GN NR -> Value.NR + NSO -> Value.NSO + NSO_ZA -> Value.NSO_ZA NUS -> Value.NUS NUS_SS -> Value.NUS_SS NV -> Value.NV @@ -6328,6 +6549,8 @@ private constructor( SR_XK -> Value.SR_XK SS -> Value.SS ST -> Value.ST + ST_LS -> Value.ST_LS + ST_ZA -> Value.ST_ZA SU -> Value.SU SU_ID -> Value.SU_ID SV -> Value.SV @@ -6340,6 +6563,11 @@ private constructor( SW_TZ -> Value.SW_TZ SW_UG -> Value.SW_UG SY -> Value.SY + SYR -> Value.SYR + SYR_IQ -> Value.SYR_IQ + SYR_SY -> Value.SYR_SY + SZL -> Value.SZL + SZL_PL -> Value.SZL_PL TA -> Value.TA TA_IN -> Value.TA_IN TA_LK -> Value.TA_LK @@ -6361,6 +6589,8 @@ private constructor( TK_TM -> Value.TK_TM TL -> Value.TL TN -> Value.TN + TN_BW -> Value.TN_BW + TN_ZA -> Value.TN_ZA TO -> Value.TO TO_TO -> Value.TO_TO TOK -> Value.TOK @@ -6390,8 +6620,12 @@ private constructor( VAI -> Value.VAI VAI_LR -> Value.VAI_LR VE -> Value.VE + VEC -> Value.VEC + VEC_IT -> Value.VEC_IT VI -> Value.VI VI_VN -> Value.VI_VN + VMW -> Value.VMW + VMW_MZ -> Value.VMW_MZ VO -> Value.VO VO_001 -> Value.VO_001 VUN -> Value.VUN @@ -6403,12 +6637,15 @@ private constructor( WO_SN -> Value.WO_SN XH -> Value.XH XH_ZA -> Value.XH_ZA + XNR -> Value.XNR + XNR_IN -> Value.XNR_IN XOG -> Value.XOG XOG_UG -> Value.XOG_UG YAV -> Value.YAV YAV_CM -> Value.YAV_CM YI -> Value.YI YI_001 -> Value.YI_001 + YI_UA -> Value.YI_UA YO -> Value.YO YO_BJ -> Value.YO_BJ YO_NG -> Value.YO_NG @@ -6419,7 +6656,9 @@ private constructor( YUE -> Value.YUE YUE_CN -> Value.YUE_CN YUE_HK -> Value.YUE_HK + YUE_MO -> Value.YUE_MO ZA -> Value.ZA + ZA_CN -> Value.ZA_CN ZGH -> Value.ZGH ZGH_MA -> Value.ZGH_MA ZH -> Value.ZH @@ -6428,6 +6667,7 @@ private constructor( ZH_HANT -> Value.ZH_HANT ZH_HK -> Value.ZH_HK ZH_MO -> Value.ZH_MO + ZH_MY -> Value.ZH_MY ZH_SG -> Value.ZH_SG ZH_TW -> Value.ZH_TW ZU -> Value.ZU @@ -6501,6 +6741,8 @@ private constructor( AZ -> Known.AZ AZ_AZ -> Known.AZ_AZ BA -> Known.BA + BAL -> Known.BAL + BAL_PK -> Known.BAL_PK BAS -> Known.BAS BAS_CM -> Known.BAS_CM BE -> Known.BE @@ -6516,6 +6758,8 @@ private constructor( BHO -> Known.BHO BHO_IN -> Known.BHO_IN BI -> Known.BI + BLO -> Known.BLO + BLO_BJ -> Known.BLO_BJ BM -> Known.BM BM_ML -> Known.BM_ML BN -> Known.BN @@ -6554,6 +6798,8 @@ private constructor( CR -> Known.CR CS -> Known.CS CS_CZ -> Known.CS_CZ + CSW -> Known.CSW + CSW_CA -> Known.CSW_CA CU -> Known.CU CU_RU -> Known.CU_RU CV -> Known.CV @@ -6619,6 +6865,7 @@ private constructor( EN_CN -> Known.EN_CN EN_CX -> Known.EN_CX EN_CY -> Known.EN_CY + EN_CZ -> Known.EN_CZ EN_DE -> Known.EN_DE EN_DG -> Known.EN_DG EN_DK -> Known.EN_DK @@ -6638,15 +6885,18 @@ private constructor( EN_GH -> Known.EN_GH EN_GI -> Known.EN_GI EN_GM -> Known.EN_GM + EN_GS -> Known.EN_GS EN_GU -> Known.EN_GU EN_GY -> Known.EN_GY EN_HK -> Known.EN_HK + EN_HU -> Known.EN_HU EN_ID -> Known.EN_ID EN_IE -> Known.EN_IE EN_IL -> Known.EN_IL EN_IM -> Known.EN_IM EN_IN -> Known.EN_IN EN_IO -> Known.EN_IO + EN_IT -> Known.EN_IT EN_JE -> Known.EN_JE EN_JM -> Known.EN_JM EN_KE -> Known.EN_KE @@ -6672,16 +6922,19 @@ private constructor( EN_NF -> Known.EN_NF EN_NG -> Known.EN_NG EN_NL -> Known.EN_NL + EN_NO -> Known.EN_NO EN_NR -> Known.EN_NR EN_NU -> Known.EN_NU EN_NZ -> Known.EN_NZ EN_PG -> Known.EN_PG EN_PH -> Known.EN_PH EN_PK -> Known.EN_PK + EN_PL -> Known.EN_PL EN_PN -> Known.EN_PN EN_PR -> Known.EN_PR EN_PT -> Known.EN_PT EN_PW -> Known.EN_PW + EN_RO -> Known.EN_RO EN_RW -> Known.EN_RW EN_SB -> Known.EN_SB EN_SC -> Known.EN_SC @@ -6690,6 +6943,7 @@ private constructor( EN_SG -> Known.EN_SG EN_SH -> Known.EN_SH EN_SI -> Known.EN_SI + EN_SK -> Known.EN_SK EN_SL -> Known.EN_SL EN_SS -> Known.EN_SS EN_SX -> Known.EN_SX @@ -6831,6 +7085,8 @@ private constructor( GA -> Known.GA GA_GB -> Known.GA_GB GA_IE -> Known.GA_IE + GAA -> Known.GAA + GAA_GH -> Known.GAA_GH GD -> Known.GD GD_GB -> Known.GD_GB GL -> Known.GL @@ -6864,6 +7120,7 @@ private constructor( HSB -> Known.HSB HSB_DE -> Known.HSB_DE HT -> Known.HT + HT_HT -> Known.HT_HT HU -> Known.HU HU_HU -> Known.HU_HU HY -> Known.HY @@ -6874,6 +7131,7 @@ private constructor( ID -> Known.ID ID_ID -> Known.ID_ID IE -> Known.IE + IE_EE -> Known.IE_EE IG -> Known.IG IG_NG -> Known.IG_NG II -> Known.II @@ -6929,6 +7187,7 @@ private constructor( KN -> Known.KN KN_IN -> Known.KN_IN KO -> Known.KO + KO_CN -> Known.KO_CN KO_KP -> Known.KO_KP KO_KR -> Known.KO_KR KOK -> Known.KOK @@ -6947,6 +7206,8 @@ private constructor( KV -> Known.KV KW -> Known.KW KW_GB -> Known.KW_GB + KXV -> Known.KXV + KXV_IN -> Known.KXV_IN KY -> Known.KY KY_KG -> Known.KY_KG LA -> Known.LA @@ -6957,8 +7218,12 @@ private constructor( LG -> Known.LG LG_UG -> Known.LG_UG LI -> Known.LI + LIJ -> Known.LIJ + LIJ_IT -> Known.LIJ_IT LKT -> Known.LKT LKT_US -> Known.LKT_US + LMO -> Known.LMO + LMO_IT -> Known.LMO_IT LN -> Known.LN LN_AO -> Known.LN_AO LN_CD -> Known.LN_CD @@ -7055,7 +7320,11 @@ private constructor( NNH_CM -> Known.NNH_CM NO -> Known.NO NO_NO -> Known.NO_NO + NQO -> Known.NQO + NQO_GN -> Known.NQO_GN NR -> Known.NR + NSO -> Known.NSO + NSO_ZA -> Known.NSO_ZA NUS -> Known.NUS NUS_SS -> Known.NUS_SS NV -> Known.NV @@ -7185,6 +7454,8 @@ private constructor( SR_XK -> Known.SR_XK SS -> Known.SS ST -> Known.ST + ST_LS -> Known.ST_LS + ST_ZA -> Known.ST_ZA SU -> Known.SU SU_ID -> Known.SU_ID SV -> Known.SV @@ -7197,6 +7468,11 @@ private constructor( SW_TZ -> Known.SW_TZ SW_UG -> Known.SW_UG SY -> Known.SY + SYR -> Known.SYR + SYR_IQ -> Known.SYR_IQ + SYR_SY -> Known.SYR_SY + SZL -> Known.SZL + SZL_PL -> Known.SZL_PL TA -> Known.TA TA_IN -> Known.TA_IN TA_LK -> Known.TA_LK @@ -7218,6 +7494,8 @@ private constructor( TK_TM -> Known.TK_TM TL -> Known.TL TN -> Known.TN + TN_BW -> Known.TN_BW + TN_ZA -> Known.TN_ZA TO -> Known.TO TO_TO -> Known.TO_TO TOK -> Known.TOK @@ -7247,8 +7525,12 @@ private constructor( VAI -> Known.VAI VAI_LR -> Known.VAI_LR VE -> Known.VE + VEC -> Known.VEC + VEC_IT -> Known.VEC_IT VI -> Known.VI VI_VN -> Known.VI_VN + VMW -> Known.VMW + VMW_MZ -> Known.VMW_MZ VO -> Known.VO VO_001 -> Known.VO_001 VUN -> Known.VUN @@ -7260,12 +7542,15 @@ private constructor( WO_SN -> Known.WO_SN XH -> Known.XH XH_ZA -> Known.XH_ZA + XNR -> Known.XNR + XNR_IN -> Known.XNR_IN XOG -> Known.XOG XOG_UG -> Known.XOG_UG YAV -> Known.YAV YAV_CM -> Known.YAV_CM YI -> Known.YI YI_001 -> Known.YI_001 + YI_UA -> Known.YI_UA YO -> Known.YO YO_BJ -> Known.YO_BJ YO_NG -> Known.YO_NG @@ -7276,7 +7561,9 @@ private constructor( YUE -> Known.YUE YUE_CN -> Known.YUE_CN YUE_HK -> Known.YUE_HK + YUE_MO -> Known.YUE_MO ZA -> Known.ZA + ZA_CN -> Known.ZA_CN ZGH -> Known.ZGH ZGH_MA -> Known.ZGH_MA ZH -> Known.ZH @@ -7285,6 +7572,7 @@ private constructor( ZH_HANT -> Known.ZH_HANT ZH_HK -> Known.ZH_HK ZH_MO -> Known.ZH_MO + ZH_MY -> Known.ZH_MY ZH_SG -> Known.ZH_SG ZH_TW -> Known.ZH_TW ZU -> Known.ZU diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/WebhookCreateJournalSubscriptionParams.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/WebhookCreateJournalSubscriptionParams.kt index ff1f73b6..7e85d8a6 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/WebhookCreateJournalSubscriptionParams.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/WebhookCreateJournalSubscriptionParams.kt @@ -77,16 +77,10 @@ private constructor( /** * Alias for calling [subscriptionUpsertRequest] with - * `SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest(objectSubscriptionUpsertRequest)`. + * `SubscriptionUpsertRequest.ofObject(object_)`. */ - fun subscriptionUpsertRequest( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest - ) = - subscriptionUpsertRequest( - SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest( - objectSubscriptionUpsertRequest - ) - ) + fun subscriptionUpsertRequest(object_: ObjectSubscriptionUpsertRequest) = + subscriptionUpsertRequest(SubscriptionUpsertRequest.ofObject(object_)) /** * Alias for calling [subscriptionUpsertRequest] with diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooksjournal/subscriptions/SubscriptionCreateParams.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooksjournal/subscriptions/SubscriptionCreateParams.kt index aa55b97f..3d01efa2 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooksjournal/subscriptions/SubscriptionCreateParams.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooksjournal/subscriptions/SubscriptionCreateParams.kt @@ -72,16 +72,10 @@ private constructor( /** * Alias for calling [subscriptionUpsertRequest] with - * `SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest(objectSubscriptionUpsertRequest)`. + * `SubscriptionUpsertRequest.ofObject(object_)`. */ - fun subscriptionUpsertRequest( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest - ) = - subscriptionUpsertRequest( - SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest( - objectSubscriptionUpsertRequest - ) - ) + fun subscriptionUpsertRequest(object_: ObjectSubscriptionUpsertRequest) = + subscriptionUpsertRequest(SubscriptionUpsertRequest.ofObject(object_)) /** * Alias for calling [subscriptionUpsertRequest] with diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/services/async/WebhookServiceAsync.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/services/async/WebhookServiceAsync.kt index cee77d35..899fafb9 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/services/async/WebhookServiceAsync.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/services/async/WebhookServiceAsync.kt @@ -205,21 +205,16 @@ interface WebhookServiceAsync { /** @see createJournalSubscription */ fun createJournalSubscription( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest, + object_: ObjectSubscriptionUpsertRequest, requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture = - createJournalSubscription( - SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest( - objectSubscriptionUpsertRequest - ), - requestOptions, - ) + createJournalSubscription(SubscriptionUpsertRequest.ofObject(object_), requestOptions) /** @see createJournalSubscription */ fun createJournalSubscription( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest + object_: ObjectSubscriptionUpsertRequest ): CompletableFuture = - createJournalSubscription(objectSubscriptionUpsertRequest, RequestOptions.none()) + createJournalSubscription(object_, RequestOptions.none()) /** @see createJournalSubscription */ fun createJournalSubscription( @@ -1595,21 +1590,16 @@ interface WebhookServiceAsync { /** @see createJournalSubscription */ fun createJournalSubscription( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest, + object_: ObjectSubscriptionUpsertRequest, requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture> = - createJournalSubscription( - SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest( - objectSubscriptionUpsertRequest - ), - requestOptions, - ) + createJournalSubscription(SubscriptionUpsertRequest.ofObject(object_), requestOptions) /** @see createJournalSubscription */ fun createJournalSubscription( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest + object_: ObjectSubscriptionUpsertRequest ): CompletableFuture> = - createJournalSubscription(objectSubscriptionUpsertRequest, RequestOptions.none()) + createJournalSubscription(object_, RequestOptions.none()) /** @see createJournalSubscription */ fun createJournalSubscription( diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/services/async/webhooksjournal/SubscriptionServiceAsync.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/services/async/webhooksjournal/SubscriptionServiceAsync.kt index 513efab0..2643eb74 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/services/async/webhooksjournal/SubscriptionServiceAsync.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/services/async/webhooksjournal/SubscriptionServiceAsync.kt @@ -75,21 +75,15 @@ interface SubscriptionServiceAsync { /** @see create */ fun create( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest, + object_: ObjectSubscriptionUpsertRequest, requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture = - create( - SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest( - objectSubscriptionUpsertRequest - ), - requestOptions, - ) + create(SubscriptionUpsertRequest.ofObject(object_), requestOptions) /** @see create */ fun create( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest - ): CompletableFuture = - create(objectSubscriptionUpsertRequest, RequestOptions.none()) + object_: ObjectSubscriptionUpsertRequest + ): CompletableFuture = create(object_, RequestOptions.none()) /** @see create */ fun create( @@ -333,21 +327,16 @@ interface SubscriptionServiceAsync { /** @see create */ fun create( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest, + object_: ObjectSubscriptionUpsertRequest, requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture> = - create( - SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest( - objectSubscriptionUpsertRequest - ), - requestOptions, - ) + create(SubscriptionUpsertRequest.ofObject(object_), requestOptions) /** @see create */ fun create( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest + object_: ObjectSubscriptionUpsertRequest ): CompletableFuture> = - create(objectSubscriptionUpsertRequest, RequestOptions.none()) + create(object_, RequestOptions.none()) /** @see create */ fun create( diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/services/blocking/WebhookService.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/services/blocking/WebhookService.kt index c0638bd7..c907a7bd 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/services/blocking/WebhookService.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/services/blocking/WebhookService.kt @@ -201,21 +201,15 @@ interface WebhookService { /** @see createJournalSubscription */ fun createJournalSubscription( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest, + object_: ObjectSubscriptionUpsertRequest, requestOptions: RequestOptions = RequestOptions.none(), ): JournalSubscriptionResponse = - createJournalSubscription( - SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest( - objectSubscriptionUpsertRequest - ), - requestOptions, - ) + createJournalSubscription(SubscriptionUpsertRequest.ofObject(object_), requestOptions) /** @see createJournalSubscription */ fun createJournalSubscription( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest - ): JournalSubscriptionResponse = - createJournalSubscription(objectSubscriptionUpsertRequest, RequestOptions.none()) + object_: ObjectSubscriptionUpsertRequest + ): JournalSubscriptionResponse = createJournalSubscription(object_, RequestOptions.none()) /** @see createJournalSubscription */ fun createJournalSubscription( @@ -1553,22 +1547,17 @@ interface WebhookService { /** @see createJournalSubscription */ @MustBeClosed fun createJournalSubscription( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest, + object_: ObjectSubscriptionUpsertRequest, requestOptions: RequestOptions = RequestOptions.none(), ): HttpResponseFor = - createJournalSubscription( - SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest( - objectSubscriptionUpsertRequest - ), - requestOptions, - ) + createJournalSubscription(SubscriptionUpsertRequest.ofObject(object_), requestOptions) /** @see createJournalSubscription */ @MustBeClosed fun createJournalSubscription( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest + object_: ObjectSubscriptionUpsertRequest ): HttpResponseFor = - createJournalSubscription(objectSubscriptionUpsertRequest, RequestOptions.none()) + createJournalSubscription(object_, RequestOptions.none()) /** @see createJournalSubscription */ @MustBeClosed diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/services/blocking/webhooksjournal/SubscriptionService.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/services/blocking/webhooksjournal/SubscriptionService.kt index 9825c275..8c383832 100644 --- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/services/blocking/webhooksjournal/SubscriptionService.kt +++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/services/blocking/webhooksjournal/SubscriptionService.kt @@ -73,20 +73,14 @@ interface SubscriptionService { /** @see create */ fun create( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest, + object_: ObjectSubscriptionUpsertRequest, requestOptions: RequestOptions = RequestOptions.none(), ): JournalSubscriptionResponse = - create( - SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest( - objectSubscriptionUpsertRequest - ), - requestOptions, - ) + create(SubscriptionUpsertRequest.ofObject(object_), requestOptions) /** @see create */ - fun create( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest - ): JournalSubscriptionResponse = create(objectSubscriptionUpsertRequest, RequestOptions.none()) + fun create(object_: ObjectSubscriptionUpsertRequest): JournalSubscriptionResponse = + create(object_, RequestOptions.none()) /** @see create */ fun create( @@ -319,22 +313,16 @@ interface SubscriptionService { /** @see create */ @MustBeClosed fun create( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest, + object_: ObjectSubscriptionUpsertRequest, requestOptions: RequestOptions = RequestOptions.none(), ): HttpResponseFor = - create( - SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest( - objectSubscriptionUpsertRequest - ), - requestOptions, - ) + create(SubscriptionUpsertRequest.ofObject(object_), requestOptions) /** @see create */ @MustBeClosed fun create( - objectSubscriptionUpsertRequest: ObjectSubscriptionUpsertRequest - ): HttpResponseFor = - create(objectSubscriptionUpsertRequest, RequestOptions.none()) + object_: ObjectSubscriptionUpsertRequest + ): HttpResponseFor = create(object_, RequestOptions.none()) /** @see create */ @MustBeClosed diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/BatchInputPropertyCreateTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/BatchInputPropertyCreateTest.kt index 8b36bdd4..8e95a819 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/BatchInputPropertyCreateTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/BatchInputPropertyCreateTest.kt @@ -41,6 +41,7 @@ internal class BatchInputPropertyCreateTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() @@ -74,6 +75,7 @@ internal class BatchInputPropertyCreateTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) } @@ -111,6 +113,7 @@ internal class BatchInputPropertyCreateTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/PropertyCreateTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/PropertyCreateTest.kt index 83f2948b..a788fa94 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/PropertyCreateTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/PropertyCreateTest.kt @@ -40,6 +40,7 @@ internal class PropertyCreateTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() assertThat(propertyCreate.fieldType()).isEqualTo(PropertyCreate.FieldType.BOOLEANCHECKBOX) @@ -71,6 +72,8 @@ internal class PropertyCreateTest { ) assertThat(propertyCreate.referencedObjectType()).contains("referencedObjectType") assertThat(propertyCreate.showCurrencySymbol()).contains(true) + assertThat(propertyCreate.textDisplayHint()) + .contains(PropertyCreate.TextDisplayHint.DOMAIN_NAME) } @Test @@ -104,6 +107,7 @@ internal class PropertyCreateTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() val roundtrippedPropertyCreate = diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/PropertyTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/PropertyTest.kt index 64619ee2..e188db33 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/PropertyTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/PropertyTest.kt @@ -57,6 +57,7 @@ internal class PropertyTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -105,6 +106,7 @@ internal class PropertyTest { assertThat(property.referencedObjectType()).contains("referencedObjectType") assertThat(property.sensitiveDataCategories().getOrNull()).containsExactly("string") assertThat(property.showCurrencySymbol()).contains(true) + assertThat(property.textDisplayHint()).contains(Property.TextDisplayHint.DOMAIN_NAME) assertThat(property.updatedAt()).contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(property.updatedUserId()).contains("updatedUserId") } @@ -156,6 +158,7 @@ internal class PropertyTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/SubscriptionUpsertRequestTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/SubscriptionUpsertRequestTest.kt index 3cf00e0a..be4e83ed 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/SubscriptionUpsertRequestTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/SubscriptionUpsertRequestTest.kt @@ -15,8 +15,8 @@ import org.junit.jupiter.params.provider.EnumSource internal class SubscriptionUpsertRequestTest { @Test - fun ofObjectSubscriptionUpsertRequest() { - val objectSubscriptionUpsertRequest = + fun ofObject() { + val object_ = ObjectSubscriptionUpsertRequest.builder() .addAction(ObjectSubscriptionUpsertRequest.Action.CREATE) .addObjectId(0L) @@ -26,13 +26,9 @@ internal class SubscriptionUpsertRequestTest { .subscriptionType(ObjectSubscriptionUpsertRequest.SubscriptionType.OBJECT) .build() - val subscriptionUpsertRequest = - SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest( - objectSubscriptionUpsertRequest - ) + val subscriptionUpsertRequest = SubscriptionUpsertRequest.ofObject(object_) - assertThat(subscriptionUpsertRequest.objectSubscriptionUpsertRequest()) - .contains(objectSubscriptionUpsertRequest) + assertThat(subscriptionUpsertRequest.object_()).contains(object_) assertThat(subscriptionUpsertRequest.association()).isEmpty assertThat(subscriptionUpsertRequest.appLifecycleEvent()).isEmpty assertThat(subscriptionUpsertRequest.listMembership()).isEmpty @@ -40,10 +36,10 @@ internal class SubscriptionUpsertRequestTest { } @Test - fun ofObjectSubscriptionUpsertRequestRoundtrip() { + fun ofObjectRoundtrip() { val jsonMapper = jsonMapper() val subscriptionUpsertRequest = - SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest( + SubscriptionUpsertRequest.ofObject( ObjectSubscriptionUpsertRequest.builder() .addAction(ObjectSubscriptionUpsertRequest.Action.CREATE) .addObjectId(0L) @@ -77,7 +73,7 @@ internal class SubscriptionUpsertRequestTest { val subscriptionUpsertRequest = SubscriptionUpsertRequest.ofAssociation(association) - assertThat(subscriptionUpsertRequest.objectSubscriptionUpsertRequest()).isEmpty + assertThat(subscriptionUpsertRequest.object_()).isEmpty assertThat(subscriptionUpsertRequest.association()).contains(association) assertThat(subscriptionUpsertRequest.appLifecycleEvent()).isEmpty assertThat(subscriptionUpsertRequest.listMembership()).isEmpty @@ -124,7 +120,7 @@ internal class SubscriptionUpsertRequestTest { val subscriptionUpsertRequest = SubscriptionUpsertRequest.ofAppLifecycleEvent(appLifecycleEvent) - assertThat(subscriptionUpsertRequest.objectSubscriptionUpsertRequest()).isEmpty + assertThat(subscriptionUpsertRequest.object_()).isEmpty assertThat(subscriptionUpsertRequest.association()).isEmpty assertThat(subscriptionUpsertRequest.appLifecycleEvent()).contains(appLifecycleEvent) assertThat(subscriptionUpsertRequest.listMembership()).isEmpty @@ -170,7 +166,7 @@ internal class SubscriptionUpsertRequestTest { val subscriptionUpsertRequest = SubscriptionUpsertRequest.ofListMembership(listMembership) - assertThat(subscriptionUpsertRequest.objectSubscriptionUpsertRequest()).isEmpty + assertThat(subscriptionUpsertRequest.object_()).isEmpty assertThat(subscriptionUpsertRequest.association()).isEmpty assertThat(subscriptionUpsertRequest.appLifecycleEvent()).isEmpty assertThat(subscriptionUpsertRequest.listMembership()).contains(listMembership) @@ -218,7 +214,7 @@ internal class SubscriptionUpsertRequestTest { val subscriptionUpsertRequest = SubscriptionUpsertRequest.ofGdprPrivacyDeletion(gdprPrivacyDeletion) - assertThat(subscriptionUpsertRequest.objectSubscriptionUpsertRequest()).isEmpty + assertThat(subscriptionUpsertRequest.object_()).isEmpty assertThat(subscriptionUpsertRequest.association()).isEmpty assertThat(subscriptionUpsertRequest.appLifecycleEvent()).isEmpty assertThat(subscriptionUpsertRequest.listMembership()).isEmpty diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/auth/oauth/TokenInfoResponseBaseIfTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/auth/oauth/TokenInfoResponseBaseIfTest.kt index 6739d08d..4cc08806 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/auth/oauth/TokenInfoResponseBaseIfTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/auth/oauth/TokenInfoResponseBaseIfTest.kt @@ -15,8 +15,8 @@ import org.junit.jupiter.params.provider.EnumSource internal class TokenInfoResponseBaseIfTest { @Test - fun ofPublicAccessTokenInfoResponse() { - val publicAccessTokenInfoResponse = + fun ofAccessToken() { + val accessToken = PublicAccessTokenInfoResponse.builder() .token("token") .active(true) @@ -52,19 +52,17 @@ internal class TokenInfoResponseBaseIfTest { .user("user") .build() - val tokenInfoResponseBaseIf = - TokenInfoResponseBaseIf.ofPublicAccessTokenInfoResponse(publicAccessTokenInfoResponse) + val tokenInfoResponseBaseIf = TokenInfoResponseBaseIf.ofAccessToken(accessToken) - assertThat(tokenInfoResponseBaseIf.publicAccessTokenInfoResponse()) - .contains(publicAccessTokenInfoResponse) - assertThat(tokenInfoResponseBaseIf.publicRefreshTokenInfoResponse()).isEmpty + assertThat(tokenInfoResponseBaseIf.accessToken()).contains(accessToken) + assertThat(tokenInfoResponseBaseIf.refreshToken()).isEmpty } @Test - fun ofPublicAccessTokenInfoResponseRoundtrip() { + fun ofAccessTokenRoundtrip() { val jsonMapper = jsonMapper() val tokenInfoResponseBaseIf = - TokenInfoResponseBaseIf.ofPublicAccessTokenInfoResponse( + TokenInfoResponseBaseIf.ofAccessToken( PublicAccessTokenInfoResponse.builder() .token("token") .active(true) @@ -111,8 +109,8 @@ internal class TokenInfoResponseBaseIfTest { } @Test - fun ofPublicRefreshTokenInfoResponse() { - val publicRefreshTokenInfoResponse = + fun ofRefreshToken() { + val refreshToken = PublicRefreshTokenInfoResponse.builder() .token("token") .active(true) @@ -127,19 +125,17 @@ internal class TokenInfoResponseBaseIfTest { .user("user") .build() - val tokenInfoResponseBaseIf = - TokenInfoResponseBaseIf.ofPublicRefreshTokenInfoResponse(publicRefreshTokenInfoResponse) + val tokenInfoResponseBaseIf = TokenInfoResponseBaseIf.ofRefreshToken(refreshToken) - assertThat(tokenInfoResponseBaseIf.publicAccessTokenInfoResponse()).isEmpty - assertThat(tokenInfoResponseBaseIf.publicRefreshTokenInfoResponse()) - .contains(publicRefreshTokenInfoResponse) + assertThat(tokenInfoResponseBaseIf.accessToken()).isEmpty + assertThat(tokenInfoResponseBaseIf.refreshToken()).contains(refreshToken) } @Test - fun ofPublicRefreshTokenInfoResponseRoundtrip() { + fun ofRefreshTokenRoundtrip() { val jsonMapper = jsonMapper() val tokenInfoResponseBaseIf = - TokenInfoResponseBaseIf.ofPublicRefreshTokenInfoResponse( + TokenInfoResponseBaseIf.ofRefreshToken( PublicRefreshTokenInfoResponse.builder() .token("token") .active(true) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/auth/oauth/TokenResponseIfTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/auth/oauth/TokenResponseIfTest.kt index 8cc5219a..81b7dada 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/auth/oauth/TokenResponseIfTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/auth/oauth/TokenResponseIfTest.kt @@ -15,8 +15,8 @@ import org.junit.jupiter.params.provider.EnumSource internal class TokenResponseIfTest { @Test - fun ofAccessTokenResponse() { - val accessTokenResponse = + fun ofAccessToken() { + val accessToken = AccessTokenResponse.builder() .accessToken("access_token") .expiresIn(0L) @@ -29,17 +29,17 @@ internal class TokenResponseIfTest { .userId(0) .build() - val tokenResponseIf = TokenResponseIf.ofAccessTokenResponse(accessTokenResponse) + val tokenResponseIf = TokenResponseIf.ofAccessToken(accessToken) - assertThat(tokenResponseIf.accessTokenResponse()).contains(accessTokenResponse) - assertThat(tokenResponseIf.clientCredentialsTokenResponse()).isEmpty + assertThat(tokenResponseIf.accessToken()).contains(accessToken) + assertThat(tokenResponseIf.clientCredentials()).isEmpty } @Test - fun ofAccessTokenResponseRoundtrip() { + fun ofAccessTokenRoundtrip() { val jsonMapper = jsonMapper() val tokenResponseIf = - TokenResponseIf.ofAccessTokenResponse( + TokenResponseIf.ofAccessToken( AccessTokenResponse.builder() .accessToken("access_token") .expiresIn(0L) @@ -63,8 +63,8 @@ internal class TokenResponseIfTest { } @Test - fun ofClientCredentialsTokenResponse() { - val clientCredentialsTokenResponse = + fun ofClientCredentials() { + val clientCredentials = ClientCredentialsTokenResponse.builder() .accessToken("access_token") .expiresIn(0L) @@ -76,19 +76,17 @@ internal class TokenResponseIfTest { .userId(0) .build() - val tokenResponseIf = - TokenResponseIf.ofClientCredentialsTokenResponse(clientCredentialsTokenResponse) + val tokenResponseIf = TokenResponseIf.ofClientCredentials(clientCredentials) - assertThat(tokenResponseIf.accessTokenResponse()).isEmpty - assertThat(tokenResponseIf.clientCredentialsTokenResponse()) - .contains(clientCredentialsTokenResponse) + assertThat(tokenResponseIf.accessToken()).isEmpty + assertThat(tokenResponseIf.clientCredentials()).contains(clientCredentials) } @Test - fun ofClientCredentialsTokenResponseRoundtrip() { + fun ofClientCredentialsRoundtrip() { val jsonMapper = jsonMapper() val tokenResponseIf = - TokenResponseIf.ofClientCredentialsTokenResponse( + TokenResponseIf.ofClientCredentials( ClientCredentialsTokenResponse.builder() .accessToken("access_token") .expiresIn(0L) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/automation/actions/FieldTypeDefinitionTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/automation/actions/FieldTypeDefinitionTest.kt index 2c318a1d..a84b3423 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/automation/actions/FieldTypeDefinitionTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/automation/actions/FieldTypeDefinitionTest.kt @@ -61,7 +61,7 @@ internal class FieldTypeDefinitionTest { ) assertThat(fieldTypeDefinition.schema()) .isEqualTo( - FieldTypeDefinition.Schema.ofIntegerField( + FieldTypeDefinition.Schema.ofInteger( IntegerFieldSchema.builder() .type(IntegerFieldSchema.Type.INTEGER) .maximum(0) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionEggTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionEggTest.kt index 84bae9f7..d5e5522b 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionEggTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionEggTest.kt @@ -217,7 +217,7 @@ internal class PublicActionDefinitionEggTest { ) assertThat(publicActionDefinitionEgg.inputFieldDependencies().getOrNull()) .containsExactly( - PublicActionDefinitionEgg.InputFieldDependency.ofPublicSingle( + PublicActionDefinitionEgg.InputFieldDependency.ofSingleField( PublicSingleFieldDependency.builder() .controllingFieldName("controllingFieldName") .dependencyType(PublicSingleFieldDependency.DependencyType.SINGLE_FIELD) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionPatchTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionPatchTest.kt index e1ab3670..3eb53102 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionPatchTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionPatchTest.kt @@ -145,7 +145,7 @@ internal class PublicActionDefinitionPatchTest { ) assertThat(publicActionDefinitionPatch.inputFieldDependencies().getOrNull()) .containsExactly( - PublicActionDefinitionPatch.InputFieldDependency.ofPublicSingle( + PublicActionDefinitionPatch.InputFieldDependency.ofSingleField( PublicSingleFieldDependency.builder() .controllingFieldName("controllingFieldName") .dependencyType(PublicSingleFieldDependency.DependencyType.SINGLE_FIELD) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionTest.kt index 64693e25..90972ac8 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/automation/actions/PublicActionDefinitionTest.kt @@ -221,7 +221,7 @@ internal class PublicActionDefinitionTest { ) assertThat(publicActionDefinition.inputFieldDependencies().getOrNull()) .containsExactly( - PublicActionDefinition.InputFieldDependency.ofPublicSingle( + PublicActionDefinition.InputFieldDependency.ofSingleField( PublicSingleFieldDependency.builder() .controllingFieldName("controllingFieldName") .dependencyType(PublicSingleFieldDependency.DependencyType.SINGLE_FIELD) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/hubdb/UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3Test.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/hubdb/UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3Test.kt index c4ec169a..9c536efb 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/hubdb/UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3Test.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/hubdb/UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3Test.kt @@ -18,8 +18,8 @@ import org.junit.jupiter.params.provider.EnumSource internal class UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3Test { @Test - fun ofRandomAccessCollectionResponseWithTotal() { - val randomAccessCollectionResponseWithTotal = + fun ofRandomAccess() { + val randomAccess = RandomAccessCollectionResponseWithTotalHubDbTableRowV3.builder() .addResult(HubDbTableRowV3Wrapper.builder().build()) .total(0) @@ -32,41 +32,29 @@ internal class UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3Test { .build() val unifiedCollectionResponseWithTotalBaseHubDbTableRowV3 = - UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3 - .ofRandomAccessCollectionResponseWithTotal(randomAccessCollectionResponseWithTotal) + UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3.ofRandomAccess(randomAccess) - assertThat( - unifiedCollectionResponseWithTotalBaseHubDbTableRowV3 - .randomAccessCollectionResponseWithTotal() - ) - .contains(randomAccessCollectionResponseWithTotal) - assertThat( - unifiedCollectionResponseWithTotalBaseHubDbTableRowV3 - .streamingCollectionResponseWithTotal() - ) - .isEmpty + assertThat(unifiedCollectionResponseWithTotalBaseHubDbTableRowV3.randomAccess()) + .contains(randomAccess) + assertThat(unifiedCollectionResponseWithTotalBaseHubDbTableRowV3.streaming()).isEmpty } @Test - fun ofRandomAccessCollectionResponseWithTotalRoundtrip() { + fun ofRandomAccessRoundtrip() { val jsonMapper = jsonMapper() val unifiedCollectionResponseWithTotalBaseHubDbTableRowV3 = - UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3 - .ofRandomAccessCollectionResponseWithTotal( - RandomAccessCollectionResponseWithTotalHubDbTableRowV3.builder() - .addResult(HubDbTableRowV3Wrapper.builder().build()) - .total(0) - .type( - RandomAccessCollectionResponseWithTotalHubDbTableRowV3.Type - .RANDOM_ACCESS - ) - .paging( - BoundedPaging.builder() - .next(BoundedNextPage.builder().offset(0).link("link").build()) - .build() - ) - .build() - ) + UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3.ofRandomAccess( + RandomAccessCollectionResponseWithTotalHubDbTableRowV3.builder() + .addResult(HubDbTableRowV3Wrapper.builder().build()) + .total(0) + .type(RandomAccessCollectionResponseWithTotalHubDbTableRowV3.Type.RANDOM_ACCESS) + .paging( + BoundedPaging.builder() + .next(BoundedNextPage.builder().offset(0).link("link").build()) + .build() + ) + .build() + ) val roundtrippedUnifiedCollectionResponseWithTotalBaseHubDbTableRowV3 = jsonMapper.readValue( @@ -81,8 +69,8 @@ internal class UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3Test { } @Test - fun ofStreamingCollectionResponseWithTotal() { - val streamingCollectionResponseWithTotal = + fun ofStreaming() { + val streaming = StreamingCollectionResponseWithTotalHubDbTableRowV3.builder() .addResult(HubDbTableRowV3Wrapper.builder().build()) .total(0) @@ -96,39 +84,30 @@ internal class UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3Test { .build() val unifiedCollectionResponseWithTotalBaseHubDbTableRowV3 = - UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3 - .ofStreamingCollectionResponseWithTotal(streamingCollectionResponseWithTotal) + UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3.ofStreaming(streaming) - assertThat( - unifiedCollectionResponseWithTotalBaseHubDbTableRowV3 - .randomAccessCollectionResponseWithTotal() - ) - .isEmpty - assertThat( - unifiedCollectionResponseWithTotalBaseHubDbTableRowV3 - .streamingCollectionResponseWithTotal() - ) - .contains(streamingCollectionResponseWithTotal) + assertThat(unifiedCollectionResponseWithTotalBaseHubDbTableRowV3.randomAccess()).isEmpty + assertThat(unifiedCollectionResponseWithTotalBaseHubDbTableRowV3.streaming()) + .contains(streaming) } @Test - fun ofStreamingCollectionResponseWithTotalRoundtrip() { + fun ofStreamingRoundtrip() { val jsonMapper = jsonMapper() val unifiedCollectionResponseWithTotalBaseHubDbTableRowV3 = - UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3 - .ofStreamingCollectionResponseWithTotal( - StreamingCollectionResponseWithTotalHubDbTableRowV3.builder() - .addResult(HubDbTableRowV3Wrapper.builder().build()) - .total(0) - .type(StreamingCollectionResponseWithTotalHubDbTableRowV3.Type.STREAMING) - .paging( - Paging.builder() - .next(NextPage.builder().after("after").link("link").build()) - .prev(PreviousPage.builder().before("before").link("link").build()) - .build() - ) - .build() - ) + UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3.ofStreaming( + StreamingCollectionResponseWithTotalHubDbTableRowV3.builder() + .addResult(HubDbTableRowV3Wrapper.builder().build()) + .total(0) + .type(StreamingCollectionResponseWithTotalHubDbTableRowV3.Type.STREAMING) + .paging( + Paging.builder() + .next(NextPage.builder().after("after").link("link").build()) + .prev(PreviousPage.builder().before("before").link("link").build()) + .build() + ) + .build() + ) val roundtrippedUnifiedCollectionResponseWithTotalBaseHubDbTableRowV3 = jsonMapper.readValue( diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/CollectionResponseObjectSchemaNoPagingTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/CollectionResponseObjectSchemaNoPagingTest.kt index 36bb91da..f257de51 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/CollectionResponseObjectSchemaNoPagingTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/CollectionResponseObjectSchemaNoPagingTest.kt @@ -85,6 +85,7 @@ internal class CollectionResponseObjectSchemaNoPagingTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property1.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -171,6 +172,7 @@ internal class CollectionResponseObjectSchemaNoPagingTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property1.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -261,6 +263,7 @@ internal class CollectionResponseObjectSchemaNoPagingTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property1.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/CollectionResponsePropertyNoPagingTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/CollectionResponsePropertyNoPagingTest.kt index cda37089..d49edf61 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/CollectionResponsePropertyNoPagingTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/CollectionResponsePropertyNoPagingTest.kt @@ -59,6 +59,7 @@ internal class CollectionResponsePropertyNoPagingTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property1.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -110,6 +111,7 @@ internal class CollectionResponsePropertyNoPagingTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property1.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -165,6 +167,7 @@ internal class CollectionResponsePropertyNoPagingTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property1.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/MediaBridgeCreatePropertyParamsTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/MediaBridgeCreatePropertyParamsTest.kt index 10b24c9a..9487af55 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/MediaBridgeCreatePropertyParamsTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/MediaBridgeCreatePropertyParamsTest.kt @@ -42,6 +42,7 @@ internal class MediaBridgeCreatePropertyParamsTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() @@ -104,6 +105,7 @@ internal class MediaBridgeCreatePropertyParamsTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() @@ -139,6 +141,7 @@ internal class MediaBridgeCreatePropertyParamsTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) } diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/MediaBridgePropertyUpdateTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/MediaBridgePropertyUpdateTest.kt index a1b8a032..b55aa7c0 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/MediaBridgePropertyUpdateTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/MediaBridgePropertyUpdateTest.kt @@ -36,6 +36,7 @@ internal class MediaBridgePropertyUpdateTest { .build() ) .showCurrencySymbol(true) + .textDisplayHint(MediaBridgePropertyUpdate.TextDisplayHint.DOMAIN_NAME) .type(MediaBridgePropertyUpdate.Type.BOOL) .build() @@ -64,6 +65,8 @@ internal class MediaBridgePropertyUpdateTest { .build() ) assertThat(mediaBridgePropertyUpdate.showCurrencySymbol()).contains(true) + assertThat(mediaBridgePropertyUpdate.textDisplayHint()) + .contains(MediaBridgePropertyUpdate.TextDisplayHint.DOMAIN_NAME) assertThat(mediaBridgePropertyUpdate.type()).contains(MediaBridgePropertyUpdate.Type.BOOL) } @@ -93,6 +96,7 @@ internal class MediaBridgePropertyUpdateTest { .build() ) .showCurrencySymbol(true) + .textDisplayHint(MediaBridgePropertyUpdate.TextDisplayHint.DOMAIN_NAME) .type(MediaBridgePropertyUpdate.Type.BOOL) .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/MediaBridgeUpdatePropertyParamsTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/MediaBridgeUpdatePropertyParamsTest.kt index 101c2782..0eb225e3 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/MediaBridgeUpdatePropertyParamsTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/MediaBridgeUpdatePropertyParamsTest.kt @@ -37,6 +37,7 @@ internal class MediaBridgeUpdatePropertyParamsTest { .build() ) .showCurrencySymbol(true) + .textDisplayHint(MediaBridgePropertyUpdate.TextDisplayHint.DOMAIN_NAME) .type(MediaBridgePropertyUpdate.Type.BOOL) .build() ) @@ -90,6 +91,7 @@ internal class MediaBridgeUpdatePropertyParamsTest { .build() ) .showCurrencySymbol(true) + .textDisplayHint(MediaBridgePropertyUpdate.TextDisplayHint.DOMAIN_NAME) .type(MediaBridgePropertyUpdate.Type.BOOL) .build() ) @@ -121,6 +123,7 @@ internal class MediaBridgeUpdatePropertyParamsTest { .build() ) .showCurrencySymbol(true) + .textDisplayHint(MediaBridgePropertyUpdate.TextDisplayHint.DOMAIN_NAME) .type(MediaBridgePropertyUpdate.Type.BOOL) .build() ) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/ObjectSchemaTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/ObjectSchemaTest.kt index 6769ca6d..de574f25 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/ObjectSchemaTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/ObjectSchemaTest.kt @@ -83,6 +83,7 @@ internal class ObjectSchemaTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property1.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -164,6 +165,7 @@ internal class ObjectSchemaTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property1.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -252,6 +254,7 @@ internal class ObjectSchemaTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property1.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/Property1Test.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/Property1Test.kt index c4148220..92f4ff74 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/Property1Test.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/Property1Test.kt @@ -58,6 +58,7 @@ internal class Property1Test { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property1.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -107,6 +108,7 @@ internal class Property1Test { assertThat(property1.referencedObjectType()).contains("referencedObjectType") assertThat(property1.sensitiveDataCategories().getOrNull()).containsExactly("string") assertThat(property1.showCurrencySymbol()).contains(true) + assertThat(property1.textDisplayHint()).contains(Property1.TextDisplayHint.DOMAIN_NAME) assertThat(property1.updatedAt()).contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(property1.updatedUserId()).contains("updatedUserId") } @@ -158,6 +160,7 @@ internal class Property1Test { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property1.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/batch/BatchCreateParamsTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/batch/BatchCreateParamsTest.kt index 23ad49ce..9110cb68 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/batch/BatchCreateParamsTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/cms/mediabridge/batch/BatchCreateParamsTest.kt @@ -45,6 +45,7 @@ internal class BatchCreateParamsTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() @@ -115,6 +116,7 @@ internal class BatchCreateParamsTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() @@ -154,6 +156,7 @@ internal class BatchCreateParamsTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/conversations/customchannels/PublicConversationsMessageTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/conversations/customchannels/PublicConversationsMessageTest.kt index d02b5d74..59bdd08d 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/conversations/customchannels/PublicConversationsMessageTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/conversations/customchannels/PublicConversationsMessageTest.kt @@ -92,7 +92,7 @@ internal class PublicConversationsMessageTest { assertThat(publicConversationsMessage.archived()).isEqualTo(true) assertThat(publicConversationsMessage.attachments()) .containsExactly( - PublicConversationsMessage.Attachment.ofPublicFile( + PublicConversationsMessage.Attachment.ofFile( PublicFile.builder() .fileId("fileId") .fileUsageType(PublicFile.FileUsageType.AUDIO) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/conversations/customchannels/messages/MessageCreateParamsTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/conversations/customchannels/messages/MessageCreateParamsTest.kt index d019608c..2c9280b3 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/conversations/customchannels/messages/MessageCreateParamsTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/conversations/customchannels/messages/MessageCreateParamsTest.kt @@ -84,12 +84,7 @@ internal class MessageCreateParamsTest { .channelId(0) .channelIntegrationMessageEgg( ChannelIntegrationMessageEgg.builder() - .addAttachment( - FileAttachment.builder() - .fileId("fileId") - .type(FileAttachment.Type.FILE) - .build() - ) + .addFileAttachment("fileId") .channelAccountId("channelAccountId") .messageDirection(ChannelIntegrationMessageEgg.MessageDirection.INCOMING) .addRecipient( @@ -263,12 +258,7 @@ internal class MessageCreateParamsTest { .channelId(0) .channelIntegrationMessageEgg( ChannelIntegrationMessageEgg.builder() - .addAttachment( - FileAttachment.builder() - .fileId("fileId") - .type(FileAttachment.Type.FILE) - .build() - ) + .addFileAttachment("fileId") .channelAccountId("channelAccountId") .messageDirection(ChannelIntegrationMessageEgg.MessageDirection.INCOMING) .addRecipient( @@ -306,12 +296,7 @@ internal class MessageCreateParamsTest { assertThat(body) .isEqualTo( ChannelIntegrationMessageEgg.builder() - .addAttachment( - FileAttachment.builder() - .fileId("fileId") - .type(FileAttachment.Type.FILE) - .build() - ) + .addFileAttachment("fileId") .channelAccountId("channelAccountId") .messageDirection(ChannelIntegrationMessageEgg.MessageDirection.INCOMING) .addRecipient( diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/extensions/calling/CompletedThirdPartyCallResponseTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/extensions/calling/CompletedThirdPartyCallResponseTest.kt index e9217244..2b647c8a 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/extensions/calling/CompletedThirdPartyCallResponseTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/extensions/calling/CompletedThirdPartyCallResponseTest.kt @@ -32,7 +32,7 @@ internal class CompletedThirdPartyCallResponseTest { assertThat(completedThirdPartyCallResponse.callerIdMatches()) .containsExactly( - CompletedThirdPartyCallResponse.CallerIdMatch.ofContactCallerId( + CompletedThirdPartyCallResponse.CallerIdMatch.ofContact( ContactCallerId.builder() .callerIdType(ContactCallerId.CallerIdType.CONTACT) .objectCoordinates( diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/extensions/cardsdev/IntegratorObjectResultTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/extensions/cardsdev/IntegratorObjectResultTest.kt index 3dd792ef..05d15057 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/extensions/cardsdev/IntegratorObjectResultTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/extensions/cardsdev/IntegratorObjectResultTest.kt @@ -45,7 +45,7 @@ internal class IntegratorObjectResultTest { assertThat(integratorObjectResult.id()).isEqualTo("id") assertThat(integratorObjectResult.actions()) .containsExactly( - IntegratorObjectResult.Action.ofHookActionBody( + IntegratorObjectResult.Action.ofHook( ActionHookActionBody.builder() .httpMethod(ActionHookActionBody.HttpMethod.CONNECT) .addPropertyNamesIncluded("string") diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/extensions/cardsdev/TopLevelActionsTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/extensions/cardsdev/TopLevelActionsTest.kt index 4f80b999..2d40f2b8 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/extensions/cardsdev/TopLevelActionsTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/extensions/cardsdev/TopLevelActionsTest.kt @@ -59,7 +59,7 @@ internal class TopLevelActionsTest { assertThat(topLevelActions.secondary()) .containsExactly( - TopLevelActions.Secondary.ofActionHookActionBody( + TopLevelActions.Secondary.ofActionHook( ActionHookActionBody.builder() .httpMethod(ActionHookActionBody.HttpMethod.CONNECT) .addPropertyNamesIncluded("string") @@ -78,7 +78,7 @@ internal class TopLevelActionsTest { ) assertThat(topLevelActions.primary()) .contains( - TopLevelActions.Primary.ofActionHookActionBody( + TopLevelActions.Primary.ofActionHook( ActionHookActionBody.builder() .httpMethod(ActionHookActionBody.HttpMethod.CONNECT) .addPropertyNamesIncluded("string") diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/ListUpdateScheduleConversionParamsTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/ListUpdateScheduleConversionParamsTest.kt index 83f3645f..7bc50cea 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/ListUpdateScheduleConversionParamsTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/ListUpdateScheduleConversionParamsTest.kt @@ -61,7 +61,7 @@ internal class ListUpdateScheduleConversionParamsTest { assertThat(body) .isEqualTo( - PublicListConversionTime.ofDate( + PublicListConversionTime.ofConversionDate( PublicListConversionDate.builder() .conversionType(PublicListConversionDate.ConversionType.CONVERSION_DATE) .day(0) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicAdsTimeFilterTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicAdsTimeFilterTest.kt index 297929ea..19d81313 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicAdsTimeFilterTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicAdsTimeFilterTest.kt @@ -27,7 +27,7 @@ internal class PublicAdsTimeFilterTest { .isEqualTo(PublicAdsTimeFilter.FilterType.ADS_TIME) assertThat(publicAdsTimeFilter.pruningRefineBy()) .isEqualTo( - PublicAdsTimeFilter.PruningRefineBy.ofPublicNumOccurrences( + PublicAdsTimeFilter.PruningRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicAssociationInListFilterTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicAssociationInListFilterTest.kt index 4345b705..ec812b6f 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicAssociationInListFilterTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicAssociationInListFilterTest.kt @@ -34,7 +34,7 @@ internal class PublicAssociationInListFilterTest { assertThat(publicAssociationInListFilter.associationTypeId()).isEqualTo(0) assertThat(publicAssociationInListFilter.coalescingRefineBy()) .isEqualTo( - PublicAssociationInListFilter.CoalescingRefineBy.ofPublicNumOccurrences( + PublicAssociationInListFilter.CoalescingRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicCtaAnalyticsFilterTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicCtaAnalyticsFilterTest.kt index 5db5608c..e3738a04 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicCtaAnalyticsFilterTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicCtaAnalyticsFilterTest.kt @@ -38,7 +38,7 @@ internal class PublicCtaAnalyticsFilterTest { assertThat(publicCtaAnalyticsFilter.operator()).isEqualTo("operator") assertThat(publicCtaAnalyticsFilter.coalescingRefineBy()) .contains( - PublicCtaAnalyticsFilter.CoalescingRefineBy.ofPublicNumOccurrences( + PublicCtaAnalyticsFilter.CoalescingRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) @@ -48,7 +48,7 @@ internal class PublicCtaAnalyticsFilterTest { ) assertThat(publicCtaAnalyticsFilter.pruningRefineBy()) .contains( - PublicCtaAnalyticsFilter.PruningRefineBy.ofPublicNumOccurrences( + PublicCtaAnalyticsFilter.PruningRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicEmailEventFilterTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicEmailEventFilterTest.kt index 1b18dd7d..c6493ac1 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicEmailEventFilterTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicEmailEventFilterTest.kt @@ -38,7 +38,7 @@ internal class PublicEmailEventFilterTest { assertThat(publicEmailEventFilter.clickUrl()).contains("clickUrl") assertThat(publicEmailEventFilter.pruningRefineBy()) .contains( - PublicEmailEventFilter.PruningRefineBy.ofPublicNumOccurrences( + PublicEmailEventFilter.PruningRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicEventAnalyticsFilterTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicEventAnalyticsFilterTest.kt index a5e28e86..3ff79740 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicEventAnalyticsFilterTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicEventAnalyticsFilterTest.kt @@ -38,7 +38,7 @@ internal class PublicEventAnalyticsFilterTest { assertThat(publicEventAnalyticsFilter.operator()).isEqualTo("operator") assertThat(publicEventAnalyticsFilter.coalescingRefineBy()) .contains( - PublicEventAnalyticsFilter.CoalescingRefineBy.ofPublicNumOccurrences( + PublicEventAnalyticsFilter.CoalescingRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) @@ -48,7 +48,7 @@ internal class PublicEventAnalyticsFilterTest { ) assertThat(publicEventAnalyticsFilter.pruningRefineBy()) .contains( - PublicEventAnalyticsFilter.PruningRefineBy.ofPublicNumOccurrences( + PublicEventAnalyticsFilter.PruningRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicEventFilterMetadataTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicEventFilterMetadataTest.kt index 973a5727..99bcd224 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicEventFilterMetadataTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicEventFilterMetadataTest.kt @@ -26,7 +26,7 @@ internal class PublicEventFilterMetadataTest { assertThat(publicEventFilterMetadata.operation()) .isEqualTo( - PublicEventFilterMetadata.Operation.ofPublicBoolProperty( + PublicEventFilterMetadata.Operation.ofBool( PublicBoolPropertyOperation.builder() .includeObjectsWithNoValueSet(true) .operationType(PublicBoolPropertyOperation.OperationType.BOOL) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicFormSubmissionFilterTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicFormSubmissionFilterTest.kt index abe5c521..0ac6fee2 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicFormSubmissionFilterTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicFormSubmissionFilterTest.kt @@ -38,7 +38,7 @@ internal class PublicFormSubmissionFilterTest { .isEqualTo(PublicFormSubmissionFilter.Operator.FILLED_OUT) assertThat(publicFormSubmissionFilter.coalescingRefineBy()) .contains( - PublicFormSubmissionFilter.CoalescingRefineBy.ofPublicNumOccurrences( + PublicFormSubmissionFilter.CoalescingRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) @@ -49,7 +49,7 @@ internal class PublicFormSubmissionFilterTest { assertThat(publicFormSubmissionFilter.formId()).contains("formId") assertThat(publicFormSubmissionFilter.pruningRefineBy()) .contains( - PublicFormSubmissionFilter.PruningRefineBy.ofPublicNumOccurrences( + PublicFormSubmissionFilter.PruningRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicFormSubmissionOnPageFilterTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicFormSubmissionOnPageFilterTest.kt index 74471d8a..21b8416d 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicFormSubmissionOnPageFilterTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicFormSubmissionOnPageFilterTest.kt @@ -40,7 +40,7 @@ internal class PublicFormSubmissionOnPageFilterTest { assertThat(publicFormSubmissionOnPageFilter.pageId()).isEqualTo("pageId") assertThat(publicFormSubmissionOnPageFilter.coalescingRefineBy()) .contains( - PublicFormSubmissionOnPageFilter.CoalescingRefineBy.ofPublicNumOccurrences( + PublicFormSubmissionOnPageFilter.CoalescingRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) @@ -51,7 +51,7 @@ internal class PublicFormSubmissionOnPageFilterTest { assertThat(publicFormSubmissionOnPageFilter.formId()).contains("formId") assertThat(publicFormSubmissionOnPageFilter.pruningRefineBy()) .contains( - PublicFormSubmissionOnPageFilter.PruningRefineBy.ofPublicNumOccurrences( + PublicFormSubmissionOnPageFilter.PruningRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicIndexedTimePointTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicIndexedTimePointTest.kt index d58773ff..6efa8216 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicIndexedTimePointTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicIndexedTimePointTest.kt @@ -42,7 +42,7 @@ internal class PublicIndexedTimePointTest { assertThat(publicIndexedTimePoint.indexReference()) .isEqualTo( - PublicIndexedTimePoint.IndexReference.ofPublicNow( + PublicIndexedTimePoint.IndexReference.ofNow( PublicNowReference.builder() .referenceType(PublicNowReference.ReferenceType.NOW) .hour(0) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicListConversionResponseTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicListConversionResponseTest.kt index 676e85de..2fafa3a9 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicListConversionResponseTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicListConversionResponseTest.kt @@ -31,7 +31,7 @@ internal class PublicListConversionResponseTest { .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(publicListConversionResponse.requestedConversionTime()) .contains( - PublicListConversionResponse.RequestedConversionTime.ofPublicListConversionDate( + PublicListConversionResponse.RequestedConversionTime.ofConversionDate( PublicListConversionDate.builder() .conversionType(PublicListConversionDate.ConversionType.CONVERSION_DATE) .day(0) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicListConversionTimeTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicListConversionTimeTest.kt index b6260716..d350625c 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicListConversionTimeTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicListConversionTimeTest.kt @@ -15,8 +15,8 @@ import org.junit.jupiter.params.provider.EnumSource internal class PublicListConversionTimeTest { @Test - fun ofDate() { - val date = + fun ofConversionDate() { + val conversionDate = PublicListConversionDate.builder() .conversionType(PublicListConversionDate.ConversionType.CONVERSION_DATE) .day(0) @@ -24,17 +24,17 @@ internal class PublicListConversionTimeTest { .year(0) .build() - val publicListConversionTime = PublicListConversionTime.ofDate(date) + val publicListConversionTime = PublicListConversionTime.ofConversionDate(conversionDate) - assertThat(publicListConversionTime.date()).contains(date) + assertThat(publicListConversionTime.conversionDate()).contains(conversionDate) assertThat(publicListConversionTime.inactivity()).isEmpty } @Test - fun ofDateRoundtrip() { + fun ofConversionDateRoundtrip() { val jsonMapper = jsonMapper() val publicListConversionTime = - PublicListConversionTime.ofDate( + PublicListConversionTime.ofConversionDate( PublicListConversionDate.builder() .conversionType(PublicListConversionDate.ConversionType.CONVERSION_DATE) .day(0) @@ -63,7 +63,7 @@ internal class PublicListConversionTimeTest { val publicListConversionTime = PublicListConversionTime.ofInactivity(inactivity) - assertThat(publicListConversionTime.date()).isEmpty + assertThat(publicListConversionTime.conversionDate()).isEmpty assertThat(publicListConversionTime.inactivity()).contains(inactivity) } diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicPageViewAnalyticsFilterTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicPageViewAnalyticsFilterTest.kt index 84b54513..7c95ddb4 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicPageViewAnalyticsFilterTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicPageViewAnalyticsFilterTest.kt @@ -39,7 +39,7 @@ internal class PublicPageViewAnalyticsFilterTest { assertThat(publicPageViewAnalyticsFilter.pageUrl()).isEqualTo("pageUrl") assertThat(publicPageViewAnalyticsFilter.coalescingRefineBy()) .contains( - PublicPageViewAnalyticsFilter.CoalescingRefineBy.ofPublicNumOccurrences( + PublicPageViewAnalyticsFilter.CoalescingRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) @@ -50,7 +50,7 @@ internal class PublicPageViewAnalyticsFilterTest { assertThat(publicPageViewAnalyticsFilter.enableTracking()).contains(true) assertThat(publicPageViewAnalyticsFilter.pruningRefineBy()) .contains( - PublicPageViewAnalyticsFilter.PruningRefineBy.ofPublicNumOccurrences( + PublicPageViewAnalyticsFilter.PruningRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicRangedTimeOperationTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicRangedTimeOperationTest.kt index 9d8e40a4..e7c4b3ec 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicRangedTimeOperationTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicRangedTimeOperationTest.kt @@ -53,7 +53,7 @@ internal class PublicRangedTimeOperationTest { assertThat(publicRangedTimeOperation.includeObjectsWithNoValueSet()).isEqualTo(true) assertThat(publicRangedTimeOperation.lowerBoundTimePoint()) .isEqualTo( - PublicRangedTimeOperation.LowerBoundTimePoint.ofPublicDate( + PublicRangedTimeOperation.LowerBoundTimePoint.ofDate( PublicDatePoint.builder() .day(0) .month(0) @@ -75,7 +75,7 @@ internal class PublicRangedTimeOperationTest { .isEqualTo(PublicRangedTimeOperation.Type.TIME_RANGED) assertThat(publicRangedTimeOperation.upperBoundTimePoint()) .isEqualTo( - PublicRangedTimeOperation.UpperBoundTimePoint.ofPublicDate( + PublicRangedTimeOperation.UpperBoundTimePoint.ofDate( PublicDatePoint.builder() .day(0) .month(0) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicSurveyMonkeyValueFilterTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicSurveyMonkeyValueFilterTest.kt index 604f3c66..2232b0e5 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicSurveyMonkeyValueFilterTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicSurveyMonkeyValueFilterTest.kt @@ -36,7 +36,7 @@ internal class PublicSurveyMonkeyValueFilterTest { assertThat(publicSurveyMonkeyValueFilter.surveyQuestion()).isEqualTo("surveyQuestion") assertThat(publicSurveyMonkeyValueFilter.valueComparison()) .isEqualTo( - PublicSurveyMonkeyValueFilter.ValueComparison.ofPublicBoolPropertyOperation( + PublicSurveyMonkeyValueFilter.ValueComparison.ofBool( PublicBoolPropertyOperation.builder() .includeObjectsWithNoValueSet(true) .operationType(PublicBoolPropertyOperation.OperationType.BOOL) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicTimePointOperationTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicTimePointOperationTest.kt index 0b24dbc4..e6267ab1 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicTimePointOperationTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicTimePointOperationTest.kt @@ -41,7 +41,7 @@ internal class PublicTimePointOperationTest { assertThat(publicTimePointOperation.operator()).isEqualTo("operator") assertThat(publicTimePointOperation.timePoint()) .isEqualTo( - PublicTimePointOperation.TimePoint.ofPublicDate( + PublicTimePointOperation.TimePoint.ofDate( PublicDatePoint.builder() .day(0) .month(0) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicUnifiedEventsFilterBranchTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicUnifiedEventsFilterBranchTest.kt index 9ca9cc11..48689212 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicUnifiedEventsFilterBranchTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicUnifiedEventsFilterBranchTest.kt @@ -526,7 +526,7 @@ internal class PublicUnifiedEventsFilterBranchTest { .isEqualTo(PublicUnifiedEventsFilterBranch.Operator.HAS_COMPLETED) assertThat(publicUnifiedEventsFilterBranch.coalescingRefineBy()) .contains( - PublicUnifiedEventsFilterBranch.CoalescingRefineBy.ofPublicNumOccurrences( + PublicUnifiedEventsFilterBranch.CoalescingRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) @@ -536,7 +536,7 @@ internal class PublicUnifiedEventsFilterBranchTest { ) assertThat(publicUnifiedEventsFilterBranch.pruningRefineBy()) .contains( - PublicUnifiedEventsFilterBranch.PruningRefineBy.ofPublicNumOccurrences( + PublicUnifiedEventsFilterBranch.PruningRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicUnifiedEventsFilterTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicUnifiedEventsFilterTest.kt index 39dc5727..814126ed 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicUnifiedEventsFilterTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/lists/PublicUnifiedEventsFilterTest.kt @@ -62,7 +62,7 @@ internal class PublicUnifiedEventsFilterTest { .isEqualTo(PublicUnifiedEventsFilter.FilterType.UNIFIED_EVENTS) assertThat(publicUnifiedEventsFilter.coalescingRefineBy()) .contains( - PublicUnifiedEventsFilter.CoalescingRefineBy.ofPublicNumOccurrences( + PublicUnifiedEventsFilter.CoalescingRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) @@ -73,7 +73,7 @@ internal class PublicUnifiedEventsFilterTest { assertThat(publicUnifiedEventsFilter.eventTypeId()).contains("eventTypeId") assertThat(publicUnifiedEventsFilter.pruningRefineBy()) .contains( - PublicUnifiedEventsFilter.PruningRefineBy.ofPublicNumOccurrences( + PublicUnifiedEventsFilter.PruningRefineBy.ofNumOccurrences( PublicNumOccurrencesRefineBy.builder() .type(PublicNumOccurrencesRefineBy.Type.NUM_OCCURRENCES) .maxOccurrences(0) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/objectschemas/CollectionResponseObjectSchemaNoPagingTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/objectschemas/CollectionResponseObjectSchemaNoPagingTest.kt index cabd9d7d..327ffe4f 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/objectschemas/CollectionResponseObjectSchemaNoPagingTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/objectschemas/CollectionResponseObjectSchemaNoPagingTest.kt @@ -87,6 +87,7 @@ internal class CollectionResponseObjectSchemaNoPagingTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -173,6 +174,7 @@ internal class CollectionResponseObjectSchemaNoPagingTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -263,6 +265,7 @@ internal class CollectionResponseObjectSchemaNoPagingTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/objectschemas/ObjectSchemaTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/objectschemas/ObjectSchemaTest.kt index b4c8a97d..c1fcf4cd 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/objectschemas/ObjectSchemaTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/objectschemas/ObjectSchemaTest.kt @@ -85,6 +85,7 @@ internal class ObjectSchemaTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -166,6 +167,7 @@ internal class ObjectSchemaTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -254,6 +256,7 @@ internal class ObjectSchemaTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/BatchResponsePropertyTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/BatchResponsePropertyTest.kt index 1fc2db4b..2e37b365 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/BatchResponsePropertyTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/BatchResponsePropertyTest.kt @@ -63,6 +63,7 @@ internal class BatchResponsePropertyTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -124,6 +125,7 @@ internal class BatchResponsePropertyTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -191,6 +193,7 @@ internal class BatchResponsePropertyTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/BatchResponsePropertyWithErrorsTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/BatchResponsePropertyWithErrorsTest.kt index 378443f8..fa16b18a 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/BatchResponsePropertyWithErrorsTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/BatchResponsePropertyWithErrorsTest.kt @@ -66,6 +66,7 @@ internal class BatchResponsePropertyWithErrorsTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -287,6 +288,7 @@ internal class BatchResponsePropertyWithErrorsTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -420,6 +422,7 @@ internal class BatchResponsePropertyWithErrorsTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/CollectionResponsePropertyNoPagingTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/CollectionResponsePropertyNoPagingTest.kt index b2c4943f..5277d54e 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/CollectionResponsePropertyNoPagingTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/CollectionResponsePropertyNoPagingTest.kt @@ -61,6 +61,7 @@ internal class CollectionResponsePropertyNoPagingTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -112,6 +113,7 @@ internal class CollectionResponsePropertyNoPagingTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -167,6 +169,7 @@ internal class CollectionResponsePropertyNoPagingTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/PropertyCreateParamsTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/PropertyCreateParamsTest.kt index e967108c..d41e4b8e 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/PropertyCreateParamsTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/PropertyCreateParamsTest.kt @@ -41,6 +41,7 @@ internal class PropertyCreateParamsTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() @@ -100,6 +101,7 @@ internal class PropertyCreateParamsTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() @@ -135,6 +137,7 @@ internal class PropertyCreateParamsTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) } diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/PropertyUpdateParamsTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/PropertyUpdateParamsTest.kt index 8b0265be..90a9f4de 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/PropertyUpdateParamsTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/PropertyUpdateParamsTest.kt @@ -35,6 +35,7 @@ internal class PropertyUpdateParamsTest { .build() ) .showCurrencySymbol(true) + .textDisplayHint(PropertyUpdate.TextDisplayHint.DOMAIN_NAME) .type(PropertyUpdate.Type.BOOL) .build() ) @@ -84,6 +85,7 @@ internal class PropertyUpdateParamsTest { .build() ) .showCurrencySymbol(true) + .textDisplayHint(PropertyUpdate.TextDisplayHint.DOMAIN_NAME) .type(PropertyUpdate.Type.BOOL) .build() ) @@ -114,6 +116,7 @@ internal class PropertyUpdateParamsTest { .build() ) .showCurrencySymbol(true) + .textDisplayHint(PropertyUpdate.TextDisplayHint.DOMAIN_NAME) .type(PropertyUpdate.Type.BOOL) .build() ) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/PropertyUpdateTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/PropertyUpdateTest.kt index 6bebe90b..2d45bd25 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/PropertyUpdateTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/PropertyUpdateTest.kt @@ -35,6 +35,7 @@ internal class PropertyUpdateTest { .build() ) .showCurrencySymbol(true) + .textDisplayHint(PropertyUpdate.TextDisplayHint.DOMAIN_NAME) .type(PropertyUpdate.Type.BOOL) .build() @@ -60,6 +61,8 @@ internal class PropertyUpdateTest { .build() ) assertThat(propertyUpdate.showCurrencySymbol()).contains(true) + assertThat(propertyUpdate.textDisplayHint()) + .contains(PropertyUpdate.TextDisplayHint.DOMAIN_NAME) assertThat(propertyUpdate.type()).contains(PropertyUpdate.Type.BOOL) } @@ -88,6 +91,7 @@ internal class PropertyUpdateTest { .build() ) .showCurrencySymbol(true) + .textDisplayHint(PropertyUpdate.TextDisplayHint.DOMAIN_NAME) .type(PropertyUpdate.Type.BOOL) .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/batch/BatchCreateParamsTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/batch/BatchCreateParamsTest.kt index 675ba3cb..360bf28c 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/batch/BatchCreateParamsTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/crm/properties/batch/BatchCreateParamsTest.kt @@ -44,6 +44,7 @@ internal class BatchCreateParamsTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() @@ -111,6 +112,7 @@ internal class BatchCreateParamsTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() @@ -150,6 +152,7 @@ internal class BatchCreateParamsTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/events/definitions/CollectionResponseWithTotalExternalBehavioralEventTypeDefinitionTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/events/definitions/CollectionResponseWithTotalExternalBehavioralEventTypeDefinitionTest.kt index 2f6953ee..bc5a82e5 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/events/definitions/CollectionResponseWithTotalExternalBehavioralEventTypeDefinitionTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/events/definitions/CollectionResponseWithTotalExternalBehavioralEventTypeDefinitionTest.kt @@ -118,6 +118,7 @@ internal class CollectionResponseWithTotalExternalBehavioralEventTypeDefinitionT .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -293,6 +294,7 @@ internal class CollectionResponseWithTotalExternalBehavioralEventTypeDefinitionT .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -476,6 +478,7 @@ internal class CollectionResponseWithTotalExternalBehavioralEventTypeDefinitionT .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/events/definitions/ExternalBehavioralEventTypeDefinitionTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/events/definitions/ExternalBehavioralEventTypeDefinitionTest.kt index 33261080..2d20f7b2 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/events/definitions/ExternalBehavioralEventTypeDefinitionTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/events/definitions/ExternalBehavioralEventTypeDefinitionTest.kt @@ -109,6 +109,7 @@ internal class ExternalBehavioralEventTypeDefinitionTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -272,6 +273,7 @@ internal class ExternalBehavioralEventTypeDefinitionTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() @@ -444,6 +446,7 @@ internal class ExternalBehavioralEventTypeDefinitionTest { .referencedObjectType("referencedObjectType") .addSensitiveDataCategory("string") .showCurrencySymbol(true) + .textDisplayHint(Property.TextDisplayHint.DOMAIN_NAME) .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .updatedUserId("updatedUserId") .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/events/definitions/PropertyFilterTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/events/definitions/PropertyFilterTest.kt index d019a4bb..87fd42dd 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/events/definitions/PropertyFilterTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/events/definitions/PropertyFilterTest.kt @@ -35,7 +35,7 @@ internal class PropertyFilterTest { assertThat(propertyFilter.filterType()).isEqualTo(PropertyFilter.FilterType.PROPERTY) assertThat(propertyFilter.operation()) .isEqualTo( - PropertyFilter.Operation.ofBoolProperty( + PropertyFilter.Operation.ofBool( BoolPropertyOperation.builder() .includeObjectsWithNoValueSet(true) .operationType("operationType") diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/webhooks/WebhookCreateJournalSubscriptionParamsTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/webhooks/WebhookCreateJournalSubscriptionParamsTest.kt index 1bf9bd79..2d79d3f4 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/webhooks/WebhookCreateJournalSubscriptionParamsTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/webhooks/WebhookCreateJournalSubscriptionParamsTest.kt @@ -45,7 +45,7 @@ internal class WebhookCreateJournalSubscriptionParamsTest { assertThat(body) .isEqualTo( - SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest( + SubscriptionUpsertRequest.ofObject( ObjectSubscriptionUpsertRequest.builder() .addAction(ObjectSubscriptionUpsertRequest.Action.CREATE) .addObjectId(0L) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/webhooksjournal/subscriptions/SubscriptionCreateParamsTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/webhooksjournal/subscriptions/SubscriptionCreateParamsTest.kt index 367b5e5a..dba1a1c4 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/webhooksjournal/subscriptions/SubscriptionCreateParamsTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/models/webhooksjournal/subscriptions/SubscriptionCreateParamsTest.kt @@ -45,7 +45,7 @@ internal class SubscriptionCreateParamsTest { assertThat(body) .isEqualTo( - SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest( + SubscriptionUpsertRequest.ofObject( ObjectSubscriptionUpsertRequest.builder() .addAction(ObjectSubscriptionUpsertRequest.Action.CREATE) .addObjectId(0L) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/async/cms/MediaBridgeServiceAsyncTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/async/cms/MediaBridgeServiceAsyncTest.kt index 32996a8a..26590850 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/async/cms/MediaBridgeServiceAsyncTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/async/cms/MediaBridgeServiceAsyncTest.kt @@ -273,6 +273,7 @@ internal class MediaBridgeServiceAsyncTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() @@ -683,6 +684,7 @@ internal class MediaBridgeServiceAsyncTest { .build() ) .showCurrencySymbol(true) + .textDisplayHint(MediaBridgePropertyUpdate.TextDisplayHint.DOMAIN_NAME) .type(MediaBridgePropertyUpdate.Type.BOOL) .build() ) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/async/cms/mediabridge/BatchServiceAsyncTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/async/cms/mediabridge/BatchServiceAsyncTest.kt index 91c15bf1..9616f210 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/async/cms/mediabridge/BatchServiceAsyncTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/async/cms/mediabridge/BatchServiceAsyncTest.kt @@ -60,6 +60,7 @@ internal class BatchServiceAsyncTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/async/crm/PropertyServiceAsyncTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/async/crm/PropertyServiceAsyncTest.kt index ef072a1e..1844ef3e 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/async/crm/PropertyServiceAsyncTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/async/crm/PropertyServiceAsyncTest.kt @@ -54,6 +54,7 @@ internal class PropertyServiceAsyncTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() @@ -96,6 +97,7 @@ internal class PropertyServiceAsyncTest { .build() ) .showCurrencySymbol(true) + .textDisplayHint(PropertyUpdate.TextDisplayHint.DOMAIN_NAME) .type(PropertyUpdate.Type.BOOL) .build() ) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/async/crm/properties/BatchServiceAsyncTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/async/crm/properties/BatchServiceAsyncTest.kt index a415f271..2903ee37 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/async/crm/properties/BatchServiceAsyncTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/async/crm/properties/BatchServiceAsyncTest.kt @@ -59,6 +59,7 @@ internal class BatchServiceAsyncTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/blocking/cms/MediaBridgeServiceTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/blocking/cms/MediaBridgeServiceTest.kt index b91c9295..d494b83f 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/blocking/cms/MediaBridgeServiceTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/blocking/cms/MediaBridgeServiceTest.kt @@ -267,6 +267,7 @@ internal class MediaBridgeServiceTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() @@ -641,6 +642,7 @@ internal class MediaBridgeServiceTest { .build() ) .showCurrencySymbol(true) + .textDisplayHint(MediaBridgePropertyUpdate.TextDisplayHint.DOMAIN_NAME) .type(MediaBridgePropertyUpdate.Type.BOOL) .build() ) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/blocking/cms/mediabridge/BatchServiceTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/blocking/cms/mediabridge/BatchServiceTest.kt index 088b38ca..0f3f639e 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/blocking/cms/mediabridge/BatchServiceTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/blocking/cms/mediabridge/BatchServiceTest.kt @@ -60,6 +60,7 @@ internal class BatchServiceTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/blocking/crm/PropertyServiceTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/blocking/crm/PropertyServiceTest.kt index 384b0f5d..5700319b 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/blocking/crm/PropertyServiceTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/blocking/crm/PropertyServiceTest.kt @@ -54,6 +54,7 @@ internal class PropertyServiceTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() @@ -95,6 +96,7 @@ internal class PropertyServiceTest { .build() ) .showCurrencySymbol(true) + .textDisplayHint(PropertyUpdate.TextDisplayHint.DOMAIN_NAME) .type(PropertyUpdate.Type.BOOL) .build() ) diff --git a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/blocking/crm/properties/BatchServiceTest.kt b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/blocking/crm/properties/BatchServiceTest.kt index 0039b380..a252daf8 100644 --- a/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/blocking/crm/properties/BatchServiceTest.kt +++ b/hubspot-java-core/src/test/kotlin/com/hubspot/sdk/services/blocking/crm/properties/BatchServiceTest.kt @@ -59,6 +59,7 @@ internal class BatchServiceTest { ) .referencedObjectType("referencedObjectType") .showCurrencySymbol(true) + .textDisplayHint(PropertyCreate.TextDisplayHint.DOMAIN_NAME) .build() ) .build() diff --git a/hubspot-java-proguard-test/src/test/kotlin/com/hubspot/sdk/proguard/ProGuardCompatibilityTest.kt b/hubspot-java-proguard-test/src/test/kotlin/com/hubspot/sdk/proguard/ProGuardCompatibilityTest.kt index e66d6bce..76a74767 100644 --- a/hubspot-java-proguard-test/src/test/kotlin/com/hubspot/sdk/proguard/ProGuardCompatibilityTest.kt +++ b/hubspot-java-proguard-test/src/test/kotlin/com/hubspot/sdk/proguard/ProGuardCompatibilityTest.kt @@ -86,7 +86,7 @@ internal class ProGuardCompatibilityTest { fun subscriptionUpsertRequestRoundtrip() { val jsonMapper = jsonMapper() val subscriptionUpsertRequest = - SubscriptionUpsertRequest.ofObjectSubscriptionUpsertRequest( + SubscriptionUpsertRequest.ofObject( ObjectSubscriptionUpsertRequest.builder() .addAction(ObjectSubscriptionUpsertRequest.Action.CREATE) .addObjectId(0L) From 4f6c290ed3914aa0f3584d9a402d3047306bc121 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 28 May 2026 12:52:55 +0000 Subject: [PATCH 2/2] release: 0.1.0-alpha.9 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c373724d..46b9b6b2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.8" + ".": "0.1.0-alpha.9" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b130df82..c28b2985 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.1.0-alpha.9 (2026-05-28) + +Full Changelog: [v0.1.0-alpha.8...v0.1.0-alpha.9](https://github.com/HubSpot/hubspot-sdk-java/compare/v0.1.0-alpha.8...v0.1.0-alpha.9) + +### Features + +* **api:** api update ([9490bc8](https://github.com/HubSpot/hubspot-sdk-java/commit/9490bc8b93e568c210d041210d527b193219a502)) + ## 0.1.0-alpha.8 (2026-05-26) Full Changelog: [v0.1.0-alpha.7...v0.1.0-alpha.8](https://github.com/HubSpot/hubspot-sdk-java/compare/v0.1.0-alpha.7...v0.1.0-alpha.8) diff --git a/README.md b/README.md index aa180214..d57bd408 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.hubspot.sdk/hubspot-java)](https://central.sonatype.com/artifact/com.hubspot.sdk/hubspot-java/0.1.0-alpha.8) -[![javadoc](https://javadoc.io/badge2/com.hubspot.sdk/hubspot-java/0.1.0-alpha.8/javadoc.svg)](https://javadoc.io/doc/com.hubspot.sdk/hubspot-java/0.1.0-alpha.8) +[![Maven Central](https://img.shields.io/maven-central/v/com.hubspot.sdk/hubspot-java)](https://central.sonatype.com/artifact/com.hubspot.sdk/hubspot-java/0.1.0-alpha.9) +[![javadoc](https://javadoc.io/badge2/com.hubspot.sdk/hubspot-java/0.1.0-alpha.9/javadoc.svg)](https://javadoc.io/doc/com.hubspot.sdk/hubspot-java/0.1.0-alpha.9) @@ -13,7 +13,7 @@ It is generated with [Stainless](https://www.stainless.com/). -The REST API documentation can be found on [developers.hubspot.com](https://developers.hubspot.com/docs/api-reference/overview). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.hubspot.sdk/hubspot-java/0.1.0-alpha.8). +The REST API documentation can be found on [developers.hubspot.com](https://developers.hubspot.com/docs/api-reference/overview). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.hubspot.sdk/hubspot-java/0.1.0-alpha.9). @@ -24,7 +24,7 @@ The REST API documentation can be found on [developers.hubspot.com](https://deve ### Gradle ```kotlin -implementation("com.hubspot.sdk:hubspot-java:0.1.0-alpha.8") +implementation("com.hubspot.sdk:hubspot-java:0.1.0-alpha.9") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.hubspot.sdk:hubspot-java:0.1.0-alpha.8") com.hubspot.sdk hubspot-java - 0.1.0-alpha.8 + 0.1.0-alpha.9 ``` diff --git a/build.gradle.kts b/build.gradle.kts index b4b6f07b..9e6c7389 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ repositories { allprojects { group = "com.hubspot.sdk" - version = "0.1.0-alpha.8" // x-release-please-version + version = "0.1.0-alpha.9" // x-release-please-version } subprojects {