Skip to content

Commit c9ff6da

Browse files
feat(api): Add naics_code to account holder requests/responses
1 parent 2f605c1 commit c9ff6da

20 files changed

Lines changed: 394 additions & 28 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 176
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-ce2adff9b644ed4562b5342a4a43d0b40c98d43b4e063b4626f4ca5d342f1b92.yml
3-
openapi_spec_hash: fbc84b866ce96457261ac58b4e75c71d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-05d665e9c7e81d85c0d6629bf3898e2eb221268d677b772ef3da3891b25d8346.yml
3+
openapi_spec_hash: fd8900412ab9a393719dba3669d44d3a
44
config_hash: faacaff68ffb3a4d051f0a7b8442e099

lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolder.kt

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ private constructor(
3636
private val exemptionType: JsonField<ExemptionType>,
3737
private val externalId: JsonField<String>,
3838
private val individual: JsonField<AccountHolderIndividualResponse>,
39+
private val naicsCode: JsonField<String>,
3940
private val natureOfBusiness: JsonField<String>,
4041
private val phoneNumber: JsonField<String>,
4142
private val requiredDocuments: JsonField<List<RequiredDocument>>,
@@ -82,6 +83,7 @@ private constructor(
8283
@JsonProperty("individual")
8384
@ExcludeMissing
8485
individual: JsonField<AccountHolderIndividualResponse> = JsonMissing.of(),
86+
@JsonProperty("naics_code") @ExcludeMissing naicsCode: JsonField<String> = JsonMissing.of(),
8587
@JsonProperty("nature_of_business")
8688
@ExcludeMissing
8789
natureOfBusiness: JsonField<String> = JsonMissing.of(),
@@ -115,6 +117,7 @@ private constructor(
115117
exemptionType,
116118
externalId,
117119
individual,
120+
naicsCode,
118121
natureOfBusiness,
119122
phoneNumber,
120123
requiredDocuments,
@@ -245,6 +248,15 @@ private constructor(
245248
fun individual(): Optional<AccountHolderIndividualResponse> =
246249
individual.getOptional("individual")
247250

251+
/**
252+
* Only present when user_type == "BUSINESS". 6-digit North American Industry Classification
253+
* System (NAICS) code for the business.
254+
*
255+
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
256+
* server responded with an unexpected value).
257+
*/
258+
fun naicsCode(): Optional<String> = naicsCode.getOptional("naics_code")
259+
248260
/**
249261
* Only present when user_type == "BUSINESS". User-submitted description of the business.
250262
*
@@ -299,8 +311,8 @@ private constructor(
299311
/**
300312
* The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will be
301313
* present. If the type is "BUSINESS" then the "business_entity", "control_person",
302-
* "beneficial_owner_individuals", "nature_of_business", and "website_url" attributes will be
303-
* present.
314+
* "beneficial_owner_individuals", "naics_code", "nature_of_business", and "website_url"
315+
* attributes will be present.
304316
*
305317
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
306318
* server responded with an unexpected value).
@@ -430,6 +442,13 @@ private constructor(
430442
@ExcludeMissing
431443
fun _individual(): JsonField<AccountHolderIndividualResponse> = individual
432444

445+
/**
446+
* Returns the raw JSON value of [naicsCode].
447+
*
448+
* Unlike [naicsCode], this method doesn't throw if the JSON field has an unexpected type.
449+
*/
450+
@JsonProperty("naics_code") @ExcludeMissing fun _naicsCode(): JsonField<String> = naicsCode
451+
433452
/**
434453
* Returns the raw JSON value of [natureOfBusiness].
435454
*
@@ -545,6 +564,7 @@ private constructor(
545564
private var exemptionType: JsonField<ExemptionType> = JsonMissing.of()
546565
private var externalId: JsonField<String> = JsonMissing.of()
547566
private var individual: JsonField<AccountHolderIndividualResponse> = JsonMissing.of()
567+
private var naicsCode: JsonField<String> = JsonMissing.of()
548568
private var natureOfBusiness: JsonField<String> = JsonMissing.of()
549569
private var phoneNumber: JsonField<String> = JsonMissing.of()
550570
private var requiredDocuments: JsonField<MutableList<RequiredDocument>>? = null
@@ -572,6 +592,7 @@ private constructor(
572592
exemptionType = accountHolder.exemptionType
573593
externalId = accountHolder.externalId
574594
individual = accountHolder.individual
595+
naicsCode = accountHolder.naicsCode
575596
natureOfBusiness = accountHolder.natureOfBusiness
576597
phoneNumber = accountHolder.phoneNumber
577598
requiredDocuments = accountHolder.requiredDocuments.map { it.toMutableList() }
@@ -811,6 +832,21 @@ private constructor(
811832
this.individual = individual
812833
}
813834

835+
/**
836+
* Only present when user_type == "BUSINESS". 6-digit North American Industry Classification
837+
* System (NAICS) code for the business.
838+
*/
839+
fun naicsCode(naicsCode: String) = naicsCode(JsonField.of(naicsCode))
840+
841+
/**
842+
* Sets [Builder.naicsCode] to an arbitrary JSON value.
843+
*
844+
* You should usually call [Builder.naicsCode] with a well-typed [String] value instead.
845+
* This method is primarily for setting the field to an undocumented or not yet supported
846+
* value.
847+
*/
848+
fun naicsCode(naicsCode: JsonField<String>) = apply { this.naicsCode = naicsCode }
849+
814850
/**
815851
* Only present when user_type == "BUSINESS". User-submitted description of the business.
816852
*/
@@ -926,8 +962,8 @@ private constructor(
926962
/**
927963
* The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will
928964
* be present. If the type is "BUSINESS" then the "business_entity", "control_person",
929-
* "beneficial_owner_individuals", "nature_of_business", and "website_url" attributes will
930-
* be present.
965+
* "beneficial_owner_individuals", "naics_code", "nature_of_business", and "website_url"
966+
* attributes will be present.
931967
*/
932968
fun userType(userType: UserType) = userType(JsonField.of(userType))
933969

@@ -1013,6 +1049,7 @@ private constructor(
10131049
exemptionType,
10141050
externalId,
10151051
individual,
1052+
naicsCode,
10161053
natureOfBusiness,
10171054
phoneNumber,
10181055
(requiredDocuments ?: JsonMissing.of()).map { it.toImmutable() },
@@ -1044,6 +1081,7 @@ private constructor(
10441081
exemptionType().ifPresent { it.validate() }
10451082
externalId()
10461083
individual().ifPresent { it.validate() }
1084+
naicsCode()
10471085
natureOfBusiness()
10481086
phoneNumber()
10491087
requiredDocuments().ifPresent { it.forEach { it.validate() } }
@@ -1083,6 +1121,7 @@ private constructor(
10831121
(exemptionType.asKnown().getOrNull()?.validity() ?: 0) +
10841122
(if (externalId.asKnown().isPresent) 1 else 0) +
10851123
(individual.asKnown().getOrNull()?.validity() ?: 0) +
1124+
(if (naicsCode.asKnown().isPresent) 1 else 0) +
10861125
(if (natureOfBusiness.asKnown().isPresent) 1 else 0) +
10871126
(if (phoneNumber.asKnown().isPresent) 1 else 0) +
10881127
(requiredDocuments.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
@@ -2447,8 +2486,8 @@ private constructor(
24472486
/**
24482487
* The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will be
24492488
* present. If the type is "BUSINESS" then the "business_entity", "control_person",
2450-
* "beneficial_owner_individuals", "nature_of_business", and "website_url" attributes will be
2451-
* present.
2489+
* "beneficial_owner_individuals", "naics_code", "nature_of_business", and "website_url"
2490+
* attributes will be present.
24522491
*/
24532492
class UserType @JsonCreator private constructor(private val value: JsonField<String>) : Enum {
24542493

@@ -3226,6 +3265,7 @@ private constructor(
32263265
exemptionType == other.exemptionType &&
32273266
externalId == other.externalId &&
32283267
individual == other.individual &&
3268+
naicsCode == other.naicsCode &&
32293269
natureOfBusiness == other.natureOfBusiness &&
32303270
phoneNumber == other.phoneNumber &&
32313271
requiredDocuments == other.requiredDocuments &&
@@ -3251,6 +3291,7 @@ private constructor(
32513291
exemptionType,
32523292
externalId,
32533293
individual,
3294+
naicsCode,
32543295
natureOfBusiness,
32553296
phoneNumber,
32563297
requiredDocuments,
@@ -3266,5 +3307,5 @@ private constructor(
32663307
override fun hashCode(): Int = hashCode
32673308

32683309
override fun toString() =
3269-
"AccountHolder{token=$token, created=$created, accountToken=$accountToken, beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, businessAccountToken=$businessAccountToken, businessEntity=$businessEntity, controlPerson=$controlPerson, email=$email, exemptionType=$exemptionType, externalId=$externalId, individual=$individual, natureOfBusiness=$natureOfBusiness, phoneNumber=$phoneNumber, requiredDocuments=$requiredDocuments, status=$status, statusReasons=$statusReasons, userType=$userType, verificationApplication=$verificationApplication, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}"
3310+
"AccountHolder{token=$token, created=$created, accountToken=$accountToken, beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, businessAccountToken=$businessAccountToken, businessEntity=$businessEntity, controlPerson=$controlPerson, email=$email, exemptionType=$exemptionType, externalId=$externalId, individual=$individual, naicsCode=$naicsCode, natureOfBusiness=$natureOfBusiness, phoneNumber=$phoneNumber, requiredDocuments=$requiredDocuments, status=$status, statusReasons=$statusReasons, userType=$userType, verificationApplication=$verificationApplication, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}"
32703311
}

lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateParams.kt

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ private constructor(
453453
private val beneficialOwnerIndividuals: JsonField<List<KybIndividual>>,
454454
private val controlPerson: JsonField<KybIndividual>,
455455
private val externalId: JsonField<String>,
456+
private val naicsCode: JsonField<String>,
456457
private val natureOfBusiness: JsonField<String>,
457458
private val tosTimestamp: JsonField<String>,
458459
private val websiteUrl: JsonField<String>,
@@ -474,6 +475,9 @@ private constructor(
474475
@JsonProperty("external_id")
475476
@ExcludeMissing
476477
externalId: JsonField<String> = JsonMissing.of(),
478+
@JsonProperty("naics_code")
479+
@ExcludeMissing
480+
naicsCode: JsonField<String> = JsonMissing.of(),
477481
@JsonProperty("nature_of_business")
478482
@ExcludeMissing
479483
natureOfBusiness: JsonField<String> = JsonMissing.of(),
@@ -491,6 +495,7 @@ private constructor(
491495
beneficialOwnerIndividuals,
492496
controlPerson,
493497
externalId,
498+
naicsCode,
494499
natureOfBusiness,
495500
tosTimestamp,
496501
websiteUrl,
@@ -546,6 +551,14 @@ private constructor(
546551
*/
547552
fun externalId(): Optional<String> = externalId.getOptional("external_id")
548553

554+
/**
555+
* 6-digit North American Industry Classification System (NAICS) code for the business.
556+
*
557+
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if
558+
* the server responded with an unexpected value).
559+
*/
560+
fun naicsCode(): Optional<String> = naicsCode.getOptional("naics_code")
561+
549562
/**
550563
* Short description of the company's line of business (i.e., what does the company
551564
* do?).
@@ -623,6 +636,16 @@ private constructor(
623636
@ExcludeMissing
624637
fun _externalId(): JsonField<String> = externalId
625638

639+
/**
640+
* Returns the raw JSON value of [naicsCode].
641+
*
642+
* Unlike [naicsCode], this method doesn't throw if the JSON field has an unexpected
643+
* type.
644+
*/
645+
@JsonProperty("naics_code")
646+
@ExcludeMissing
647+
fun _naicsCode(): JsonField<String> = naicsCode
648+
626649
/**
627650
* Returns the raw JSON value of [natureOfBusiness].
628651
*
@@ -696,6 +719,7 @@ private constructor(
696719
null
697720
private var controlPerson: JsonField<KybIndividual> = JsonMissing.of()
698721
private var externalId: JsonField<String> = JsonMissing.of()
722+
private var naicsCode: JsonField<String> = JsonMissing.of()
699723
private var natureOfBusiness: JsonField<String> = JsonMissing.of()
700724
private var tosTimestamp: JsonField<String> = JsonMissing.of()
701725
private var websiteUrl: JsonField<String> = JsonMissing.of()
@@ -709,6 +733,7 @@ private constructor(
709733
kybDelegated.beneficialOwnerIndividuals.map { it.toMutableList() }
710734
controlPerson = kybDelegated.controlPerson
711735
externalId = kybDelegated.externalId
736+
naicsCode = kybDelegated.naicsCode
712737
natureOfBusiness = kybDelegated.natureOfBusiness
713738
tosTimestamp = kybDelegated.tosTimestamp
714739
websiteUrl = kybDelegated.websiteUrl
@@ -810,6 +835,21 @@ private constructor(
810835
this.externalId = externalId
811836
}
812837

838+
/**
839+
* 6-digit North American Industry Classification System (NAICS) code for the
840+
* business.
841+
*/
842+
fun naicsCode(naicsCode: String) = naicsCode(JsonField.of(naicsCode))
843+
844+
/**
845+
* Sets [Builder.naicsCode] to an arbitrary JSON value.
846+
*
847+
* You should usually call [Builder.naicsCode] with a well-typed [String] value
848+
* instead. This method is primarily for setting the field to an undocumented or not
849+
* yet supported value.
850+
*/
851+
fun naicsCode(naicsCode: JsonField<String>) = apply { this.naicsCode = naicsCode }
852+
813853
/**
814854
* Short description of the company's line of business (i.e., what does the company
815855
* do?).
@@ -912,6 +952,7 @@ private constructor(
912952
(beneficialOwnerIndividuals ?: JsonMissing.of()).map { it.toImmutable() },
913953
controlPerson,
914954
externalId,
955+
naicsCode,
915956
natureOfBusiness,
916957
tosTimestamp,
917958
websiteUrl,
@@ -931,6 +972,7 @@ private constructor(
931972
beneficialOwnerIndividuals().ifPresent { it.forEach { it.validate() } }
932973
controlPerson().ifPresent { it.validate() }
933974
externalId()
975+
naicsCode()
934976
natureOfBusiness()
935977
tosTimestamp()
936978
websiteUrl()
@@ -960,6 +1002,7 @@ private constructor(
9601002
} ?: 0) +
9611003
(controlPerson.asKnown().getOrNull()?.validity() ?: 0) +
9621004
(if (externalId.asKnown().isPresent) 1 else 0) +
1005+
(if (naicsCode.asKnown().isPresent) 1 else 0) +
9631006
(if (natureOfBusiness.asKnown().isPresent) 1 else 0) +
9641007
(if (tosTimestamp.asKnown().isPresent) 1 else 0) +
9651008
(if (websiteUrl.asKnown().isPresent) 1 else 0) +
@@ -2014,6 +2057,7 @@ private constructor(
20142057
beneficialOwnerIndividuals == other.beneficialOwnerIndividuals &&
20152058
controlPerson == other.controlPerson &&
20162059
externalId == other.externalId &&
2060+
naicsCode == other.naicsCode &&
20172061
natureOfBusiness == other.natureOfBusiness &&
20182062
tosTimestamp == other.tosTimestamp &&
20192063
websiteUrl == other.websiteUrl &&
@@ -2027,6 +2071,7 @@ private constructor(
20272071
beneficialOwnerIndividuals,
20282072
controlPerson,
20292073
externalId,
2074+
naicsCode,
20302075
natureOfBusiness,
20312076
tosTimestamp,
20322077
websiteUrl,
@@ -2038,7 +2083,7 @@ private constructor(
20382083
override fun hashCode(): Int = hashCode
20392084

20402085
override fun toString() =
2041-
"KybDelegated{businessEntity=$businessEntity, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, controlPerson=$controlPerson, externalId=$externalId, natureOfBusiness=$natureOfBusiness, tosTimestamp=$tosTimestamp, websiteUrl=$websiteUrl, workflow=$workflow, additionalProperties=$additionalProperties}"
2086+
"KybDelegated{businessEntity=$businessEntity, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, controlPerson=$controlPerson, externalId=$externalId, naicsCode=$naicsCode, natureOfBusiness=$natureOfBusiness, tosTimestamp=$tosTimestamp, websiteUrl=$websiteUrl, workflow=$workflow, additionalProperties=$additionalProperties}"
20422087
}
20432088
}
20442089

0 commit comments

Comments
 (0)