Skip to content

Commit c7aa63d

Browse files
feat(api): adds PrimeRates API (#628)
- renames `credit_product_id` to `credit_product_token` for retrieving an ExtendedCredit
1 parent 4c88f37 commit c7aa63d

File tree

15 files changed

+679
-18
lines changed

15 files changed

+679
-18
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 148
1+
configured_endpoints: 150

api.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,20 @@ from lithic.types.credit_products import ExtendedCredit
628628

629629
Methods:
630630

631-
- <code title="get /v1/credit_products/{credit_product_id}/extended_credit">client.credit_products.extended_credit.<a href="./src/lithic/resources/credit_products/extended_credit.py">retrieve</a>(credit_product_id) -> <a href="./src/lithic/types/credit_products/extended_credit.py">ExtendedCredit</a></code>
631+
- <code title="get /v1/credit_products/{credit_product_token}/extended_credit">client.credit_products.extended_credit.<a href="./src/lithic/resources/credit_products/extended_credit.py">retrieve</a>(credit_product_token) -> <a href="./src/lithic/types/credit_products/extended_credit.py">ExtendedCredit</a></code>
632+
633+
## PrimeRates
634+
635+
Types:
636+
637+
```python
638+
from lithic.types.credit_products import PrimeRateRetrieveResponse
639+
```
640+
641+
Methods:
642+
643+
- <code title="post /v1/credit_products/{credit_product_token}/prime_rates">client.credit_products.prime_rates.<a href="./src/lithic/resources/credit_products/prime_rates.py">create</a>(credit_product_token, \*\*<a href="src/lithic/types/credit_products/prime_rate_create_params.py">params</a>) -> None</code>
644+
- <code title="get /v1/credit_products/{credit_product_token}/prime_rates">client.credit_products.prime_rates.<a href="./src/lithic/resources/credit_products/prime_rates.py">retrieve</a>(credit_product_token, \*\*<a href="src/lithic/types/credit_products/prime_rate_retrieve_params.py">params</a>) -> <a href="./src/lithic/types/credit_products/prime_rate_retrieve_response.py">PrimeRateRetrieveResponse</a></code>
632645

633646
# ExternalPayments
634647

src/lithic/resources/credit_products/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from .prime_rates import (
4+
PrimeRates,
5+
AsyncPrimeRates,
6+
PrimeRatesWithRawResponse,
7+
AsyncPrimeRatesWithRawResponse,
8+
PrimeRatesWithStreamingResponse,
9+
AsyncPrimeRatesWithStreamingResponse,
10+
)
311
from .credit_products import (
412
CreditProducts,
513
AsyncCreditProducts,
@@ -24,6 +32,12 @@
2432
"AsyncExtendedCreditResourceWithRawResponse",
2533
"ExtendedCreditResourceWithStreamingResponse",
2634
"AsyncExtendedCreditResourceWithStreamingResponse",
35+
"PrimeRates",
36+
"AsyncPrimeRates",
37+
"PrimeRatesWithRawResponse",
38+
"AsyncPrimeRatesWithRawResponse",
39+
"PrimeRatesWithStreamingResponse",
40+
"AsyncPrimeRatesWithStreamingResponse",
2741
"CreditProducts",
2842
"AsyncCreditProducts",
2943
"CreditProductsWithRawResponse",

src/lithic/resources/credit_products/credit_products.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44

55
from ..._compat import cached_property
66
from ..._resource import SyncAPIResource, AsyncAPIResource
7+
from .prime_rates import (
8+
PrimeRates,
9+
AsyncPrimeRates,
10+
PrimeRatesWithRawResponse,
11+
AsyncPrimeRatesWithRawResponse,
12+
PrimeRatesWithStreamingResponse,
13+
AsyncPrimeRatesWithStreamingResponse,
14+
)
715
from .extended_credit import (
816
ExtendedCreditResource,
917
AsyncExtendedCreditResource,
@@ -21,6 +29,10 @@ class CreditProducts(SyncAPIResource):
2129
def extended_credit(self) -> ExtendedCreditResource:
2230
return ExtendedCreditResource(self._client)
2331

32+
@cached_property
33+
def prime_rates(self) -> PrimeRates:
34+
return PrimeRates(self._client)
35+
2436
@cached_property
2537
def with_raw_response(self) -> CreditProductsWithRawResponse:
2638
"""
@@ -46,6 +58,10 @@ class AsyncCreditProducts(AsyncAPIResource):
4658
def extended_credit(self) -> AsyncExtendedCreditResource:
4759
return AsyncExtendedCreditResource(self._client)
4860

61+
@cached_property
62+
def prime_rates(self) -> AsyncPrimeRates:
63+
return AsyncPrimeRates(self._client)
64+
4965
@cached_property
5066
def with_raw_response(self) -> AsyncCreditProductsWithRawResponse:
5167
"""
@@ -74,6 +90,10 @@ def __init__(self, credit_products: CreditProducts) -> None:
7490
def extended_credit(self) -> ExtendedCreditResourceWithRawResponse:
7591
return ExtendedCreditResourceWithRawResponse(self._credit_products.extended_credit)
7692

93+
@cached_property
94+
def prime_rates(self) -> PrimeRatesWithRawResponse:
95+
return PrimeRatesWithRawResponse(self._credit_products.prime_rates)
96+
7797

7898
class AsyncCreditProductsWithRawResponse:
7999
def __init__(self, credit_products: AsyncCreditProducts) -> None:
@@ -83,6 +103,10 @@ def __init__(self, credit_products: AsyncCreditProducts) -> None:
83103
def extended_credit(self) -> AsyncExtendedCreditResourceWithRawResponse:
84104
return AsyncExtendedCreditResourceWithRawResponse(self._credit_products.extended_credit)
85105

106+
@cached_property
107+
def prime_rates(self) -> AsyncPrimeRatesWithRawResponse:
108+
return AsyncPrimeRatesWithRawResponse(self._credit_products.prime_rates)
109+
86110

87111
class CreditProductsWithStreamingResponse:
88112
def __init__(self, credit_products: CreditProducts) -> None:
@@ -92,6 +116,10 @@ def __init__(self, credit_products: CreditProducts) -> None:
92116
def extended_credit(self) -> ExtendedCreditResourceWithStreamingResponse:
93117
return ExtendedCreditResourceWithStreamingResponse(self._credit_products.extended_credit)
94118

119+
@cached_property
120+
def prime_rates(self) -> PrimeRatesWithStreamingResponse:
121+
return PrimeRatesWithStreamingResponse(self._credit_products.prime_rates)
122+
95123

96124
class AsyncCreditProductsWithStreamingResponse:
97125
def __init__(self, credit_products: AsyncCreditProducts) -> None:
@@ -100,3 +128,7 @@ def __init__(self, credit_products: AsyncCreditProducts) -> None:
100128
@cached_property
101129
def extended_credit(self) -> AsyncExtendedCreditResourceWithStreamingResponse:
102130
return AsyncExtendedCreditResourceWithStreamingResponse(self._credit_products.extended_credit)
131+
132+
@cached_property
133+
def prime_rates(self) -> AsyncPrimeRatesWithStreamingResponse:
134+
return AsyncPrimeRatesWithStreamingResponse(self._credit_products.prime_rates)

src/lithic/resources/credit_products/extended_credit.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def with_streaming_response(self) -> ExtendedCreditResourceWithStreamingResponse
3737

3838
def retrieve(
3939
self,
40-
credit_product_id: str,
40+
credit_product_token: str,
4141
*,
4242
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4343
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -58,10 +58,12 @@ def retrieve(
5858
5959
timeout: Override the client-level default timeout for this request, in seconds
6060
"""
61-
if not credit_product_id:
62-
raise ValueError(f"Expected a non-empty value for `credit_product_id` but received {credit_product_id!r}")
61+
if not credit_product_token:
62+
raise ValueError(
63+
f"Expected a non-empty value for `credit_product_token` but received {credit_product_token!r}"
64+
)
6365
return self._get(
64-
f"/v1/credit_products/{credit_product_id}/extended_credit",
66+
f"/v1/credit_products/{credit_product_token}/extended_credit",
6567
options=make_request_options(
6668
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
6769
),
@@ -91,7 +93,7 @@ def with_streaming_response(self) -> AsyncExtendedCreditResourceWithStreamingRes
9193

9294
async def retrieve(
9395
self,
94-
credit_product_id: str,
96+
credit_product_token: str,
9597
*,
9698
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
9799
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -112,10 +114,12 @@ async def retrieve(
112114
113115
timeout: Override the client-level default timeout for this request, in seconds
114116
"""
115-
if not credit_product_id:
116-
raise ValueError(f"Expected a non-empty value for `credit_product_id` but received {credit_product_id!r}")
117+
if not credit_product_token:
118+
raise ValueError(
119+
f"Expected a non-empty value for `credit_product_token` but received {credit_product_token!r}"
120+
)
117121
return await self._get(
118-
f"/v1/credit_products/{credit_product_id}/extended_credit",
122+
f"/v1/credit_products/{credit_product_token}/extended_credit",
119123
options=make_request_options(
120124
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
121125
),

0 commit comments

Comments
 (0)