lark-billing 0.0.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of lark-billing might be problematic. Click here for more details.
- lark/__init__.py +522 -0
- lark/checkout/__init__.py +4 -0
- lark/checkout/client.py +214 -0
- lark/checkout/raw_client.py +252 -0
- lark/client.py +240 -0
- lark/core/__init__.py +105 -0
- lark/core/api_error.py +23 -0
- lark/core/client_wrapper.py +79 -0
- lark/core/datetime_utils.py +28 -0
- lark/core/file.py +67 -0
- lark/core/force_multipart.py +18 -0
- lark/core/http_client.py +543 -0
- lark/core/http_response.py +55 -0
- lark/core/jsonable_encoder.py +100 -0
- lark/core/pydantic_utilities.py +258 -0
- lark/core/query_encoder.py +58 -0
- lark/core/remove_none_from_dict.py +11 -0
- lark/core/request_options.py +35 -0
- lark/core/serialization.py +276 -0
- lark/errors/__init__.py +34 -0
- lark/errors/unprocessable_entity_error.py +11 -0
- lark/feature_access/__init__.py +4 -0
- lark/feature_access/client.py +102 -0
- lark/feature_access/raw_client.py +113 -0
- lark/py.typed +0 -0
- lark/rate_cards/__init__.py +61 -0
- lark/rate_cards/client.py +817 -0
- lark/rate_cards/raw_client.py +728 -0
- lark/rate_cards/types/__init__.py +63 -0
- lark/rate_cards/types/create_rate_card_request_billing_interval.py +5 -0
- lark/rate_cards/types/create_rate_card_request_usage_based_rates_item.py +56 -0
- lark/rate_cards/types/create_rate_card_version_request_usage_based_rates_item.py +58 -0
- lark/rate_cards/types/create_rate_card_version_request_version_type.py +5 -0
- lark/subjects/__init__.py +4 -0
- lark/subjects/client.py +501 -0
- lark/subjects/raw_client.py +633 -0
- lark/subscriptions/__init__.py +4 -0
- lark/subscriptions/client.py +462 -0
- lark/subscriptions/raw_client.py +495 -0
- lark/types/__init__.py +493 -0
- lark/types/aggregation.py +80 -0
- lark/types/amount.py +20 -0
- lark/types/check_feature_access_request.py +24 -0
- lark/types/check_feature_access_response.py +21 -0
- lark/types/complete_subscription_checkout_response.py +21 -0
- lark/types/count_aggregation_pricing_metric_interface.py +17 -0
- lark/types/create_credit_grant_interface.py +27 -0
- lark/types/create_credit_grant_interface_expiration.py +27 -0
- lark/types/create_credit_pool_request.py +5 -0
- lark/types/create_dimension_coordinate_interface.py +20 -0
- lark/types/create_dimension_interface.py +20 -0
- lark/types/create_dimensional_usage_based_rate_interface.py +32 -0
- lark/types/create_fixed_rate_interface.py +28 -0
- lark/types/create_pricing_matrix_cell_interface.py +22 -0
- lark/types/create_pricing_matrix_interface.py +20 -0
- lark/types/create_pricing_metric_interface.py +26 -0
- lark/types/create_pricing_plan_request.py +5 -0
- lark/types/create_rate_card_response.py +36 -0
- lark/types/create_rate_card_response_billing_interval.py +5 -0
- lark/types/create_rate_card_response_usage_based_rates_item.py +58 -0
- lark/types/create_rate_card_version_response.py +36 -0
- lark/types/create_rate_card_version_response_billing_interval.py +5 -0
- lark/types/create_rate_card_version_response_usage_based_rates_item.py +59 -0
- lark/types/create_simple_usage_based_rate_interface.py +30 -0
- lark/types/create_subject_response.py +24 -0
- lark/types/create_subscription_checkout_session_response.py +23 -0
- lark/types/create_usage_event_summary_response.py +23 -0
- lark/types/credit_grant.py +5 -0
- lark/types/credit_grant_date_time_expiration_interface.py +19 -0
- lark/types/credit_grant_date_time_expiration_resource.py +19 -0
- lark/types/credit_grant_duration_expiration_interface.py +21 -0
- lark/types/credit_grant_duration_expiration_resource.py +21 -0
- lark/types/credit_grant_interface.py +28 -0
- lark/types/credit_grant_interface_input_expiration.py +27 -0
- lark/types/credit_grant_interface_output_expiration.py +43 -0
- lark/types/credit_grant_interface_output_schedule.py +41 -0
- lark/types/credit_grant_resource.py +28 -0
- lark/types/credit_grant_resource_input_expiration.py +27 -0
- lark/types/credit_grant_resource_input_schedule.py +39 -0
- lark/types/credit_grant_resource_output_expiration.py +43 -0
- lark/types/credit_grant_resource_output_schedule.py +39 -0
- lark/types/credit_grant_schedule.py +5 -0
- lark/types/credit_grant_schedule_one_time_interface.py +19 -0
- lark/types/credit_grant_schedule_one_time_resource.py +17 -0
- lark/types/credit_grant_schedule_rate_cycle_start_interface.py +19 -0
- lark/types/credit_grant_schedule_rate_cycle_start_resource.py +17 -0
- lark/types/credit_grant_subject_granting_config_interface.py +20 -0
- lark/types/credit_pool.py +5 -0
- lark/types/credit_pool_rollover_config.py +5 -0
- lark/types/custom_aggregation_pricing_metric_interface.py +22 -0
- lark/types/custom_pricing_metric.py +5 -0
- lark/types/custom_unit.py +5 -0
- lark/types/custom_unit_amount.py +5 -0
- lark/types/dimension.py +5 -0
- lark/types/dimension_coordinate.py +5 -0
- lark/types/dimension_coordinate_interface.py +20 -0
- lark/types/dimension_coordinate_set.py +5 -0
- lark/types/dimension_interface.py +20 -0
- lark/types/dimensional_rate_matrix.py +5 -0
- lark/types/dimensional_rate_matrix_cell.py +5 -0
- lark/types/dimensional_usage_based_rate.py +5 -0
- lark/types/dimensional_usage_based_rate_input.py +5 -0
- lark/types/dimensional_usage_based_rate_interface.py +33 -0
- lark/types/feature_access_resource.py +21 -0
- lark/types/fixed_rate_interface.py +29 -0
- lark/types/flat_price.py +24 -0
- lark/types/get_rate_card_response.py +36 -0
- lark/types/get_rate_card_response_billing_interval.py +5 -0
- lark/types/get_rate_card_response_usage_based_rates_item.py +58 -0
- lark/types/grant_credits_request.py +5 -0
- lark/types/http_validation_error.py +20 -0
- lark/types/last_aggregation_pricing_metric_interface.py +22 -0
- lark/types/license_based_rate.py +5 -0
- lark/types/license_based_rate_input.py +5 -0
- lark/types/list_rate_cards_response.py +21 -0
- lark/types/list_subjects_response.py +21 -0
- lark/types/list_subscriptions_response.py +21 -0
- lark/types/max_aggregation_pricing_metric_interface.py +22 -0
- lark/types/monetary_amount.py +5 -0
- lark/types/package_price.py +27 -0
- lark/types/package_price_rounding_behavior.py +5 -0
- lark/types/package_price_wrapper.py +5 -0
- lark/types/period.py +22 -0
- lark/types/price.py +5 -0
- lark/types/pricing_matrix_cell_interface.py +22 -0
- lark/types/pricing_matrix_interface.py +20 -0
- lark/types/pricing_metric.py +5 -0
- lark/types/pricing_metric_interface.py +27 -0
- lark/types/pricing_plan.py +5 -0
- lark/types/pricing_plan_subscription.py +5 -0
- lark/types/pricing_tier.py +5 -0
- lark/types/rate_card.py +5 -0
- lark/types/rate_card_resource.py +36 -0
- lark/types/rate_card_resource_billing_interval.py +5 -0
- lark/types/rate_card_resource_usage_based_rates_item.py +58 -0
- lark/types/rate_card_version.py +5 -0
- lark/types/rate_card_version_input.py +5 -0
- lark/types/simple_usage_based_rate.py +5 -0
- lark/types/simple_usage_based_rate_input.py +5 -0
- lark/types/simple_usage_based_rate_interface.py +31 -0
- lark/types/status.py +5 -0
- lark/types/subject.py +5 -0
- lark/types/subject_granting_config.py +5 -0
- lark/types/subject_granting_config_resource.py +20 -0
- lark/types/subject_resource.py +24 -0
- lark/types/subscription_resource.py +28 -0
- lark/types/sum_aggregation_pricing_metric_interface.py +22 -0
- lark/types/tiered_price.py +5 -0
- lark/types/tiered_price_wrapper.py +5 -0
- lark/types/unit.py +5 -0
- lark/types/update_pricing_plan_request.py +5 -0
- lark/types/update_rate_card_request.py +5 -0
- lark/types/update_subscription_request.py +5 -0
- lark/types/usage_based_rate.py +5 -0
- lark/types/usage_based_rate_input.py +5 -0
- lark/types/usage_unit.py +5 -0
- lark/types/validation_error.py +22 -0
- lark/types/validation_error_loc_item.py +5 -0
- lark/usage_events/__init__.py +34 -0
- lark/usage_events/client.py +293 -0
- lark/usage_events/raw_client.py +318 -0
- lark/usage_events/types/__init__.py +36 -0
- lark/usage_events/types/create_usage_event_summary_request_aggregation_type.py +5 -0
- lark/version.py +3 -0
- lark_billing-0.0.6.dist-info/METADATA +188 -0
- lark_billing-0.0.6.dist-info/RECORD +167 -0
- lark_billing-0.0.6.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ..core.request_options import RequestOptions
|
|
7
|
+
from ..types.check_feature_access_response import CheckFeatureAccessResponse
|
|
8
|
+
from .raw_client import AsyncRawFeatureAccessClient, RawFeatureAccessClient
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class FeatureAccessClient:
|
|
12
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
13
|
+
self._raw_client = RawFeatureAccessClient(client_wrapper=client_wrapper)
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def with_raw_response(self) -> RawFeatureAccessClient:
|
|
17
|
+
"""
|
|
18
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
19
|
+
|
|
20
|
+
Returns
|
|
21
|
+
-------
|
|
22
|
+
RawFeatureAccessClient
|
|
23
|
+
"""
|
|
24
|
+
return self._raw_client
|
|
25
|
+
|
|
26
|
+
def get_feature_access(
|
|
27
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
28
|
+
) -> CheckFeatureAccessResponse:
|
|
29
|
+
"""
|
|
30
|
+
Parameters
|
|
31
|
+
----------
|
|
32
|
+
request_options : typing.Optional[RequestOptions]
|
|
33
|
+
Request-specific configuration.
|
|
34
|
+
|
|
35
|
+
Returns
|
|
36
|
+
-------
|
|
37
|
+
CheckFeatureAccessResponse
|
|
38
|
+
Successful Response
|
|
39
|
+
|
|
40
|
+
Examples
|
|
41
|
+
--------
|
|
42
|
+
from lark import Lark
|
|
43
|
+
|
|
44
|
+
client = Lark(
|
|
45
|
+
api_key="YOUR_API_KEY",
|
|
46
|
+
base_url="https://yourhost.com/path/to/api",
|
|
47
|
+
)
|
|
48
|
+
client.feature_access.get_feature_access()
|
|
49
|
+
"""
|
|
50
|
+
_response = self._raw_client.get_feature_access(request_options=request_options)
|
|
51
|
+
return _response.data
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class AsyncFeatureAccessClient:
|
|
55
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
56
|
+
self._raw_client = AsyncRawFeatureAccessClient(client_wrapper=client_wrapper)
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def with_raw_response(self) -> AsyncRawFeatureAccessClient:
|
|
60
|
+
"""
|
|
61
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
62
|
+
|
|
63
|
+
Returns
|
|
64
|
+
-------
|
|
65
|
+
AsyncRawFeatureAccessClient
|
|
66
|
+
"""
|
|
67
|
+
return self._raw_client
|
|
68
|
+
|
|
69
|
+
async def get_feature_access(
|
|
70
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
71
|
+
) -> CheckFeatureAccessResponse:
|
|
72
|
+
"""
|
|
73
|
+
Parameters
|
|
74
|
+
----------
|
|
75
|
+
request_options : typing.Optional[RequestOptions]
|
|
76
|
+
Request-specific configuration.
|
|
77
|
+
|
|
78
|
+
Returns
|
|
79
|
+
-------
|
|
80
|
+
CheckFeatureAccessResponse
|
|
81
|
+
Successful Response
|
|
82
|
+
|
|
83
|
+
Examples
|
|
84
|
+
--------
|
|
85
|
+
import asyncio
|
|
86
|
+
|
|
87
|
+
from lark import AsyncLark
|
|
88
|
+
|
|
89
|
+
client = AsyncLark(
|
|
90
|
+
api_key="YOUR_API_KEY",
|
|
91
|
+
base_url="https://yourhost.com/path/to/api",
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
async def main() -> None:
|
|
96
|
+
await client.feature_access.get_feature_access()
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
asyncio.run(main())
|
|
100
|
+
"""
|
|
101
|
+
_response = await self._raw_client.get_feature_access(request_options=request_options)
|
|
102
|
+
return _response.data
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from json.decoder import JSONDecodeError
|
|
5
|
+
|
|
6
|
+
from ..core.api_error import ApiError
|
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
|
+
from ..core.pydantic_utilities import parse_obj_as
|
|
10
|
+
from ..core.request_options import RequestOptions
|
|
11
|
+
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
12
|
+
from ..types.check_feature_access_response import CheckFeatureAccessResponse
|
|
13
|
+
from ..types.http_validation_error import HttpValidationError
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class RawFeatureAccessClient:
|
|
17
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
18
|
+
self._client_wrapper = client_wrapper
|
|
19
|
+
|
|
20
|
+
def get_feature_access(
|
|
21
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
22
|
+
) -> HttpResponse[CheckFeatureAccessResponse]:
|
|
23
|
+
"""
|
|
24
|
+
Parameters
|
|
25
|
+
----------
|
|
26
|
+
request_options : typing.Optional[RequestOptions]
|
|
27
|
+
Request-specific configuration.
|
|
28
|
+
|
|
29
|
+
Returns
|
|
30
|
+
-------
|
|
31
|
+
HttpResponse[CheckFeatureAccessResponse]
|
|
32
|
+
Successful Response
|
|
33
|
+
"""
|
|
34
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
35
|
+
"feature-access",
|
|
36
|
+
method="GET",
|
|
37
|
+
request_options=request_options,
|
|
38
|
+
)
|
|
39
|
+
try:
|
|
40
|
+
if 200 <= _response.status_code < 300:
|
|
41
|
+
_data = typing.cast(
|
|
42
|
+
CheckFeatureAccessResponse,
|
|
43
|
+
parse_obj_as(
|
|
44
|
+
type_=CheckFeatureAccessResponse, # type: ignore
|
|
45
|
+
object_=_response.json(),
|
|
46
|
+
),
|
|
47
|
+
)
|
|
48
|
+
return HttpResponse(response=_response, data=_data)
|
|
49
|
+
if _response.status_code == 422:
|
|
50
|
+
raise UnprocessableEntityError(
|
|
51
|
+
headers=dict(_response.headers),
|
|
52
|
+
body=typing.cast(
|
|
53
|
+
HttpValidationError,
|
|
54
|
+
parse_obj_as(
|
|
55
|
+
type_=HttpValidationError, # type: ignore
|
|
56
|
+
object_=_response.json(),
|
|
57
|
+
),
|
|
58
|
+
),
|
|
59
|
+
)
|
|
60
|
+
_response_json = _response.json()
|
|
61
|
+
except JSONDecodeError:
|
|
62
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
63
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class AsyncRawFeatureAccessClient:
|
|
67
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
68
|
+
self._client_wrapper = client_wrapper
|
|
69
|
+
|
|
70
|
+
async def get_feature_access(
|
|
71
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
72
|
+
) -> AsyncHttpResponse[CheckFeatureAccessResponse]:
|
|
73
|
+
"""
|
|
74
|
+
Parameters
|
|
75
|
+
----------
|
|
76
|
+
request_options : typing.Optional[RequestOptions]
|
|
77
|
+
Request-specific configuration.
|
|
78
|
+
|
|
79
|
+
Returns
|
|
80
|
+
-------
|
|
81
|
+
AsyncHttpResponse[CheckFeatureAccessResponse]
|
|
82
|
+
Successful Response
|
|
83
|
+
"""
|
|
84
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
85
|
+
"feature-access",
|
|
86
|
+
method="GET",
|
|
87
|
+
request_options=request_options,
|
|
88
|
+
)
|
|
89
|
+
try:
|
|
90
|
+
if 200 <= _response.status_code < 300:
|
|
91
|
+
_data = typing.cast(
|
|
92
|
+
CheckFeatureAccessResponse,
|
|
93
|
+
parse_obj_as(
|
|
94
|
+
type_=CheckFeatureAccessResponse, # type: ignore
|
|
95
|
+
object_=_response.json(),
|
|
96
|
+
),
|
|
97
|
+
)
|
|
98
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
99
|
+
if _response.status_code == 422:
|
|
100
|
+
raise UnprocessableEntityError(
|
|
101
|
+
headers=dict(_response.headers),
|
|
102
|
+
body=typing.cast(
|
|
103
|
+
HttpValidationError,
|
|
104
|
+
parse_obj_as(
|
|
105
|
+
type_=HttpValidationError, # type: ignore
|
|
106
|
+
object_=_response.json(),
|
|
107
|
+
),
|
|
108
|
+
),
|
|
109
|
+
)
|
|
110
|
+
_response_json = _response.json()
|
|
111
|
+
except JSONDecodeError:
|
|
112
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
113
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
lark/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .types import (
|
|
10
|
+
CreateRateCardRequestBillingInterval,
|
|
11
|
+
CreateRateCardRequestUsageBasedRatesItem,
|
|
12
|
+
CreateRateCardRequestUsageBasedRatesItem_Dimensional,
|
|
13
|
+
CreateRateCardRequestUsageBasedRatesItem_Simple,
|
|
14
|
+
CreateRateCardVersionRequestUsageBasedRatesItem,
|
|
15
|
+
CreateRateCardVersionRequestUsageBasedRatesItem_Dimensional,
|
|
16
|
+
CreateRateCardVersionRequestUsageBasedRatesItem_Simple,
|
|
17
|
+
CreateRateCardVersionRequestVersionType,
|
|
18
|
+
)
|
|
19
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
20
|
+
"CreateRateCardRequestBillingInterval": ".types",
|
|
21
|
+
"CreateRateCardRequestUsageBasedRatesItem": ".types",
|
|
22
|
+
"CreateRateCardRequestUsageBasedRatesItem_Dimensional": ".types",
|
|
23
|
+
"CreateRateCardRequestUsageBasedRatesItem_Simple": ".types",
|
|
24
|
+
"CreateRateCardVersionRequestUsageBasedRatesItem": ".types",
|
|
25
|
+
"CreateRateCardVersionRequestUsageBasedRatesItem_Dimensional": ".types",
|
|
26
|
+
"CreateRateCardVersionRequestUsageBasedRatesItem_Simple": ".types",
|
|
27
|
+
"CreateRateCardVersionRequestVersionType": ".types",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
32
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
33
|
+
if module_name is None:
|
|
34
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
35
|
+
try:
|
|
36
|
+
module = import_module(module_name, __package__)
|
|
37
|
+
if module_name == f".{attr_name}":
|
|
38
|
+
return module
|
|
39
|
+
else:
|
|
40
|
+
return getattr(module, attr_name)
|
|
41
|
+
except ImportError as e:
|
|
42
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
43
|
+
except AttributeError as e:
|
|
44
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def __dir__():
|
|
48
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
49
|
+
return sorted(lazy_attrs)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
__all__ = [
|
|
53
|
+
"CreateRateCardRequestBillingInterval",
|
|
54
|
+
"CreateRateCardRequestUsageBasedRatesItem",
|
|
55
|
+
"CreateRateCardRequestUsageBasedRatesItem_Dimensional",
|
|
56
|
+
"CreateRateCardRequestUsageBasedRatesItem_Simple",
|
|
57
|
+
"CreateRateCardVersionRequestUsageBasedRatesItem",
|
|
58
|
+
"CreateRateCardVersionRequestUsageBasedRatesItem_Dimensional",
|
|
59
|
+
"CreateRateCardVersionRequestUsageBasedRatesItem_Simple",
|
|
60
|
+
"CreateRateCardVersionRequestVersionType",
|
|
61
|
+
]
|