Skip to content

Commit 31be48f

Browse files
committed
Added new methods to test and submit solutions
1 parent 8dcdbfd commit 31be48f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3761
-40
lines changed

README.md

Lines changed: 93 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ configuration = swagger_client.Configuration()
6666
configuration.api_key['x-csrftoken'] = 'YOUR_API_KEY'
6767
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
6868
# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'
69+
# Configure API key authorization: referer
70+
configuration = swagger_client.Configuration()
71+
configuration.api_key['Referer'] = 'YOUR_API_KEY'
72+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
73+
# configuration.api_key_prefix['Referer'] = 'Bearer'
6974

7075
# create an instance of the API class
7176
api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration))
@@ -92,18 +97,85 @@ configuration = swagger_client.Configuration()
9297
configuration.api_key['x-csrftoken'] = 'YOUR_API_KEY'
9398
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
9499
# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'
100+
# Configure API key authorization: referer
101+
configuration = swagger_client.Configuration()
102+
configuration.api_key['Referer'] = 'YOUR_API_KEY'
103+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
104+
# configuration.api_key_prefix['Referer'] = 'Bearer'
95105

96106
# create an instance of the API class
97107
api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration))
98-
referer = 'referer_example' # str |
99108
problem = 'problem_example' # str |
100-
body = swagger_client.Solution() # Solution | Solution to test (optional)
109+
body = swagger_client.TestSubmission() # TestSubmission | Solution to test (optional)
101110

