-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): add
get spend_limits
endpoints to cards
and accounts
- Loading branch information
1 parent
6edf142
commit b72eee5
Showing
19 changed files
with
1,156 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
configured_endpoints: 104 | ||
configured_endpoints: 106 |
126 changes: 126 additions & 0 deletions
126
lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountRetrieveSpendLimitsParams.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
// File generated from our OpenAPI spec by Stainless. | ||
|
||
package com.lithic.api.models | ||
|
||
import com.lithic.api.core.NoAutoDetect | ||
import com.lithic.api.core.toUnmodifiable | ||
import com.lithic.api.models.* | ||
import java.util.Objects | ||
|
||
class AccountRetrieveSpendLimitsParams | ||
constructor( | ||
private val accountToken: String, | ||
private val additionalQueryParams: Map<String, List<String>>, | ||
private val additionalHeaders: Map<String, List<String>>, | ||
) { | ||
|
||
fun accountToken(): String = accountToken | ||
|
||
internal fun getQueryParams(): Map<String, List<String>> = additionalQueryParams | ||
|
||
internal fun getHeaders(): Map<String, List<String>> = additionalHeaders | ||
|
||
fun getPathParam(index: Int): String { | ||
return when (index) { | ||
0 -> accountToken | ||
else -> "" | ||
} | ||
} | ||
|
||
fun _additionalQueryParams(): Map<String, List<String>> = additionalQueryParams | ||
|
||
fun _additionalHeaders(): Map<String, List<String>> = additionalHeaders | ||
|
||
override fun equals(other: Any?): Boolean { | ||
if (this === other) { | ||
return true | ||
} | ||
|
||
return other is AccountRetrieveSpendLimitsParams && | ||
this.accountToken == other.accountToken && | ||
this.additionalQueryParams == other.additionalQueryParams && | ||
this.additionalHeaders == other.additionalHeaders | ||
} | ||
|
||
override fun hashCode(): Int { | ||
return Objects.hash( | ||
accountToken, | ||
additionalQueryParams, | ||
additionalHeaders, | ||
) | ||
} | ||
|
||
override fun toString() = | ||
"AccountRetrieveSpendLimitsParams{accountToken=$accountToken, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders}" | ||
|
||
fun toBuilder() = Builder().from(this) | ||
|
||
companion object { | ||
|
||
fun builder() = Builder() | ||
} | ||
|
||
@NoAutoDetect | ||
class Builder { | ||
|
||
private var accountToken: String? = null | ||
private var additionalQueryParams: MutableMap<String, MutableList<String>> = mutableMapOf() | ||
private var additionalHeaders: MutableMap<String, MutableList<String>> = mutableMapOf() | ||
|
||
internal fun from(accountRetrieveSpendLimitsParams: AccountRetrieveSpendLimitsParams) = | ||
apply { | ||
this.accountToken = accountRetrieveSpendLimitsParams.accountToken | ||
additionalQueryParams(accountRetrieveSpendLimitsParams.additionalQueryParams) | ||
additionalHeaders(accountRetrieveSpendLimitsParams.additionalHeaders) | ||
} | ||
|
||
fun accountToken(accountToken: String) = apply { this.accountToken = accountToken } | ||
|
||
fun additionalQueryParams(additionalQueryParams: Map<String, List<String>>) = apply { | ||
this.additionalQueryParams.clear() | ||
putAllQueryParams(additionalQueryParams) | ||
} | ||
|
||
fun putQueryParam(name: String, value: String) = apply { | ||
this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) | ||
} | ||
|
||
fun putQueryParams(name: String, values: Iterable<String>) = apply { | ||
this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) | ||
} | ||
|
||
fun putAllQueryParams(additionalQueryParams: Map<String, Iterable<String>>) = apply { | ||
additionalQueryParams.forEach(this::putQueryParams) | ||
} | ||
|
||
fun removeQueryParam(name: String) = apply { | ||
this.additionalQueryParams.put(name, mutableListOf()) | ||
} | ||
|
||
fun additionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply { | ||
this.additionalHeaders.clear() | ||
putAllHeaders(additionalHeaders) | ||
} | ||
|
||
fun putHeader(name: String, value: String) = apply { | ||
this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) | ||
} | ||
|
||
fun putHeaders(name: String, values: Iterable<String>) = apply { | ||
this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) | ||
} | ||
|
||
fun putAllHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply { | ||
additionalHeaders.forEach(this::putHeaders) | ||
} | ||
|
||
fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } | ||
|
||
fun build(): AccountRetrieveSpendLimitsParams = | ||
AccountRetrieveSpendLimitsParams( | ||
checkNotNull(accountToken) { "`accountToken` is required but was not set" }, | ||
additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), | ||
additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), | ||
) | ||
} | ||
} |
Oops, something went wrong.