diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 3b4c2d4b..bd7f3844 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "4.1.0"
+ ".": "4.2.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 23dfdad6..bed01067 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
configured_endpoints: 40
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-5d2b3a9cdbcfb6f10b6e621ef7ababbd2701316e5ea1117ced072ab76bdbec34.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-7a816d4a5f0039230590a6662f3513d5756344ca662761ecbc49016593f65836.yml
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9fe07907..a4a094f3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,32 @@
# Changelog
+## 4.2.0 (2025-02-27)
+
+Full Changelog: [v4.1.0...v4.2.0](https://github.com/Finch-API/finch-api-java/compare/v4.1.0...v4.2.0)
+
+### Features
+
+* **api:** api update ([#463](https://github.com/Finch-API/finch-api-java/issues/463)) ([2eb1796](https://github.com/Finch-API/finch-api-java/commit/2eb1796d9d21e25e60b5242041cc7ef9e7e1df0e))
+* **client:** allow omitting params object when none required ([#455](https://github.com/Finch-API/finch-api-java/issues/455)) ([cac8229](https://github.com/Finch-API/finch-api-java/commit/cac82298a09597acfa12046c8d6396aa08bb3807))
+
+
+### Bug Fixes
+
+* **client:** add missing `@JvmStatic` ([#457](https://github.com/Finch-API/finch-api-java/issues/457)) ([258a817](https://github.com/Finch-API/finch-api-java/commit/258a817f842e9344c107586f1ac7c879f6c1e3ae))
+
+
+### Chores
+
+* **client:** use deep identity methods for primitive array types ([#459](https://github.com/Finch-API/finch-api-java/issues/459)) ([4424710](https://github.com/Finch-API/finch-api-java/commit/4424710651151e1a0a075ee7a4c05ed96dc1ce64))
+* **internal:** add async service tests ([#458](https://github.com/Finch-API/finch-api-java/issues/458)) ([4698263](https://github.com/Finch-API/finch-api-java/commit/4698263f9490cc4df1b8412c084c1ade14c38b68))
+* **internal:** improve sync service tests ([4698263](https://github.com/Finch-API/finch-api-java/commit/4698263f9490cc4df1b8412c084c1ade14c38b68))
+* **internal:** refactor `ServiceParamsTest` ([#460](https://github.com/Finch-API/finch-api-java/issues/460)) ([c375fa6](https://github.com/Finch-API/finch-api-java/commit/c375fa659417a964964c150b7b0f8dc27ceab91f))
+
+
+### Documentation
+
+* readme parameter tweaks ([4698263](https://github.com/Finch-API/finch-api-java/commit/4698263f9490cc4df1b8412c084c1ade14c38b68))
+
## 4.1.0 (2025-02-25)
Full Changelog: [v4.0.2...v4.1.0](https://github.com/Finch-API/finch-api-java/compare/v4.0.2...v4.1.0)
diff --git a/README.md b/README.md
index d469a892..a4e73200 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-[](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/4.1.0)
+[](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/4.2.0)
@@ -23,7 +23,7 @@ The REST API documentation can be foundĀ [in the Finch Documentation Center](htt
### Gradle
```kotlin
-implementation("com.tryfinch.api:finch-java:4.1.0")
+implementation("com.tryfinch.api:finch-java:4.2.0")
```
### Maven
@@ -32,7 +32,7 @@ implementation("com.tryfinch.api:finch-java:4.1.0")
com.tryfinch.api
finch-java
- 4.1.0
+ 4.2.0
```
@@ -56,10 +56,7 @@ FinchClient client = FinchOkHttpClient.builder()
.accessToken("My Access Token")
.build();
-HrisDirectoryListParams params = HrisDirectoryListParams.builder()
- .candidateId("")
- .build();
-HrisDirectoryListPage page = client.hris().directory().list(params);
+HrisDirectoryListPage page = client.hris().directory().list();
```
## Client configuration
@@ -98,7 +95,6 @@ FinchClient client = FinchOkHttpClient.builder()
// Configures using the `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET` and `FINCH_WEBHOOK_SECRET` environment variables
.fromEnv()
.accessToken("My Access Token")
- .accessToken("My Access Token")
.build();
```
@@ -145,8 +141,7 @@ FinchClient client = FinchOkHttpClient.builder()
.accessToken("My Access Token")
.build();
-HrisDirectoryListParams params = HrisDirectoryListParams.builder().build();
-CompletableFuture page = client.async().hris().directory().list(params);
+CompletableFuture page = client.async().hris().directory().list();
```
Or create an asynchronous client from the beginning:
@@ -164,8 +159,7 @@ FinchClientAsync client = FinchOkHttpClientAsync.builder()
.accessToken("My Access Token")
.build();
-HrisDirectoryListParams params = HrisDirectoryListParams.builder().build();
-CompletableFuture page = client.hris().directory().list(params);
+CompletableFuture page = client.hris().directory().list();
```
The asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s.
@@ -295,8 +289,8 @@ import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
- .accessToken("My Access Token")
.maxRetries(4)
+ .accessToken("My Access Token")
.build();
```
@@ -310,9 +304,7 @@ To set a custom timeout, configure the method call using the `timeout` method:
import com.tryfinch.api.models.HrisDirectoryListPage;
import com.tryfinch.api.models.HrisDirectoryListParams;
-HrisDirectoryListPage page = client.hris().directory().list(
- params, RequestOptions.builder().timeout(Duration.ofSeconds(30)).build()
-);
+HrisDirectoryListPage page = client.hris().directory().list(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());
```
Or configure the default for all method calls at the client level:
@@ -324,8 +316,8 @@ import java.time.Duration;
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
- .accessToken("My Access Token")
.timeout(Duration.ofSeconds(30))
+ .accessToken("My Access Token")
.build();
```
@@ -341,12 +333,12 @@ import java.net.Proxy;
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
- .accessToken("My Access Token")
.proxy(new Proxy(
Proxy.Type.HTTP, new InetSocketAddress(
"https://example.com", 8080
)
))
+ .accessToken("My Access Token")
.build();
```
@@ -453,9 +445,7 @@ Or configure the method call to validate the response using the `responseValidat
import com.tryfinch.api.models.HrisDirectoryListPage;
import com.tryfinch.api.models.HrisDirectoryListParams;
-HrisDirectoryListPage page = client.hris().directory().list(
- params, RequestOptions.builder().responseValidation(true).build()
-);
+HrisDirectoryListPage page = client.hris().directory().list(RequestOptions.builder().responseValidation(true).build());
```
Or configure the default for all method calls at the client level:
@@ -466,8 +456,8 @@ import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
- .accessToken("My Access Token")
.responseValidation(true)
+ .accessToken("My Access Token")
.build();
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 4b46d1a3..5b66da78 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,4 +1,4 @@
allprojects {
group = "com.tryfinch.api"
- version = "4.1.0" // x-release-please-version
+ version = "4.2.0" // x-release-please-version
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Utils.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Utils.kt
index c2f32509..979a3580 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Utils.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Utils.kt
@@ -26,6 +26,42 @@ internal fun , V> SortedMap.toImmutable(): SortedMap value.contentHashCode()
- is String -> value
- is Boolean -> value
- is Long -> value
- is Double -> value
- else -> value?.hashCode()
- },
- )
- }
- return hashCode
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (other == null || this.javaClass != other.javaClass) return false
+ private val hashCode: Int by lazy { contentHash(name, value, contentType, filename) }
- other as MultipartFormValue<*>
+ override fun hashCode(): Int = hashCode
- if (name != other.name || contentType != other.contentType || filename != other.filename)
- return false
-
- return when {
- value is ByteArray && other.value is ByteArray -> value contentEquals other.value
- else -> value?.equals(other.value) ?: (other.value == null)
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
}
+
+ return other is MultipartFormValue<*> &&
+ name == other.name &&
+ value contentEquals other.value &&
+ contentType == other.contentType &&
+ filename == other.filename
}
override fun toString(): String =
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt
index 8edd0cba..1e95395e 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt
@@ -37,6 +37,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): AccountDisconnectParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt
index 0f3ddc95..c9718b4c 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt
@@ -27,6 +27,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): AccountIntrospectParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt
index 5f17f2f8..868e087a 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt
@@ -227,6 +227,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): HrisBenefitCreateParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt
index 74a5d5b8..63ae4bf0 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt
@@ -27,6 +27,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): HrisBenefitListParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParams.kt
index 0719a212..c783f66b 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParams.kt
@@ -27,6 +27,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): HrisBenefitListSupportedBenefitsParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt
index f1eca56d..cd51a0ed 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt
@@ -27,6 +27,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): HrisCompanyRetrieveParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParams.kt
index 5eafd559..aa21caf7 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParams.kt
@@ -43,6 +43,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): HrisDirectoryListIndividualsParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListParams.kt
index 000f255d..ed4d67ad 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListParams.kt
@@ -42,6 +42,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): HrisDirectoryListParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentListParams.kt
index 28c06a6a..8e51b518 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentListParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDocumentListParams.kt
@@ -60,6 +60,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): HrisDocumentListParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt
index e65280f8..3809d289 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt
@@ -183,6 +183,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): HrisIndividualRetrieveManyParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt
index 187f04d1..34e0c010 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt
@@ -741,6 +741,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): JobAutomatedCreateParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt
index 9a6b4b60..d49551f0 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt
@@ -46,6 +46,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): JobAutomatedListParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt
index 359f7437..0553227d 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt
@@ -381,7 +381,7 @@ private constructor(
private val amount: JsonField = JsonMissing.of(),
@JsonProperty("attributes")
@ExcludeMissing
- private val attributes: JsonField = JsonMissing.of(),
+ private val attributes: JsonField = JsonMissing.of(),
@JsonProperty("currency")
@ExcludeMissing
private val currency: JsonField = JsonMissing.of(),
@@ -399,7 +399,7 @@ private constructor(
/** The earnings amount in cents. */
fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount"))
- fun attributes(): Optional =
+ fun attributes(): Optional =
Optional.ofNullable(attributes.getNullable("attributes"))
/** The earnings currency code. */
@@ -422,7 +422,7 @@ private constructor(
@JsonProperty("attributes")
@ExcludeMissing
- fun _attributes(): JsonField = attributes
+ fun _attributes(): JsonField = attributes
/** The earnings currency code. */
@JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency
@@ -470,7 +470,7 @@ private constructor(
class Builder internal constructor() {
private var amount: JsonField = JsonMissing.of()
- private var attributes: JsonField = JsonMissing.of()
+ private var attributes: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var hours: JsonField = JsonMissing.of()
private var name: JsonField = JsonMissing.of()
@@ -501,11 +501,13 @@ private constructor(
/** The earnings amount in cents. */
fun amount(amount: JsonField) = apply { this.amount = amount }
- fun attributes(attributes: Metadata?) = attributes(JsonField.ofNullable(attributes))
+ fun attributes(attributes: Attributes?) = attributes(JsonField.ofNullable(attributes))
- fun attributes(attributes: Optional) = attributes(attributes.orElse(null))
+ fun attributes(attributes: Optional) = attributes(attributes.orElse(null))
- fun attributes(attributes: JsonField) = apply { this.attributes = attributes }
+ fun attributes(attributes: JsonField) = apply {
+ this.attributes = attributes
+ }
/** The earnings currency code. */
fun currency(currency: String?) = currency(JsonField.ofNullable(currency))
@@ -591,30 +593,22 @@ private constructor(
}
@NoAutoDetect
- class Metadata
+ class Attributes
@JsonCreator
private constructor(
@JsonProperty("metadata")
@ExcludeMissing
- private val metadata: JsonField = JsonMissing.of(),
+ private val metadata: JsonField = JsonMissing.of(),
@JsonAnySetter
private val additionalProperties: Map = immutableEmptyMap(),
) {
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value pairs
- * where the values can be of any type (string, number, boolean, object, array, etc.).
- */
- fun metadata(): Optional =
+ fun metadata(): Optional =
Optional.ofNullable(metadata.getNullable("metadata"))
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value pairs
- * where the values can be of any type (string, number, boolean, object, array, etc.).
- */
@JsonProperty("metadata")
@ExcludeMissing
- fun _metadata(): JsonField = metadata
+ fun _metadata(): JsonField = metadata
@JsonAnyGetter
@ExcludeMissing
@@ -622,7 +616,7 @@ private constructor(
private var validated: Boolean = false
- fun validate(): Metadata = apply {
+ fun validate(): Attributes = apply {
if (validated) {
return@apply
}
@@ -638,33 +632,21 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- /** A builder for [Metadata]. */
+ /** A builder for [Attributes]. */
class Builder internal constructor() {
- private var metadata: JsonField = JsonMissing.of()
+ private var metadata: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
- internal fun from(metadata: Metadata) = apply {
- this.metadata = metadata.metadata
- additionalProperties = metadata.additionalProperties.toMutableMap()
+ internal fun from(attributes: Attributes) = apply {
+ metadata = attributes.metadata
+ additionalProperties = attributes.additionalProperties.toMutableMap()
}
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value
- * pairs where the values can be of any type (string, number, boolean, object,
- * array, etc.).
- */
- fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata))
+ fun metadata(metadata: Metadata) = metadata(JsonField.of(metadata))
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value
- * pairs where the values can be of any type (string, number, boolean, object,
- * array, etc.).
- */
- fun metadata(metadata: JsonField) = apply {
- this.metadata = metadata
- }
+ fun metadata(metadata: JsonField) = apply { this.metadata = metadata }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
@@ -688,32 +670,49 @@ private constructor(
keys.forEach(::removeAdditionalProperty)
}
- fun build(): Metadata = Metadata(metadata, additionalProperties.toImmutable())
+ fun build(): Attributes = Attributes(metadata, additionalProperties.toImmutable())
}
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value pairs
- * where the values can be of any type (string, number, boolean, object, array, etc.).
- */
@NoAutoDetect
- class InnerMetadata
+ class Metadata
@JsonCreator
private constructor(
+ @JsonProperty("metadata")
+ @ExcludeMissing
+ private val metadata: JsonField = JsonMissing.of(),
@JsonAnySetter
- private val additionalProperties: Map = immutableEmptyMap()
+ private val additionalProperties: Map = immutableEmptyMap(),
) {
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a key-value
+ * pairs where the values can be of any type (string, number, boolean, object,
+ * array, etc.).
+ */
+ fun metadata(): Optional =
+ Optional.ofNullable(metadata.getNullable("metadata"))
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a key-value
+ * pairs where the values can be of any type (string, number, boolean, object,
+ * array, etc.).
+ */
+ @JsonProperty("metadata")
+ @ExcludeMissing
+ fun _metadata(): JsonField = metadata
+
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
private var validated: Boolean = false
- fun validate(): InnerMetadata = apply {
+ fun validate(): Metadata = apply {
if (validated) {
return@apply
}
+ metadata().ifPresent { it.validate() }
validated = true
}
@@ -724,14 +723,32 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- /** A builder for [InnerMetadata]. */
+ /** A builder for [Metadata]. */
class Builder internal constructor() {
+ private var metadata: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
- internal fun from(innerMetadata: InnerMetadata) = apply {
- additionalProperties = innerMetadata.additionalProperties.toMutableMap()
+ internal fun from(metadata: Metadata) = apply {
+ this.metadata = metadata.metadata
+ additionalProperties = metadata.additionalProperties.toMutableMap()
+ }
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a
+ * key-value pairs where the values can be of any type (string, number, boolean,
+ * object, array, etc.).
+ */
+ fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata))
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a
+ * key-value pairs where the values can be of any type (string, number, boolean,
+ * object, array, etc.).
+ */
+ fun metadata(metadata: JsonField) = apply {
+ this.metadata = metadata
}
fun additionalProperties(additionalProperties: Map) = apply {
@@ -756,7 +773,96 @@ private constructor(
keys.forEach(::removeAdditionalProperty)
}
- fun build(): InnerMetadata = InnerMetadata(additionalProperties.toImmutable())
+ fun build(): Metadata = Metadata(metadata, additionalProperties.toImmutable())
+ }
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a key-value
+ * pairs where the values can be of any type (string, number, boolean, object,
+ * array, etc.).
+ */
+ @NoAutoDetect
+ class InnerMetadata
+ @JsonCreator
+ private constructor(
+ @JsonAnySetter
+ private val additionalProperties: Map = immutableEmptyMap()
+ ) {
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ private var validated: Boolean = false
+
+ fun validate(): InnerMetadata = apply {
+ if (validated) {
+ return@apply
+ }
+
+ validated = true
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [InnerMetadata]. */
+ class Builder internal constructor() {
+
+ private var additionalProperties: MutableMap =
+ mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(innerMetadata: InnerMetadata) = apply {
+ additionalProperties = innerMetadata.additionalProperties.toMutableMap()
+ }
+
+ 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)
+ }
+
+ fun build(): InnerMetadata =
+ InnerMetadata(additionalProperties.toImmutable())
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is InnerMetadata && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "InnerMetadata{additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
@@ -764,17 +870,17 @@ private constructor(
return true
}
- return /* spotless:off */ other is InnerMetadata && additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Metadata && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
}
/* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+ private val hashCode: Int by lazy { Objects.hash(metadata, additionalProperties) }
/* spotless:on */
override fun hashCode(): Int = hashCode
override fun toString() =
- "InnerMetadata{additionalProperties=$additionalProperties}"
+ "Metadata{metadata=$metadata, additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
@@ -782,7 +888,7 @@ private constructor(
return true
}
- return /* spotless:off */ other is Metadata && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Attributes && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
}
/* spotless:off */
@@ -792,7 +898,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "Metadata{metadata=$metadata, additionalProperties=$additionalProperties}"
+ "Attributes{metadata=$metadata, additionalProperties=$additionalProperties}"
}
/** The type of earning. */
@@ -989,7 +1095,7 @@ private constructor(
private val amount: JsonField = JsonMissing.of(),
@JsonProperty("attributes")
@ExcludeMissing
- private val attributes: JsonField = JsonMissing.of(),
+ private val attributes: JsonField = JsonMissing.of(),
@JsonProperty("currency")
@ExcludeMissing
private val currency: JsonField = JsonMissing.of(),
@@ -1009,7 +1115,7 @@ private constructor(
/** The deduction amount in cents. */
fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount"))
- fun attributes(): Optional =
+ fun attributes(): Optional =
Optional.ofNullable(attributes.getNullable("attributes"))
/** The deduction currency. */
@@ -1029,7 +1135,7 @@ private constructor(
@JsonProperty("attributes")
@ExcludeMissing
- fun _attributes(): JsonField = attributes
+ fun _attributes(): JsonField = attributes
/** The deduction currency. */
@JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency
@@ -1074,7 +1180,7 @@ private constructor(
class Builder internal constructor() {
private var amount: JsonField = JsonMissing.of()
- private var attributes: JsonField = JsonMissing.of()
+ private var attributes: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var name: JsonField = JsonMissing.of()
private var preTax: JsonField = JsonMissing.of()
@@ -1105,11 +1211,13 @@ private constructor(
/** The deduction amount in cents. */
fun amount(amount: JsonField) = apply { this.amount = amount }
- fun attributes(attributes: Metadata?) = attributes(JsonField.ofNullable(attributes))
+ fun attributes(attributes: Attributes?) = attributes(JsonField.ofNullable(attributes))
- fun attributes(attributes: Optional) = attributes(attributes.orElse(null))
+ fun attributes(attributes: Optional) = attributes(attributes.orElse(null))
- fun attributes(attributes: JsonField) = apply { this.attributes = attributes }
+ fun attributes(attributes: JsonField) = apply {
+ this.attributes = attributes
+ }
/** The deduction currency. */
fun currency(currency: String?) = currency(JsonField.ofNullable(currency))
@@ -1183,30 +1291,22 @@ private constructor(
}
@NoAutoDetect
- class Metadata
+ class Attributes
@JsonCreator
private constructor(
@JsonProperty("metadata")
@ExcludeMissing
- private val metadata: JsonField = JsonMissing.of(),
+ private val metadata: JsonField = JsonMissing.of(),
@JsonAnySetter
private val additionalProperties: Map = immutableEmptyMap(),
) {
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value pairs
- * where the values can be of any type (string, number, boolean, object, array, etc.).
- */
- fun metadata(): Optional =
+ fun metadata(): Optional =
Optional.ofNullable(metadata.getNullable("metadata"))
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value pairs
- * where the values can be of any type (string, number, boolean, object, array, etc.).
- */
@JsonProperty("metadata")
@ExcludeMissing
- fun _metadata(): JsonField = metadata
+ fun _metadata(): JsonField = metadata
@JsonAnyGetter
@ExcludeMissing
@@ -1214,7 +1314,7 @@ private constructor(
private var validated: Boolean = false
- fun validate(): Metadata = apply {
+ fun validate(): Attributes = apply {
if (validated) {
return@apply
}
@@ -1230,33 +1330,21 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- /** A builder for [Metadata]. */
+ /** A builder for [Attributes]. */
class Builder internal constructor() {
- private var metadata: JsonField = JsonMissing.of()
+ private var metadata: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
- internal fun from(metadata: Metadata) = apply {
- this.metadata = metadata.metadata
- additionalProperties = metadata.additionalProperties.toMutableMap()
+ internal fun from(attributes: Attributes) = apply {
+ metadata = attributes.metadata
+ additionalProperties = attributes.additionalProperties.toMutableMap()
}
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value
- * pairs where the values can be of any type (string, number, boolean, object,
- * array, etc.).
- */
- fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata))
+ fun metadata(metadata: Metadata) = metadata(JsonField.of(metadata))
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value
- * pairs where the values can be of any type (string, number, boolean, object,
- * array, etc.).
- */
- fun metadata(metadata: JsonField) = apply {
- this.metadata = metadata
- }
+ fun metadata(metadata: JsonField) = apply { this.metadata = metadata }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
@@ -1280,32 +1368,49 @@ private constructor(
keys.forEach(::removeAdditionalProperty)
}
- fun build(): Metadata = Metadata(metadata, additionalProperties.toImmutable())
+ fun build(): Attributes = Attributes(metadata, additionalProperties.toImmutable())
}
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value pairs
- * where the values can be of any type (string, number, boolean, object, array, etc.).
- */
@NoAutoDetect
- class InnerMetadata
+ class Metadata
@JsonCreator
private constructor(
+ @JsonProperty("metadata")
+ @ExcludeMissing
+ private val metadata: JsonField = JsonMissing.of(),
@JsonAnySetter
- private val additionalProperties: Map = immutableEmptyMap()
+ private val additionalProperties: Map = immutableEmptyMap(),
) {
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a key-value
+ * pairs where the values can be of any type (string, number, boolean, object,
+ * array, etc.).
+ */
+ fun metadata(): Optional =
+ Optional.ofNullable(metadata.getNullable("metadata"))
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a key-value
+ * pairs where the values can be of any type (string, number, boolean, object,
+ * array, etc.).
+ */
+ @JsonProperty("metadata")
+ @ExcludeMissing
+ fun _metadata(): JsonField = metadata
+
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
private var validated: Boolean = false
- fun validate(): InnerMetadata = apply {
+ fun validate(): Metadata = apply {
if (validated) {
return@apply
}
+ metadata().ifPresent { it.validate() }
validated = true
}
@@ -1316,14 +1421,32 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- /** A builder for [InnerMetadata]. */
+ /** A builder for [Metadata]. */
class Builder internal constructor() {
+ private var metadata: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
- internal fun from(innerMetadata: InnerMetadata) = apply {
- additionalProperties = innerMetadata.additionalProperties.toMutableMap()
+ internal fun from(metadata: Metadata) = apply {
+ this.metadata = metadata.metadata
+ additionalProperties = metadata.additionalProperties.toMutableMap()
+ }
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a
+ * key-value pairs where the values can be of any type (string, number, boolean,
+ * object, array, etc.).
+ */
+ fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata))
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a
+ * key-value pairs where the values can be of any type (string, number, boolean,
+ * object, array, etc.).
+ */
+ fun metadata(metadata: JsonField) = apply {
+ this.metadata = metadata
}
fun additionalProperties(additionalProperties: Map) = apply {
@@ -1348,7 +1471,96 @@ private constructor(
keys.forEach(::removeAdditionalProperty)
}
- fun build(): InnerMetadata = InnerMetadata(additionalProperties.toImmutable())
+ fun build(): Metadata = Metadata(metadata, additionalProperties.toImmutable())
+ }
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a key-value
+ * pairs where the values can be of any type (string, number, boolean, object,
+ * array, etc.).
+ */
+ @NoAutoDetect
+ class InnerMetadata
+ @JsonCreator
+ private constructor(
+ @JsonAnySetter
+ private val additionalProperties: Map = immutableEmptyMap()
+ ) {
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ private var validated: Boolean = false
+
+ fun validate(): InnerMetadata = apply {
+ if (validated) {
+ return@apply
+ }
+
+ validated = true
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [InnerMetadata]. */
+ class Builder internal constructor() {
+
+ private var additionalProperties: MutableMap =
+ mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(innerMetadata: InnerMetadata) = apply {
+ additionalProperties = innerMetadata.additionalProperties.toMutableMap()
+ }
+
+ 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)
+ }
+
+ fun build(): InnerMetadata =
+ InnerMetadata(additionalProperties.toImmutable())
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is InnerMetadata && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "InnerMetadata{additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
@@ -1356,17 +1568,17 @@ private constructor(
return true
}
- return /* spotless:off */ other is InnerMetadata && additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Metadata && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
}
/* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+ private val hashCode: Int by lazy { Objects.hash(metadata, additionalProperties) }
/* spotless:on */
override fun hashCode(): Int = hashCode
override fun toString() =
- "InnerMetadata{additionalProperties=$additionalProperties}"
+ "Metadata{metadata=$metadata, additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
@@ -1374,7 +1586,7 @@ private constructor(
return true
}
- return /* spotless:off */ other is Metadata && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Attributes && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
}
/* spotless:off */
@@ -1384,7 +1596,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "Metadata{metadata=$metadata, additionalProperties=$additionalProperties}"
+ "Attributes{metadata=$metadata, additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
@@ -1414,7 +1626,7 @@ private constructor(
private val amount: JsonField = JsonMissing.of(),
@JsonProperty("attributes")
@ExcludeMissing
- private val attributes: JsonField = JsonMissing.of(),
+ private val attributes: JsonField = JsonMissing.of(),
@JsonProperty("currency")
@ExcludeMissing
private val currency: JsonField = JsonMissing.of(),
@@ -1431,7 +1643,7 @@ private constructor(
/** The contribution amount in cents. */
fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount"))
- fun attributes(): Optional =
+ fun attributes(): Optional =
Optional.ofNullable(attributes.getNullable("attributes"))
/** The contribution currency. */
@@ -1448,7 +1660,7 @@ private constructor(
@JsonProperty("attributes")
@ExcludeMissing
- fun _attributes(): JsonField = attributes
+ fun _attributes(): JsonField = attributes
/** The contribution currency. */
@JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency
@@ -1489,7 +1701,7 @@ private constructor(
class Builder internal constructor() {
private var amount: JsonField = JsonMissing.of()
- private var attributes: JsonField = JsonMissing.of()
+ private var attributes: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var name: JsonField = JsonMissing.of()
private var type: JsonField = JsonMissing.of()
@@ -1518,11 +1730,13 @@ private constructor(
/** The contribution amount in cents. */
fun amount(amount: JsonField) = apply { this.amount = amount }
- fun attributes(attributes: Metadata?) = attributes(JsonField.ofNullable(attributes))
+ fun attributes(attributes: Attributes?) = attributes(JsonField.ofNullable(attributes))
- fun attributes(attributes: Optional) = attributes(attributes.orElse(null))
+ fun attributes(attributes: Optional) = attributes(attributes.orElse(null))
- fun attributes(attributes: JsonField) = apply { this.attributes = attributes }
+ fun attributes(attributes: JsonField) = apply {
+ this.attributes = attributes
+ }
/** The contribution currency. */
fun currency(currency: String?) = currency(JsonField.ofNullable(currency))
@@ -1582,30 +1796,22 @@ private constructor(
}
@NoAutoDetect
- class Metadata
+ class Attributes
@JsonCreator
private constructor(
@JsonProperty("metadata")
@ExcludeMissing
- private val metadata: JsonField = JsonMissing.of(),
+ private val metadata: JsonField = JsonMissing.of(),
@JsonAnySetter
private val additionalProperties: Map = immutableEmptyMap(),
) {
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value pairs
- * where the values can be of any type (string, number, boolean, object, array, etc.).
- */
- fun metadata(): Optional =
+ fun metadata(): Optional =
Optional.ofNullable(metadata.getNullable("metadata"))
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value pairs
- * where the values can be of any type (string, number, boolean, object, array, etc.).
- */
@JsonProperty("metadata")
@ExcludeMissing
- fun _metadata(): JsonField = metadata
+ fun _metadata(): JsonField = metadata
@JsonAnyGetter
@ExcludeMissing
@@ -1613,7 +1819,7 @@ private constructor(
private var validated: Boolean = false
- fun validate(): Metadata = apply {
+ fun validate(): Attributes = apply {
if (validated) {
return@apply
}
@@ -1629,33 +1835,21 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- /** A builder for [Metadata]. */
+ /** A builder for [Attributes]. */
class Builder internal constructor() {
- private var metadata: JsonField = JsonMissing.of()
+ private var metadata: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
- internal fun from(metadata: Metadata) = apply {
- this.metadata = metadata.metadata
- additionalProperties = metadata.additionalProperties.toMutableMap()
+ internal fun from(attributes: Attributes) = apply {
+ metadata = attributes.metadata
+ additionalProperties = attributes.additionalProperties.toMutableMap()
}
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value
- * pairs where the values can be of any type (string, number, boolean, object,
- * array, etc.).
- */
- fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata))
+ fun metadata(metadata: Metadata) = metadata(JsonField.of(metadata))
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value
- * pairs where the values can be of any type (string, number, boolean, object,
- * array, etc.).
- */
- fun metadata(metadata: JsonField) = apply {
- this.metadata = metadata
- }
+ fun metadata(metadata: JsonField) = apply { this.metadata = metadata }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
@@ -1679,32 +1873,49 @@ private constructor(
keys.forEach(::removeAdditionalProperty)
}
- fun build(): Metadata = Metadata(metadata, additionalProperties.toImmutable())
+ fun build(): Attributes = Attributes(metadata, additionalProperties.toImmutable())
}
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value pairs
- * where the values can be of any type (string, number, boolean, object, array, etc.).
- */
@NoAutoDetect
- class InnerMetadata
+ class Metadata
@JsonCreator
private constructor(
+ @JsonProperty("metadata")
+ @ExcludeMissing
+ private val metadata: JsonField = JsonMissing.of(),
@JsonAnySetter
- private val additionalProperties: Map = immutableEmptyMap()
+ private val additionalProperties: Map = immutableEmptyMap(),
) {
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a key-value
+ * pairs where the values can be of any type (string, number, boolean, object,
+ * array, etc.).
+ */
+ fun metadata(): Optional =
+ Optional.ofNullable(metadata.getNullable("metadata"))
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a key-value
+ * pairs where the values can be of any type (string, number, boolean, object,
+ * array, etc.).
+ */
+ @JsonProperty("metadata")
+ @ExcludeMissing
+ fun _metadata(): JsonField = metadata
+
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
private var validated: Boolean = false
- fun validate(): InnerMetadata = apply {
+ fun validate(): Metadata = apply {
if (validated) {
return@apply
}
+ metadata().ifPresent { it.validate() }
validated = true
}
@@ -1715,14 +1926,32 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- /** A builder for [InnerMetadata]. */
+ /** A builder for [Metadata]. */
class Builder internal constructor() {
+ private var metadata: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
- internal fun from(innerMetadata: InnerMetadata) = apply {
- additionalProperties = innerMetadata.additionalProperties.toMutableMap()
+ internal fun from(metadata: Metadata) = apply {
+ this.metadata = metadata.metadata
+ additionalProperties = metadata.additionalProperties.toMutableMap()
+ }
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a
+ * key-value pairs where the values can be of any type (string, number, boolean,
+ * object, array, etc.).
+ */
+ fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata))
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a
+ * key-value pairs where the values can be of any type (string, number, boolean,
+ * object, array, etc.).
+ */
+ fun metadata(metadata: JsonField) = apply {
+ this.metadata = metadata
}
fun additionalProperties(additionalProperties: Map) = apply {
@@ -1747,7 +1976,96 @@ private constructor(
keys.forEach(::removeAdditionalProperty)
}
- fun build(): InnerMetadata = InnerMetadata(additionalProperties.toImmutable())
+ fun build(): Metadata = Metadata(metadata, additionalProperties.toImmutable())
+ }
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a key-value
+ * pairs where the values can be of any type (string, number, boolean, object,
+ * array, etc.).
+ */
+ @NoAutoDetect
+ class InnerMetadata
+ @JsonCreator
+ private constructor(
+ @JsonAnySetter
+ private val additionalProperties: Map = immutableEmptyMap()
+ ) {
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ private var validated: Boolean = false
+
+ fun validate(): InnerMetadata = apply {
+ if (validated) {
+ return@apply
+ }
+
+ validated = true
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [InnerMetadata]. */
+ class Builder internal constructor() {
+
+ private var additionalProperties: MutableMap =
+ mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(innerMetadata: InnerMetadata) = apply {
+ additionalProperties = innerMetadata.additionalProperties.toMutableMap()
+ }
+
+ 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)
+ }
+
+ fun build(): InnerMetadata =
+ InnerMetadata(additionalProperties.toImmutable())
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is InnerMetadata && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "InnerMetadata{additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
@@ -1755,17 +2073,17 @@ private constructor(
return true
}
- return /* spotless:off */ other is InnerMetadata && additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Metadata && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
}
/* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+ private val hashCode: Int by lazy { Objects.hash(metadata, additionalProperties) }
/* spotless:on */
override fun hashCode(): Int = hashCode
override fun toString() =
- "InnerMetadata{additionalProperties=$additionalProperties}"
+ "Metadata{metadata=$metadata, additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
@@ -1773,7 +2091,7 @@ private constructor(
return true
}
- return /* spotless:off */ other is Metadata && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Attributes && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
}
/* spotless:off */
@@ -1783,7 +2101,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "Metadata{metadata=$metadata, additionalProperties=$additionalProperties}"
+ "Attributes{metadata=$metadata, additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
@@ -1915,7 +2233,7 @@ private constructor(
private val amount: JsonField = JsonMissing.of(),
@JsonProperty("attributes")
@ExcludeMissing
- private val attributes: JsonField = JsonMissing.of(),
+ private val attributes: JsonField = JsonMissing.of(),
@JsonProperty("currency")
@ExcludeMissing
private val currency: JsonField = JsonMissing.of(),
@@ -1933,7 +2251,7 @@ private constructor(
/** The tax amount in cents. */
fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount"))
- fun attributes(): Optional =
+ fun attributes(): Optional =
Optional.ofNullable(attributes.getNullable("attributes"))
/** The currency code. */
@@ -1953,7 +2271,7 @@ private constructor(
@JsonProperty("attributes")
@ExcludeMissing
- fun _attributes(): JsonField = attributes
+ fun _attributes(): JsonField = attributes
/** The currency code. */
@JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency
@@ -1998,7 +2316,7 @@ private constructor(
class Builder internal constructor() {
private var amount: JsonField = JsonMissing.of()
- private var attributes: JsonField = JsonMissing.of()
+ private var attributes: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var employer: JsonField = JsonMissing.of()
private var name: JsonField = JsonMissing.of()
@@ -2029,11 +2347,13 @@ private constructor(
/** The tax amount in cents. */
fun amount(amount: JsonField) = apply { this.amount = amount }
- fun attributes(attributes: Metadata?) = attributes(JsonField.ofNullable(attributes))
+ fun attributes(attributes: Attributes?) = attributes(JsonField.ofNullable(attributes))
- fun attributes(attributes: Optional) = attributes(attributes.orElse(null))
+ fun attributes(attributes: Optional) = attributes(attributes.orElse(null))
- fun attributes(attributes: JsonField) = apply { this.attributes = attributes }
+ fun attributes(attributes: JsonField) = apply {
+ this.attributes = attributes
+ }
/** The currency code. */
fun currency(currency: String?) = currency(JsonField.ofNullable(currency))
@@ -2107,30 +2427,22 @@ private constructor(
}
@NoAutoDetect
- class Metadata
+ class Attributes
@JsonCreator
private constructor(
@JsonProperty("metadata")
@ExcludeMissing
- private val metadata: JsonField = JsonMissing.of(),
+ private val metadata: JsonField = JsonMissing.of(),
@JsonAnySetter
private val additionalProperties: Map = immutableEmptyMap(),
) {
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value pairs
- * where the values can be of any type (string, number, boolean, object, array, etc.).
- */
- fun metadata(): Optional =
+ fun metadata(): Optional =
Optional.ofNullable(metadata.getNullable("metadata"))
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value pairs
- * where the values can be of any type (string, number, boolean, object, array, etc.).
- */
@JsonProperty("metadata")
@ExcludeMissing
- fun _metadata(): JsonField = metadata
+ fun _metadata(): JsonField = metadata
@JsonAnyGetter
@ExcludeMissing
@@ -2138,7 +2450,7 @@ private constructor(
private var validated: Boolean = false
- fun validate(): Metadata = apply {
+ fun validate(): Attributes = apply {
if (validated) {
return@apply
}
@@ -2154,33 +2466,21 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- /** A builder for [Metadata]. */
+ /** A builder for [Attributes]. */
class Builder internal constructor() {
- private var metadata: JsonField = JsonMissing.of()
+ private var metadata: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
- internal fun from(metadata: Metadata) = apply {
- this.metadata = metadata.metadata
- additionalProperties = metadata.additionalProperties.toMutableMap()
+ internal fun from(attributes: Attributes) = apply {
+ metadata = attributes.metadata
+ additionalProperties = attributes.additionalProperties.toMutableMap()
}
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value
- * pairs where the values can be of any type (string, number, boolean, object,
- * array, etc.).
- */
- fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata))
+ fun metadata(metadata: Metadata) = metadata(JsonField.of(metadata))
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value
- * pairs where the values can be of any type (string, number, boolean, object,
- * array, etc.).
- */
- fun metadata(metadata: JsonField) = apply {
- this.metadata = metadata
- }
+ fun metadata(metadata: JsonField) = apply { this.metadata = metadata }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
@@ -2204,32 +2504,49 @@ private constructor(
keys.forEach(::removeAdditionalProperty)
}
- fun build(): Metadata = Metadata(metadata, additionalProperties.toImmutable())
+ fun build(): Attributes = Attributes(metadata, additionalProperties.toImmutable())
}
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value pairs
- * where the values can be of any type (string, number, boolean, object, array, etc.).
- */
@NoAutoDetect
- class InnerMetadata
+ class Metadata
@JsonCreator
private constructor(
+ @JsonProperty("metadata")
+ @ExcludeMissing
+ private val metadata: JsonField = JsonMissing.of(),
@JsonAnySetter
- private val additionalProperties: Map = immutableEmptyMap()
+ private val additionalProperties: Map = immutableEmptyMap(),
) {
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a key-value
+ * pairs where the values can be of any type (string, number, boolean, object,
+ * array, etc.).
+ */
+ fun metadata(): Optional =
+ Optional.ofNullable(metadata.getNullable("metadata"))
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a key-value
+ * pairs where the values can be of any type (string, number, boolean, object,
+ * array, etc.).
+ */
+ @JsonProperty("metadata")
+ @ExcludeMissing
+ fun _metadata(): JsonField = metadata
+
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
private var validated: Boolean = false
- fun validate(): InnerMetadata = apply {
+ fun validate(): Metadata = apply {
if (validated) {
return@apply
}
+ metadata().ifPresent { it.validate() }
validated = true
}
@@ -2240,14 +2557,32 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- /** A builder for [InnerMetadata]. */
+ /** A builder for [Metadata]. */
class Builder internal constructor() {
+ private var metadata: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
- internal fun from(innerMetadata: InnerMetadata) = apply {
- additionalProperties = innerMetadata.additionalProperties.toMutableMap()
+ internal fun from(metadata: Metadata) = apply {
+ this.metadata = metadata.metadata
+ additionalProperties = metadata.additionalProperties.toMutableMap()
+ }
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a
+ * key-value pairs where the values can be of any type (string, number, boolean,
+ * object, array, etc.).
+ */
+ fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata))
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a
+ * key-value pairs where the values can be of any type (string, number, boolean,
+ * object, array, etc.).
+ */
+ fun metadata(metadata: JsonField) = apply {
+ this.metadata = metadata
}
fun additionalProperties(additionalProperties: Map) = apply {
@@ -2272,7 +2607,96 @@ private constructor(
keys.forEach(::removeAdditionalProperty)
}
- fun build(): InnerMetadata = InnerMetadata(additionalProperties.toImmutable())
+ fun build(): Metadata = Metadata(metadata, additionalProperties.toImmutable())
+ }
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a key-value
+ * pairs where the values can be of any type (string, number, boolean, object,
+ * array, etc.).
+ */
+ @NoAutoDetect
+ class InnerMetadata
+ @JsonCreator
+ private constructor(
+ @JsonAnySetter
+ private val additionalProperties: Map = immutableEmptyMap()
+ ) {
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ private var validated: Boolean = false
+
+ fun validate(): InnerMetadata = apply {
+ if (validated) {
+ return@apply
+ }
+
+ validated = true
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [InnerMetadata]. */
+ class Builder internal constructor() {
+
+ private var additionalProperties: MutableMap =
+ mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(innerMetadata: InnerMetadata) = apply {
+ additionalProperties = innerMetadata.additionalProperties.toMutableMap()
+ }
+
+ 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)
+ }
+
+ fun build(): InnerMetadata =
+ InnerMetadata(additionalProperties.toImmutable())
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is InnerMetadata && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "InnerMetadata{additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
@@ -2280,17 +2704,17 @@ private constructor(
return true
}
- return /* spotless:off */ other is InnerMetadata && additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Metadata && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
}
/* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+ private val hashCode: Int by lazy { Objects.hash(metadata, additionalProperties) }
/* spotless:on */
override fun hashCode(): Int = hashCode
override fun toString() =
- "InnerMetadata{additionalProperties=$additionalProperties}"
+ "Metadata{metadata=$metadata, additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
@@ -2298,7 +2722,7 @@ private constructor(
return true
}
- return /* spotless:off */ other is Metadata && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Attributes && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
}
/* spotless:off */
@@ -2308,7 +2732,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "Metadata{metadata=$metadata, additionalProperties=$additionalProperties}"
+ "Attributes{metadata=$metadata, additionalProperties=$additionalProperties}"
}
/** The type of taxes. */
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListParams.kt
index fe12118b..0b6a7c84 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListParams.kt
@@ -41,6 +41,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): PayrollPayGroupListParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt
index d73f15c9..2940b01d 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt
@@ -27,6 +27,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): ProviderListParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt
index c487b917..521e6d18 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt
@@ -149,6 +149,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): SandboxConnectionAccountUpdateParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt
index 69d1eaeb..3bca9b07 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt
@@ -2361,6 +2361,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): SandboxDirectoryCreateParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParams.kt
index 8bde74ca..b13948c7 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParams.kt
@@ -27,6 +27,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): SandboxJobConfigurationRetrieveParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt
index f28985d0..27e89a23 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt
@@ -207,6 +207,8 @@ private constructor(
companion object {
+ @JvmStatic fun none(): SandboxPaymentCreateParams = builder().build()
+
@JvmStatic fun builder() = Builder()
}
@@ -745,7 +747,7 @@ private constructor(
private val amount: JsonField = JsonMissing.of(),
@JsonProperty("attributes")
@ExcludeMissing
- private val attributes: JsonField = JsonMissing.of(),
+ private val attributes: JsonField = JsonMissing.of(),
@JsonProperty("currency")
@ExcludeMissing
private val currency: JsonField = JsonMissing.of(),
@@ -765,7 +767,7 @@ private constructor(
/** The earnings amount in cents. */
fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount"))
- fun attributes(): Optional =
+ fun attributes(): Optional =
Optional.ofNullable(attributes.getNullable("attributes"))
/** The earnings currency code. */
@@ -788,7 +790,7 @@ private constructor(
@JsonProperty("attributes")
@ExcludeMissing
- fun _attributes(): JsonField = attributes
+ fun _attributes(): JsonField = attributes
/** The earnings currency code. */
@JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency
@@ -836,7 +838,7 @@ private constructor(
class Builder internal constructor() {
private var amount: JsonField = JsonMissing.of()
- private var attributes: JsonField = JsonMissing.of()
+ private var attributes: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var hours: JsonField = JsonMissing.of()
private var name: JsonField = JsonMissing.of()
@@ -867,11 +869,13 @@ private constructor(
/** The earnings amount in cents. */
fun amount(amount: JsonField) = apply { this.amount = amount }
- fun attributes(attributes: Metadata?) = attributes(JsonField.ofNullable(attributes))
+ fun attributes(attributes: Attributes?) =
+ attributes(JsonField.ofNullable(attributes))
- fun attributes(attributes: Optional) = attributes(attributes.orElse(null))
+ fun attributes(attributes: Optional) =
+ attributes(attributes.orElse(null))
- fun attributes(attributes: JsonField) = apply {
+ fun attributes(attributes: JsonField) = apply {
this.attributes = attributes
}
@@ -962,32 +966,22 @@ private constructor(
}
@NoAutoDetect
- class Metadata
+ class Attributes
@JsonCreator
private constructor(
@JsonProperty("metadata")
@ExcludeMissing
- private val metadata: JsonField = JsonMissing.of(),
+ private val metadata: JsonField = JsonMissing.of(),
@JsonAnySetter
private val additionalProperties: Map = immutableEmptyMap(),
) {
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value
- * pairs where the values can be of any type (string, number, boolean, object,
- * array, etc.).
- */
- fun metadata(): Optional =
+ fun metadata(): Optional =
Optional.ofNullable(metadata.getNullable("metadata"))
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value
- * pairs where the values can be of any type (string, number, boolean, object,
- * array, etc.).
- */
@JsonProperty("metadata")
@ExcludeMissing
- fun _metadata(): JsonField = metadata
+ fun _metadata(): JsonField = metadata
@JsonAnyGetter
@ExcludeMissing
@@ -995,7 +989,7 @@ private constructor(
private var validated: Boolean = false
- fun validate(): Metadata = apply {
+ fun validate(): Attributes = apply {
if (validated) {
return@apply
}
@@ -1011,33 +1005,21 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- /** A builder for [Metadata]. */
+ /** A builder for [Attributes]. */
class Builder internal constructor() {
- private var metadata: JsonField = JsonMissing.of()
+ private var metadata: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
- internal fun from(metadata: Metadata) = apply {
- this.metadata = metadata.metadata
- additionalProperties = metadata.additionalProperties.toMutableMap()
+ internal fun from(attributes: Attributes) = apply {
+ metadata = attributes.metadata
+ additionalProperties = attributes.additionalProperties.toMutableMap()
}
- /**
- * The metadata to be attached to the entity by existing rules. It is a
- * key-value pairs where the values can be of any type (string, number, boolean,
- * object, array, etc.).
- */
- fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata))
+ fun metadata(metadata: Metadata) = metadata(JsonField.of(metadata))
- /**
- * The metadata to be attached to the entity by existing rules. It is a
- * key-value pairs where the values can be of any type (string, number, boolean,
- * object, array, etc.).
- */
- fun metadata(metadata: JsonField) = apply {
- this.metadata = metadata
- }
+ fun metadata(metadata: JsonField) = apply { this.metadata = metadata }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
@@ -1061,33 +1043,50 @@ private constructor(
keys.forEach(::removeAdditionalProperty)
}
- fun build(): Metadata = Metadata(metadata, additionalProperties.toImmutable())
+ fun build(): Attributes =
+ Attributes(metadata, additionalProperties.toImmutable())
}
- /**
- * The metadata to be attached to the entity by existing rules. It is a key-value
- * pairs where the values can be of any type (string, number, boolean, object,
- * array, etc.).
- */
@NoAutoDetect
- class InnerMetadata
+ class Metadata
@JsonCreator
private constructor(
+ @JsonProperty("metadata")
+ @ExcludeMissing
+ private val metadata: JsonField = JsonMissing.of(),
@JsonAnySetter
- private val additionalProperties: Map = immutableEmptyMap()
+ private val additionalProperties: Map = immutableEmptyMap(),
) {
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a
+ * key-value pairs where the values can be of any type (string, number, boolean,
+ * object, array, etc.).
+ */
+ fun metadata(): Optional =
+ Optional.ofNullable(metadata.getNullable("metadata"))
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a
+ * key-value pairs where the values can be of any type (string, number, boolean,
+ * object, array, etc.).
+ */
+ @JsonProperty("metadata")
+ @ExcludeMissing
+ fun _metadata(): JsonField = metadata
+
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
private var validated: Boolean = false
- fun validate(): InnerMetadata = apply {
+ fun validate(): Metadata = apply {
if (validated) {
return@apply
}
+ metadata().ifPresent { it.validate() }
validated = true
}
@@ -1098,15 +1097,33 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- /** A builder for [InnerMetadata]. */
+ /** A builder for [Metadata]. */
class Builder internal constructor() {
+ private var metadata: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
@JvmSynthetic
- internal fun from(innerMetadata: InnerMetadata) = apply {
- additionalProperties = innerMetadata.additionalProperties.toMutableMap()
+ internal fun from(metadata: Metadata) = apply {
+ this.metadata = metadata.metadata
+ additionalProperties = metadata.additionalProperties.toMutableMap()
+ }
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a
+ * key-value pairs where the values can be of any type (string, number,
+ * boolean, object, array, etc.).
+ */
+ fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata))
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a
+ * key-value pairs where the values can be of any type (string, number,
+ * boolean, object, array, etc.).
+ */
+ fun metadata(metadata: JsonField) = apply {
+ this.metadata = metadata
}
fun additionalProperties(additionalProperties: Map) =
@@ -1131,8 +1148,99 @@ private constructor(
keys.forEach(::removeAdditionalProperty)
}
- fun build(): InnerMetadata =
- InnerMetadata(additionalProperties.toImmutable())
+ fun build(): Metadata =
+ Metadata(metadata, additionalProperties.toImmutable())
+ }
+
+ /**
+ * The metadata to be attached to the entity by existing rules. It is a
+ * key-value pairs where the values can be of any type (string, number, boolean,
+ * object, array, etc.).
+ */
+ @NoAutoDetect
+ class InnerMetadata
+ @JsonCreator
+ private constructor(
+ @JsonAnySetter
+ private val additionalProperties: Map =
+ immutableEmptyMap()
+ ) {
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ private var validated: Boolean = false
+
+ fun validate(): InnerMetadata = apply {
+ if (validated) {
+ return@apply
+ }
+
+ validated = true
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [InnerMetadata]. */
+ class Builder internal constructor() {
+
+ private var additionalProperties: MutableMap