Skip to content

Commit baa01e1

Browse files
feat(api): api update
1 parent caab6c9 commit baa01e1

5 files changed

Lines changed: 43 additions & 3 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 20
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-3614380ba4315687bbaf6561e9872fd72dd876f9230ce690c35d7efc1250e808.yml
3-
openapi_spec_hash: f1aa17e08d0379766a61de68714c7c21
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-ffb96b6ba7020a8e2608ad727c330c6f353c037485dc1c1309aa86ea5549af15.yml
3+
openapi_spec_hash: 2b969dbfad500d6f8a8d1ccfcaae930c
44
config_hash: 4cd3173ea1cce7183640aae49cfbb374

brand-dev-java-core/src/main/kotlin/com/branddev/api/models/brand/BrandIdentifyFromTransactionParams.kt

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ private constructor(
2424
private val city: String?,
2525
private val countryGl: CountryGl?,
2626
private val forceLanguage: ForceLanguage?,
27+
private val highConfidenceOnly: Boolean?,
2728
private val maxSpeed: Boolean?,
2829
private val mcc: String?,
2930
private val phone: Double?,
@@ -47,6 +48,12 @@ private constructor(
4748
/** Optional parameter to force the language of the retrieved brand data. */
4849
fun forceLanguage(): Optional<ForceLanguage> = Optional.ofNullable(forceLanguage)
4950

51+
/**
52+
* When set to true, the API will perform an additional verification steps to ensure the
53+
* identified brand matches the transaction with high confidence. Defaults to false.
54+
*/
55+
fun highConfidenceOnly(): Optional<Boolean> = Optional.ofNullable(highConfidenceOnly)
56+
5057
/**
5158
* Optional parameter to optimize the API call for maximum speed. When set to true, the API will
5259
* skip time-consuming operations for faster response at the cost of less comprehensive data.
@@ -95,6 +102,7 @@ private constructor(
95102
private var city: String? = null
96103
private var countryGl: CountryGl? = null
97104
private var forceLanguage: ForceLanguage? = null
105+
private var highConfidenceOnly: Boolean? = null
98106
private var maxSpeed: Boolean? = null
99107
private var mcc: String? = null
100108
private var phone: Double? = null
@@ -109,6 +117,7 @@ private constructor(
109117
city = brandIdentifyFromTransactionParams.city
110118
countryGl = brandIdentifyFromTransactionParams.countryGl
111119
forceLanguage = brandIdentifyFromTransactionParams.forceLanguage
120+
highConfidenceOnly = brandIdentifyFromTransactionParams.highConfidenceOnly
112121
maxSpeed = brandIdentifyFromTransactionParams.maxSpeed
113122
mcc = brandIdentifyFromTransactionParams.mcc
114123
phone = brandIdentifyFromTransactionParams.phone
@@ -147,6 +156,28 @@ private constructor(
147156
fun forceLanguage(forceLanguage: Optional<ForceLanguage>) =
148157
forceLanguage(forceLanguage.getOrNull())
149158

159+
/**
160+
* When set to true, the API will perform an additional verification steps to ensure the
161+
* identified brand matches the transaction with high confidence. Defaults to false.
162+
*/
163+
fun highConfidenceOnly(highConfidenceOnly: Boolean?) = apply {
164+
this.highConfidenceOnly = highConfidenceOnly
165+
}
166+
167+
/**
168+
* Alias for [Builder.highConfidenceOnly].
169+
*
170+
* This unboxed primitive overload exists for backwards compatibility.
171+
*/
172+
fun highConfidenceOnly(highConfidenceOnly: Boolean) =
173+
highConfidenceOnly(highConfidenceOnly as Boolean?)
174+
175+
/**
176+
* Alias for calling [Builder.highConfidenceOnly] with `highConfidenceOnly.orElse(null)`.
177+
*/
178+
fun highConfidenceOnly(highConfidenceOnly: Optional<Boolean>) =
179+
highConfidenceOnly(highConfidenceOnly.getOrNull())
180+
150181
/**
151182
* Optional parameter to optimize the API call for maximum speed. When set to true, the API
152183
* will skip time-consuming operations for faster response at the cost of less comprehensive
@@ -318,6 +349,7 @@ private constructor(
318349
city,
319350
countryGl,
320351
forceLanguage,
352+
highConfidenceOnly,
321353
maxSpeed,
322354
mcc,
323355
phone,
@@ -336,6 +368,7 @@ private constructor(
336368
city?.let { put("city", it) }
337369
countryGl?.let { put("country_gl", it.toString()) }
338370
forceLanguage?.let { put("force_language", it.toString()) }
371+
highConfidenceOnly?.let { put("high_confidence_only", it.toString()) }
339372
maxSpeed?.let { put("maxSpeed", it.toString()) }
340373
mcc?.let { put("mcc", it) }
341374
phone?.let { put("phone", it.toString()) }
@@ -2341,6 +2374,7 @@ private constructor(
23412374
city == other.city &&
23422375
countryGl == other.countryGl &&
23432376
forceLanguage == other.forceLanguage &&
2377+
highConfidenceOnly == other.highConfidenceOnly &&
23442378
maxSpeed == other.maxSpeed &&
23452379
mcc == other.mcc &&
23462380
phone == other.phone &&
@@ -2355,6 +2389,7 @@ private constructor(
23552389
city,
23562390
countryGl,
23572391
forceLanguage,
2392+
highConfidenceOnly,
23582393
maxSpeed,
23592394
mcc,
23602395
phone,
@@ -2364,5 +2399,5 @@ private constructor(
23642399
)
23652400

23662401
override fun toString() =
2367-
"BrandIdentifyFromTransactionParams{transactionInfo=$transactionInfo, city=$city, countryGl=$countryGl, forceLanguage=$forceLanguage, maxSpeed=$maxSpeed, mcc=$mcc, phone=$phone, timeoutMs=$timeoutMs, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
2402+
"BrandIdentifyFromTransactionParams{transactionInfo=$transactionInfo, city=$city, countryGl=$countryGl, forceLanguage=$forceLanguage, highConfidenceOnly=$highConfidenceOnly, maxSpeed=$maxSpeed, mcc=$mcc, phone=$phone, timeoutMs=$timeoutMs, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
23682403
}

brand-dev-java-core/src/test/kotlin/com/branddev/api/models/brand/BrandIdentifyFromTransactionParamsTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ internal class BrandIdentifyFromTransactionParamsTest {
1515
.city("city")
1616
.countryGl(BrandIdentifyFromTransactionParams.CountryGl.AD)
1717
.forceLanguage(BrandIdentifyFromTransactionParams.ForceLanguage.ALBANIAN)
18+
.highConfidenceOnly(true)
1819
.maxSpeed(true)
1920
.mcc("mcc")
2021
.phone(0.0)
@@ -30,6 +31,7 @@ internal class BrandIdentifyFromTransactionParamsTest {
3031
.city("city")
3132
.countryGl(BrandIdentifyFromTransactionParams.CountryGl.AD)
3233
.forceLanguage(BrandIdentifyFromTransactionParams.ForceLanguage.ALBANIAN)
34+
.highConfidenceOnly(true)
3335
.maxSpeed(true)
3436
.mcc("mcc")
3537
.phone(0.0)
@@ -45,6 +47,7 @@ internal class BrandIdentifyFromTransactionParamsTest {
4547
.put("city", "city")
4648
.put("country_gl", "ad")
4749
.put("force_language", "albanian")
50+
.put("high_confidence_only", "true")
4851
.put("maxSpeed", "true")
4952
.put("mcc", "mcc")
5053
.put("phone", "0.0")

brand-dev-java-core/src/test/kotlin/com/branddev/api/services/async/BrandServiceAsyncTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ internal class BrandServiceAsyncTest {
165165
.city("city")
166166
.countryGl(BrandIdentifyFromTransactionParams.CountryGl.AD)
167167
.forceLanguage(BrandIdentifyFromTransactionParams.ForceLanguage.ALBANIAN)
168+
.highConfidenceOnly(true)
168169
.maxSpeed(true)
169170
.mcc("mcc")
170171
.phone(0.0)

brand-dev-java-core/src/test/kotlin/com/branddev/api/services/blocking/BrandServiceTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ internal class BrandServiceTest {
158158
.city("city")
159159
.countryGl(BrandIdentifyFromTransactionParams.CountryGl.AD)
160160
.forceLanguage(BrandIdentifyFromTransactionParams.ForceLanguage.ALBANIAN)
161+
.highConfidenceOnly(true)
161162
.maxSpeed(true)
162163
.mcc("mcc")
163164
.phone(0.0)

0 commit comments

Comments
 (0)