@@ -95,7 +95,7 @@ private constructor(
9595 Optional .ofNullable(controlPerson.getNullable(" control_person" ))
9696
9797 /* * Timestamp of when the account holder was created. */
98- fun created (): Optional < OffsetDateTime > = Optional .ofNullable( created.getNullable (" created" ) )
98+ fun created (): OffsetDateTime = created.getRequired (" created" )
9999
100100 /* *
101101 * < Deprecated. Use control_person.email when user_type == "BUSINESS". Use
@@ -843,8 +843,7 @@ private constructor(
843843 fun phoneNumbers (): List <String > = phoneNumbers.getRequired(" phone_numbers" )
844844
845845 /* * Globally unique identifier for the entity. */
846- fun entityToken (): Optional <String > =
847- Optional .ofNullable(entityToken.getNullable(" entity_token" ))
846+ fun entityToken (): String = entityToken.getRequired(" entity_token" )
848847
849848 /* *
850849 * Business's physical address - PO boxes, UPS drops, and FedEx drops are not acceptable;
@@ -1100,27 +1099,25 @@ private constructor(
11001099 private var hashCode: Int = 0
11011100
11021101 /* * Individual's current address */
1103- fun address (): Optional < Address > = Optional .ofNullable( address.getNullable (" address" ) )
1102+ fun address (): Address = address.getRequired (" address" )
11041103
11051104 /* * Individual's date of birth, as an RFC 3339 date. */
1106- fun dob (): Optional < String > = Optional .ofNullable( dob.getNullable (" dob" ) )
1105+ fun dob (): String = dob.getRequired (" dob" )
11071106
11081107 /* * Individual's email address. */
1109- fun email (): Optional < String > = Optional .ofNullable( email.getNullable (" email" ) )
1108+ fun email (): String = email.getRequired (" email" )
11101109
11111110 /* * Individual's first name, as it appears on government-issued identity documents. */
1112- fun firstName (): Optional < String > = Optional .ofNullable( firstName.getNullable (" first_name" ) )
1111+ fun firstName (): String = firstName.getRequired (" first_name" )
11131112
11141113 /* * Individual's last name, as it appears on government-issued identity documents. */
1115- fun lastName (): Optional < String > = Optional .ofNullable( lastName.getNullable (" last_name" ) )
1114+ fun lastName (): String = lastName.getRequired (" last_name" )
11161115
11171116 /* * Individual's phone number, entered in E.164 format. */
1118- fun phoneNumber (): Optional <String > =
1119- Optional .ofNullable(phoneNumber.getNullable(" phone_number" ))
1117+ fun phoneNumber (): String = phoneNumber.getRequired(" phone_number" )
11201118
11211119 /* * Globally unique identifier for the entity. */
1122- fun entityToken (): Optional <String > =
1123- Optional .ofNullable(entityToken.getNullable(" entity_token" ))
1120+ fun entityToken (): String = entityToken.getRequired(" entity_token" )
11241121
11251122 /* * Individual's current address */
11261123 @JsonProperty(" address" ) @ExcludeMissing fun _address () = address
@@ -1149,7 +1146,7 @@ private constructor(
11491146
11501147 fun validate (): AccountHolderIndividualResponse = apply {
11511148 if (! validated) {
1152- address().map { it. validate() }
1149+ address().validate()
11531150 dob()
11541151 email()
11551152 firstName()
0 commit comments