Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 238
openapi_spec_hash: fa67b808ca579e929aea7dd917b18cf9
openapi_spec_hash: 7f33ff43b4b498d0954b28032669a1a6
config_hash: 2ae0d8aaecf01b38cbf9f9e112822c23
Original file line number Diff line number Diff line change
Expand Up @@ -1011,8 +1011,8 @@ private constructor(
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val city: JsonField<String>,
private val line1: JsonField<String>,
private val country: JsonField<String>,
private val line1: JsonField<String>,
private val line2: JsonField<String>,
private val state: JsonField<String>,
private val zip: JsonField<String>,
Expand All @@ -1022,14 +1022,14 @@ private constructor(
@JsonCreator
private constructor(
@JsonProperty("city") @ExcludeMissing city: JsonField<String> = JsonMissing.of(),
@JsonProperty("line1") @ExcludeMissing line1: JsonField<String> = JsonMissing.of(),
@JsonProperty("country")
@ExcludeMissing
country: JsonField<String> = JsonMissing.of(),
@JsonProperty("line1") @ExcludeMissing line1: JsonField<String> = JsonMissing.of(),
@JsonProperty("line2") @ExcludeMissing line2: JsonField<String> = JsonMissing.of(),
@JsonProperty("state") @ExcludeMissing state: JsonField<String> = JsonMissing.of(),
@JsonProperty("zip") @ExcludeMissing zip: JsonField<String> = JsonMissing.of(),
) : this(city, line1, country, line2, state, zip, mutableMapOf())
) : this(city, country, line1, line2, state, zip, mutableMapOf())

/**
* The city, district, town, or village of the address.
Expand All @@ -1041,22 +1041,22 @@ private constructor(
fun city(): String = city.getRequired("city")

/**
* The first line of the address. This is usually the street number and street.
* The two-letter ISO 3166-1 alpha-2 code for the country of the address.
*
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected
* value).
*/
fun line1(): String = line1.getRequired("line1")
fun country(): String = country.getRequired("country")

/**
* The two-letter ISO 3166-1 alpha-2 code for the country of the address. Defaults to
* `US`.
* The first line of the address. This is usually the street number and street.
*
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
* if the server responded with an unexpected value).
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected
* value).
*/
fun country(): Optional<String> = country.getOptional("country")
fun line1(): String = line1.getRequired("line1")

/**
* The second line of the address. This might be the floor or room number.
Expand Down Expand Up @@ -1091,18 +1091,18 @@ private constructor(
@JsonProperty("city") @ExcludeMissing fun _city(): JsonField<String> = city

/**
* Returns the raw JSON value of [line1].
* Returns the raw JSON value of [country].
*
* Unlike [line1], this method doesn't throw if the JSON field has an unexpected type.
* Unlike [country], this method doesn't throw if the JSON field has an unexpected type.
*/
@JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField<String> = line1
@JsonProperty("country") @ExcludeMissing fun _country(): JsonField<String> = country

/**
* Returns the raw JSON value of [country].
* Returns the raw JSON value of [line1].
*
* Unlike [country], this method doesn't throw if the JSON field has an unexpected type.
* Unlike [line1], this method doesn't throw if the JSON field has an unexpected type.
*/
@JsonProperty("country") @ExcludeMissing fun _country(): JsonField<String> = country
@JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField<String> = line1

/**
* Returns the raw JSON value of [line2].
Expand Down Expand Up @@ -1145,6 +1145,7 @@ private constructor(
* The following fields are required:
* ```java
* .city()
* .country()
* .line1()
* ```
*/
Expand All @@ -1155,8 +1156,8 @@ private constructor(
class Builder internal constructor() {

private var city: JsonField<String>? = null
private var country: JsonField<String>? = null
private var line1: JsonField<String>? = null
private var country: JsonField<String> = JsonMissing.of()
private var line2: JsonField<String> = JsonMissing.of()
private var state: JsonField<String> = JsonMissing.of()
private var zip: JsonField<String> = JsonMissing.of()
Expand All @@ -1165,8 +1166,8 @@ private constructor(
@JvmSynthetic
internal fun from(address: Address) = apply {
city = address.city
line1 = address.line1
country = address.country
line1 = address.line1
line2 = address.line2
state = address.state
zip = address.zip
Expand All @@ -1185,6 +1186,18 @@ private constructor(
*/
fun city(city: JsonField<String>) = apply { this.city = city }

/** The two-letter ISO 3166-1 alpha-2 code for the country of the address. */
fun country(country: String) = country(JsonField.of(country))

/**
* Sets [Builder.country] to an arbitrary JSON value.
*
* You should usually call [Builder.country] with a well-typed [String] value
* instead. This method is primarily for setting the field to an undocumented or not
* yet supported value.
*/
fun country(country: JsonField<String>) = apply { this.country = country }

/** The first line of the address. This is usually the street number and street. */
fun line1(line1: String) = line1(JsonField.of(line1))

Expand All @@ -1197,21 +1210,6 @@ private constructor(
*/
fun line1(line1: JsonField<String>) = apply { this.line1 = line1 }

/**
* The two-letter ISO 3166-1 alpha-2 code for the country of the address. Defaults
* to `US`.
*/
fun country(country: String) = country(JsonField.of(country))

/**
* Sets [Builder.country] to an arbitrary JSON value.
*
* You should usually call [Builder.country] with a well-typed [String] value
* instead. This method is primarily for setting the field to an undocumented or not
* yet supported value.
*/
fun country(country: JsonField<String>) = apply { this.country = country }

/** The second line of the address. This might be the floor or room number. */
fun line2(line2: String) = line2(JsonField.of(line2))

Expand Down Expand Up @@ -1281,6 +1279,7 @@ private constructor(
* The following fields are required:
* ```java
* .city()
* .country()
* .line1()
* ```
*
Expand All @@ -1289,8 +1288,8 @@ private constructor(
fun build(): Address =
Address(
checkRequired("city", city),
checkRequired("country", country),
checkRequired("line1", line1),
country,
line2,
state,
zip,
Expand All @@ -1316,8 +1315,8 @@ private constructor(
}

city()
line1()
country()
line1()
line2()
state()
zip()
Expand All @@ -1341,8 +1340,8 @@ private constructor(
@JvmSynthetic
internal fun validity(): Int =
(if (city.asKnown().isPresent) 1 else 0) +
(if (line1.asKnown().isPresent) 1 else 0) +
(if (country.asKnown().isPresent) 1 else 0) +
(if (line1.asKnown().isPresent) 1 else 0) +
(if (line2.asKnown().isPresent) 1 else 0) +
(if (state.asKnown().isPresent) 1 else 0) +
(if (zip.asKnown().isPresent) 1 else 0)
Expand All @@ -1354,22 +1353,22 @@ private constructor(

return other is Address &&
city == other.city &&
line1 == other.line1 &&
country == other.country &&
line1 == other.line1 &&
line2 == other.line2 &&
state == other.state &&
zip == other.zip &&
additionalProperties == other.additionalProperties
}

private val hashCode: Int by lazy {
Objects.hash(city, line1, country, line2, state, zip, additionalProperties)
Objects.hash(city, country, line1, line2, state, zip, additionalProperties)
}

override fun hashCode(): Int = hashCode

override fun toString() =
"Address{city=$city, line1=$line1, country=$country, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}"
"Address{city=$city, country=$country, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}"
}

/** A means of verifying the person's identity. */
Expand Down
Loading
Loading