|
| 1 | +package io.weaviate.client6.v1.api.collections; |
| 2 | + |
| 3 | +import com.google.gson.annotations.SerializedName; |
| 4 | + |
| 5 | +public record PhoneNumber( |
| 6 | + /** Raw input data provided at creation. */ |
| 7 | + @SerializedName("input") String rawInput, |
| 8 | + /** |
| 9 | + * ISO 3166-1 alpha-2 country code. Required only if the raw input does not |
| 10 | + * include an explicit country code, e.g. {@code +31}. Only present if provided |
| 11 | + * by user. |
| 12 | + */ |
| 13 | + @SerializedName("defaultCountry") String defaultCountry, |
| 14 | + /** Numerical country code. Returned by Weaviate on read. */ |
| 15 | + @SerializedName("countryCode") Integer countryCode, |
| 16 | + /** |
| 17 | + * Phone number with numerical country code prepended. |
| 18 | + * Returned by Weaviate on read. |
| 19 | + */ |
| 20 | + @SerializedName("internationalFormatted") String internationalFormatted, |
| 21 | + /** |
| 22 | + * Numerical representation of the national number. |
| 23 | + * Returned by Weaviate on read. |
| 24 | + */ |
| 25 | + @SerializedName("national") Integer national, |
| 26 | + /** |
| 27 | + * Formatted national number. |
| 28 | + * Returned by Weaviate on read. |
| 29 | + */ |
| 30 | + @SerializedName("nationalFormatted") String nationalFormatted, |
| 31 | + /** |
| 32 | + * Whether the server recognized this number as valid. |
| 33 | + * Returned by Weaviate on read. |
| 34 | + */ |
| 35 | + @SerializedName("valid") Boolean valid) { |
| 36 | + |
| 37 | + /** |
| 38 | + * Create national phone number (without explicit country code), |
| 39 | + * e.g. {@code "020 1234567"} |
| 40 | + * |
| 41 | + * @param country ISO 3166-1 alpha-2 country code. |
| 42 | + * @param phoneNumber Phone number. |
| 43 | + * @return PhoneNumber |
| 44 | + */ |
| 45 | + public static PhoneNumber national(String country, String phoneNumber) { |
| 46 | + return new PhoneNumber(phoneNumber, country, null, null, null, null, null); |
| 47 | + } |
| 48 | + |
| 49 | + /** |
| 50 | + * Create a phone number with explicit country code, |
| 51 | + * e.g. {@code "+31 20 1234567"} |
| 52 | + * |
| 53 | + * @param phoneNumber Phone number. |
| 54 | + * @return PhoneNumber |
| 55 | + */ |
| 56 | + public static PhoneNumber international(String phoneNumber) { |
| 57 | + return new PhoneNumber(phoneNumber, null, null, null, null, null, null); |
| 58 | + } |
| 59 | +} |
0 commit comments