102111
try:
103-
api_response = api_instance.problems_problem_interpret_solution_post(referer, problem, body=body)
112+
api_response = api_instance.problems_problem_interpret_solution_post(problem, body=body)
104113
pprint(api_response)
105114
except ApiException as e:
106115
print("Exception when calling DefaultApi->problems_problem_interpret_solution_post: %s\n" % e)
116+
117+
# Configure API key authorization: cookieCSRF
118+
configuration = swagger_client.Configuration()
119+
configuration.api_key['csrftoken'] = 'YOUR_API_KEY'
120+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
121+
# configuration.api_key_prefix['csrftoken'] = 'Bearer'
122+
# Configure API key authorization: cookieSession
123+
configuration = swagger_client.Configuration()
124+
configuration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'
125+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
126+
# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'
127+
# Configure API key authorization: headerCSRF
128+
configuration = swagger_client.Configuration()
129+
configuration.api_key['x-csrftoken'] = 'YOUR_API_KEY'
130+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
131+
# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'
132+
# Configure API key authorization: referer
133+
configuration = swagger_client.Configuration()
134+
configuration.api_key['Referer'] = 'YOUR_API_KEY'
135+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
136+
# configuration.api_key_prefix['Referer'] = 'Bearer'
137+
138+
# create an instance of the API class
139+
api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration))
140+
problem = 'problem_example' # str |
141+
body = swagger_client.Submission() # Submission | Solution to test (optional)
142+
143+
try:
144+
api_response = api_instance.problems_problem_submit_post(problem, body=body)
145+
pprint(api_response)
146+
except ApiException as e:
147+
print("Exception when calling DefaultApi->problems_problem_submit_post: %s\n" % e)
148+
149+
# Configure API key authorization: cookieCSRF
150+
configuration = swagger_client.Configuration()
151+
configuration.api_key['csrftoken'] = 'YOUR_API_KEY'
152+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
153+
# configuration.api_key_prefix['csrftoken'] = 'Bearer'
154+
# Configure API key authorization: cookieSession
155+
configuration = swagger_client.Configuration()
156+
configuration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'
157+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
158+
# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'
159+
# Configure API key authorization: headerCSRF
160+
configuration = swagger_client.Configuration()
161+
configuration.api_key['x-csrftoken'] = 'YOUR_API_KEY'
162+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
163+
# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'
164+
# Configure API key authorization: referer
165+
configuration = swagger_client.Configuration()
166+
configuration.api_key['Referer'] = 'YOUR_API_KEY'
167+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
168+
# configuration.api_key_prefix['Referer'] = 'Bearer'
169+
170+
# create an instance of the API class
171+
api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration))
172+
id = swagger_client.Id() # Id | Either submission id (int) or interpretation id (string)
173+
174+
try:
175+
api_response = api_instance.submissions_detail_id_check_get(id)
176+
pprint(api_response)
177+
except ApiException as e:
178+
print("Exception when calling DefaultApi->submissions_detail_id_check_get: %s\n" % e)
107179
```
108180

109181
## Documentation for API Endpoints
@@ -114,15 +186,26 @@ Class | Method | HTTP request | Description
114186
------------ | ------------- | ------------- | -------------
115187
*DefaultApi* | [**api_problems_topic_get**](docs/DefaultApi.md#api_problems_topic_get) | **GET** /api/problems/{topic}/ |
116188
*DefaultApi* | [**problems_problem_interpret_solution_post**](docs/DefaultApi.md#problems_problem_interpret_solution_post) | **POST** /problems/{problem}/interpret_solution/ |
189+
*DefaultApi* | [**problems_problem_submit_post**](docs/DefaultApi.md#problems_problem_submit_post) | **POST** /problems/{problem}/submit/ |
190+
*DefaultApi* | [**submissions_detail_id_check_get**](docs/DefaultApi.md#submissions_detail_id_check_get) | **GET** /submissions/detail/{id}/check/ |
117191

118192
## Documentation For Models
119193

194+
- [BaseSubmissionResult](docs/BaseSubmissionResult.md)
120195
- [Difficulty](docs/Difficulty.md)
196+
- [Id](docs/Id.md)
197+
- [InlineResponse200](docs/InlineResponse200.md)
121198
- [Interpretation](docs/Interpretation.md)
199+
- [OneOfid](docs/OneOfid.md)
200+
- [OneOfinlineResponse200](docs/OneOfinlineResponse200.md)
122201
- [Problems](docs/Problems.md)
123-
- [Solution](docs/Solution.md)
124202
- [Stat](docs/Stat.md)
125203
- [StatStatusPair](docs/StatStatusPair.md)
204+
- [Submission](docs/Submission.md)
205+
- [SubmissionId](docs/SubmissionId.md)
206+
- [SubmissionResult](docs/SubmissionResult.md)
207+
- [TestSubmission](docs/TestSubmission.md)
208+
- [TestSubmissionResult](docs/TestSubmissionResult.md)
126209

127210
## Documentation For Authorization
128211

@@ -145,6 +228,12 @@ Class | Method | HTTP request | Description
145228
- **API key parameter name**: x-csrftoken
146229
- **Location**: HTTP header
147230

231+
## referer
232+
233+
- **Type**: API key
234+
- **API key parameter name**: Referer
235+
- **Location**: HTTP header
236+
148237

149238
## Author
150239

docs/AnyOfinlineResponse200.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# AnyOfinlineResponse200
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
7+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
8+

docs/BaseSubmissionResult.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# BaseSubmissionResult
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**code_output** | **list[str]** | | [optional]
7+
**elapsed_time** | **int** | |
8+
**full_runtime_error** | **str** | | [optional]
9+
**lang** | **str** | |
10+
**memory** | **int** | |
11+
**memory_percentile** | **float** | | [optional]
12+
**pretty_lang** | **str** | |
13+
**run_success** | **bool** | |
14+
**runtime_error** | **str** | | [optional]
15+
**runtime_percentile** | **float** | | [optional]
16+
**state** | **str** | |
17+
**status_code** | **int** | |
18+
**status_memory** | **str** | | [optional]
19+
**status_msg** | **str** | |
20+
**status_runtime** | **str** | |
21+
**submission_id** | **str** | |
22+
**task_finish_time** | **int** | |
23+
**total_correct** | **int** | | [optional]
24+
**total_testcases** | **int** | | [optional]
25+
**question_id** | **int** | | [optional]
26+
27+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
28+

0 commit comments

Comments
 (0)