Skip to content

Commit 8aa31c7

Browse files
feat(api): api update
1 parent 7ac04a1 commit 8aa31c7

File tree

5 files changed

+72
-6
lines changed

5 files changed

+72
-6
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 227
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-9e8b4907003e0149ea10d8c95b2facfbc011f366cea40fe86b5f02940e68998d.yml
3-
openapi_spec_hash: e93ee5c48421038334b8961b303465d6
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-0281c1d774b1853b7b09bbce88b8d6e0301179b68d53627c5940edd7d2f8b180.yml
3+
openapi_spec_hash: e22a9d6a4f0f32976d0ac9dd7e6d7dd0
44
config_hash: ca52ca9a2968f330339fd50c1a386e05

increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityUpdateParams.kt

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,7 @@ private constructor(
933933
private constructor(
934934
private val address: JsonField<Address>,
935935
private val email: JsonField<String>,
936+
private val incorporationState: JsonField<String>,
936937
private val industryCode: JsonField<String>,
937938
private val name: JsonField<String>,
938939
private val additionalProperties: MutableMap<String, JsonValue>,
@@ -942,11 +943,14 @@ private constructor(
942943
private constructor(
943944
@JsonProperty("address") @ExcludeMissing address: JsonField<Address> = JsonMissing.of(),
944945
@JsonProperty("email") @ExcludeMissing email: JsonField<String> = JsonMissing.of(),
946+
@JsonProperty("incorporation_state")
947+
@ExcludeMissing
948+
incorporationState: JsonField<String> = JsonMissing.of(),
945949
@JsonProperty("industry_code")
946950
@ExcludeMissing
947951
industryCode: JsonField<String> = JsonMissing.of(),
948952
@JsonProperty("name") @ExcludeMissing name: JsonField<String> = JsonMissing.of(),
949-
) : this(address, email, industryCode, name, mutableMapOf())
953+
) : this(address, email, incorporationState, industryCode, name, mutableMapOf())
950954

951955
/**
952956
* The entity's physical address. Mail receiving locations like PO Boxes and PMB's are
@@ -966,6 +970,16 @@ private constructor(
966970
*/
967971
fun email(): Optional<String> = email.getOptional("email")
968972

973+
/**
974+
* The two-letter United States Postal Service (USPS) abbreviation for the corporation's
975+
* state of incorporation.
976+
*
977+
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
978+
* the server responded with an unexpected value).
979+
*/
980+
fun incorporationState(): Optional<String> =
981+
incorporationState.getOptional("incorporation_state")
982+
969983
/**
970984
* The North American Industry Classification System (NAICS) code for the corporation's
971985
* primary line of business. This is a number, like `5132` for `Software Publishers`. A full
@@ -999,6 +1013,16 @@ private constructor(
9991013
*/
10001014
@JsonProperty("email") @ExcludeMissing fun _email(): JsonField<String> = email
10011015

1016+
/**
1017+
* Returns the raw JSON value of [incorporationState].
1018+
*
1019+
* Unlike [incorporationState], this method doesn't throw if the JSON field has an
1020+
* unexpected type.
1021+
*/
1022+
@JsonProperty("incorporation_state")
1023+
@ExcludeMissing
1024+
fun _incorporationState(): JsonField<String> = incorporationState
1025+
10021026
/**
10031027
* Returns the raw JSON value of [industryCode].
10041028
*
@@ -1039,6 +1063,7 @@ private constructor(
10391063

10401064
private var address: JsonField<Address> = JsonMissing.of()
10411065
private var email: JsonField<String> = JsonMissing.of()
1066+
private var incorporationState: JsonField<String> = JsonMissing.of()
10421067
private var industryCode: JsonField<String> = JsonMissing.of()
10431068
private var name: JsonField<String> = JsonMissing.of()
10441069
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
@@ -1047,6 +1072,7 @@ private constructor(
10471072
internal fun from(corporation: Corporation) = apply {
10481073
address = corporation.address
10491074
email = corporation.email
1075+
incorporationState = corporation.incorporationState
10501076
industryCode = corporation.industryCode
10511077
name = corporation.name
10521078
additionalProperties = corporation.additionalProperties.toMutableMap()
@@ -1082,6 +1108,24 @@ private constructor(
10821108
*/
10831109
fun email(email: JsonField<String>) = apply { this.email = email }
10841110

1111+
/**
1112+
* The two-letter United States Postal Service (USPS) abbreviation for the corporation's
1113+
* state of incorporation.
1114+
*/
1115+
fun incorporationState(incorporationState: String) =
1116+
incorporationState(JsonField.of(incorporationState))
1117+
1118+
/**
1119+
* Sets [Builder.incorporationState] to an arbitrary JSON value.
1120+
*
1121+
* You should usually call [Builder.incorporationState] with a well-typed [String] value
1122+
* instead. This method is primarily for setting the field to an undocumented or not yet
1123+
* supported value.
1124+
*/
1125+
fun incorporationState(incorporationState: JsonField<String>) = apply {
1126+
this.incorporationState = incorporationState
1127+
}
1128+
10851129
/**
10861130
* The North American Industry Classification System (NAICS) code for the corporation's
10871131
* primary line of business. This is a number, like `5132` for `Software Publishers`. A
@@ -1138,7 +1182,14 @@ private constructor(
11381182
* Further updates to this [Builder] will not mutate the returned instance.
11391183
*/
11401184
fun build(): Corporation =
1141-
Corporation(address, email, industryCode, name, additionalProperties.toMutableMap())
1185+
Corporation(
1186+
address,
1187+
email,
1188+
incorporationState,
1189+
industryCode,
1190+
name,
1191+
additionalProperties.toMutableMap(),
1192+
)
11421193
}
11431194

11441195
private var validated: Boolean = false
@@ -1150,6 +1201,7 @@ private constructor(
11501201

11511202
address().ifPresent { it.validate() }
11521203
email()
1204+
incorporationState()
11531205
industryCode()
11541206
name()
11551207
validated = true
@@ -1173,6 +1225,7 @@ private constructor(
11731225
internal fun validity(): Int =
11741226
(address.asKnown().getOrNull()?.validity() ?: 0) +
11751227
(if (email.asKnown().isPresent) 1 else 0) +
1228+
(if (incorporationState.asKnown().isPresent) 1 else 0) +
11761229
(if (industryCode.asKnown().isPresent) 1 else 0) +
11771230
(if (name.asKnown().isPresent) 1 else 0)
11781231

@@ -1508,19 +1561,27 @@ private constructor(
15081561
return other is Corporation &&
15091562
address == other.address &&
15101563
email == other.email &&
1564+
incorporationState == other.incorporationState &&
15111565
industryCode == other.industryCode &&
15121566
name == other.name &&
15131567
additionalProperties == other.additionalProperties
15141568
}
15151569

15161570
private val hashCode: Int by lazy {
1517-
Objects.hash(address, email, industryCode, name, additionalProperties)
1571+
Objects.hash(
1572+
address,
1573+
email,
1574+
incorporationState,
1575+
industryCode,
1576+
name,
1577+
additionalProperties,
1578+
)
15181579
}
15191580

15201581
override fun hashCode(): Int = hashCode
15211582

15221583
override fun toString() =
1523-
"Corporation{address=$address, email=$email, industryCode=$industryCode, name=$name, additionalProperties=$additionalProperties}"
1584+
"Corporation{address=$address, email=$email, incorporationState=$incorporationState, industryCode=$industryCode, name=$name, additionalProperties=$additionalProperties}"
15241585
}
15251586

15261587
/**

increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityUpdateParamsTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ internal class EntityUpdateParamsTest {
2424
.build()
2525
)
2626
.email("dev@stainless.com")
27+
.incorporationState("x")
2728
.industryCode("x")
2829
.name("x")
2930
.build()
@@ -112,6 +113,7 @@ internal class EntityUpdateParamsTest {
112113
.build()
113114
)
114115
.email("dev@stainless.com")
116+
.incorporationState("x")
115117
.industryCode("x")
116118
.name("x")
117119
.build()
@@ -188,6 +190,7 @@ internal class EntityUpdateParamsTest {
188190
.build()
189191
)
190192
.email("dev@stainless.com")
193+
.incorporationState("x")
191194
.industryCode("x")
192195
.name("x")
193196
.build()

increase-java-core/src/test/kotlin/com/increase/api/services/async/EntityServiceAsyncTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ internal class EntityServiceAsyncTest {
503503
.build()
504504
)
505505
.email("dev@stainless.com")
506+
.incorporationState("x")
506507
.industryCode("x")
507508
.name("x")
508509
.build()

increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EntityServiceTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ internal class EntityServiceTest {
501501
.build()
502502
)
503503
.email("dev@stainless.com")
504+
.incorporationState("x")
504505
.industryCode("x")
505506
.name("x")
506507
.build()

0 commit comments

Comments
 (0)