kalshi-python-async 3.0.0__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.
- kalshi_python_async/__init__.py +272 -0
- kalshi_python_async/api/__init__.py +19 -0
- kalshi_python_async/api/api_keys_api.py +1098 -0
- kalshi_python_async/api/communications_api.py +3216 -0
- kalshi_python_async/api/events_api.py +1941 -0
- kalshi_python_async/api/exchange_api.py +1263 -0
- kalshi_python_async/api/fcm_api.py +792 -0
- kalshi_python_async/api/incentive_programs_api.py +346 -0
- kalshi_python_async/api/live_data_api.py +564 -0
- kalshi_python_async/api/market_api.py +2568 -0
- kalshi_python_async/api/milestone_api.py +689 -0
- kalshi_python_async/api/multivariate_api.py +1486 -0
- kalshi_python_async/api/order_groups_api.py +1375 -0
- kalshi_python_async/api/orders_api.py +2913 -0
- kalshi_python_async/api/portfolio_api.py +1572 -0
- kalshi_python_async/api/search_api.py +516 -0
- kalshi_python_async/api/structured_targets_api.py +605 -0
- kalshi_python_async/api_client.py +833 -0
- kalshi_python_async/api_response.py +21 -0
- kalshi_python_async/auth.py +89 -0
- kalshi_python_async/configuration.py +622 -0
- kalshi_python_async/exceptions.py +216 -0
- kalshi_python_async/models/__init__.py +136 -0
- kalshi_python_async/models/accept_quote_request.py +94 -0
- kalshi_python_async/models/amend_order_request.py +120 -0
- kalshi_python_async/models/amend_order_response.py +96 -0
- kalshi_python_async/models/announcement.py +108 -0
- kalshi_python_async/models/api_key.py +89 -0
- kalshi_python_async/models/associated_event.py +105 -0
- kalshi_python_async/models/batch_cancel_orders_individual_response.py +111 -0
- kalshi_python_async/models/batch_cancel_orders_request.py +87 -0
- kalshi_python_async/models/batch_cancel_orders_response.py +95 -0
- kalshi_python_async/models/batch_create_orders_individual_response.py +114 -0
- kalshi_python_async/models/batch_create_orders_request.py +95 -0
- kalshi_python_async/models/batch_create_orders_response.py +95 -0
- kalshi_python_async/models/batch_get_market_candlesticks_response.py +95 -0
- kalshi_python_async/models/bid_ask_distribution.py +101 -0
- kalshi_python_async/models/cancel_order_response.py +93 -0
- kalshi_python_async/models/create_api_key_request.py +89 -0
- kalshi_python_async/models/create_api_key_response.py +87 -0
- kalshi_python_async/models/create_market_in_multivariate_event_collection_request.py +95 -0
- kalshi_python_async/models/create_market_in_multivariate_event_collection_response.py +89 -0
- kalshi_python_async/models/create_order_group_request.py +88 -0
- kalshi_python_async/models/create_order_group_response.py +87 -0
- kalshi_python_async/models/create_order_request.py +159 -0
- kalshi_python_async/models/create_order_response.py +91 -0
- kalshi_python_async/models/create_quote_request.py +93 -0
- kalshi_python_async/models/create_quote_response.py +87 -0
- kalshi_python_async/models/create_rfq_request.py +97 -0
- kalshi_python_async/models/create_rfq_response.py +87 -0
- kalshi_python_async/models/daily_schedule.py +89 -0
- kalshi_python_async/models/decrease_order_request.py +90 -0
- kalshi_python_async/models/decrease_order_response.py +91 -0
- kalshi_python_async/models/error_response.py +93 -0
- kalshi_python_async/models/event_data.py +133 -0
- kalshi_python_async/models/event_position.py +105 -0
- kalshi_python_async/models/exchange_status.py +97 -0
- kalshi_python_async/models/fill.py +134 -0
- kalshi_python_async/models/forecast_percentiles_point.py +101 -0
- kalshi_python_async/models/generate_api_key_request.py +87 -0
- kalshi_python_async/models/generate_api_key_response.py +89 -0
- kalshi_python_async/models/get_api_keys_response.py +95 -0
- kalshi_python_async/models/get_balance_response.py +91 -0
- kalshi_python_async/models/get_communications_id_response.py +87 -0
- kalshi_python_async/models/get_event_candlesticks_response.py +104 -0
- kalshi_python_async/models/get_event_forecast_percentiles_history_response.py +95 -0
- kalshi_python_async/models/get_event_metadata_response.py +123 -0
- kalshi_python_async/models/get_event_response.py +101 -0
- kalshi_python_async/models/get_events_candlesticks_response.py +95 -0
- kalshi_python_async/models/get_events_candlesticks_response_events_inner.py +106 -0
- kalshi_python_async/models/get_events_response.py +107 -0
- kalshi_python_async/models/get_exchange_announcements_response.py +95 -0
- kalshi_python_async/models/get_exchange_schedule_response.py +91 -0
- kalshi_python_async/models/get_fills_response.py +97 -0
- kalshi_python_async/models/get_filters_by_sports_response.py +102 -0
- kalshi_python_async/models/get_incentive_programs_response.py +97 -0
- kalshi_python_async/models/get_live_data_response.py +91 -0
- kalshi_python_async/models/get_live_datas_response.py +95 -0
- kalshi_python_async/models/get_market_candlesticks_response.py +97 -0
- kalshi_python_async/models/get_market_orderbook_response.py +91 -0
- kalshi_python_async/models/get_market_response.py +91 -0
- kalshi_python_async/models/get_markets_response.py +97 -0
- kalshi_python_async/models/get_milestone_response.py +91 -0
- kalshi_python_async/models/get_milestones_response.py +97 -0
- kalshi_python_async/models/get_multivariate_event_collection_lookup_history_response.py +95 -0
- kalshi_python_async/models/get_multivariate_event_collection_response.py +91 -0
- kalshi_python_async/models/get_multivariate_event_collections_response.py +97 -0
- kalshi_python_async/models/get_multivariate_events_response.py +97 -0
- kalshi_python_async/models/get_order_group_response.py +89 -0
- kalshi_python_async/models/get_order_groups_response.py +95 -0
- kalshi_python_async/models/get_order_queue_position_response.py +87 -0
- kalshi_python_async/models/get_order_queue_positions_response.py +95 -0
- kalshi_python_async/models/get_order_response.py +91 -0
- kalshi_python_async/models/get_orders_response.py +97 -0
- kalshi_python_async/models/get_portfolio_resting_order_total_value_response.py +87 -0
- kalshi_python_async/models/get_positions_response.py +107 -0
- kalshi_python_async/models/get_quote_response.py +91 -0
- kalshi_python_async/models/get_quotes_response.py +97 -0
- kalshi_python_async/models/get_rfq_response.py +91 -0
- kalshi_python_async/models/get_rfqs_response.py +97 -0
- kalshi_python_async/models/get_series_fee_changes_response.py +95 -0
- kalshi_python_async/models/get_series_list_response.py +95 -0
- kalshi_python_async/models/get_series_response.py +91 -0
- kalshi_python_async/models/get_settlements_response.py +97 -0
- kalshi_python_async/models/get_structured_target_response.py +91 -0
- kalshi_python_async/models/get_structured_targets_response.py +97 -0
- kalshi_python_async/models/get_tags_for_series_categories_response.py +87 -0
- kalshi_python_async/models/get_trades_response.py +97 -0
- kalshi_python_async/models/get_user_data_timestamp_response.py +88 -0
- kalshi_python_async/models/incentive_program.py +121 -0
- kalshi_python_async/models/live_data.py +91 -0
- kalshi_python_async/models/lookup_point.py +102 -0
- kalshi_python_async/models/lookup_tickers_for_market_in_multivariate_event_collection_request.py +95 -0
- kalshi_python_async/models/lookup_tickers_for_market_in_multivariate_event_collection_response.py +89 -0
- kalshi_python_async/models/maintenance_window.py +90 -0
- kalshi_python_async/models/market.py +307 -0
- kalshi_python_async/models/market_candlestick.py +108 -0
- kalshi_python_async/models/market_candlesticks_response.py +97 -0
- kalshi_python_async/models/market_metadata.py +91 -0
- kalshi_python_async/models/market_position.py +110 -0
- kalshi_python_async/models/milestone.py +120 -0
- kalshi_python_async/models/multivariate_event_collection.py +122 -0
- kalshi_python_async/models/mve_selected_leg.py +91 -0
- kalshi_python_async/models/order.py +189 -0
- kalshi_python_async/models/order_group.py +89 -0
- kalshi_python_async/models/order_queue_position.py +91 -0
- kalshi_python_async/models/order_status.py +38 -0
- kalshi_python_async/models/orderbook.py +94 -0
- kalshi_python_async/models/percentile_point.py +93 -0
- kalshi_python_async/models/price_distribution.py +157 -0
- kalshi_python_async/models/price_range.py +91 -0
- kalshi_python_async/models/quote.py +153 -0
- kalshi_python_async/models/rfq.py +129 -0
- kalshi_python_async/models/schedule.py +105 -0
- kalshi_python_async/models/scope_list.py +87 -0
- kalshi_python_async/models/self_trade_prevention_type.py +37 -0
- kalshi_python_async/models/series.py +129 -0
- kalshi_python_async/models/series_fee_change.py +103 -0
- kalshi_python_async/models/settlement.py +118 -0
- kalshi_python_async/models/settlement_source.py +89 -0
- kalshi_python_async/models/sport_filter_details.py +102 -0
- kalshi_python_async/models/structured_target.py +98 -0
- kalshi_python_async/models/ticker_pair.py +98 -0
- kalshi_python_async/models/trade.py +113 -0
- kalshi_python_async/models/weekly_schedule.py +154 -0
- kalshi_python_async/py.typed +0 -0
- kalshi_python_async/rest.py +213 -0
- kalshi_python_async-3.0.0.dist-info/METADATA +78 -0
- kalshi_python_async-3.0.0.dist-info/RECORD +151 -0
- kalshi_python_async-3.0.0.dist-info/WHEEL +5 -0
- kalshi_python_async-3.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1098 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Kalshi Trade API Manual Endpoints
|
|
5
|
+
|
|
6
|
+
Manually defined OpenAPI spec for endpoints being migrated to spec-first approach
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 3.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
import warnings
|
|
14
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt, StrictBool
|
|
15
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
16
|
+
from typing_extensions import Annotated
|
|
17
|
+
|
|
18
|
+
from pydantic import Field, StrictStr
|
|
19
|
+
from typing_extensions import Annotated
|
|
20
|
+
from kalshi_python_async.models.create_api_key_request import CreateApiKeyRequest
|
|
21
|
+
from kalshi_python_async.models.create_api_key_response import CreateApiKeyResponse
|
|
22
|
+
from kalshi_python_async.models.generate_api_key_request import GenerateApiKeyRequest
|
|
23
|
+
from kalshi_python_async.models.generate_api_key_response import GenerateApiKeyResponse
|
|
24
|
+
from kalshi_python_async.models.get_api_keys_response import GetApiKeysResponse
|
|
25
|
+
|
|
26
|
+
from kalshi_python_async.api_client import ApiClient, RequestSerialized
|
|
27
|
+
from kalshi_python_async.api_response import ApiResponse
|
|
28
|
+
from kalshi_python_async.rest import RESTResponseType
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class ApiKeysApi:
|
|
32
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
33
|
+
Ref: https://openapi-generator.tech
|
|
34
|
+
|
|
35
|
+
Do not edit the class manually.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
def __init__(self, api_client=None) -> None:
|
|
39
|
+
if api_client is None:
|
|
40
|
+
api_client = ApiClient.get_default()
|
|
41
|
+
self.api_client = api_client
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@validate_call
|
|
45
|
+
async def create_api_key(
|
|
46
|
+
self,
|
|
47
|
+
# Request body parameters as keyword arguments
|
|
48
|
+
**kwargs: Any,
|
|
49
|
+
) -> CreateApiKeyResponse:
|
|
50
|
+
"""Create API Key
|
|
51
|
+
|
|
52
|
+
Endpoint for creating a new API key with a user-provided public key. This endpoint allows users with Premier or Market Maker API usage levels to create API keys by providing their own RSA public key. The platform will use this public key to verify signatures on API requests.
|
|
53
|
+
|
|
54
|
+
:param create_api_key_request: (required)
|
|
55
|
+
:type create_api_key_request: CreateApiKeyRequest
|
|
56
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
57
|
+
number provided, it will be total request
|
|
58
|
+
timeout. It can also be a pair (tuple) of
|
|
59
|
+
(connection, read) timeouts.
|
|
60
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
61
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
62
|
+
request; this effectively ignores the
|
|
63
|
+
authentication in the spec for a single request.
|
|
64
|
+
:type _request_auth: dict, optional
|
|
65
|
+
:param _content_type: force content-type for the request.
|
|
66
|
+
:type _content_type: str, Optional
|
|
67
|
+
:param _headers: set to override the headers for a single
|
|
68
|
+
request; this effectively ignores the headers
|
|
69
|
+
in the spec for a single request.
|
|
70
|
+
:type _headers: dict, optional
|
|
71
|
+
:param _host_index: set to override the host_index for a single
|
|
72
|
+
request; this effectively ignores the host_index
|
|
73
|
+
in the spec for a single request.
|
|
74
|
+
:type _host_index: int, optional
|
|
75
|
+
:return: Returns the result object.
|
|
76
|
+
""" # noqa: E501
|
|
77
|
+
|
|
78
|
+
# Create request object from kwargs
|
|
79
|
+
create_api_key_request = CreateApiKeyRequest(**kwargs) if kwargs else None
|
|
80
|
+
|
|
81
|
+
_param = self._create_api_key_serialize(
|
|
82
|
+
create_api_key_request=create_api_key_request,
|
|
83
|
+
_request_auth=kwargs.get('_request_auth'),
|
|
84
|
+
_content_type=kwargs.get('_content_type'),
|
|
85
|
+
_headers=kwargs.get('_headers'),
|
|
86
|
+
_host_index=kwargs.get('_host_index', 0)
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
90
|
+
'201': "CreateApiKeyResponse",
|
|
91
|
+
'400': None,
|
|
92
|
+
'401': None,
|
|
93
|
+
'403': None,
|
|
94
|
+
'500': None,
|
|
95
|
+
}
|
|
96
|
+
response_data = await self.api_client.call_api(
|
|
97
|
+
*_param,
|
|
98
|
+
_request_timeout=kwargs.get('_request_timeout'),
|
|
99
|
+
)
|
|
100
|
+
await response_data.read()
|
|
101
|
+
return self.api_client.response_deserialize(
|
|
102
|
+
response_data=response_data,
|
|
103
|
+
response_types_map=_response_types_map,
|
|
104
|
+
).data
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
@validate_call
|
|
108
|
+
async def create_api_key_with_http_info(
|
|
109
|
+
self,
|
|
110
|
+
create_api_key_request: CreateApiKeyRequest,
|
|
111
|
+
_request_timeout: Union[
|
|
112
|
+
None,
|
|
113
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
114
|
+
Tuple[
|
|
115
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
116
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
117
|
+
]
|
|
118
|
+
] = None,
|
|
119
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
120
|
+
_content_type: Optional[StrictStr] = None,
|
|
121
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
122
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
123
|
+
) -> ApiResponse[CreateApiKeyResponse]:
|
|
124
|
+
"""Create API Key
|
|
125
|
+
|
|
126
|
+
Endpoint for creating a new API key with a user-provided public key. This endpoint allows users with Premier or Market Maker API usage levels to create API keys by providing their own RSA public key. The platform will use this public key to verify signatures on API requests.
|
|
127
|
+
|
|
128
|
+
:param create_api_key_request: (required)
|
|
129
|
+
:type create_api_key_request: CreateApiKeyRequest
|
|
130
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
131
|
+
number provided, it will be total request
|
|
132
|
+
timeout. It can also be a pair (tuple) of
|
|
133
|
+
(connection, read) timeouts.
|
|
134
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
135
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
136
|
+
request; this effectively ignores the
|
|
137
|
+
authentication in the spec for a single request.
|
|
138
|
+
:type _request_auth: dict, optional
|
|
139
|
+
:param _content_type: force content-type for the request.
|
|
140
|
+
:type _content_type: str, Optional
|
|
141
|
+
:param _headers: set to override the headers for a single
|
|
142
|
+
request; this effectively ignores the headers
|
|
143
|
+
in the spec for a single request.
|
|
144
|
+
:type _headers: dict, optional
|
|
145
|
+
:param _host_index: set to override the host_index for a single
|
|
146
|
+
request; this effectively ignores the host_index
|
|
147
|
+
in the spec for a single request.
|
|
148
|
+
:type _host_index: int, optional
|
|
149
|
+
:return: Returns the result object.
|
|
150
|
+
""" # noqa: E501
|
|
151
|
+
|
|
152
|
+
_param = self._create_api_key_serialize(
|
|
153
|
+
create_api_key_request=create_api_key_request,
|
|
154
|
+
_request_auth=_request_auth,
|
|
155
|
+
_content_type=_content_type,
|
|
156
|
+
_headers=_headers,
|
|
157
|
+
_host_index=_host_index
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
161
|
+
'201': "CreateApiKeyResponse",
|
|
162
|
+
'400': None,
|
|
163
|
+
'401': None,
|
|
164
|
+
'403': None,
|
|
165
|
+
'500': None,
|
|
166
|
+
}
|
|
167
|
+
response_data = await self.api_client.call_api(
|
|
168
|
+
*_param,
|
|
169
|
+
_request_timeout=_request_timeout
|
|
170
|
+
)
|
|
171
|
+
await response_data.read()
|
|
172
|
+
return self.api_client.response_deserialize(
|
|
173
|
+
response_data=response_data,
|
|
174
|
+
response_types_map=_response_types_map,
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
@validate_call
|
|
179
|
+
async def create_api_key_without_preload_content(
|
|
180
|
+
self,
|
|
181
|
+
create_api_key_request: CreateApiKeyRequest,
|
|
182
|
+
_request_timeout: Union[
|
|
183
|
+
None,
|
|
184
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
185
|
+
Tuple[
|
|
186
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
187
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
188
|
+
]
|
|
189
|
+
] = None,
|
|
190
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
191
|
+
_content_type: Optional[StrictStr] = None,
|
|
192
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
193
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
194
|
+
) -> RESTResponseType:
|
|
195
|
+
"""Create API Key
|
|
196
|
+
|
|
197
|
+
Endpoint for creating a new API key with a user-provided public key. This endpoint allows users with Premier or Market Maker API usage levels to create API keys by providing their own RSA public key. The platform will use this public key to verify signatures on API requests.
|
|
198
|
+
|
|
199
|
+
:param create_api_key_request: (required)
|
|
200
|
+
:type create_api_key_request: CreateApiKeyRequest
|
|
201
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
202
|
+
number provided, it will be total request
|
|
203
|
+
timeout. It can also be a pair (tuple) of
|
|
204
|
+
(connection, read) timeouts.
|
|
205
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
206
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
207
|
+
request; this effectively ignores the
|
|
208
|
+
authentication in the spec for a single request.
|
|
209
|
+
:type _request_auth: dict, optional
|
|
210
|
+
:param _content_type: force content-type for the request.
|
|
211
|
+
:type _content_type: str, Optional
|
|
212
|
+
:param _headers: set to override the headers for a single
|
|
213
|
+
request; this effectively ignores the headers
|
|
214
|
+
in the spec for a single request.
|
|
215
|
+
:type _headers: dict, optional
|
|
216
|
+
:param _host_index: set to override the host_index for a single
|
|
217
|
+
request; this effectively ignores the host_index
|
|
218
|
+
in the spec for a single request.
|
|
219
|
+
:type _host_index: int, optional
|
|
220
|
+
:return: Returns the result object.
|
|
221
|
+
""" # noqa: E501
|
|
222
|
+
|
|
223
|
+
_param = self._create_api_key_serialize(
|
|
224
|
+
create_api_key_request=create_api_key_request,
|
|
225
|
+
_request_auth=_request_auth,
|
|
226
|
+
_content_type=_content_type,
|
|
227
|
+
_headers=_headers,
|
|
228
|
+
_host_index=_host_index
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
232
|
+
'201': "CreateApiKeyResponse",
|
|
233
|
+
'400': None,
|
|
234
|
+
'401': None,
|
|
235
|
+
'403': None,
|
|
236
|
+
'500': None,
|
|
237
|
+
}
|
|
238
|
+
response_data = await self.api_client.call_api(
|
|
239
|
+
*_param,
|
|
240
|
+
_request_timeout=_request_timeout
|
|
241
|
+
)
|
|
242
|
+
return response_data.response
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
def _create_api_key_serialize(
|
|
246
|
+
self,
|
|
247
|
+
create_api_key_request,
|
|
248
|
+
_request_auth,
|
|
249
|
+
_content_type,
|
|
250
|
+
_headers,
|
|
251
|
+
_host_index,
|
|
252
|
+
) -> RequestSerialized:
|
|
253
|
+
|
|
254
|
+
_host = None
|
|
255
|
+
|
|
256
|
+
_collection_formats: Dict[str, str] = {
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
_path_params: Dict[str, str] = {}
|
|
260
|
+
_query_params: List[Tuple[str, str]] = []
|
|
261
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
262
|
+
_form_params: List[Tuple[str, str]] = []
|
|
263
|
+
_files: Dict[
|
|
264
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
265
|
+
] = {}
|
|
266
|
+
_body_params: Optional[bytes] = None
|
|
267
|
+
|
|
268
|
+
# process the path parameters
|
|
269
|
+
# process the query parameters
|
|
270
|
+
# process the header parameters
|
|
271
|
+
# process the form parameters
|
|
272
|
+
# process the body parameter
|
|
273
|
+
if create_api_key_request is not None:
|
|
274
|
+
_body_params = create_api_key_request
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
# set the HTTP header `Accept`
|
|
278
|
+
if 'Accept' not in _header_params:
|
|
279
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
280
|
+
[
|
|
281
|
+
'application/json'
|
|
282
|
+
]
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
# set the HTTP header `Content-Type`
|
|
286
|
+
if _content_type:
|
|
287
|
+
_header_params['Content-Type'] = _content_type
|
|
288
|
+
else:
|
|
289
|
+
_default_content_type = (
|
|
290
|
+
self.api_client.select_header_content_type(
|
|
291
|
+
[
|
|
292
|
+
'application/json'
|
|
293
|
+
]
|
|
294
|
+
)
|
|
295
|
+
)
|
|
296
|
+
if _default_content_type is not None:
|
|
297
|
+
_header_params['Content-Type'] = _default_content_type
|
|
298
|
+
|
|
299
|
+
# authentication setting
|
|
300
|
+
_auth_settings: List[str] = [
|
|
301
|
+
'kalshiAccessSignature',
|
|
302
|
+
'kalshiAccessKey',
|
|
303
|
+
'kalshiAccessTimestamp'
|
|
304
|
+
]
|
|
305
|
+
|
|
306
|
+
return self.api_client.param_serialize(
|
|
307
|
+
method='POST',
|
|
308
|
+
resource_path='/api_keys',
|
|
309
|
+
path_params=_path_params,
|
|
310
|
+
query_params=_query_params,
|
|
311
|
+
header_params=_header_params,
|
|
312
|
+
body=_body_params,
|
|
313
|
+
post_params=_form_params,
|
|
314
|
+
files=_files,
|
|
315
|
+
auth_settings=_auth_settings,
|
|
316
|
+
collection_formats=_collection_formats,
|
|
317
|
+
_host=_host,
|
|
318
|
+
_request_auth=_request_auth
|
|
319
|
+
)
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
@validate_call
|
|
325
|
+
async def delete_api_key(
|
|
326
|
+
self,
|
|
327
|
+
api_key: StrictStr,
|
|
328
|
+
) -> None:
|
|
329
|
+
"""Delete API Key
|
|
330
|
+
|
|
331
|
+
Endpoint for deleting an existing API key. This endpoint permanently deletes an API key. Once deleted, the key can no longer be used for authentication. This action cannot be undone.
|
|
332
|
+
|
|
333
|
+
:param api_key: API key ID to delete (required)
|
|
334
|
+
:type api_key: str
|
|
335
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
336
|
+
number provided, it will be total request
|
|
337
|
+
timeout. It can also be a pair (tuple) of
|
|
338
|
+
(connection, read) timeouts.
|
|
339
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
340
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
341
|
+
request; this effectively ignores the
|
|
342
|
+
authentication in the spec for a single request.
|
|
343
|
+
:type _request_auth: dict, optional
|
|
344
|
+
:param _content_type: force content-type for the request.
|
|
345
|
+
:type _content_type: str, Optional
|
|
346
|
+
:param _headers: set to override the headers for a single
|
|
347
|
+
request; this effectively ignores the headers
|
|
348
|
+
in the spec for a single request.
|
|
349
|
+
:type _headers: dict, optional
|
|
350
|
+
:param _host_index: set to override the host_index for a single
|
|
351
|
+
request; this effectively ignores the host_index
|
|
352
|
+
in the spec for a single request.
|
|
353
|
+
:type _host_index: int, optional
|
|
354
|
+
:return: Returns the result object.
|
|
355
|
+
""" # noqa: E501
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
_param = self._delete_api_key_serialize(
|
|
359
|
+
api_key=api_key,
|
|
360
|
+
_request_auth=None,
|
|
361
|
+
_content_type=None,
|
|
362
|
+
_headers=None,
|
|
363
|
+
_host_index=0
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
367
|
+
'204': None,
|
|
368
|
+
'400': None,
|
|
369
|
+
'401': None,
|
|
370
|
+
'404': None,
|
|
371
|
+
'500': None,
|
|
372
|
+
}
|
|
373
|
+
response_data = await self.api_client.call_api(
|
|
374
|
+
*_param,
|
|
375
|
+
_request_timeout=None,
|
|
376
|
+
)
|
|
377
|
+
await response_data.read()
|
|
378
|
+
return self.api_client.response_deserialize(
|
|
379
|
+
response_data=response_data,
|
|
380
|
+
response_types_map=_response_types_map,
|
|
381
|
+
).data
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
@validate_call
|
|
385
|
+
async def delete_api_key_with_http_info(
|
|
386
|
+
self,
|
|
387
|
+
api_key: Annotated[StrictStr, Field(description="API key ID to delete")],
|
|
388
|
+
_request_timeout: Union[
|
|
389
|
+
None,
|
|
390
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
391
|
+
Tuple[
|
|
392
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
393
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
394
|
+
]
|
|
395
|
+
] = None,
|
|
396
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
397
|
+
_content_type: Optional[StrictStr] = None,
|
|
398
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
399
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
400
|
+
) -> ApiResponse[None]:
|
|
401
|
+
"""Delete API Key
|
|
402
|
+
|
|
403
|
+
Endpoint for deleting an existing API key. This endpoint permanently deletes an API key. Once deleted, the key can no longer be used for authentication. This action cannot be undone.
|
|
404
|
+
|
|
405
|
+
:param api_key: API key ID to delete (required)
|
|
406
|
+
:type api_key: str
|
|
407
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
408
|
+
number provided, it will be total request
|
|
409
|
+
timeout. It can also be a pair (tuple) of
|
|
410
|
+
(connection, read) timeouts.
|
|
411
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
412
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
413
|
+
request; this effectively ignores the
|
|
414
|
+
authentication in the spec for a single request.
|
|
415
|
+
:type _request_auth: dict, optional
|
|
416
|
+
:param _content_type: force content-type for the request.
|
|
417
|
+
:type _content_type: str, Optional
|
|
418
|
+
:param _headers: set to override the headers for a single
|
|
419
|
+
request; this effectively ignores the headers
|
|
420
|
+
in the spec for a single request.
|
|
421
|
+
:type _headers: dict, optional
|
|
422
|
+
:param _host_index: set to override the host_index for a single
|
|
423
|
+
request; this effectively ignores the host_index
|
|
424
|
+
in the spec for a single request.
|
|
425
|
+
:type _host_index: int, optional
|
|
426
|
+
:return: Returns the result object.
|
|
427
|
+
""" # noqa: E501
|
|
428
|
+
|
|
429
|
+
_param = self._delete_api_key_serialize(
|
|
430
|
+
api_key=api_key,
|
|
431
|
+
_request_auth=_request_auth,
|
|
432
|
+
_content_type=_content_type,
|
|
433
|
+
_headers=_headers,
|
|
434
|
+
_host_index=_host_index
|
|
435
|
+
)
|
|
436
|
+
|
|
437
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
438
|
+
'204': None,
|
|
439
|
+
'400': None,
|
|
440
|
+
'401': None,
|
|
441
|
+
'404': None,
|
|
442
|
+
'500': None,
|
|
443
|
+
}
|
|
444
|
+
response_data = await self.api_client.call_api(
|
|
445
|
+
*_param,
|
|
446
|
+
_request_timeout=_request_timeout
|
|
447
|
+
)
|
|
448
|
+
await response_data.read()
|
|
449
|
+
return self.api_client.response_deserialize(
|
|
450
|
+
response_data=response_data,
|
|
451
|
+
response_types_map=_response_types_map,
|
|
452
|
+
)
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
@validate_call
|
|
456
|
+
async def delete_api_key_without_preload_content(
|
|
457
|
+
self,
|
|
458
|
+
api_key: Annotated[StrictStr, Field(description="API key ID to delete")],
|
|
459
|
+
_request_timeout: Union[
|
|
460
|
+
None,
|
|
461
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
462
|
+
Tuple[
|
|
463
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
464
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
465
|
+
]
|
|
466
|
+
] = None,
|
|
467
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
468
|
+
_content_type: Optional[StrictStr] = None,
|
|
469
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
470
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
471
|
+
) -> RESTResponseType:
|
|
472
|
+
"""Delete API Key
|
|
473
|
+
|
|
474
|
+
Endpoint for deleting an existing API key. This endpoint permanently deletes an API key. Once deleted, the key can no longer be used for authentication. This action cannot be undone.
|
|
475
|
+
|
|
476
|
+
:param api_key: API key ID to delete (required)
|
|
477
|
+
:type api_key: str
|
|
478
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
479
|
+
number provided, it will be total request
|
|
480
|
+
timeout. It can also be a pair (tuple) of
|
|
481
|
+
(connection, read) timeouts.
|
|
482
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
483
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
484
|
+
request; this effectively ignores the
|
|
485
|
+
authentication in the spec for a single request.
|
|
486
|
+
:type _request_auth: dict, optional
|
|
487
|
+
:param _content_type: force content-type for the request.
|
|
488
|
+
:type _content_type: str, Optional
|
|
489
|
+
:param _headers: set to override the headers for a single
|
|
490
|
+
request; this effectively ignores the headers
|
|
491
|
+
in the spec for a single request.
|
|
492
|
+
:type _headers: dict, optional
|
|
493
|
+
:param _host_index: set to override the host_index for a single
|
|
494
|
+
request; this effectively ignores the host_index
|
|
495
|
+
in the spec for a single request.
|
|
496
|
+
:type _host_index: int, optional
|
|
497
|
+
:return: Returns the result object.
|
|
498
|
+
""" # noqa: E501
|
|
499
|
+
|
|
500
|
+
_param = self._delete_api_key_serialize(
|
|
501
|
+
api_key=api_key,
|
|
502
|
+
_request_auth=_request_auth,
|
|
503
|
+
_content_type=_content_type,
|
|
504
|
+
_headers=_headers,
|
|
505
|
+
_host_index=_host_index
|
|
506
|
+
)
|
|
507
|
+
|
|
508
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
509
|
+
'204': None,
|
|
510
|
+
'400': None,
|
|
511
|
+
'401': None,
|
|
512
|
+
'404': None,
|
|
513
|
+
'500': None,
|
|
514
|
+
}
|
|
515
|
+
response_data = await self.api_client.call_api(
|
|
516
|
+
*_param,
|
|
517
|
+
_request_timeout=_request_timeout
|
|
518
|
+
)
|
|
519
|
+
return response_data.response
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
def _delete_api_key_serialize(
|
|
523
|
+
self,
|
|
524
|
+
api_key,
|
|
525
|
+
_request_auth,
|
|
526
|
+
_content_type,
|
|
527
|
+
_headers,
|
|
528
|
+
_host_index,
|
|
529
|
+
) -> RequestSerialized:
|
|
530
|
+
|
|
531
|
+
_host = None
|
|
532
|
+
|
|
533
|
+
_collection_formats: Dict[str, str] = {
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
_path_params: Dict[str, str] = {}
|
|
537
|
+
_query_params: List[Tuple[str, str]] = []
|
|
538
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
539
|
+
_form_params: List[Tuple[str, str]] = []
|
|
540
|
+
_files: Dict[
|
|
541
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
542
|
+
] = {}
|
|
543
|
+
_body_params: Optional[bytes] = None
|
|
544
|
+
|
|
545
|
+
# process the path parameters
|
|
546
|
+
if api_key is not None:
|
|
547
|
+
_path_params['api_key'] = api_key
|
|
548
|
+
# process the query parameters
|
|
549
|
+
# process the header parameters
|
|
550
|
+
# process the form parameters
|
|
551
|
+
# process the body parameter
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
# authentication setting
|
|
557
|
+
_auth_settings: List[str] = [
|
|
558
|
+
'kalshiAccessSignature',
|
|
559
|
+
'kalshiAccessKey',
|
|
560
|
+
'kalshiAccessTimestamp'
|
|
561
|
+
]
|
|
562
|
+
|
|
563
|
+
return self.api_client.param_serialize(
|
|
564
|
+
method='DELETE',
|
|
565
|
+
resource_path='/api_keys/{api_key}',
|
|
566
|
+
path_params=_path_params,
|
|
567
|
+
query_params=_query_params,
|
|
568
|
+
header_params=_header_params,
|
|
569
|
+
body=_body_params,
|
|
570
|
+
post_params=_form_params,
|
|
571
|
+
files=_files,
|
|
572
|
+
auth_settings=_auth_settings,
|
|
573
|
+
collection_formats=_collection_formats,
|
|
574
|
+
_host=_host,
|
|
575
|
+
_request_auth=_request_auth
|
|
576
|
+
)
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
@validate_call
|
|
582
|
+
async def generate_api_key(
|
|
583
|
+
self,
|
|
584
|
+
# Request body parameters as keyword arguments
|
|
585
|
+
**kwargs: Any,
|
|
586
|
+
) -> GenerateApiKeyResponse:
|
|
587
|
+
"""Generate API Key
|
|
588
|
+
|
|
589
|
+
Endpoint for generating a new API key with an automatically created key pair. This endpoint generates both a public and private RSA key pair. The public key is stored on the platform, while the private key is returned to the user and must be stored securely. The private key cannot be retrieved again.
|
|
590
|
+
|
|
591
|
+
:param generate_api_key_request: (required)
|
|
592
|
+
:type generate_api_key_request: GenerateApiKeyRequest
|
|
593
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
594
|
+
number provided, it will be total request
|
|
595
|
+
timeout. It can also be a pair (tuple) of
|
|
596
|
+
(connection, read) timeouts.
|
|
597
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
598
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
599
|
+
request; this effectively ignores the
|
|
600
|
+
authentication in the spec for a single request.
|
|
601
|
+
:type _request_auth: dict, optional
|
|
602
|
+
:param _content_type: force content-type for the request.
|
|
603
|
+
:type _content_type: str, Optional
|
|
604
|
+
:param _headers: set to override the headers for a single
|
|
605
|
+
request; this effectively ignores the headers
|
|
606
|
+
in the spec for a single request.
|
|
607
|
+
:type _headers: dict, optional
|
|
608
|
+
:param _host_index: set to override the host_index for a single
|
|
609
|
+
request; this effectively ignores the host_index
|
|
610
|
+
in the spec for a single request.
|
|
611
|
+
:type _host_index: int, optional
|
|
612
|
+
:return: Returns the result object.
|
|
613
|
+
""" # noqa: E501
|
|
614
|
+
|
|
615
|
+
# Create request object from kwargs
|
|
616
|
+
generate_api_key_request = GenerateApiKeyRequest(**kwargs) if kwargs else None
|
|
617
|
+
|
|
618
|
+
_param = self._generate_api_key_serialize(
|
|
619
|
+
generate_api_key_request=generate_api_key_request,
|
|
620
|
+
_request_auth=kwargs.get('_request_auth'),
|
|
621
|
+
_content_type=kwargs.get('_content_type'),
|
|
622
|
+
_headers=kwargs.get('_headers'),
|
|
623
|
+
_host_index=kwargs.get('_host_index', 0)
|
|
624
|
+
)
|
|
625
|
+
|
|
626
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
627
|
+
'201': "GenerateApiKeyResponse",
|
|
628
|
+
'400': None,
|
|
629
|
+
'401': None,
|
|
630
|
+
'500': None,
|
|
631
|
+
}
|
|
632
|
+
response_data = await self.api_client.call_api(
|
|
633
|
+
*_param,
|
|
634
|
+
_request_timeout=kwargs.get('_request_timeout'),
|
|
635
|
+
)
|
|
636
|
+
await response_data.read()
|
|
637
|
+
return self.api_client.response_deserialize(
|
|
638
|
+
response_data=response_data,
|
|
639
|
+
response_types_map=_response_types_map,
|
|
640
|
+
).data
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
@validate_call
|
|
644
|
+
async def generate_api_key_with_http_info(
|
|
645
|
+
self,
|
|
646
|
+
generate_api_key_request: GenerateApiKeyRequest,
|
|
647
|
+
_request_timeout: Union[
|
|
648
|
+
None,
|
|
649
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
650
|
+
Tuple[
|
|
651
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
652
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
653
|
+
]
|
|
654
|
+
] = None,
|
|
655
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
656
|
+
_content_type: Optional[StrictStr] = None,
|
|
657
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
658
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
659
|
+
) -> ApiResponse[GenerateApiKeyResponse]:
|
|
660
|
+
"""Generate API Key
|
|
661
|
+
|
|
662
|
+
Endpoint for generating a new API key with an automatically created key pair. This endpoint generates both a public and private RSA key pair. The public key is stored on the platform, while the private key is returned to the user and must be stored securely. The private key cannot be retrieved again.
|
|
663
|
+
|
|
664
|
+
:param generate_api_key_request: (required)
|
|
665
|
+
:type generate_api_key_request: GenerateApiKeyRequest
|
|
666
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
667
|
+
number provided, it will be total request
|
|
668
|
+
timeout. It can also be a pair (tuple) of
|
|
669
|
+
(connection, read) timeouts.
|
|
670
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
671
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
672
|
+
request; this effectively ignores the
|
|
673
|
+
authentication in the spec for a single request.
|
|
674
|
+
:type _request_auth: dict, optional
|
|
675
|
+
:param _content_type: force content-type for the request.
|
|
676
|
+
:type _content_type: str, Optional
|
|
677
|
+
:param _headers: set to override the headers for a single
|
|
678
|
+
request; this effectively ignores the headers
|
|
679
|
+
in the spec for a single request.
|
|
680
|
+
:type _headers: dict, optional
|
|
681
|
+
:param _host_index: set to override the host_index for a single
|
|
682
|
+
request; this effectively ignores the host_index
|
|
683
|
+
in the spec for a single request.
|
|
684
|
+
:type _host_index: int, optional
|
|
685
|
+
:return: Returns the result object.
|
|
686
|
+
""" # noqa: E501
|
|
687
|
+
|
|
688
|
+
_param = self._generate_api_key_serialize(
|
|
689
|
+
generate_api_key_request=generate_api_key_request,
|
|
690
|
+
_request_auth=_request_auth,
|
|
691
|
+
_content_type=_content_type,
|
|
692
|
+
_headers=_headers,
|
|
693
|
+
_host_index=_host_index
|
|
694
|
+
)
|
|
695
|
+
|
|
696
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
697
|
+
'201': "GenerateApiKeyResponse",
|
|
698
|
+
'400': None,
|
|
699
|
+
'401': None,
|
|
700
|
+
'500': None,
|
|
701
|
+
}
|
|
702
|
+
response_data = await self.api_client.call_api(
|
|
703
|
+
*_param,
|
|
704
|
+
_request_timeout=_request_timeout
|
|
705
|
+
)
|
|
706
|
+
await response_data.read()
|
|
707
|
+
return self.api_client.response_deserialize(
|
|
708
|
+
response_data=response_data,
|
|
709
|
+
response_types_map=_response_types_map,
|
|
710
|
+
)
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
@validate_call
|
|
714
|
+
async def generate_api_key_without_preload_content(
|
|
715
|
+
self,
|
|
716
|
+
generate_api_key_request: GenerateApiKeyRequest,
|
|
717
|
+
_request_timeout: Union[
|
|
718
|
+
None,
|
|
719
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
720
|
+
Tuple[
|
|
721
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
722
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
723
|
+
]
|
|
724
|
+
] = None,
|
|
725
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
726
|
+
_content_type: Optional[StrictStr] = None,
|
|
727
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
728
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
729
|
+
) -> RESTResponseType:
|
|
730
|
+
"""Generate API Key
|
|
731
|
+
|
|
732
|
+
Endpoint for generating a new API key with an automatically created key pair. This endpoint generates both a public and private RSA key pair. The public key is stored on the platform, while the private key is returned to the user and must be stored securely. The private key cannot be retrieved again.
|
|
733
|
+
|
|
734
|
+
:param generate_api_key_request: (required)
|
|
735
|
+
:type generate_api_key_request: GenerateApiKeyRequest
|
|
736
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
737
|
+
number provided, it will be total request
|
|
738
|
+
timeout. It can also be a pair (tuple) of
|
|
739
|
+
(connection, read) timeouts.
|
|
740
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
741
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
742
|
+
request; this effectively ignores the
|
|
743
|
+
authentication in the spec for a single request.
|
|
744
|
+
:type _request_auth: dict, optional
|
|
745
|
+
:param _content_type: force content-type for the request.
|
|
746
|
+
:type _content_type: str, Optional
|
|
747
|
+
:param _headers: set to override the headers for a single
|
|
748
|
+
request; this effectively ignores the headers
|
|
749
|
+
in the spec for a single request.
|
|
750
|
+
:type _headers: dict, optional
|
|
751
|
+
:param _host_index: set to override the host_index for a single
|
|
752
|
+
request; this effectively ignores the host_index
|
|
753
|
+
in the spec for a single request.
|
|
754
|
+
:type _host_index: int, optional
|
|
755
|
+
:return: Returns the result object.
|
|
756
|
+
""" # noqa: E501
|
|
757
|
+
|
|
758
|
+
_param = self._generate_api_key_serialize(
|
|
759
|
+
generate_api_key_request=generate_api_key_request,
|
|
760
|
+
_request_auth=_request_auth,
|
|
761
|
+
_content_type=_content_type,
|
|
762
|
+
_headers=_headers,
|
|
763
|
+
_host_index=_host_index
|
|
764
|
+
)
|
|
765
|
+
|
|
766
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
767
|
+
'201': "GenerateApiKeyResponse",
|
|
768
|
+
'400': None,
|
|
769
|
+
'401': None,
|
|
770
|
+
'500': None,
|
|
771
|
+
}
|
|
772
|
+
response_data = await self.api_client.call_api(
|
|
773
|
+
*_param,
|
|
774
|
+
_request_timeout=_request_timeout
|
|
775
|
+
)
|
|
776
|
+
return response_data.response
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
def _generate_api_key_serialize(
|
|
780
|
+
self,
|
|
781
|
+
generate_api_key_request,
|
|
782
|
+
_request_auth,
|
|
783
|
+
_content_type,
|
|
784
|
+
_headers,
|
|
785
|
+
_host_index,
|
|
786
|
+
) -> RequestSerialized:
|
|
787
|
+
|
|
788
|
+
_host = None
|
|
789
|
+
|
|
790
|
+
_collection_formats: Dict[str, str] = {
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
_path_params: Dict[str, str] = {}
|
|
794
|
+
_query_params: List[Tuple[str, str]] = []
|
|
795
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
796
|
+
_form_params: List[Tuple[str, str]] = []
|
|
797
|
+
_files: Dict[
|
|
798
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
799
|
+
] = {}
|
|
800
|
+
_body_params: Optional[bytes] = None
|
|
801
|
+
|
|
802
|
+
# process the path parameters
|
|
803
|
+
# process the query parameters
|
|
804
|
+
# process the header parameters
|
|
805
|
+
# process the form parameters
|
|
806
|
+
# process the body parameter
|
|
807
|
+
if generate_api_key_request is not None:
|
|
808
|
+
_body_params = generate_api_key_request
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
# set the HTTP header `Accept`
|
|
812
|
+
if 'Accept' not in _header_params:
|
|
813
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
814
|
+
[
|
|
815
|
+
'application/json'
|
|
816
|
+
]
|
|
817
|
+
)
|
|
818
|
+
|
|
819
|
+
# set the HTTP header `Content-Type`
|
|
820
|
+
if _content_type:
|
|
821
|
+
_header_params['Content-Type'] = _content_type
|
|
822
|
+
else:
|
|
823
|
+
_default_content_type = (
|
|
824
|
+
self.api_client.select_header_content_type(
|
|
825
|
+
[
|
|
826
|
+
'application/json'
|
|
827
|
+
]
|
|
828
|
+
)
|
|
829
|
+
)
|
|
830
|
+
if _default_content_type is not None:
|
|
831
|
+
_header_params['Content-Type'] = _default_content_type
|
|
832
|
+
|
|
833
|
+
# authentication setting
|
|
834
|
+
_auth_settings: List[str] = [
|
|
835
|
+
'kalshiAccessSignature',
|
|
836
|
+
'kalshiAccessKey',
|
|
837
|
+
'kalshiAccessTimestamp'
|
|
838
|
+
]
|
|
839
|
+
|
|
840
|
+
return self.api_client.param_serialize(
|
|
841
|
+
method='POST',
|
|
842
|
+
resource_path='/api_keys/generate',
|
|
843
|
+
path_params=_path_params,
|
|
844
|
+
query_params=_query_params,
|
|
845
|
+
header_params=_header_params,
|
|
846
|
+
body=_body_params,
|
|
847
|
+
post_params=_form_params,
|
|
848
|
+
files=_files,
|
|
849
|
+
auth_settings=_auth_settings,
|
|
850
|
+
collection_formats=_collection_formats,
|
|
851
|
+
_host=_host,
|
|
852
|
+
_request_auth=_request_auth
|
|
853
|
+
)
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
@validate_call
|
|
859
|
+
async def get_api_keys(
|
|
860
|
+
self,
|
|
861
|
+
) -> GetApiKeysResponse:
|
|
862
|
+
"""Get API Keys
|
|
863
|
+
|
|
864
|
+
Endpoint for retrieving all API keys associated with the authenticated user. API keys allow programmatic access to the platform without requiring username/password authentication. Each key has a unique identifier and name.
|
|
865
|
+
|
|
866
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
867
|
+
number provided, it will be total request
|
|
868
|
+
timeout. It can also be a pair (tuple) of
|
|
869
|
+
(connection, read) timeouts.
|
|
870
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
871
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
872
|
+
request; this effectively ignores the
|
|
873
|
+
authentication in the spec for a single request.
|
|
874
|
+
:type _request_auth: dict, optional
|
|
875
|
+
:param _content_type: force content-type for the request.
|
|
876
|
+
:type _content_type: str, Optional
|
|
877
|
+
:param _headers: set to override the headers for a single
|
|
878
|
+
request; this effectively ignores the headers
|
|
879
|
+
in the spec for a single request.
|
|
880
|
+
:type _headers: dict, optional
|
|
881
|
+
:param _host_index: set to override the host_index for a single
|
|
882
|
+
request; this effectively ignores the host_index
|
|
883
|
+
in the spec for a single request.
|
|
884
|
+
:type _host_index: int, optional
|
|
885
|
+
:return: Returns the result object.
|
|
886
|
+
""" # noqa: E501
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
_param = self._get_api_keys_serialize(
|
|
890
|
+
_request_auth=None,
|
|
891
|
+
_content_type=None,
|
|
892
|
+
_headers=None,
|
|
893
|
+
_host_index=0
|
|
894
|
+
)
|
|
895
|
+
|
|
896
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
897
|
+
'200': "GetApiKeysResponse",
|
|
898
|
+
'401': None,
|
|
899
|
+
'500': None,
|
|
900
|
+
}
|
|
901
|
+
response_data = await self.api_client.call_api(
|
|
902
|
+
*_param,
|
|
903
|
+
_request_timeout=None,
|
|
904
|
+
)
|
|
905
|
+
await response_data.read()
|
|
906
|
+
return self.api_client.response_deserialize(
|
|
907
|
+
response_data=response_data,
|
|
908
|
+
response_types_map=_response_types_map,
|
|
909
|
+
).data
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
@validate_call
|
|
913
|
+
async def get_api_keys_with_http_info(
|
|
914
|
+
self,
|
|
915
|
+
_request_timeout: Union[
|
|
916
|
+
None,
|
|
917
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
918
|
+
Tuple[
|
|
919
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
920
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
921
|
+
]
|
|
922
|
+
] = None,
|
|
923
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
924
|
+
_content_type: Optional[StrictStr] = None,
|
|
925
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
926
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
927
|
+
) -> ApiResponse[GetApiKeysResponse]:
|
|
928
|
+
"""Get API Keys
|
|
929
|
+
|
|
930
|
+
Endpoint for retrieving all API keys associated with the authenticated user. API keys allow programmatic access to the platform without requiring username/password authentication. Each key has a unique identifier and name.
|
|
931
|
+
|
|
932
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
933
|
+
number provided, it will be total request
|
|
934
|
+
timeout. It can also be a pair (tuple) of
|
|
935
|
+
(connection, read) timeouts.
|
|
936
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
937
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
938
|
+
request; this effectively ignores the
|
|
939
|
+
authentication in the spec for a single request.
|
|
940
|
+
:type _request_auth: dict, optional
|
|
941
|
+
:param _content_type: force content-type for the request.
|
|
942
|
+
:type _content_type: str, Optional
|
|
943
|
+
:param _headers: set to override the headers for a single
|
|
944
|
+
request; this effectively ignores the headers
|
|
945
|
+
in the spec for a single request.
|
|
946
|
+
:type _headers: dict, optional
|
|
947
|
+
:param _host_index: set to override the host_index for a single
|
|
948
|
+
request; this effectively ignores the host_index
|
|
949
|
+
in the spec for a single request.
|
|
950
|
+
:type _host_index: int, optional
|
|
951
|
+
:return: Returns the result object.
|
|
952
|
+
""" # noqa: E501
|
|
953
|
+
|
|
954
|
+
_param = self._get_api_keys_serialize(
|
|
955
|
+
_request_auth=_request_auth,
|
|
956
|
+
_content_type=_content_type,
|
|
957
|
+
_headers=_headers,
|
|
958
|
+
_host_index=_host_index
|
|
959
|
+
)
|
|
960
|
+
|
|
961
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
962
|
+
'200': "GetApiKeysResponse",
|
|
963
|
+
'401': None,
|
|
964
|
+
'500': None,
|
|
965
|
+
}
|
|
966
|
+
response_data = await self.api_client.call_api(
|
|
967
|
+
*_param,
|
|
968
|
+
_request_timeout=_request_timeout
|
|
969
|
+
)
|
|
970
|
+
await response_data.read()
|
|
971
|
+
return self.api_client.response_deserialize(
|
|
972
|
+
response_data=response_data,
|
|
973
|
+
response_types_map=_response_types_map,
|
|
974
|
+
)
|
|
975
|
+
|
|
976
|
+
|
|
977
|
+
@validate_call
|
|
978
|
+
async def get_api_keys_without_preload_content(
|
|
979
|
+
self,
|
|
980
|
+
_request_timeout: Union[
|
|
981
|
+
None,
|
|
982
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
983
|
+
Tuple[
|
|
984
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
985
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
986
|
+
]
|
|
987
|
+
] = None,
|
|
988
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
989
|
+
_content_type: Optional[StrictStr] = None,
|
|
990
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
991
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
992
|
+
) -> RESTResponseType:
|
|
993
|
+
"""Get API Keys
|
|
994
|
+
|
|
995
|
+
Endpoint for retrieving all API keys associated with the authenticated user. API keys allow programmatic access to the platform without requiring username/password authentication. Each key has a unique identifier and name.
|
|
996
|
+
|
|
997
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
998
|
+
number provided, it will be total request
|
|
999
|
+
timeout. It can also be a pair (tuple) of
|
|
1000
|
+
(connection, read) timeouts.
|
|
1001
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1002
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1003
|
+
request; this effectively ignores the
|
|
1004
|
+
authentication in the spec for a single request.
|
|
1005
|
+
:type _request_auth: dict, optional
|
|
1006
|
+
:param _content_type: force content-type for the request.
|
|
1007
|
+
:type _content_type: str, Optional
|
|
1008
|
+
:param _headers: set to override the headers for a single
|
|
1009
|
+
request; this effectively ignores the headers
|
|
1010
|
+
in the spec for a single request.
|
|
1011
|
+
:type _headers: dict, optional
|
|
1012
|
+
:param _host_index: set to override the host_index for a single
|
|
1013
|
+
request; this effectively ignores the host_index
|
|
1014
|
+
in the spec for a single request.
|
|
1015
|
+
:type _host_index: int, optional
|
|
1016
|
+
:return: Returns the result object.
|
|
1017
|
+
""" # noqa: E501
|
|
1018
|
+
|
|
1019
|
+
_param = self._get_api_keys_serialize(
|
|
1020
|
+
_request_auth=_request_auth,
|
|
1021
|
+
_content_type=_content_type,
|
|
1022
|
+
_headers=_headers,
|
|
1023
|
+
_host_index=_host_index
|
|
1024
|
+
)
|
|
1025
|
+
|
|
1026
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1027
|
+
'200': "GetApiKeysResponse",
|
|
1028
|
+
'401': None,
|
|
1029
|
+
'500': None,
|
|
1030
|
+
}
|
|
1031
|
+
response_data = await self.api_client.call_api(
|
|
1032
|
+
*_param,
|
|
1033
|
+
_request_timeout=_request_timeout
|
|
1034
|
+
)
|
|
1035
|
+
return response_data.response
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
def _get_api_keys_serialize(
|
|
1039
|
+
self,
|
|
1040
|
+
_request_auth,
|
|
1041
|
+
_content_type,
|
|
1042
|
+
_headers,
|
|
1043
|
+
_host_index,
|
|
1044
|
+
) -> RequestSerialized:
|
|
1045
|
+
|
|
1046
|
+
_host = None
|
|
1047
|
+
|
|
1048
|
+
_collection_formats: Dict[str, str] = {
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
_path_params: Dict[str, str] = {}
|
|
1052
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1053
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1054
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1055
|
+
_files: Dict[
|
|
1056
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1057
|
+
] = {}
|
|
1058
|
+
_body_params: Optional[bytes] = None
|
|
1059
|
+
|
|
1060
|
+
# process the path parameters
|
|
1061
|
+
# process the query parameters
|
|
1062
|
+
# process the header parameters
|
|
1063
|
+
# process the form parameters
|
|
1064
|
+
# process the body parameter
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
# set the HTTP header `Accept`
|
|
1068
|
+
if 'Accept' not in _header_params:
|
|
1069
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1070
|
+
[
|
|
1071
|
+
'application/json'
|
|
1072
|
+
]
|
|
1073
|
+
)
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
# authentication setting
|
|
1077
|
+
_auth_settings: List[str] = [
|
|
1078
|
+
'kalshiAccessSignature',
|
|
1079
|
+
'kalshiAccessKey',
|
|
1080
|
+
'kalshiAccessTimestamp'
|
|
1081
|
+
]
|
|
1082
|
+
|
|
1083
|
+
return self.api_client.param_serialize(
|
|
1084
|
+
method='GET',
|
|
1085
|
+
resource_path='/api_keys',
|
|
1086
|
+
path_params=_path_params,
|
|
1087
|
+
query_params=_query_params,
|
|
1088
|
+
header_params=_header_params,
|
|
1089
|
+
body=_body_params,
|
|
1090
|
+
post_params=_form_params,
|
|
1091
|
+
files=_files,
|
|
1092
|
+
auth_settings=_auth_settings,
|
|
1093
|
+
collection_formats=_collection_formats,
|
|
1094
|
+
_host=_host,
|
|
1095
|
+
_request_auth=_request_auth
|
|
1096
|
+
)
|
|
1097
|
+
|
|
1098
|
+
|