diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index b5db7ce1..c373724d 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.7"
+ ".": "0.1.0-alpha.8"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 9441a68d..60d51403 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 955
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hubspot/hubspot-sdk-8aa2c4935982d3998769d656b2caae13c71151b5f00caaa875357ceb83f6e0a6.yml
-openapi_spec_hash: 47d20b6496315d47f4f64441d4682f47
-config_hash: 9c2a17b9755f3edac92a3ec4b93ac51c
+configured_endpoints: 959
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hubspot/hubspot-sdk-5471b42def181422e461f5657935bcc5d80f62e169b34b60d017257cab8ed6a7.yml
+openapi_spec_hash: 93b8671a542b331e067319184c943fdd
+config_hash: 42a440e814378897b5ca0c2ad29c7f99
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 100982fe..a502b5ba 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,19 @@
# Changelog
+## 0.1.0-alpha.8 (2026-05-25)
+
+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)
+
+### Features
+
+* **api:** manual updates ([6d430fc](https://github.com/HubSpot/hubspot-sdk-java/commit/6d430fc5ddb7aae83600c15a688fddb161cb52af))
+* **api:** manual updates ([d7c232e](https://github.com/HubSpot/hubspot-sdk-java/commit/d7c232e43aa171695bbe6df5ecb30d74d4afa9b4))
+
+
+### Chores
+
+* configure new SDK language ([6a22711](https://github.com/HubSpot/hubspot-sdk-java/commit/6a22711806762dad9face4bda75ed5ac41d7fdc0))
+
## 0.1.0-alpha.7 (2026-05-18)
Full Changelog: [v0.1.0-alpha.6...v0.1.0-alpha.7](https://github.com/HubSpot/hubspot-sdk-java/compare/v0.1.0-alpha.6...v0.1.0-alpha.7)
diff --git a/README.md b/README.md
index 4dd9b988..aa180214 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.hubspot.sdk/hubspot-java/0.1.0-alpha.7)
-[](https://javadoc.io/doc/com.hubspot.sdk/hubspot-java/0.1.0-alpha.7)
+[](https://central.sonatype.com/artifact/com.hubspot.sdk/hubspot-java/0.1.0-alpha.8)
+[](https://javadoc.io/doc/com.hubspot.sdk/hubspot-java/0.1.0-alpha.8)
@@ -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.7).
+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).
@@ -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.7")
+implementation("com.hubspot.sdk:hubspot-java:0.1.0-alpha.8")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.hubspot.sdk:hubspot-java:0.1.0-alpha.7")
com.hubspot.sdk
hubspot-java
- 0.1.0-alpha.7
+ 0.1.0-alpha.8
```
@@ -257,9 +257,9 @@ These methods return [`HttpResponse`](hubspot-java-core/src/main/kotlin/com/hubs
```java
import com.hubspot.sdk.core.http.HttpResponse;
-import com.hubspot.sdk.models.auth.oauth.OAuthCreateTokenParams;
+import com.hubspot.sdk.models.auth.oauth.OAuthRevokeTokenParams;
-HttpResponse response = client.auth().oauth().createToken();
+HttpResponse response = client.auth().oauth().revokeToken();
```
To save the response content to a file, use the [`Files.copy(...)`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#copy-java.io.InputStream-java.nio.file.Path-java.nio.file.CopyOption...-) method:
@@ -270,7 +270,7 @@ import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
-try (HttpResponse response = client.auth().oauth().createToken(params)) {
+try (HttpResponse response = client.auth().oauth().revokeToken(params)) {
Files.copy(
response.body(),
Paths.get(path),
@@ -289,7 +289,7 @@ import com.hubspot.sdk.core.http.HttpResponse;
import java.nio.file.Files;
import java.nio.file.Paths;
-try (HttpResponse response = client.auth().oauth().createToken(params)) {
+try (HttpResponse response = client.auth().oauth().revokeToken(params)) {
response.body().transferTo(Files.newOutputStream(Paths.get(path)));
} catch (Exception e) {
System.out.println("Something went wrong!");
diff --git a/build.gradle.kts b/build.gradle.kts
index 72b998be..b4b6f07b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,7 +9,7 @@ repositories {
allprojects {
group = "com.hubspot.sdk"
- version = "0.1.0-alpha.7" // x-release-please-version
+ version = "0.1.0-alpha.8" // x-release-please-version
}
subprojects {
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/client/HubSpotClient.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/client/HubSpotClient.kt
index 4c506625..4a194dbb 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/client/HubSpotClient.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/client/HubSpotClient.kt
@@ -18,6 +18,7 @@ import com.hubspot.sdk.services.blocking.MetaService
import com.hubspot.sdk.services.blocking.SchedulerService
import com.hubspot.sdk.services.blocking.SettingService
import com.hubspot.sdk.services.blocking.WebhookService
+import com.hubspot.sdk.services.blocking.WebhooksJournalService
import java.util.function.Consumer
/**
@@ -86,6 +87,8 @@ interface HubSpotClient {
fun webhooks(): WebhookService
+ fun webhooksJournal(): WebhooksJournalService
+
/**
* Closes this client, relinquishing any underlying resources.
*
@@ -138,5 +141,7 @@ interface HubSpotClient {
fun settings(): SettingService.WithRawResponse
fun webhooks(): WebhookService.WithRawResponse
+
+ fun webhooksJournal(): WebhooksJournalService.WithRawResponse
}
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/client/HubSpotClientAsync.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/client/HubSpotClientAsync.kt
index f4b95178..7826f45c 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/client/HubSpotClientAsync.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/client/HubSpotClientAsync.kt
@@ -18,6 +18,7 @@ import com.hubspot.sdk.services.async.MetaServiceAsync
import com.hubspot.sdk.services.async.SchedulerServiceAsync
import com.hubspot.sdk.services.async.SettingServiceAsync
import com.hubspot.sdk.services.async.WebhookServiceAsync
+import com.hubspot.sdk.services.async.WebhooksJournalServiceAsync
import java.util.function.Consumer
/**
@@ -86,6 +87,8 @@ interface HubSpotClientAsync {
fun webhooks(): WebhookServiceAsync
+ fun webhooksJournal(): WebhooksJournalServiceAsync
+
/**
* Closes this client, relinquishing any underlying resources.
*
@@ -142,5 +145,7 @@ interface HubSpotClientAsync {
fun settings(): SettingServiceAsync.WithRawResponse
fun webhooks(): WebhookServiceAsync.WithRawResponse
+
+ fun webhooksJournal(): WebhooksJournalServiceAsync.WithRawResponse
}
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/client/HubSpotClientAsyncImpl.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/client/HubSpotClientAsyncImpl.kt
index 4d549592..f667f1c1 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/client/HubSpotClientAsyncImpl.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/client/HubSpotClientAsyncImpl.kt
@@ -34,6 +34,8 @@ import com.hubspot.sdk.services.async.SettingServiceAsync
import com.hubspot.sdk.services.async.SettingServiceAsyncImpl
import com.hubspot.sdk.services.async.WebhookServiceAsync
import com.hubspot.sdk.services.async.WebhookServiceAsyncImpl
+import com.hubspot.sdk.services.async.WebhooksJournalServiceAsync
+import com.hubspot.sdk.services.async.WebhooksJournalServiceAsyncImpl
import java.util.function.Consumer
class HubSpotClientAsyncImpl(private val clientOptions: ClientOptions) : HubSpotClientAsync {
@@ -103,6 +105,10 @@ class HubSpotClientAsyncImpl(private val clientOptions: ClientOptions) : HubSpot
WebhookServiceAsyncImpl(clientOptionsWithUserAgent)
}
+ private val webhooksJournal: WebhooksJournalServiceAsync by lazy {
+ WebhooksJournalServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
override fun sync(): HubSpotClient = sync
override fun withRawResponse(): HubSpotClientAsync.WithRawResponse = withRawResponse
@@ -141,6 +147,8 @@ class HubSpotClientAsyncImpl(private val clientOptions: ClientOptions) : HubSpot
override fun webhooks(): WebhookServiceAsync = webhooks
+ override fun webhooksJournal(): WebhooksJournalServiceAsync = webhooksJournal
+
override fun close() = clientOptions.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
@@ -207,6 +215,10 @@ class HubSpotClientAsyncImpl(private val clientOptions: ClientOptions) : HubSpot
WebhookServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
+ private val webhooksJournal: WebhooksJournalServiceAsync.WithRawResponse by lazy {
+ WebhooksJournalServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
override fun withOptions(
modifier: Consumer
): HubSpotClientAsync.WithRawResponse =
@@ -244,5 +256,8 @@ class HubSpotClientAsyncImpl(private val clientOptions: ClientOptions) : HubSpot
override fun settings(): SettingServiceAsync.WithRawResponse = settings
override fun webhooks(): WebhookServiceAsync.WithRawResponse = webhooks
+
+ override fun webhooksJournal(): WebhooksJournalServiceAsync.WithRawResponse =
+ webhooksJournal
}
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/client/HubSpotClientImpl.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/client/HubSpotClientImpl.kt
index 0141d7f8..c932397f 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/client/HubSpotClientImpl.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/client/HubSpotClientImpl.kt
@@ -34,6 +34,8 @@ import com.hubspot.sdk.services.blocking.SettingService
import com.hubspot.sdk.services.blocking.SettingServiceImpl
import com.hubspot.sdk.services.blocking.WebhookService
import com.hubspot.sdk.services.blocking.WebhookServiceImpl
+import com.hubspot.sdk.services.blocking.WebhooksJournalService
+import com.hubspot.sdk.services.blocking.WebhooksJournalServiceImpl
import java.util.function.Consumer
class HubSpotClientImpl(private val clientOptions: ClientOptions) : HubSpotClient {
@@ -95,6 +97,10 @@ class HubSpotClientImpl(private val clientOptions: ClientOptions) : HubSpotClien
private val webhooks: WebhookService by lazy { WebhookServiceImpl(clientOptionsWithUserAgent) }
+ private val webhooksJournal: WebhooksJournalService by lazy {
+ WebhooksJournalServiceImpl(clientOptionsWithUserAgent)
+ }
+
override fun async(): HubSpotClientAsync = async
override fun withRawResponse(): HubSpotClient.WithRawResponse = withRawResponse
@@ -133,6 +139,8 @@ class HubSpotClientImpl(private val clientOptions: ClientOptions) : HubSpotClien
override fun webhooks(): WebhookService = webhooks
+ override fun webhooksJournal(): WebhooksJournalService = webhooksJournal
+
override fun close() = clientOptions.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
@@ -199,6 +207,10 @@ class HubSpotClientImpl(private val clientOptions: ClientOptions) : HubSpotClien
WebhookServiceImpl.WithRawResponseImpl(clientOptions)
}
+ private val webhooksJournal: WebhooksJournalService.WithRawResponse by lazy {
+ WebhooksJournalServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
override fun withOptions(
modifier: Consumer
): HubSpotClient.WithRawResponse =
@@ -236,5 +248,7 @@ class HubSpotClientImpl(private val clientOptions: ClientOptions) : HubSpotClien
override fun settings(): SettingService.WithRawResponse = settings
override fun webhooks(): WebhookService.WithRawResponse = webhooks
+
+ override fun webhooksJournal(): WebhooksJournalService.WithRawResponse = webhooksJournal
}
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/ActionOverrideRequest.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/ActionOverrideRequest.kt
similarity index 99%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/ActionOverrideRequest.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/ActionOverrideRequest.kt
index f1d1fe15..73a9ddc9 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/ActionOverrideRequest.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/ActionOverrideRequest.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/AppLifecycleEventSubscriptionUpsertRequest.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/AppLifecycleEventSubscriptionUpsertRequest.kt
similarity index 93%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/AppLifecycleEventSubscriptionUpsertRequest.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/AppLifecycleEventSubscriptionUpsertRequest.kt
index ca9ae90b..49f89ce1 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/AppLifecycleEventSubscriptionUpsertRequest.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/AppLifecycleEventSubscriptionUpsertRequest.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
@@ -280,29 +280,14 @@ private constructor(
companion object {
- @JvmField val OBJECT = of("OBJECT")
-
- @JvmField val ASSOCIATION = of("ASSOCIATION")
-
- @JvmField val EVENT = of("EVENT")
-
@JvmField val APP_LIFECYCLE_EVENT = of("APP_LIFECYCLE_EVENT")
- @JvmField val LIST_MEMBERSHIP = of("LIST_MEMBERSHIP")
-
- @JvmField val GDPR_PRIVACY_DELETION = of("GDPR_PRIVACY_DELETION")
-
@JvmStatic fun of(value: String) = SubscriptionType(JsonField.of(value))
}
/** An enum containing [SubscriptionType]'s known values. */
enum class Known {
- OBJECT,
- ASSOCIATION,
- EVENT,
- APP_LIFECYCLE_EVENT,
- LIST_MEMBERSHIP,
- GDPR_PRIVACY_DELETION,
+ APP_LIFECYCLE_EVENT
}
/**
@@ -315,12 +300,7 @@ private constructor(
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
- OBJECT,
- ASSOCIATION,
- EVENT,
APP_LIFECYCLE_EVENT,
- LIST_MEMBERSHIP,
- GDPR_PRIVACY_DELETION,
/**
* An enum member indicating that [SubscriptionType] was instantiated with an unknown
* value.
@@ -337,12 +317,7 @@ private constructor(
*/
fun value(): Value =
when (this) {
- OBJECT -> Value.OBJECT
- ASSOCIATION -> Value.ASSOCIATION
- EVENT -> Value.EVENT
APP_LIFECYCLE_EVENT -> Value.APP_LIFECYCLE_EVENT
- LIST_MEMBERSHIP -> Value.LIST_MEMBERSHIP
- GDPR_PRIVACY_DELETION -> Value.GDPR_PRIVACY_DELETION
else -> Value._UNKNOWN
}
@@ -357,12 +332,7 @@ private constructor(
*/
fun known(): Known =
when (this) {
- OBJECT -> Known.OBJECT
- ASSOCIATION -> Known.ASSOCIATION
- EVENT -> Known.EVENT
APP_LIFECYCLE_EVENT -> Known.APP_LIFECYCLE_EVENT
- LIST_MEMBERSHIP -> Known.LIST_MEMBERSHIP
- GDPR_PRIVACY_DELETION -> Known.GDPR_PRIVACY_DELETION
else -> throw HubSpotInvalidDataException("Unknown SubscriptionType: $value")
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/AssociationSubscriptionUpsertRequest.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/AssociationSubscriptionUpsertRequest.kt
similarity index 96%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/AssociationSubscriptionUpsertRequest.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/AssociationSubscriptionUpsertRequest.kt
index 4c142e3b..9dea2326 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/AssociationSubscriptionUpsertRequest.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/AssociationSubscriptionUpsertRequest.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
@@ -629,29 +629,14 @@ private constructor(
companion object {
- @JvmField val OBJECT = of("OBJECT")
-
@JvmField val ASSOCIATION = of("ASSOCIATION")
- @JvmField val EVENT = of("EVENT")
-
- @JvmField val APP_LIFECYCLE_EVENT = of("APP_LIFECYCLE_EVENT")
-
- @JvmField val LIST_MEMBERSHIP = of("LIST_MEMBERSHIP")
-
- @JvmField val GDPR_PRIVACY_DELETION = of("GDPR_PRIVACY_DELETION")
-
@JvmStatic fun of(value: String) = SubscriptionType(JsonField.of(value))
}
/** An enum containing [SubscriptionType]'s known values. */
enum class Known {
- OBJECT,
- ASSOCIATION,
- EVENT,
- APP_LIFECYCLE_EVENT,
- LIST_MEMBERSHIP,
- GDPR_PRIVACY_DELETION,
+ ASSOCIATION
}
/**
@@ -664,12 +649,7 @@ private constructor(
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
- OBJECT,
ASSOCIATION,
- EVENT,
- APP_LIFECYCLE_EVENT,
- LIST_MEMBERSHIP,
- GDPR_PRIVACY_DELETION,
/**
* An enum member indicating that [SubscriptionType] was instantiated with an unknown
* value.
@@ -686,12 +666,7 @@ private constructor(
*/
fun value(): Value =
when (this) {
- OBJECT -> Value.OBJECT
ASSOCIATION -> Value.ASSOCIATION
- EVENT -> Value.EVENT
- APP_LIFECYCLE_EVENT -> Value.APP_LIFECYCLE_EVENT
- LIST_MEMBERSHIP -> Value.LIST_MEMBERSHIP
- GDPR_PRIVACY_DELETION -> Value.GDPR_PRIVACY_DELETION
else -> Value._UNKNOWN
}
@@ -706,12 +681,7 @@ private constructor(
*/
fun known(): Known =
when (this) {
- OBJECT -> Known.OBJECT
ASSOCIATION -> Known.ASSOCIATION
- EVENT -> Known.EVENT
- APP_LIFECYCLE_EVENT -> Known.APP_LIFECYCLE_EVENT
- LIST_MEMBERSHIP -> Known.LIST_MEMBERSHIP
- GDPR_PRIVACY_DELETION -> Known.GDPR_PRIVACY_DELETION
else -> throw HubSpotInvalidDataException("Unknown SubscriptionType: $value")
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/BatchResponseJournalFetchResponse.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/BatchResponseJournalFetchResponse.kt
similarity index 99%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/BatchResponseJournalFetchResponse.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/BatchResponseJournalFetchResponse.kt
index 353c1d73..592f774c 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/BatchResponseJournalFetchResponse.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/BatchResponseJournalFetchResponse.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/BatchResponseJournalFetchResponseWithErrors.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/BatchResponseJournalFetchResponseWithErrors.kt
similarity index 99%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/BatchResponseJournalFetchResponseWithErrors.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/BatchResponseJournalFetchResponseWithErrors.kt
index 69e98273..52603117 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/BatchResponseJournalFetchResponseWithErrors.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/BatchResponseJournalFetchResponseWithErrors.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
@@ -15,7 +15,6 @@ import com.hubspot.sdk.core.checkKnown
import com.hubspot.sdk.core.checkRequired
import com.hubspot.sdk.core.toImmutable
import com.hubspot.sdk.errors.HubSpotInvalidDataException
-import com.hubspot.sdk.models.StandardError
import java.time.OffsetDateTime
import java.util.Collections
import java.util.Objects
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/Condition.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/Condition.kt
similarity index 99%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/Condition.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/Condition.kt
index 31bff07e..80762301 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/Condition.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/Condition.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/CrmObjectSnapshotBatchRequest.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/CrmObjectSnapshotBatchRequest.kt
similarity index 99%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/CrmObjectSnapshotBatchRequest.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/CrmObjectSnapshotBatchRequest.kt
index f6fa05f0..a35280b2 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/CrmObjectSnapshotBatchRequest.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/CrmObjectSnapshotBatchRequest.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/CrmObjectSnapshotBatchResponse.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/CrmObjectSnapshotBatchResponse.kt
similarity index 99%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/CrmObjectSnapshotBatchResponse.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/CrmObjectSnapshotBatchResponse.kt
index af380a8c..5c0f6f01 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/CrmObjectSnapshotBatchResponse.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/CrmObjectSnapshotBatchResponse.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/CrmObjectSnapshotRequest.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/CrmObjectSnapshotRequest.kt
similarity index 99%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/CrmObjectSnapshotRequest.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/CrmObjectSnapshotRequest.kt
index de012355..da930f98 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/CrmObjectSnapshotRequest.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/CrmObjectSnapshotRequest.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/CrmObjectSnapshotResponse.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/CrmObjectSnapshotResponse.kt
similarity index 99%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/CrmObjectSnapshotResponse.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/CrmObjectSnapshotResponse.kt
index ab6993c5..061a79be 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/CrmObjectSnapshotResponse.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/CrmObjectSnapshotResponse.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/Filter.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/Filter.kt
similarity index 99%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/Filter.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/Filter.kt
index 6587e4e4..2d8e1754 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/Filter.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/Filter.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/FilterCreateRequest.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/FilterCreateRequest.kt
similarity index 99%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/FilterCreateRequest.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/FilterCreateRequest.kt
index 25c71ccd..892aa95b 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/FilterCreateRequest.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/FilterCreateRequest.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/FilterCreateResponse.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/FilterCreateResponse.kt
similarity index 99%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/FilterCreateResponse.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/FilterCreateResponse.kt
index 7673b85e..ea6ea0b8 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/FilterCreateResponse.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/FilterCreateResponse.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/FilterResponse.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/FilterResponse.kt
similarity index 99%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/FilterResponse.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/FilterResponse.kt
index fd1f5949..631c1ef1 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/FilterResponse.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/FilterResponse.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/GdprPrivacyDeletionSubscriptionUpsertRequest.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/GdprPrivacyDeletionSubscriptionUpsertRequest.kt
similarity index 95%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/GdprPrivacyDeletionSubscriptionUpsertRequest.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/GdprPrivacyDeletionSubscriptionUpsertRequest.kt
index 76ff2c0b..841fa246 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/GdprPrivacyDeletionSubscriptionUpsertRequest.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/GdprPrivacyDeletionSubscriptionUpsertRequest.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
@@ -515,16 +515,6 @@ private constructor(
companion object {
- @JvmField val OBJECT = of("OBJECT")
-
- @JvmField val ASSOCIATION = of("ASSOCIATION")
-
- @JvmField val EVENT = of("EVENT")
-
- @JvmField val APP_LIFECYCLE_EVENT = of("APP_LIFECYCLE_EVENT")
-
- @JvmField val LIST_MEMBERSHIP = of("LIST_MEMBERSHIP")
-
@JvmField val GDPR_PRIVACY_DELETION = of("GDPR_PRIVACY_DELETION")
@JvmStatic fun of(value: String) = SubscriptionType(JsonField.of(value))
@@ -532,12 +522,7 @@ private constructor(
/** An enum containing [SubscriptionType]'s known values. */
enum class Known {
- OBJECT,
- ASSOCIATION,
- EVENT,
- APP_LIFECYCLE_EVENT,
- LIST_MEMBERSHIP,
- GDPR_PRIVACY_DELETION,
+ GDPR_PRIVACY_DELETION
}
/**
@@ -550,11 +535,6 @@ private constructor(
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
- OBJECT,
- ASSOCIATION,
- EVENT,
- APP_LIFECYCLE_EVENT,
- LIST_MEMBERSHIP,
GDPR_PRIVACY_DELETION,
/**
* An enum member indicating that [SubscriptionType] was instantiated with an unknown
@@ -572,11 +552,6 @@ private constructor(
*/
fun value(): Value =
when (this) {
- OBJECT -> Value.OBJECT
- ASSOCIATION -> Value.ASSOCIATION
- EVENT -> Value.EVENT
- APP_LIFECYCLE_EVENT -> Value.APP_LIFECYCLE_EVENT
- LIST_MEMBERSHIP -> Value.LIST_MEMBERSHIP
GDPR_PRIVACY_DELETION -> Value.GDPR_PRIVACY_DELETION
else -> Value._UNKNOWN
}
@@ -592,11 +567,6 @@ private constructor(
*/
fun known(): Known =
when (this) {
- OBJECT -> Known.OBJECT
- ASSOCIATION -> Known.ASSOCIATION
- EVENT -> Known.EVENT
- APP_LIFECYCLE_EVENT -> Known.APP_LIFECYCLE_EVENT
- LIST_MEMBERSHIP -> Known.LIST_MEMBERSHIP
GDPR_PRIVACY_DELETION -> Known.GDPR_PRIVACY_DELETION
else -> throw HubSpotInvalidDataException("Unknown SubscriptionType: $value")
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/JournalFetchResponse.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/JournalFetchResponse.kt
similarity index 99%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/JournalFetchResponse.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/JournalFetchResponse.kt
index 1fbdc44d..de76ad6d 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/JournalFetchResponse.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/JournalFetchResponse.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/ListMembershipSubscriptionUpsertRequest.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/ListMembershipSubscriptionUpsertRequest.kt
similarity index 95%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/ListMembershipSubscriptionUpsertRequest.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/ListMembershipSubscriptionUpsertRequest.kt
index 0cce1c39..2eaa35dd 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/ListMembershipSubscriptionUpsertRequest.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/ListMembershipSubscriptionUpsertRequest.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
@@ -570,29 +570,14 @@ private constructor(
companion object {
- @JvmField val OBJECT = of("OBJECT")
-
- @JvmField val ASSOCIATION = of("ASSOCIATION")
-
- @JvmField val EVENT = of("EVENT")
-
- @JvmField val APP_LIFECYCLE_EVENT = of("APP_LIFECYCLE_EVENT")
-
@JvmField val LIST_MEMBERSHIP = of("LIST_MEMBERSHIP")
- @JvmField val GDPR_PRIVACY_DELETION = of("GDPR_PRIVACY_DELETION")
-
@JvmStatic fun of(value: String) = SubscriptionType(JsonField.of(value))
}
/** An enum containing [SubscriptionType]'s known values. */
enum class Known {
- OBJECT,
- ASSOCIATION,
- EVENT,
- APP_LIFECYCLE_EVENT,
- LIST_MEMBERSHIP,
- GDPR_PRIVACY_DELETION,
+ LIST_MEMBERSHIP
}
/**
@@ -605,12 +590,7 @@ private constructor(
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
- OBJECT,
- ASSOCIATION,
- EVENT,
- APP_LIFECYCLE_EVENT,
LIST_MEMBERSHIP,
- GDPR_PRIVACY_DELETION,
/**
* An enum member indicating that [SubscriptionType] was instantiated with an unknown
* value.
@@ -627,12 +607,7 @@ private constructor(
*/
fun value(): Value =
when (this) {
- OBJECT -> Value.OBJECT
- ASSOCIATION -> Value.ASSOCIATION
- EVENT -> Value.EVENT
- APP_LIFECYCLE_EVENT -> Value.APP_LIFECYCLE_EVENT
LIST_MEMBERSHIP -> Value.LIST_MEMBERSHIP
- GDPR_PRIVACY_DELETION -> Value.GDPR_PRIVACY_DELETION
else -> Value._UNKNOWN
}
@@ -647,12 +622,7 @@ private constructor(
*/
fun known(): Known =
when (this) {
- OBJECT -> Known.OBJECT
- ASSOCIATION -> Known.ASSOCIATION
- EVENT -> Known.EVENT
- APP_LIFECYCLE_EVENT -> Known.APP_LIFECYCLE_EVENT
LIST_MEMBERSHIP -> Known.LIST_MEMBERSHIP
- GDPR_PRIVACY_DELETION -> Known.GDPR_PRIVACY_DELETION
else -> throw HubSpotInvalidDataException("Unknown SubscriptionType: $value")
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/ObjectSubscriptionUpsertRequest.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/ObjectSubscriptionUpsertRequest.kt
similarity index 95%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/ObjectSubscriptionUpsertRequest.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/ObjectSubscriptionUpsertRequest.kt
index 85428b02..490084ee 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/ObjectSubscriptionUpsertRequest.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/ObjectSubscriptionUpsertRequest.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
@@ -622,27 +622,12 @@ private constructor(
@JvmField val OBJECT = of("OBJECT")
- @JvmField val ASSOCIATION = of("ASSOCIATION")
-
- @JvmField val EVENT = of("EVENT")
-
- @JvmField val APP_LIFECYCLE_EVENT = of("APP_LIFECYCLE_EVENT")
-
- @JvmField val LIST_MEMBERSHIP = of("LIST_MEMBERSHIP")
-
- @JvmField val GDPR_PRIVACY_DELETION = of("GDPR_PRIVACY_DELETION")
-
@JvmStatic fun of(value: String) = SubscriptionType(JsonField.of(value))
}
/** An enum containing [SubscriptionType]'s known values. */
enum class Known {
- OBJECT,
- ASSOCIATION,
- EVENT,
- APP_LIFECYCLE_EVENT,
- LIST_MEMBERSHIP,
- GDPR_PRIVACY_DELETION,
+ OBJECT
}
/**
@@ -656,11 +641,6 @@ private constructor(
*/
enum class Value {
OBJECT,
- ASSOCIATION,
- EVENT,
- APP_LIFECYCLE_EVENT,
- LIST_MEMBERSHIP,
- GDPR_PRIVACY_DELETION,
/**
* An enum member indicating that [SubscriptionType] was instantiated with an unknown
* value.
@@ -678,11 +658,6 @@ private constructor(
fun value(): Value =
when (this) {
OBJECT -> Value.OBJECT
- ASSOCIATION -> Value.ASSOCIATION
- EVENT -> Value.EVENT
- APP_LIFECYCLE_EVENT -> Value.APP_LIFECYCLE_EVENT
- LIST_MEMBERSHIP -> Value.LIST_MEMBERSHIP
- GDPR_PRIVACY_DELETION -> Value.GDPR_PRIVACY_DELETION
else -> Value._UNKNOWN
}
@@ -698,11 +673,6 @@ private constructor(
fun known(): Known =
when (this) {
OBJECT -> Known.OBJECT
- ASSOCIATION -> Known.ASSOCIATION
- EVENT -> Known.EVENT
- APP_LIFECYCLE_EVENT -> Known.APP_LIFECYCLE_EVENT
- LIST_MEMBERSHIP -> Known.LIST_MEMBERSHIP
- GDPR_PRIVACY_DELETION -> Known.GDPR_PRIVACY_DELETION
else -> throw HubSpotInvalidDataException("Unknown SubscriptionType: $value")
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/PropertyValue.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/PropertyValue.kt
index 6e5bafc8..b5539555 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/PropertyValue.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/PropertyValue.kt
@@ -1138,6 +1138,8 @@ private constructor(
@JvmField val BOT = of("BOT")
+ @JvmField val BREEZE_AGENT = of("BREEZE_AGENT")
+
@JvmField val CALCULATED = of("CALCULATED")
@JvmField val CENTRAL_EXCHANGE_RATES = of("CENTRAL_EXCHANGE_RATES")
@@ -1186,6 +1188,8 @@ private constructor(
@JvmField val DELETE_OBJECTS = of("DELETE_OBJECTS")
+ @JvmField val DI_WRITE_TO_CRM = of("DI_WRITE_TO_CRM")
+
@JvmField val EMAIL = of("EMAIL")
@JvmField val EMAIL_INBOX_IMPORT = of("EMAIL_INBOX_IMPORT")
@@ -1352,6 +1356,7 @@ private constructor(
BIDEN,
BILLING,
BOT,
+ BREEZE_AGENT,
CALCULATED,
CENTRAL_EXCHANGE_RATES,
CHATSPOT,
@@ -1376,6 +1381,7 @@ private constructor(
DEALS,
DEFAULT,
DELETE_OBJECTS,
+ DI_WRITE_TO_CRM,
EMAIL,
EMAIL_INBOX_IMPORT,
EMAIL_INTEGRATION,
@@ -1480,6 +1486,7 @@ private constructor(
BIDEN,
BILLING,
BOT,
+ BREEZE_AGENT,
CALCULATED,
CENTRAL_EXCHANGE_RATES,
CHATSPOT,
@@ -1504,6 +1511,7 @@ private constructor(
DEALS,
DEFAULT,
DELETE_OBJECTS,
+ DI_WRITE_TO_CRM,
EMAIL,
EMAIL_INBOX_IMPORT,
EMAIL_INTEGRATION,
@@ -1609,6 +1617,7 @@ private constructor(
BIDEN -> Value.BIDEN
BILLING -> Value.BILLING
BOT -> Value.BOT
+ BREEZE_AGENT -> Value.BREEZE_AGENT
CALCULATED -> Value.CALCULATED
CENTRAL_EXCHANGE_RATES -> Value.CENTRAL_EXCHANGE_RATES
CHATSPOT -> Value.CHATSPOT
@@ -1633,6 +1642,7 @@ private constructor(
DEALS -> Value.DEALS
DEFAULT -> Value.DEFAULT
DELETE_OBJECTS -> Value.DELETE_OBJECTS
+ DI_WRITE_TO_CRM -> Value.DI_WRITE_TO_CRM
EMAIL -> Value.EMAIL
EMAIL_INBOX_IMPORT -> Value.EMAIL_INBOX_IMPORT
EMAIL_INTEGRATION -> Value.EMAIL_INTEGRATION
@@ -1739,6 +1749,7 @@ private constructor(
BIDEN -> Known.BIDEN
BILLING -> Known.BILLING
BOT -> Known.BOT
+ BREEZE_AGENT -> Known.BREEZE_AGENT
CALCULATED -> Known.CALCULATED
CENTRAL_EXCHANGE_RATES -> Known.CENTRAL_EXCHANGE_RATES
CHATSPOT -> Known.CHATSPOT
@@ -1763,6 +1774,7 @@ private constructor(
DEALS -> Known.DEALS
DEFAULT -> Known.DEFAULT
DELETE_OBJECTS -> Known.DELETE_OBJECTS
+ DI_WRITE_TO_CRM -> Known.DI_WRITE_TO_CRM
EMAIL -> Known.EMAIL
EMAIL_INBOX_IMPORT -> Known.EMAIL_INBOX_IMPORT
EMAIL_INTEGRATION -> Known.EMAIL_INTEGRATION
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/SnapshotStatusResponse.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/SnapshotStatusResponse.kt
similarity index 99%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/SnapshotStatusResponse.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/SnapshotStatusResponse.kt
index 9edc62b1..45a0c5f5 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/SnapshotStatusResponse.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/SnapshotStatusResponse.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/SubscriptionUpsertRequest.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/SubscriptionUpsertRequest.kt
similarity index 99%
rename from hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/SubscriptionUpsertRequest.kt
rename to hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/SubscriptionUpsertRequest.kt
index dfd7181e..91d3946f 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/webhooks/SubscriptionUpsertRequest.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/SubscriptionUpsertRequest.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.hubspot.sdk.models.webhooks
+package com.hubspot.sdk.models
import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.core.ObjectCodec
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/AccessTokenResponse.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/AccessTokenResponse.kt
new file mode 100644
index 00000000..a32bb11e
--- /dev/null
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/AccessTokenResponse.kt
@@ -0,0 +1,622 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.hubspot.sdk.models.auth.oauth
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter
+import com.fasterxml.jackson.annotation.JsonAnySetter
+import com.fasterxml.jackson.annotation.JsonCreator
+import com.fasterxml.jackson.annotation.JsonProperty
+import com.hubspot.sdk.core.Enum
+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.checkKnown
+import com.hubspot.sdk.core.checkRequired
+import com.hubspot.sdk.core.toImmutable
+import com.hubspot.sdk.errors.HubSpotInvalidDataException
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+class AccessTokenResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val accessToken: JsonField,
+ private val expiresIn: JsonField,
+ private val refreshToken: JsonField,
+ private val tokenType: JsonField,
+ private val tokenUse: JsonField,
+ private val hubId: JsonField,
+ private val idToken: JsonField,
+ private val scopes: JsonField>,
+ private val userId: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("access_token")
+ @ExcludeMissing
+ accessToken: JsonField = JsonMissing.of(),
+ @JsonProperty("expires_in") @ExcludeMissing expiresIn: JsonField = JsonMissing.of(),
+ @JsonProperty("refresh_token")
+ @ExcludeMissing
+ refreshToken: JsonField = JsonMissing.of(),
+ @JsonProperty("token_type") @ExcludeMissing tokenType: JsonField = JsonMissing.of(),
+ @JsonProperty("token_use") @ExcludeMissing tokenUse: JsonField = JsonMissing.of(),
+ @JsonProperty("hub_id") @ExcludeMissing hubId: JsonField = JsonMissing.of(),
+ @JsonProperty("id_token") @ExcludeMissing idToken: JsonField = JsonMissing.of(),
+ @JsonProperty("scopes") @ExcludeMissing scopes: JsonField> = JsonMissing.of(),
+ @JsonProperty("user_id") @ExcludeMissing userId: JsonField = JsonMissing.of(),
+ ) : this(
+ accessToken,
+ expiresIn,
+ refreshToken,
+ tokenType,
+ tokenUse,
+ hubId,
+ idToken,
+ scopes,
+ userId,
+ mutableMapOf(),
+ )
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun accessToken(): String = accessToken.getRequired("access_token")
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun expiresIn(): Long = expiresIn.getRequired("expires_in")
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun refreshToken(): String = refreshToken.getRequired("refresh_token")
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun tokenType(): String = tokenType.getRequired("token_type")
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun tokenUse(): TokenUse = tokenUse.getRequired("token_use")
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun hubId(): Optional = hubId.getOptional("hub_id")
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun idToken(): Optional = idToken.getOptional("id_token")
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun scopes(): Optional> = scopes.getOptional("scopes")
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun userId(): Optional = userId.getOptional("user_id")
+
+ /**
+ * Returns the raw JSON value of [accessToken].
+ *
+ * Unlike [accessToken], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("access_token")
+ @ExcludeMissing
+ fun _accessToken(): JsonField = accessToken
+
+ /**
+ * Returns the raw JSON value of [expiresIn].
+ *
+ * Unlike [expiresIn], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("expires_in") @ExcludeMissing fun _expiresIn(): JsonField = expiresIn
+
+ /**
+ * Returns the raw JSON value of [refreshToken].
+ *
+ * Unlike [refreshToken], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("refresh_token")
+ @ExcludeMissing
+ fun _refreshToken(): JsonField = refreshToken
+
+ /**
+ * Returns the raw JSON value of [tokenType].
+ *
+ * Unlike [tokenType], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("token_type") @ExcludeMissing fun _tokenType(): JsonField = tokenType
+
+ /**
+ * Returns the raw JSON value of [tokenUse].
+ *
+ * Unlike [tokenUse], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("token_use") @ExcludeMissing fun _tokenUse(): JsonField = tokenUse
+
+ /**
+ * Returns the raw JSON value of [hubId].
+ *
+ * Unlike [hubId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("hub_id") @ExcludeMissing fun _hubId(): JsonField = hubId
+
+ /**
+ * Returns the raw JSON value of [idToken].
+ *
+ * Unlike [idToken], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("id_token") @ExcludeMissing fun _idToken(): JsonField = idToken
+
+ /**
+ * Returns the raw JSON value of [scopes].
+ *
+ * Unlike [scopes], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("scopes") @ExcludeMissing fun _scopes(): JsonField> = scopes
+
+ /**
+ * Returns the raw JSON value of [userId].
+ *
+ * Unlike [userId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("user_id") @ExcludeMissing fun _userId(): JsonField = userId
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [AccessTokenResponse].
+ *
+ * The following fields are required:
+ * ```java
+ * .accessToken()
+ * .expiresIn()
+ * .refreshToken()
+ * .tokenType()
+ * .tokenUse()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [AccessTokenResponse]. */
+ class Builder internal constructor() {
+
+ private var accessToken: JsonField? = null
+ private var expiresIn: JsonField? = null
+ private var refreshToken: JsonField? = null
+ private var tokenType: JsonField? = null
+ private var tokenUse: JsonField? = null
+ private var hubId: JsonField = JsonMissing.of()
+ private var idToken: JsonField = JsonMissing.of()
+ private var scopes: JsonField>? = null
+ private var userId: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(accessTokenResponse: AccessTokenResponse) = apply {
+ accessToken = accessTokenResponse.accessToken
+ expiresIn = accessTokenResponse.expiresIn
+ refreshToken = accessTokenResponse.refreshToken
+ tokenType = accessTokenResponse.tokenType
+ tokenUse = accessTokenResponse.tokenUse
+ hubId = accessTokenResponse.hubId
+ idToken = accessTokenResponse.idToken
+ scopes = accessTokenResponse.scopes.map { it.toMutableList() }
+ userId = accessTokenResponse.userId
+ additionalProperties = accessTokenResponse.additionalProperties.toMutableMap()
+ }
+
+ fun accessToken(accessToken: String) = accessToken(JsonField.of(accessToken))
+
+ /**
+ * Sets [Builder.accessToken] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.accessToken] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken }
+
+ fun expiresIn(expiresIn: Long) = expiresIn(JsonField.of(expiresIn))
+
+ /**
+ * Sets [Builder.expiresIn] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.expiresIn] with a well-typed [Long] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun expiresIn(expiresIn: JsonField) = apply { this.expiresIn = expiresIn }
+
+ fun refreshToken(refreshToken: String) = refreshToken(JsonField.of(refreshToken))
+
+ /**
+ * Sets [Builder.refreshToken] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.refreshToken] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun refreshToken(refreshToken: JsonField) = apply {
+ this.refreshToken = refreshToken
+ }
+
+ fun tokenType(tokenType: String) = tokenType(JsonField.of(tokenType))
+
+ /**
+ * Sets [Builder.tokenType] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.tokenType] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun tokenType(tokenType: JsonField) = apply { this.tokenType = tokenType }
+
+ fun tokenUse(tokenUse: TokenUse) = tokenUse(JsonField.of(tokenUse))
+
+ /**
+ * Sets [Builder.tokenUse] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.tokenUse] with a well-typed [TokenUse] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun tokenUse(tokenUse: JsonField) = apply { this.tokenUse = tokenUse }
+
+ fun hubId(hubId: Int) = hubId(JsonField.of(hubId))
+
+ /**
+ * Sets [Builder.hubId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.hubId] with a well-typed [Int] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun hubId(hubId: JsonField) = apply { this.hubId = hubId }
+
+ fun idToken(idToken: String) = idToken(JsonField.of(idToken))
+
+ /**
+ * Sets [Builder.idToken] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.idToken] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun idToken(idToken: JsonField) = apply { this.idToken = idToken }
+
+ fun scopes(scopes: List) = scopes(JsonField.of(scopes))
+
+ /**
+ * Sets [Builder.scopes] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.scopes] with a well-typed `List` value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun scopes(scopes: JsonField>) = apply {
+ this.scopes = scopes.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [scopes].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addScope(scope: String) = apply {
+ scopes =
+ (scopes ?: JsonField.of(mutableListOf())).also {
+ checkKnown("scopes", it).add(scope)
+ }
+ }
+
+ fun userId(userId: Int) = userId(JsonField.of(userId))
+
+ /**
+ * Sets [Builder.userId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.userId] with a well-typed [Int] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun userId(userId: JsonField) = apply { this.userId = userId }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [AccessTokenResponse].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .accessToken()
+ * .expiresIn()
+ * .refreshToken()
+ * .tokenType()
+ * .tokenUse()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): AccessTokenResponse =
+ AccessTokenResponse(
+ checkRequired("accessToken", accessToken),
+ checkRequired("expiresIn", expiresIn),
+ checkRequired("refreshToken", refreshToken),
+ checkRequired("tokenType", tokenType),
+ checkRequired("tokenUse", tokenUse),
+ hubId,
+ idToken,
+ (scopes ?: JsonMissing.of()).map { it.toImmutable() },
+ userId,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ 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(): AccessTokenResponse = apply {
+ if (validated) {
+ return@apply
+ }
+
+ accessToken()
+ expiresIn()
+ refreshToken()
+ tokenType()
+ tokenUse().validate()
+ hubId()
+ idToken()
+ scopes()
+ userId()
+ 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 (accessToken.asKnown().isPresent) 1 else 0) +
+ (if (expiresIn.asKnown().isPresent) 1 else 0) +
+ (if (refreshToken.asKnown().isPresent) 1 else 0) +
+ (if (tokenType.asKnown().isPresent) 1 else 0) +
+ (tokenUse.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (hubId.asKnown().isPresent) 1 else 0) +
+ (if (idToken.asKnown().isPresent) 1 else 0) +
+ (scopes.asKnown().getOrNull()?.size ?: 0) +
+ (if (userId.asKnown().isPresent) 1 else 0)
+
+ class TokenUse @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 ACCESS_TOKEN = of("access_token")
+
+ @JvmStatic fun of(value: String) = TokenUse(JsonField.of(value))
+ }
+
+ /** An enum containing [TokenUse]'s known values. */
+ enum class Known {
+ ACCESS_TOKEN
+ }
+
+ /**
+ * An enum containing [TokenUse]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [TokenUse] 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 {
+ ACCESS_TOKEN,
+ /** An enum member indicating that [TokenUse] 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) {
+ ACCESS_TOKEN -> Value.ACCESS_TOKEN
+ 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) {
+ ACCESS_TOKEN -> Known.ACCESS_TOKEN
+ else -> throw HubSpotInvalidDataException("Unknown TokenUse: $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(): TokenUse = 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 TokenUse && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AccessTokenResponse &&
+ accessToken == other.accessToken &&
+ expiresIn == other.expiresIn &&
+ refreshToken == other.refreshToken &&
+ tokenType == other.tokenType &&
+ tokenUse == other.tokenUse &&
+ hubId == other.hubId &&
+ idToken == other.idToken &&
+ scopes == other.scopes &&
+ userId == other.userId &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ accessToken,
+ expiresIn,
+ refreshToken,
+ tokenType,
+ tokenUse,
+ hubId,
+ idToken,
+ scopes,
+ userId,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "AccessTokenResponse{accessToken=$accessToken, expiresIn=$expiresIn, refreshToken=$refreshToken, tokenType=$tokenType, tokenUse=$tokenUse, hubId=$hubId, idToken=$idToken, scopes=$scopes, userId=$userId, additionalProperties=$additionalProperties}"
+}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/ClientCredentialsTokenResponse.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/ClientCredentialsTokenResponse.kt
new file mode 100644
index 00000000..fe591c44
--- /dev/null
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/ClientCredentialsTokenResponse.kt
@@ -0,0 +1,582 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.hubspot.sdk.models.auth.oauth
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter
+import com.fasterxml.jackson.annotation.JsonAnySetter
+import com.fasterxml.jackson.annotation.JsonCreator
+import com.fasterxml.jackson.annotation.JsonProperty
+import com.hubspot.sdk.core.Enum
+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.checkKnown
+import com.hubspot.sdk.core.checkRequired
+import com.hubspot.sdk.core.toImmutable
+import com.hubspot.sdk.errors.HubSpotInvalidDataException
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+class ClientCredentialsTokenResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val accessToken: JsonField,
+ private val expiresIn: JsonField,
+ private val tokenType: JsonField,
+ private val tokenUse: JsonField,
+ private val hubId: JsonField,
+ private val idToken: JsonField,
+ private val scopes: JsonField>,
+ private val userId: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("access_token")
+ @ExcludeMissing
+ accessToken: JsonField = JsonMissing.of(),
+ @JsonProperty("expires_in") @ExcludeMissing expiresIn: JsonField = JsonMissing.of(),
+ @JsonProperty("token_type") @ExcludeMissing tokenType: JsonField = JsonMissing.of(),
+ @JsonProperty("token_use") @ExcludeMissing tokenUse: JsonField = JsonMissing.of(),
+ @JsonProperty("hub_id") @ExcludeMissing hubId: JsonField = JsonMissing.of(),
+ @JsonProperty("id_token") @ExcludeMissing idToken: JsonField = JsonMissing.of(),
+ @JsonProperty("scopes") @ExcludeMissing scopes: JsonField> = JsonMissing.of(),
+ @JsonProperty("user_id") @ExcludeMissing userId: JsonField = JsonMissing.of(),
+ ) : this(
+ accessToken,
+ expiresIn,
+ tokenType,
+ tokenUse,
+ hubId,
+ idToken,
+ scopes,
+ userId,
+ mutableMapOf(),
+ )
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun accessToken(): String = accessToken.getRequired("access_token")
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun expiresIn(): Long = expiresIn.getRequired("expires_in")
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun tokenType(): String = tokenType.getRequired("token_type")
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun tokenUse(): TokenUse = tokenUse.getRequired("token_use")
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun hubId(): Optional = hubId.getOptional("hub_id")
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun idToken(): Optional = idToken.getOptional("id_token")
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun scopes(): Optional> = scopes.getOptional("scopes")
+
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun userId(): Optional = userId.getOptional("user_id")
+
+ /**
+ * Returns the raw JSON value of [accessToken].
+ *
+ * Unlike [accessToken], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("access_token")
+ @ExcludeMissing
+ fun _accessToken(): JsonField = accessToken
+
+ /**
+ * Returns the raw JSON value of [expiresIn].
+ *
+ * Unlike [expiresIn], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("expires_in") @ExcludeMissing fun _expiresIn(): JsonField = expiresIn
+
+ /**
+ * Returns the raw JSON value of [tokenType].
+ *
+ * Unlike [tokenType], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("token_type") @ExcludeMissing fun _tokenType(): JsonField = tokenType
+
+ /**
+ * Returns the raw JSON value of [tokenUse].
+ *
+ * Unlike [tokenUse], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("token_use") @ExcludeMissing fun _tokenUse(): JsonField = tokenUse
+
+ /**
+ * Returns the raw JSON value of [hubId].
+ *
+ * Unlike [hubId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("hub_id") @ExcludeMissing fun _hubId(): JsonField = hubId
+
+ /**
+ * Returns the raw JSON value of [idToken].
+ *
+ * Unlike [idToken], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("id_token") @ExcludeMissing fun _idToken(): JsonField = idToken
+
+ /**
+ * Returns the raw JSON value of [scopes].
+ *
+ * Unlike [scopes], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("scopes") @ExcludeMissing fun _scopes(): JsonField> = scopes
+
+ /**
+ * Returns the raw JSON value of [userId].
+ *
+ * Unlike [userId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("user_id") @ExcludeMissing fun _userId(): JsonField = userId
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [ClientCredentialsTokenResponse].
+ *
+ * The following fields are required:
+ * ```java
+ * .accessToken()
+ * .expiresIn()
+ * .tokenType()
+ * .tokenUse()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [ClientCredentialsTokenResponse]. */
+ class Builder internal constructor() {
+
+ private var accessToken: JsonField? = null
+ private var expiresIn: JsonField? = null
+ private var tokenType: JsonField? = null
+ private var tokenUse: JsonField? = null
+ private var hubId: JsonField = JsonMissing.of()
+ private var idToken: JsonField = JsonMissing.of()
+ private var scopes: JsonField>? = null
+ private var userId: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(clientCredentialsTokenResponse: ClientCredentialsTokenResponse) = apply {
+ accessToken = clientCredentialsTokenResponse.accessToken
+ expiresIn = clientCredentialsTokenResponse.expiresIn
+ tokenType = clientCredentialsTokenResponse.tokenType
+ tokenUse = clientCredentialsTokenResponse.tokenUse
+ hubId = clientCredentialsTokenResponse.hubId
+ idToken = clientCredentialsTokenResponse.idToken
+ scopes = clientCredentialsTokenResponse.scopes.map { it.toMutableList() }
+ userId = clientCredentialsTokenResponse.userId
+ additionalProperties =
+ clientCredentialsTokenResponse.additionalProperties.toMutableMap()
+ }
+
+ fun accessToken(accessToken: String) = accessToken(JsonField.of(accessToken))
+
+ /**
+ * Sets [Builder.accessToken] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.accessToken] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken }
+
+ fun expiresIn(expiresIn: Long) = expiresIn(JsonField.of(expiresIn))
+
+ /**
+ * Sets [Builder.expiresIn] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.expiresIn] with a well-typed [Long] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun expiresIn(expiresIn: JsonField) = apply { this.expiresIn = expiresIn }
+
+ fun tokenType(tokenType: String) = tokenType(JsonField.of(tokenType))
+
+ /**
+ * Sets [Builder.tokenType] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.tokenType] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun tokenType(tokenType: JsonField) = apply { this.tokenType = tokenType }
+
+ fun tokenUse(tokenUse: TokenUse) = tokenUse(JsonField.of(tokenUse))
+
+ /**
+ * Sets [Builder.tokenUse] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.tokenUse] with a well-typed [TokenUse] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun tokenUse(tokenUse: JsonField) = apply { this.tokenUse = tokenUse }
+
+ fun hubId(hubId: Int) = hubId(JsonField.of(hubId))
+
+ /**
+ * Sets [Builder.hubId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.hubId] with a well-typed [Int] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun hubId(hubId: JsonField) = apply { this.hubId = hubId }
+
+ fun idToken(idToken: String) = idToken(JsonField.of(idToken))
+
+ /**
+ * Sets [Builder.idToken] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.idToken] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun idToken(idToken: JsonField) = apply { this.idToken = idToken }
+
+ fun scopes(scopes: List) = scopes(JsonField.of(scopes))
+
+ /**
+ * Sets [Builder.scopes] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.scopes] with a well-typed `List` value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun scopes(scopes: JsonField>) = apply {
+ this.scopes = scopes.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [scopes].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addScope(scope: String) = apply {
+ scopes =
+ (scopes ?: JsonField.of(mutableListOf())).also {
+ checkKnown("scopes", it).add(scope)
+ }
+ }
+
+ fun userId(userId: Int) = userId(JsonField.of(userId))
+
+ /**
+ * Sets [Builder.userId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.userId] with a well-typed [Int] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun userId(userId: JsonField) = apply { this.userId = userId }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [ClientCredentialsTokenResponse].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .accessToken()
+ * .expiresIn()
+ * .tokenType()
+ * .tokenUse()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): ClientCredentialsTokenResponse =
+ ClientCredentialsTokenResponse(
+ checkRequired("accessToken", accessToken),
+ checkRequired("expiresIn", expiresIn),
+ checkRequired("tokenType", tokenType),
+ checkRequired("tokenUse", tokenUse),
+ hubId,
+ idToken,
+ (scopes ?: JsonMissing.of()).map { it.toImmutable() },
+ userId,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ 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(): ClientCredentialsTokenResponse = apply {
+ if (validated) {
+ return@apply
+ }
+
+ accessToken()
+ expiresIn()
+ tokenType()
+ tokenUse().validate()
+ hubId()
+ idToken()
+ scopes()
+ userId()
+ 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 (accessToken.asKnown().isPresent) 1 else 0) +
+ (if (expiresIn.asKnown().isPresent) 1 else 0) +
+ (if (tokenType.asKnown().isPresent) 1 else 0) +
+ (tokenUse.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (hubId.asKnown().isPresent) 1 else 0) +
+ (if (idToken.asKnown().isPresent) 1 else 0) +
+ (scopes.asKnown().getOrNull()?.size ?: 0) +
+ (if (userId.asKnown().isPresent) 1 else 0)
+
+ class TokenUse @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 CLIENT_CREDENTIALS = of("client_credentials")
+
+ @JvmStatic fun of(value: String) = TokenUse(JsonField.of(value))
+ }
+
+ /** An enum containing [TokenUse]'s known values. */
+ enum class Known {
+ CLIENT_CREDENTIALS
+ }
+
+ /**
+ * An enum containing [TokenUse]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [TokenUse] 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 {
+ CLIENT_CREDENTIALS,
+ /** An enum member indicating that [TokenUse] 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) {
+ CLIENT_CREDENTIALS -> Value.CLIENT_CREDENTIALS
+ 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) {
+ CLIENT_CREDENTIALS -> Known.CLIENT_CREDENTIALS
+ else -> throw HubSpotInvalidDataException("Unknown TokenUse: $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(): TokenUse = 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 TokenUse && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is ClientCredentialsTokenResponse &&
+ accessToken == other.accessToken &&
+ expiresIn == other.expiresIn &&
+ tokenType == other.tokenType &&
+ tokenUse == other.tokenUse &&
+ hubId == other.hubId &&
+ idToken == other.idToken &&
+ scopes == other.scopes &&
+ userId == other.userId &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ accessToken,
+ expiresIn,
+ tokenType,
+ tokenUse,
+ hubId,
+ idToken,
+ scopes,
+ userId,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "ClientCredentialsTokenResponse{accessToken=$accessToken, expiresIn=$expiresIn, tokenType=$tokenType, tokenUse=$tokenUse, hubId=$hubId, idToken=$idToken, scopes=$scopes, userId=$userId, additionalProperties=$additionalProperties}"
+}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/OAuthCreateTokenParams.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/OAuthCreateTokenParams.kt
index 023d86de..795fda38 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/OAuthCreateTokenParams.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/OAuthCreateTokenParams.kt
@@ -853,6 +853,8 @@ private constructor(
@JvmField val AUTHORIZATION_CODE = of("authorization_code")
+ @JvmField val CLIENT_CREDENTIALS = of("client_credentials")
+
@JvmField val REFRESH_TOKEN = of("refresh_token")
@JvmStatic fun of(value: String) = GrantType(JsonField.of(value))
@@ -861,6 +863,7 @@ private constructor(
/** An enum containing [GrantType]'s known values. */
enum class Known {
AUTHORIZATION_CODE,
+ CLIENT_CREDENTIALS,
REFRESH_TOKEN,
}
@@ -875,6 +878,7 @@ private constructor(
*/
enum class Value {
AUTHORIZATION_CODE,
+ CLIENT_CREDENTIALS,
REFRESH_TOKEN,
/**
* An enum member indicating that [GrantType] was instantiated with an unknown value.
@@ -892,6 +896,7 @@ private constructor(
fun value(): Value =
when (this) {
AUTHORIZATION_CODE -> Value.AUTHORIZATION_CODE
+ CLIENT_CREDENTIALS -> Value.CLIENT_CREDENTIALS
REFRESH_TOKEN -> Value.REFRESH_TOKEN
else -> Value._UNKNOWN
}
@@ -908,6 +913,7 @@ private constructor(
fun known(): Known =
when (this) {
AUTHORIZATION_CODE -> Known.AUTHORIZATION_CODE
+ CLIENT_CREDENTIALS -> Known.CLIENT_CREDENTIALS
REFRESH_TOKEN -> Known.REFRESH_TOKEN
else -> throw HubSpotInvalidDataException("Unknown GrantType: $value")
}
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
new file mode 100644
index 00000000..39dee786
--- /dev/null
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/auth/oauth/TokenResponseIf.kt
@@ -0,0 +1,252 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.hubspot.sdk.models.auth.oauth
+
+import com.fasterxml.jackson.core.JsonGenerator
+import com.fasterxml.jackson.core.ObjectCodec
+import com.fasterxml.jackson.databind.JsonNode
+import com.fasterxml.jackson.databind.SerializerProvider
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize
+import com.fasterxml.jackson.databind.annotation.JsonSerialize
+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
+
+@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 _json: JsonValue? = null,
+) {
+
+ fun accessTokenResponse(): Optional =
+ Optional.ofNullable(accessTokenResponse)
+
+ fun clientCredentialsTokenResponse(): Optional =
+ Optional.ofNullable(clientCredentialsTokenResponse)
+
+ fun isAccessTokenResponse(): Boolean = accessTokenResponse != null
+
+ fun isClientCredentialsTokenResponse(): Boolean = clientCredentialsTokenResponse != null
+
+ fun asAccessTokenResponse(): AccessTokenResponse =
+ accessTokenResponse.getOrThrow("accessTokenResponse")
+
+ fun asClientCredentialsTokenResponse(): ClientCredentialsTokenResponse =
+ clientCredentialsTokenResponse.getOrThrow("clientCredentialsTokenResponse")
+
+ fun _json(): Optional = Optional.ofNullable(_json)
+
+ /**
+ * Maps this instance's current variant to a value of type [T] using the given [visitor].
+ *
+ * Note that this method is _not_ forwards compatible with new variants from the API, unless
+ * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the
+ * SDK gracefully, consider overriding [Visitor.unknown]:
+ * ```java
+ * import com.hubspot.sdk.core.JsonValue;
+ * import java.util.Optional;
+ *
+ * Optional result = tokenResponseIf.accept(new TokenResponseIf.Visitor>() {
+ * @Override
+ * public Optional visitAccessTokenResponse(AccessTokenResponse accessTokenResponse) {
+ * return Optional.of(accessTokenResponse.toString());
+ * }
+ *
+ * // ...
+ *
+ * @Override
+ * public Optional unknown(JsonValue json) {
+ * // Or inspect the `json`.
+ * return Optional.empty();
+ * }
+ * });
+ * ```
+ *
+ * @throws HubSpotInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and
+ * the current variant is unknown.
+ */
+ fun accept(visitor: Visitor): T =
+ when {
+ accessTokenResponse != null -> visitor.visitAccessTokenResponse(accessTokenResponse)
+ clientCredentialsTokenResponse != null ->
+ visitor.visitClientCredentialsTokenResponse(clientCredentialsTokenResponse)
+ else -> visitor.unknown(_json)
+ }
+
+ 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(): TokenResponseIf = apply {
+ if (validated) {
+ return@apply
+ }
+
+ accept(
+ object : Visitor {
+ override fun visitAccessTokenResponse(accessTokenResponse: AccessTokenResponse) {
+ accessTokenResponse.validate()
+ }
+
+ override fun visitClientCredentialsTokenResponse(
+ clientCredentialsTokenResponse: ClientCredentialsTokenResponse
+ ) {
+ clientCredentialsTokenResponse.validate()
+ }
+ }
+ )
+ 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 =
+ accept(
+ object : Visitor {
+ override fun visitAccessTokenResponse(accessTokenResponse: AccessTokenResponse) =
+ accessTokenResponse.validity()
+
+ override fun visitClientCredentialsTokenResponse(
+ clientCredentialsTokenResponse: ClientCredentialsTokenResponse
+ ) = clientCredentialsTokenResponse.validity()
+
+ override fun unknown(json: JsonValue?) = 0
+ }
+ )
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is TokenResponseIf &&
+ accessTokenResponse == other.accessTokenResponse &&
+ clientCredentialsTokenResponse == other.clientCredentialsTokenResponse
+ }
+
+ override fun hashCode(): Int = Objects.hash(accessTokenResponse, clientCredentialsTokenResponse)
+
+ override fun toString(): String =
+ when {
+ accessTokenResponse != null ->
+ "TokenResponseIf{accessTokenResponse=$accessTokenResponse}"
+ clientCredentialsTokenResponse != null ->
+ "TokenResponseIf{clientCredentialsTokenResponse=$clientCredentialsTokenResponse}"
+ _json != null -> "TokenResponseIf{_unknown=$_json}"
+ else -> throw IllegalStateException("Invalid TokenResponseIf")
+ }
+
+ companion object {
+
+ @JvmStatic
+ fun ofAccessTokenResponse(accessTokenResponse: AccessTokenResponse) =
+ TokenResponseIf(accessTokenResponse = accessTokenResponse)
+
+ @JvmStatic
+ fun ofClientCredentialsTokenResponse(
+ clientCredentialsTokenResponse: ClientCredentialsTokenResponse
+ ) = TokenResponseIf(clientCredentialsTokenResponse = clientCredentialsTokenResponse)
+ }
+
+ /**
+ * An interface that defines how to map each variant of [TokenResponseIf] to a value of type
+ * [T].
+ */
+ interface Visitor {
+
+ fun visitAccessTokenResponse(accessTokenResponse: AccessTokenResponse): T
+
+ fun visitClientCredentialsTokenResponse(
+ clientCredentialsTokenResponse: ClientCredentialsTokenResponse
+ ): T
+
+ /**
+ * Maps an unknown variant of [TokenResponseIf] to a value of type [T].
+ *
+ * An instance of [TokenResponseIf] can contain an unknown variant if it was deserialized
+ * from data that doesn't match any known variant. For example, if the SDK is on an older
+ * version than the API, then the API may respond with new variants that the SDK is unaware
+ * of.
+ *
+ * @throws HubSpotInvalidDataException in the default implementation.
+ */
+ fun unknown(json: JsonValue?): T {
+ throw HubSpotInvalidDataException("Unknown TokenResponseIf: $json")
+ }
+ }
+
+ internal class Deserializer : BaseDeserializer(TokenResponseIf::class) {
+
+ override fun ObjectCodec.deserialize(node: JsonNode): TokenResponseIf {
+ val json = JsonValue.fromJsonNode(node)
+
+ 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()
+ }
+ }
+ }
+
+ internal class Serializer : BaseSerializer(TokenResponseIf::class) {
+
+ override fun serialize(
+ value: TokenResponseIf,
+ generator: JsonGenerator,
+ provider: SerializerProvider,
+ ) {
+ when {
+ value.accessTokenResponse != null ->
+ generator.writeObject(value.accessTokenResponse)
+ value.clientCredentialsTokenResponse != null ->
+ generator.writeObject(value.clientCredentialsTokenResponse)
+ 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/ArrayFieldSchema.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/ArrayFieldSchema.kt
index eaa5c532..397b15ea 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/ArrayFieldSchema.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/ArrayFieldSchema.kt
@@ -198,30 +198,12 @@ private constructor(
@JvmField val ARRAY = of("ARRAY")
- @JvmField val BOOLEAN = of("BOOLEAN")
-
- @JvmField val DOUBLE = of("DOUBLE")
-
- @JvmField val INTEGER = of("INTEGER")
-
- @JvmField val LONG = of("LONG")
-
- @JvmField val OBJECT = of("OBJECT")
-
- @JvmField val STRING = of("STRING")
-
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
/** An enum containing [Type]'s known values. */
enum class Known {
- ARRAY,
- BOOLEAN,
- DOUBLE,
- INTEGER,
- LONG,
- OBJECT,
- STRING,
+ ARRAY
}
/**
@@ -235,12 +217,6 @@ private constructor(
*/
enum class Value {
ARRAY,
- BOOLEAN,
- DOUBLE,
- INTEGER,
- LONG,
- OBJECT,
- STRING,
/** An enum member indicating that [Type] was instantiated with an unknown value. */
_UNKNOWN,
}
@@ -255,12 +231,6 @@ private constructor(
fun value(): Value =
when (this) {
ARRAY -> Value.ARRAY
- BOOLEAN -> Value.BOOLEAN
- DOUBLE -> Value.DOUBLE
- INTEGER -> Value.INTEGER
- LONG -> Value.LONG
- OBJECT -> Value.OBJECT
- STRING -> Value.STRING
else -> Value._UNKNOWN
}
@@ -276,12 +246,6 @@ private constructor(
fun known(): Known =
when (this) {
ARRAY -> Known.ARRAY
- BOOLEAN -> Known.BOOLEAN
- DOUBLE -> Known.DOUBLE
- INTEGER -> Known.INTEGER
- LONG -> Known.LONG
- OBJECT -> Known.OBJECT
- STRING -> Known.STRING
else -> throw HubSpotInvalidDataException("Unknown Type: $value")
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/BooleanFieldSchema.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/BooleanFieldSchema.kt
index c7e7b562..a99dd0af 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/BooleanFieldSchema.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/BooleanFieldSchema.kt
@@ -183,32 +183,14 @@ private constructor(
companion object {
- @JvmField val ARRAY = of("ARRAY")
-
@JvmField val BOOLEAN = of("BOOLEAN")
- @JvmField val DOUBLE = of("DOUBLE")
-
- @JvmField val INTEGER = of("INTEGER")
-
- @JvmField val LONG = of("LONG")
-
- @JvmField val OBJECT = of("OBJECT")
-
- @JvmField val STRING = of("STRING")
-
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
/** An enum containing [Type]'s known values. */
enum class Known {
- ARRAY,
- BOOLEAN,
- DOUBLE,
- INTEGER,
- LONG,
- OBJECT,
- STRING,
+ BOOLEAN
}
/**
@@ -221,13 +203,7 @@ private constructor(
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
- ARRAY,
BOOLEAN,
- DOUBLE,
- INTEGER,
- LONG,
- OBJECT,
- STRING,
/** An enum member indicating that [Type] was instantiated with an unknown value. */
_UNKNOWN,
}
@@ -241,13 +217,7 @@ private constructor(
*/
fun value(): Value =
when (this) {
- ARRAY -> Value.ARRAY
BOOLEAN -> Value.BOOLEAN
- DOUBLE -> Value.DOUBLE
- INTEGER -> Value.INTEGER
- LONG -> Value.LONG
- OBJECT -> Value.OBJECT
- STRING -> Value.STRING
else -> Value._UNKNOWN
}
@@ -262,13 +232,7 @@ private constructor(
*/
fun known(): Known =
when (this) {
- ARRAY -> Known.ARRAY
BOOLEAN -> Known.BOOLEAN
- DOUBLE -> Known.DOUBLE
- INTEGER -> Known.INTEGER
- LONG -> Known.LONG
- OBJECT -> Known.OBJECT
- STRING -> Known.STRING
else -> throw HubSpotInvalidDataException("Unknown Type: $value")
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/DoubleFieldSchema.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/DoubleFieldSchema.kt
index 4f5502db..deee9a61 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/DoubleFieldSchema.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/DoubleFieldSchema.kt
@@ -248,32 +248,14 @@ private constructor(
companion object {
- @JvmField val ARRAY = of("ARRAY")
-
- @JvmField val BOOLEAN = of("BOOLEAN")
-
@JvmField val DOUBLE = of("DOUBLE")
- @JvmField val INTEGER = of("INTEGER")
-
- @JvmField val LONG = of("LONG")
-
- @JvmField val OBJECT = of("OBJECT")
-
- @JvmField val STRING = of("STRING")
-
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
/** An enum containing [Type]'s known values. */
enum class Known {
- ARRAY,
- BOOLEAN,
- DOUBLE,
- INTEGER,
- LONG,
- OBJECT,
- STRING,
+ DOUBLE
}
/**
@@ -286,13 +268,7 @@ private constructor(
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
- ARRAY,
- BOOLEAN,
DOUBLE,
- INTEGER,
- LONG,
- OBJECT,
- STRING,
/** An enum member indicating that [Type] was instantiated with an unknown value. */
_UNKNOWN,
}
@@ -306,13 +282,7 @@ private constructor(
*/
fun value(): Value =
when (this) {
- ARRAY -> Value.ARRAY
- BOOLEAN -> Value.BOOLEAN
DOUBLE -> Value.DOUBLE
- INTEGER -> Value.INTEGER
- LONG -> Value.LONG
- OBJECT -> Value.OBJECT
- STRING -> Value.STRING
else -> Value._UNKNOWN
}
@@ -327,13 +297,7 @@ private constructor(
*/
fun known(): Known =
when (this) {
- ARRAY -> Known.ARRAY
- BOOLEAN -> Known.BOOLEAN
DOUBLE -> Known.DOUBLE
- INTEGER -> Known.INTEGER
- LONG -> Known.LONG
- OBJECT -> Known.OBJECT
- STRING -> Known.STRING
else -> throw HubSpotInvalidDataException("Unknown Type: $value")
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/IntegerFieldSchema.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/IntegerFieldSchema.kt
index 065d52c2..6d57cad1 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/IntegerFieldSchema.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/IntegerFieldSchema.kt
@@ -248,32 +248,14 @@ private constructor(
companion object {
- @JvmField val ARRAY = of("ARRAY")
-
- @JvmField val BOOLEAN = of("BOOLEAN")
-
- @JvmField val DOUBLE = of("DOUBLE")
-
@JvmField val INTEGER = of("INTEGER")
- @JvmField val LONG = of("LONG")
-
- @JvmField val OBJECT = of("OBJECT")
-
- @JvmField val STRING = of("STRING")
-
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
/** An enum containing [Type]'s known values. */
enum class Known {
- ARRAY,
- BOOLEAN,
- DOUBLE,
- INTEGER,
- LONG,
- OBJECT,
- STRING,
+ INTEGER
}
/**
@@ -286,13 +268,7 @@ private constructor(
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
- ARRAY,
- BOOLEAN,
- DOUBLE,
INTEGER,
- LONG,
- OBJECT,
- STRING,
/** An enum member indicating that [Type] was instantiated with an unknown value. */
_UNKNOWN,
}
@@ -306,13 +282,7 @@ private constructor(
*/
fun value(): Value =
when (this) {
- ARRAY -> Value.ARRAY
- BOOLEAN -> Value.BOOLEAN
- DOUBLE -> Value.DOUBLE
INTEGER -> Value.INTEGER
- LONG -> Value.LONG
- OBJECT -> Value.OBJECT
- STRING -> Value.STRING
else -> Value._UNKNOWN
}
@@ -327,13 +297,7 @@ private constructor(
*/
fun known(): Known =
when (this) {
- ARRAY -> Known.ARRAY
- BOOLEAN -> Known.BOOLEAN
- DOUBLE -> Known.DOUBLE
INTEGER -> Known.INTEGER
- LONG -> Known.LONG
- OBJECT -> Known.OBJECT
- STRING -> Known.STRING
else -> throw HubSpotInvalidDataException("Unknown Type: $value")
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/LongFieldSchema.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/LongFieldSchema.kt
index 624639d5..94f1c8e8 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/LongFieldSchema.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/LongFieldSchema.kt
@@ -248,32 +248,14 @@ private constructor(
companion object {
- @JvmField val ARRAY = of("ARRAY")
-
- @JvmField val BOOLEAN = of("BOOLEAN")
-
- @JvmField val DOUBLE = of("DOUBLE")
-
- @JvmField val INTEGER = of("INTEGER")
-
@JvmField val LONG = of("LONG")
- @JvmField val OBJECT = of("OBJECT")
-
- @JvmField val STRING = of("STRING")
-
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
/** An enum containing [Type]'s known values. */
enum class Known {
- ARRAY,
- BOOLEAN,
- DOUBLE,
- INTEGER,
- LONG,
- OBJECT,
- STRING,
+ LONG
}
/**
@@ -286,13 +268,7 @@ private constructor(
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
- ARRAY,
- BOOLEAN,
- DOUBLE,
- INTEGER,
LONG,
- OBJECT,
- STRING,
/** An enum member indicating that [Type] was instantiated with an unknown value. */
_UNKNOWN,
}
@@ -306,13 +282,7 @@ private constructor(
*/
fun value(): Value =
when (this) {
- ARRAY -> Value.ARRAY
- BOOLEAN -> Value.BOOLEAN
- DOUBLE -> Value.DOUBLE
- INTEGER -> Value.INTEGER
LONG -> Value.LONG
- OBJECT -> Value.OBJECT
- STRING -> Value.STRING
else -> Value._UNKNOWN
}
@@ -327,13 +297,7 @@ private constructor(
*/
fun known(): Known =
when (this) {
- ARRAY -> Known.ARRAY
- BOOLEAN -> Known.BOOLEAN
- DOUBLE -> Known.DOUBLE
- INTEGER -> Known.INTEGER
LONG -> Known.LONG
- OBJECT -> Known.OBJECT
- STRING -> Known.STRING
else -> throw HubSpotInvalidDataException("Unknown Type: $value")
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/ObjectFieldSchema.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/ObjectFieldSchema.kt
index 02576e51..8f154085 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/ObjectFieldSchema.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/ObjectFieldSchema.kt
@@ -199,32 +199,14 @@ private constructor(
companion object {
- @JvmField val ARRAY = of("ARRAY")
-
- @JvmField val BOOLEAN = of("BOOLEAN")
-
- @JvmField val DOUBLE = of("DOUBLE")
-
- @JvmField val INTEGER = of("INTEGER")
-
- @JvmField val LONG = of("LONG")
-
@JvmField val OBJECT = of("OBJECT")
- @JvmField val STRING = of("STRING")
-
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
/** An enum containing [Type]'s known values. */
enum class Known {
- ARRAY,
- BOOLEAN,
- DOUBLE,
- INTEGER,
- LONG,
- OBJECT,
- STRING,
+ OBJECT
}
/**
@@ -237,13 +219,7 @@ private constructor(
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
- ARRAY,
- BOOLEAN,
- DOUBLE,
- INTEGER,
- LONG,
OBJECT,
- STRING,
/** An enum member indicating that [Type] was instantiated with an unknown value. */
_UNKNOWN,
}
@@ -257,13 +233,7 @@ private constructor(
*/
fun value(): Value =
when (this) {
- ARRAY -> Value.ARRAY
- BOOLEAN -> Value.BOOLEAN
- DOUBLE -> Value.DOUBLE
- INTEGER -> Value.INTEGER
- LONG -> Value.LONG
OBJECT -> Value.OBJECT
- STRING -> Value.STRING
else -> Value._UNKNOWN
}
@@ -278,13 +248,7 @@ private constructor(
*/
fun known(): Known =
when (this) {
- ARRAY -> Known.ARRAY
- BOOLEAN -> Known.BOOLEAN
- DOUBLE -> Known.DOUBLE
- INTEGER -> Known.INTEGER
- LONG -> Known.LONG
OBJECT -> Known.OBJECT
- STRING -> Known.STRING
else -> throw HubSpotInvalidDataException("Unknown Type: $value")
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/StringFieldSchema.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/StringFieldSchema.kt
index e0174f2d..d5ad1a2e 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/StringFieldSchema.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/automation/actions/StringFieldSchema.kt
@@ -219,18 +219,6 @@ private constructor(
companion object {
- @JvmField val ARRAY = of("ARRAY")
-
- @JvmField val BOOLEAN = of("BOOLEAN")
-
- @JvmField val DOUBLE = of("DOUBLE")
-
- @JvmField val INTEGER = of("INTEGER")
-
- @JvmField val LONG = of("LONG")
-
- @JvmField val OBJECT = of("OBJECT")
-
@JvmField val STRING = of("STRING")
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
@@ -238,13 +226,7 @@ private constructor(
/** An enum containing [Type]'s known values. */
enum class Known {
- ARRAY,
- BOOLEAN,
- DOUBLE,
- INTEGER,
- LONG,
- OBJECT,
- STRING,
+ STRING
}
/**
@@ -257,12 +239,6 @@ private constructor(
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
- ARRAY,
- BOOLEAN,
- DOUBLE,
- INTEGER,
- LONG,
- OBJECT,
STRING,
/** An enum member indicating that [Type] was instantiated with an unknown value. */
_UNKNOWN,
@@ -277,12 +253,6 @@ private constructor(
*/
fun value(): Value =
when (this) {
- ARRAY -> Value.ARRAY
- BOOLEAN -> Value.BOOLEAN
- DOUBLE -> Value.DOUBLE
- INTEGER -> Value.INTEGER
- LONG -> Value.LONG
- OBJECT -> Value.OBJECT
STRING -> Value.STRING
else -> Value._UNKNOWN
}
@@ -298,12 +268,6 @@ private constructor(
*/
fun known(): Known =
when (this) {
- ARRAY -> Known.ARRAY
- BOOLEAN -> Known.BOOLEAN
- DOUBLE -> Known.DOUBLE
- INTEGER -> Known.INTEGER
- LONG -> Known.LONG
- OBJECT -> Known.OBJECT
STRING -> Known.STRING
else -> throw HubSpotInvalidDataException("Unknown Type: $value")
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/mediabridge/InboundDbObjectType.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/mediabridge/InboundDbObjectType.kt
index eaed9f2f..fa5dde49 100644
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/mediabridge/InboundDbObjectType.kt
+++ b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/mediabridge/InboundDbObjectType.kt
@@ -61,6 +61,7 @@ private constructor(
private val readScopeName: JsonField,
private val singularForm: JsonField,
private val status: JsonField,
+ private val visibilities: JsonField>,
private val visibility: JsonField,
private val writeScopeName: JsonField,
private val additionalProperties: MutableMap,
@@ -166,6 +167,9 @@ private constructor(
@ExcludeMissing
singularForm: JsonField = JsonMissing.of(),
@JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(),
+ @JsonProperty("visibilities")
+ @ExcludeMissing
+ visibilities: JsonField> = JsonMissing.of(),
@JsonProperty("visibility")
@ExcludeMissing
visibility: JsonField = JsonMissing.of(),
@@ -211,6 +215,7 @@ private constructor(
readScopeName,
singularForm,
status,
+ visibilities,
visibility,
writeScopeName,
mutableMapOf(),
@@ -454,6 +459,12 @@ private constructor(
*/
fun status(): Optional = status.getOptional("status")
+ /**
+ * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun visibilities(): Optional> = visibilities.getOptional("visibilities")
+
/**
* @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -804,6 +815,15 @@ private constructor(
*/
@JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status
+ /**
+ * Returns the raw JSON value of [visibilities].
+ *
+ * Unlike [visibilities], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("visibilities")
+ @ExcludeMissing
+ fun _visibilities(): JsonField> = visibilities
+
/**
* Returns the raw JSON value of [visibility].
*
@@ -912,6 +932,7 @@ private constructor(
private var readScopeName: JsonField = JsonMissing.of()
private var singularForm: JsonField = JsonMissing.of()
private var status: JsonField = JsonMissing.of()
+ private var visibilities: JsonField>? = null
private var visibility: JsonField = JsonMissing.of()
private var writeScopeName: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@@ -958,6 +979,7 @@ private constructor(
readScopeName = inboundDbObjectType.readScopeName
singularForm = inboundDbObjectType.singularForm
status = inboundDbObjectType.status
+ visibilities = inboundDbObjectType.visibilities.map { it.toMutableList() }
visibility = inboundDbObjectType.visibility
writeScopeName = inboundDbObjectType.writeScopeName
additionalProperties = inboundDbObjectType.additionalProperties.toMutableMap()
@@ -1506,6 +1528,31 @@ private constructor(
*/
fun status(status: JsonField) = apply { this.status = status }
+ fun visibilities(visibilities: List) = visibilities(JsonField.of(visibilities))
+
+ /**
+ * Sets [Builder.visibilities] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.visibilities] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun visibilities(visibilities: JsonField>) = apply {
+ this.visibilities = visibilities.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [Visibility] to [visibilities].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addVisibility(visibility: Visibility) = apply {
+ visibilities =
+ (visibilities ?: JsonField.of(mutableListOf())).also {
+ checkKnown("visibilities", it).add(visibility)
+ }
+ }
+
fun visibility(visibility: Visibility) = visibility(JsonField.of(visibility))
/**
@@ -1631,6 +1678,7 @@ private constructor(
readScopeName,
singularForm,
status,
+ (visibilities ?: JsonMissing.of()).map { it.toImmutable() },
visibility,
writeScopeName,
additionalProperties.toMutableMap(),
@@ -1690,6 +1738,7 @@ private constructor(
readScopeName()
singularForm()
status().ifPresent { it.validate() }
+ visibilities().ifPresent { it.forEach { it.validate() } }
visibility().ifPresent { it.validate() }
writeScopeName()
validated = true
@@ -1748,6 +1797,7 @@ private constructor(
(if (readScopeName.asKnown().isPresent) 1 else 0) +
(if (singularForm.asKnown().isPresent) 1 else 0) +
(status.asKnown().getOrNull()?.validity() ?: 0) +
+ (visibilities.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(visibility.asKnown().getOrNull()?.validity() ?: 0) +
(if (writeScopeName.asKnown().isPresent) 1 else 0)
@@ -2223,6 +2273,154 @@ private constructor(
override fun toString() = value.toString()
}
+ class Visibility @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 CUSTOMER_FACING = of("Customer-facing")
+
+ @JvmField val INTERNAL_ONLY = of("Internal only")
+
+ @JvmField val CUSTOMER_FACING_UI = of("Customer-facing UI")
+
+ @JvmField val CUSTOMER_FACING_PUBLIC_API = of("Customer-facing public API")
+
+ @JvmStatic fun of(value: String) = Visibility(JsonField.of(value))
+ }
+
+ /** An enum containing [Visibility]'s known values. */
+ enum class Known {
+ CUSTOMER_FACING,
+ INTERNAL_ONLY,
+ CUSTOMER_FACING_UI,
+ CUSTOMER_FACING_PUBLIC_API,
+ }
+
+ /**
+ * An enum containing [Visibility]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Visibility] 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 {
+ CUSTOMER_FACING,
+ INTERNAL_ONLY,
+ CUSTOMER_FACING_UI,
+ CUSTOMER_FACING_PUBLIC_API,
+ /**
+ * An enum member indicating that [Visibility] 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) {
+ CUSTOMER_FACING -> Value.CUSTOMER_FACING
+ INTERNAL_ONLY -> Value.INTERNAL_ONLY
+ CUSTOMER_FACING_UI -> Value.CUSTOMER_FACING_UI
+ CUSTOMER_FACING_PUBLIC_API -> Value.CUSTOMER_FACING_PUBLIC_API
+ 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) {
+ CUSTOMER_FACING -> Known.CUSTOMER_FACING
+ INTERNAL_ONLY -> Known.INTERNAL_ONLY
+ CUSTOMER_FACING_UI -> Known.CUSTOMER_FACING_UI
+ CUSTOMER_FACING_PUBLIC_API -> Known.CUSTOMER_FACING_PUBLIC_API
+ else -> throw HubSpotInvalidDataException("Unknown Visibility: $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(): Visibility = 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 Visibility && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
class Visibility @JsonCreator private constructor(private val value: JsonField) : Enum {
/**
@@ -2415,6 +2613,7 @@ private constructor(
readScopeName == other.readScopeName &&
singularForm == other.singularForm &&
status == other.status &&
+ visibilities == other.visibilities &&
visibility == other.visibility &&
writeScopeName == other.writeScopeName &&
additionalProperties == other.additionalProperties
@@ -2460,6 +2659,7 @@ private constructor(
readScopeName,
singularForm,
status,
+ visibilities,
visibility,
writeScopeName,
additionalProperties,
@@ -2469,5 +2669,5 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "InboundDbObjectType{id=$id, allowsSensitiveProperties=$allowsSensitiveProperties, createDatePropertyName=$createDatePropertyName, defaultSearchPropertyNames=$defaultSearchPropertyNames, deleted=$deleted, fullyQualifiedName=$fullyQualifiedName, hasCustomProperties=$hasCustomProperties, hasDefaultProperties=$hasDefaultProperties, hasExternalObjectIds=$hasExternalObjectIds, hasOwners=$hasOwners, hasPipelines=$hasPipelines, indexedForFiltersAndReports=$indexedForFiltersAndReports, lastModifiedPropertyName=$lastModifiedPropertyName, metaType=$metaType, metaTypeId=$metaTypeId, name=$name, objectTypeId=$objectTypeId, objectTypeIdString=$objectTypeIdString, permissioningType=$permissioningType, pipelinePropertyName=$pipelinePropertyName, pipelineStagePropertyName=$pipelineStagePropertyName, requiredProperties=$requiredProperties, restorable=$restorable, scopeMappings=$scopeMappings, secondaryDisplayLabelPropertyNames=$secondaryDisplayLabelPropertyNames, accessScopeName=$accessScopeName, createdAt=$createdAt, description=$description, integrationAppId=$integrationAppId, janusGroup=$janusGroup, ownerPortalId=$ownerPortalId, pipelineCloseDatePropertyName=$pipelineCloseDatePropertyName, pipelineTimeToClosePropertyName=$pipelineTimeToClosePropertyName, pluralForm=$pluralForm, primaryDisplayLabelPropertyName=$primaryDisplayLabelPropertyName, readScopeName=$readScopeName, singularForm=$singularForm, status=$status, visibility=$visibility, writeScopeName=$writeScopeName, additionalProperties=$additionalProperties}"
+ "InboundDbObjectType{id=$id, allowsSensitiveProperties=$allowsSensitiveProperties, createDatePropertyName=$createDatePropertyName, defaultSearchPropertyNames=$defaultSearchPropertyNames, deleted=$deleted, fullyQualifiedName=$fullyQualifiedName, hasCustomProperties=$hasCustomProperties, hasDefaultProperties=$hasDefaultProperties, hasExternalObjectIds=$hasExternalObjectIds, hasOwners=$hasOwners, hasPipelines=$hasPipelines, indexedForFiltersAndReports=$indexedForFiltersAndReports, lastModifiedPropertyName=$lastModifiedPropertyName, metaType=$metaType, metaTypeId=$metaTypeId, name=$name, objectTypeId=$objectTypeId, objectTypeIdString=$objectTypeIdString, permissioningType=$permissioningType, pipelinePropertyName=$pipelinePropertyName, pipelineStagePropertyName=$pipelineStagePropertyName, requiredProperties=$requiredProperties, restorable=$restorable, scopeMappings=$scopeMappings, secondaryDisplayLabelPropertyNames=$secondaryDisplayLabelPropertyNames, accessScopeName=$accessScopeName, createdAt=$createdAt, description=$description, integrationAppId=$integrationAppId, janusGroup=$janusGroup, ownerPortalId=$ownerPortalId, pipelineCloseDatePropertyName=$pipelineCloseDatePropertyName, pipelineTimeToClosePropertyName=$pipelineTimeToClosePropertyName, pluralForm=$pluralForm, primaryDisplayLabelPropertyName=$primaryDisplayLabelPropertyName, readScopeName=$readScopeName, singularForm=$singularForm, status=$status, visibilities=$visibilities, visibility=$visibility, writeScopeName=$writeScopeName, additionalProperties=$additionalProperties}"
}
diff --git a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/sitesearch/ContentSearchResult.kt b/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/sitesearch/ContentSearchResult.kt
deleted file mode 100644
index e3b9eff4..00000000
--- a/hubspot-java-core/src/main/kotlin/com/hubspot/sdk/models/cms/sitesearch/ContentSearchResult.kt
+++ /dev/null
@@ -1,6279 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.hubspot.sdk.models.cms.sitesearch
-
-import com.fasterxml.jackson.annotation.JsonAnyGetter
-import com.fasterxml.jackson.annotation.JsonAnySetter
-import com.fasterxml.jackson.annotation.JsonCreator
-import com.fasterxml.jackson.annotation.JsonProperty
-import com.hubspot.sdk.core.Enum
-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.checkKnown
-import com.hubspot.sdk.core.checkRequired
-import com.hubspot.sdk.core.toImmutable
-import com.hubspot.sdk.errors.HubSpotInvalidDataException
-import java.util.Collections
-import java.util.Objects
-import java.util.Optional
-import kotlin.jvm.optionals.getOrNull
-
-class ContentSearchResult
-@JsonCreator(mode = JsonCreator.Mode.DISABLED)
-private constructor(
- private val id: JsonField,
- private val domain: JsonField,
- private val score: JsonField,
- private val type: JsonField,
- private val url: JsonField,
- private val authorFullName: JsonField,
- private val category: JsonField,
- private val combinedId: JsonField,
- private val contentType: JsonField,
- private val description: JsonField,
- private val featuredImageUrl: JsonField,
- private val inBeta: JsonField,
- private val isPrivate: JsonField,
- private val language: JsonField,
- private val publishedDate: JsonField,
- private val rowId: JsonField,
- private val subcategory: JsonField,
- private val tableId: JsonField,
- private val tags: JsonField>,
- private val title: JsonField,
- private val additionalProperties: MutableMap,
-) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("domain") @ExcludeMissing domain: JsonField = JsonMissing.of(),
- @JsonProperty("score") @ExcludeMissing score: JsonField = JsonMissing.of(),
- @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
- @JsonProperty("url") @ExcludeMissing url: JsonField = JsonMissing.of(),
- @JsonProperty("authorFullName")
- @ExcludeMissing
- authorFullName: JsonField = JsonMissing.of(),
- @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(),
- @JsonProperty("combinedId")
- @ExcludeMissing
- combinedId: JsonField = JsonMissing.of(),
- @JsonProperty("contentType")
- @ExcludeMissing
- contentType: JsonField = JsonMissing.of(),
- @JsonProperty("description")
- @ExcludeMissing
- description: JsonField = JsonMissing.of(),
- @JsonProperty("featuredImageUrl")
- @ExcludeMissing
- featuredImageUrl: JsonField = JsonMissing.of(),
- @JsonProperty("inBeta") @ExcludeMissing inBeta: JsonField = JsonMissing.of(),
- @JsonProperty("isPrivate") @ExcludeMissing isPrivate: JsonField = JsonMissing.of(),
- @JsonProperty("language") @ExcludeMissing language: JsonField = JsonMissing.of(),
- @JsonProperty("publishedDate")
- @ExcludeMissing
- publishedDate: JsonField = JsonMissing.of(),
- @JsonProperty("rowId") @ExcludeMissing rowId: JsonField = JsonMissing.of(),
- @JsonProperty("subcategory")
- @ExcludeMissing
- subcategory: JsonField = JsonMissing.of(),
- @JsonProperty("tableId") @ExcludeMissing tableId: JsonField = JsonMissing.of(),
- @JsonProperty("tags") @ExcludeMissing tags: JsonField> = JsonMissing.of(),
- @JsonProperty("title") @ExcludeMissing title: JsonField = JsonMissing.of(),
- ) : this(
- id,
- domain,
- score,
- type,
- url,
- authorFullName,
- category,
- combinedId,
- contentType,
- description,
- featuredImageUrl,
- inBeta,
- isPrivate,
- language,
- publishedDate,
- rowId,
- subcategory,
- tableId,
- tags,
- title,
- mutableMapOf(),
- )
-
- /**
- * The ID of the content.
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun id(): Long = id.getRequired("id")
-
- /**
- * The domain the document is hosted on.
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun domain(): String = domain.getRequired("domain")
-
- /**
- * The matching score of the document.
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun score(): Double = score.getRequired("score")
-
- /**
- * The type of document. Can be `SITE_PAGE`, `LANDING_PAGE`, `BLOG_POST`, `LISTING_PAGE`, or
- * `KNOWLEDGE_ARTICLE`.
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun type(): Type = type.getRequired("type")
-
- /**
- * The url of the document.
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun url(): String = url.getRequired("url")
-
- /**
- * Name of the author.
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun authorFullName(): Optional = authorFullName.getOptional("authorFullName")
-
- /**
- * The error category
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun category(): Optional = category.getOptional("category")
-
- /**
- * The ID of the document in HubSpot.
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun combinedId(): Optional = combinedId.getOptional("combinedId")
-
- /**
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun contentType(): Optional = contentType.getOptional("contentType")
-
- /**
- * The result's description. The content will be determined by the value of `length` in the
- * request.
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun description(): Optional = description.getOptional("description")
-
- /**
- * URL of the featured image.
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun featuredImageUrl(): Optional = featuredImageUrl.getOptional("featuredImageUrl")
-
- /**
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun inBeta(): Optional = inBeta.getOptional("inBeta")
-
- /**
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun isPrivate(): Optional = isPrivate.getOptional("isPrivate")
-
- /**
- * The document's language.
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun language(): Optional = language.getOptional("language")
-
- /**
- * The date the content was published.
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun publishedDate(): Optional = publishedDate.getOptional("publishedDate")
-
- /**
- * If a dynamic page, the row ID in the HubDB table.
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun rowId(): Optional = rowId.getOptional("rowId")
-
- /**
- * For knowledge articles, the subcategory of the article.
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun subcategory(): Optional = subcategory.getOptional("subcategory")
-
- /**
- * If a dynamic page, the ID of the HubDB table.
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun tableId(): Optional = tableId.getOptional("tableId")
-
- /**
- * If a blog post, the tags associated with it.
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun tags(): Optional> = tags.getOptional("tags")
-
- /**
- * The title of the returned document.
- *
- * @throws HubSpotInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun title(): Optional = title.getOptional("title")
-
- /**
- * Returns the raw JSON value of [id].
- *
- * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
-
- /**
- * Returns the raw JSON value of [domain].
- *
- * Unlike [domain], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("domain") @ExcludeMissing fun _domain(): JsonField = domain
-
- /**
- * Returns the raw JSON value of [score].
- *
- * Unlike [score], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("score") @ExcludeMissing fun _score(): JsonField = score
-
- /**
- * Returns the raw JSON value of [type].
- *
- * Unlike [type], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
-
- /**
- * Returns the raw JSON value of [url].
- *
- * Unlike [url], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("url") @ExcludeMissing fun _url(): JsonField = url
-
- /**
- * Returns the raw JSON value of [authorFullName].
- *
- * Unlike [authorFullName], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("authorFullName")
- @ExcludeMissing
- fun _authorFullName(): JsonField = authorFullName
-
- /**
- * Returns the raw JSON value of [category].
- *
- * Unlike [category], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category
-
- /**
- * Returns the raw JSON value of [combinedId].
- *
- * Unlike [combinedId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("combinedId") @ExcludeMissing fun _combinedId(): JsonField = combinedId
-
- /**
- * Returns the raw JSON value of [contentType].
- *
- * Unlike [contentType], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("contentType") @ExcludeMissing fun _contentType(): JsonField = contentType
-
- /**
- * Returns the raw JSON value of [description].
- *
- * Unlike [description], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("description") @ExcludeMissing fun _description(): JsonField = description
-
- /**
- * Returns the raw JSON value of [featuredImageUrl].
- *
- * Unlike [featuredImageUrl], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("featuredImageUrl")
- @ExcludeMissing
- fun _featuredImageUrl(): JsonField = featuredImageUrl
-
- /**
- * Returns the raw JSON value of [inBeta].
- *
- * Unlike [inBeta], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("inBeta") @ExcludeMissing fun _inBeta(): JsonField = inBeta
-
- /**
- * Returns the raw JSON value of [isPrivate].
- *
- * Unlike [isPrivate], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("isPrivate") @ExcludeMissing fun _isPrivate(): JsonField = isPrivate
-
- /**
- * Returns the raw JSON value of [language].
- *
- * Unlike [language], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("language") @ExcludeMissing fun _language(): JsonField = language
-
- /**
- * Returns the raw JSON value of [publishedDate].
- *
- * Unlike [publishedDate], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("publishedDate")
- @ExcludeMissing
- fun _publishedDate(): JsonField = publishedDate
-
- /**
- * Returns the raw JSON value of [rowId].
- *
- * Unlike [rowId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("rowId") @ExcludeMissing fun _rowId(): JsonField = rowId
-
- /**
- * Returns the raw JSON value of [subcategory].
- *
- * Unlike [subcategory], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("subcategory") @ExcludeMissing fun _subcategory(): JsonField = subcategory
-
- /**
- * Returns the raw JSON value of [tableId].
- *
- * Unlike [tableId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("tableId") @ExcludeMissing fun _tableId(): JsonField = tableId
-
- /**
- * Returns the raw JSON value of [tags].
- *
- * Unlike [tags], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("tags") @ExcludeMissing fun _tags(): JsonField> = tags
-
- /**
- * Returns the raw JSON value of [title].
- *
- * Unlike [title], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("title") @ExcludeMissing fun _title(): JsonField = title
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [ContentSearchResult].
- *
- * The following fields are required:
- * ```java
- * .id()
- * .domain()
- * .score()
- * .type()
- * .url()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [ContentSearchResult]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var domain: JsonField? = null
- private var score: JsonField? = null
- private var type: JsonField? = null
- private var url: JsonField? = null
- private var authorFullName: JsonField = JsonMissing.of()
- private var category: JsonField = JsonMissing.of()
- private var combinedId: JsonField = JsonMissing.of()
- private var contentType: JsonField = JsonMissing.of()
- private var description: JsonField = JsonMissing.of()
- private var featuredImageUrl: JsonField = JsonMissing.of()
- private var inBeta: JsonField = JsonMissing.of()
- private var isPrivate: JsonField = JsonMissing.of()
- private var language: JsonField = JsonMissing.of()
- private var publishedDate: JsonField = JsonMissing.of()
- private var rowId: JsonField = JsonMissing.of()
- private var subcategory: JsonField = JsonMissing.of()
- private var tableId: JsonField