Skip to content

Commit

Permalink
feat(api): adds PrimeRates API (#378)
Browse files Browse the repository at this point in the history
- renames `credit_product_id` to `credit_product_token` for retrieving an ExtendedCredit
  • Loading branch information
stainless-app[bot] authored Nov 14, 2024
1 parent a4c69c6 commit ff0f86a
Show file tree
Hide file tree
Showing 23 changed files with 1,273 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 149
configured_endpoints: 151
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ import java.util.Objects

class CreditProductExtendedCreditRetrieveParams
constructor(
private val creditProductId: String,
private val creditProductToken: String,
private val additionalHeaders: Headers,
private val additionalQueryParams: QueryParams,
) {

fun creditProductId(): String = creditProductId
fun creditProductToken(): String = creditProductToken

internal fun getHeaders(): Headers = additionalHeaders

internal fun getQueryParams(): QueryParams = additionalQueryParams

fun getPathParam(index: Int): String {
return when (index) {
0 -> creditProductId
0 -> creditProductToken
else -> ""
}
}
Expand All @@ -37,15 +37,15 @@ constructor(
return true
}

return /* spotless:off */ other is CreditProductExtendedCreditRetrieveParams && this.creditProductId == other.creditProductId && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams /* spotless:on */
return /* spotless:off */ other is CreditProductExtendedCreditRetrieveParams && this.creditProductToken == other.creditProductToken && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams /* spotless:on */
}

override fun hashCode(): Int {
return /* spotless:off */ Objects.hash(creditProductId, additionalHeaders, additionalQueryParams) /* spotless:on */
return /* spotless:off */ Objects.hash(creditProductToken, additionalHeaders, additionalQueryParams) /* spotless:on */
}

override fun toString() =
"CreditProductExtendedCreditRetrieveParams{creditProductId=$creditProductId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
"CreditProductExtendedCreditRetrieveParams{creditProductToken=$creditProductToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"

fun toBuilder() = Builder().from(this)

Expand All @@ -57,20 +57,20 @@ constructor(
@NoAutoDetect
class Builder {

private var creditProductId: String? = null
private var creditProductToken: String? = null
private var additionalHeaders: Headers.Builder = Headers.builder()
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()

internal fun from(
creditProductExtendedCreditRetrieveParams: CreditProductExtendedCreditRetrieveParams
) = apply {
this.creditProductId = creditProductExtendedCreditRetrieveParams.creditProductId
this.creditProductToken = creditProductExtendedCreditRetrieveParams.creditProductToken
additionalHeaders(creditProductExtendedCreditRetrieveParams.additionalHeaders)
additionalQueryParams(creditProductExtendedCreditRetrieveParams.additionalQueryParams)
}

fun creditProductId(creditProductId: String) = apply {
this.creditProductId = creditProductId
fun creditProductToken(creditProductToken: String) = apply {
this.creditProductToken = creditProductToken
}

fun additionalHeaders(additionalHeaders: Headers) = apply {
Expand Down Expand Up @@ -173,7 +173,9 @@ constructor(

fun build(): CreditProductExtendedCreditRetrieveParams =
CreditProductExtendedCreditRetrieveParams(
checkNotNull(creditProductId) { "`creditProductId` is required but was not set" },
checkNotNull(creditProductToken) {
"`creditProductToken` is required but was not set"
},
additionalHeaders.build(),
additionalQueryParams.build(),
)
Expand Down
Loading

0 comments on commit ff0f86a

Please sign in to comment.