Skip to content

Commit 1badc59

Browse files
committed
Moved autogenerated readme to a separated file
1 parent a5babd3 commit 1badc59

File tree

2 files changed

+286
-281
lines changed

2 files changed

+286
-281
lines changed

README.generated.md

Lines changed: 282 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
# leetcode
2+
Leetcode API implementation.
3+
4+
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
5+
6+
- API version: 1.0.1-1
7+
- Package version: 1.0.0
8+
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
9+
10+
## Requirements.
11+
12+
Python 2.7 and 3.4+
13+
14+
## Installation & Usage
15+
### pip install
16+
17+
If the python package is hosted on Github, you can install directly from Github
18+
19+
```sh
20+
pip install git+https://github.com/prius/python-leetcode.git
21+
```
22+
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/prius/python-leetcode.git`)
23+
24+
Then import the package:
25+
```python
26+
import leetcode
27+
```
28+
29+
### Setuptools
30+
31+
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
32+
33+
```sh
34+
python setup.py install --user
35+
```
36+
(or `sudo python setup.py install` to install the package for all users)
37+
38+
Then import the package:
39+
```python
40+
import leetcode
41+
```
42+
43+
## Getting Started
44+
45+
Please follow the [installation procedure](#installation--usage) and then run the following:
46+
47+
```python
48+
from __future__ import print_function
49+
import time
50+
import leetcode
51+
from leetcode.rest import ApiException
52+
from pprint import pprint
53+
54+
# Configure API key authorization: cookieCSRF
55+
configuration = leetcode.Configuration()
56+
configuration.api_key['csrftoken'] = 'YOUR_API_KEY'
57+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
58+
# configuration.api_key_prefix['csrftoken'] = 'Bearer'
59+
# Configure API key authorization: cookieSession
60+
configuration = leetcode.Configuration()
61+
configuration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'
62+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
63+
# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'
64+
# Configure API key authorization: headerCSRF
65+
configuration = leetcode.Configuration()
66+
configuration.api_key['x-csrftoken'] = 'YOUR_API_KEY'
67+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
68+
# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'
69+
# Configure API key authorization: referer
70+
configuration = leetcode.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'
74+
75+
# create an instance of the API class
76+
api_instance = leetcode.DefaultApi(leetcode.ApiClient(configuration))
77+
topic = 'topic_example' # str |
78+
79+
try:
80+
api_response = api_instance.api_problems_topic_get(topic)
81+
pprint(api_response)
82+
except ApiException as e:
83+
print("Exception when calling DefaultApi->api_problems_topic_get: %s\n" % e)
84+
85+
# Configure API key authorization: cookieCSRF
86+
configuration = leetcode.Configuration()
87+
configuration.api_key['csrftoken'] = 'YOUR_API_KEY'
88+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
89+
# configuration.api_key_prefix['csrftoken'] = 'Bearer'
90+
# Configure API key authorization: cookieSession
91+
configuration = leetcode.Configuration()
92+
configuration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'
93+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
94+
# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'
95+
# Configure API key authorization: headerCSRF
96+
configuration = leetcode.Configuration()
97+
configuration.api_key['x-csrftoken'] = 'YOUR_API_KEY'
98+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
99+
# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'
100+
# Configure API key authorization: referer
101+
configuration = leetcode.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'
105+
106+
# create an instance of the API class
107+
api_instance = leetcode.DefaultApi(leetcode.ApiClient(configuration))
108+
body = leetcode.GraphqlQuery() # GraphqlQuery | GraphQL query (optional)
109+
110+
try:
111+
api_response = api_instance.graphql_post(body=body)
112+
pprint(api_response)
113+
except ApiException as e:
114+
print("Exception when calling DefaultApi->graphql_post: %s\n" % e)
115+
116+
# Configure API key authorization: cookieCSRF
117+
configuration = leetcode.Configuration()
118+
configuration.api_key['csrftoken'] = 'YOUR_API_KEY'
119+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
120+
# configuration.api_key_prefix['csrftoken'] = 'Bearer'
121+
# Configure API key authorization: cookieSession
122+
configuration = leetcode.Configuration()
123+
configuration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'
124+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
125+
# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'
126+
# Configure API key authorization: headerCSRF
127+
configuration = leetcode.Configuration()
128+
configuration.api_key['x-csrftoken'] = 'YOUR_API_KEY'
129+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
130+
# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'
131+
# Configure API key authorization: referer
132+
configuration = leetcode.Configuration()
133+
configuration.api_key['Referer'] = 'YOUR_API_KEY'
134+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
135+
# configuration.api_key_prefix['Referer'] = 'Bearer'
136+
137+
# create an instance of the API class
138+
api_instance = leetcode.DefaultApi(leetcode.ApiClient(configuration))
139+
problem = 'problem_example' # str |
140+
body = leetcode.TestSubmission() # TestSubmission | Solution to test (optional)
141+
142+
try:
143+
api_response = api_instance.problems_problem_interpret_solution_post(problem, body=body)
144+
pprint(api_response)
145+
except ApiException as e:
146+
print("Exception when calling DefaultApi->problems_problem_interpret_solution_post: %s\n" % e)
147+
148+
# Configure API key authorization: cookieCSRF
149+
configuration = leetcode.Configuration()
150+
configuration.api_key['csrftoken'] = 'YOUR_API_KEY'
151+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
152+
# configuration.api_key_prefix['csrftoken'] = 'Bearer'
153+
# Configure API key authorization: cookieSession
154+
configuration = leetcode.Configuration()
155+
configuration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'
156+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
157+
# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'
158+
# Configure API key authorization: headerCSRF
159+
configuration = leetcode.Configuration()
160+
configuration.api_key['x-csrftoken'] = 'YOUR_API_KEY'
161+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
162+
# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'
163+
# Configure API key authorization: referer
164+
configuration = leetcode.Configuration()
165+
configuration.api_key['Referer'] = 'YOUR_API_KEY'
166+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
167+
# configuration.api_key_prefix['Referer'] = 'Bearer'
168+
169+
# create an instance of the API class
170+
api_instance = leetcode.DefaultApi(leetcode.ApiClient(configuration))
171+
problem = 'problem_example' # str |
172+
body = leetcode.Submission() # Submission | Solution to test (optional)
173+
174+
try:
175+
api_response = api_instance.problems_problem_submit_post(problem, body=body)
176+
pprint(api_response)
177+
except ApiException as e:
178+
print("Exception when calling DefaultApi->problems_problem_submit_post: %s\n" % e)
179+
180+
# Configure API key authorization: cookieCSRF
181+
configuration = leetcode.Configuration()
182+
configuration.api_key['csrftoken'] = 'YOUR_API_KEY'
183+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
184+
# configuration.api_key_prefix['csrftoken'] = 'Bearer'
185+
# Configure API key authorization: cookieSession
186+
configuration = leetcode.Configuration()
187+
configuration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'
188+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
189+
# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'
190+
# Configure API key authorization: headerCSRF
191+
configuration = leetcode.Configuration()
192+
configuration.api_key['x-csrftoken'] = 'YOUR_API_KEY'
193+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
194+
# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'
195+
# Configure API key authorization: referer
196+
configuration = leetcode.Configuration()
197+
configuration.api_key['Referer'] = 'YOUR_API_KEY'
198+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
199+
# configuration.api_key_prefix['Referer'] = 'Bearer'
200+
201+
# create an instance of the API class
202+
api_instance = leetcode.DefaultApi(leetcode.ApiClient(configuration))
203+
id = leetcode.Id() # Id | Either submission id (int) or interpretation id (string)
204+
205+
try:
206+
api_response = api_instance.submissions_detail_id_check_get(id)
207+
pprint(api_response)
208+
except ApiException as e:
209+
print("Exception when calling DefaultApi->submissions_detail_id_check_get: %s\n" % e)
210+
```
211+
212+
## Documentation for API Endpoints
213+
214+
All URIs are relative to *https://leetcode.com*
215+
216+
Class | Method | HTTP request | Description
217+
------------ | ------------- | ------------- | -------------
218+
*DefaultApi* | [**api_problems_topic_get**](docs/DefaultApi.md#api_problems_topic_get) | **GET** /api/problems/{topic}/ |
219+
*DefaultApi* | [**graphql_post**](docs/DefaultApi.md#graphql_post) | **POST** /graphql |
220+
*DefaultApi* | [**problems_problem_interpret_solution_post**](docs/DefaultApi.md#problems_problem_interpret_solution_post) | **POST** /problems/{problem}/interpret_solution/ |
221+
*DefaultApi* | [**problems_problem_submit_post**](docs/DefaultApi.md#problems_problem_submit_post) | **POST** /problems/{problem}/submit/ |
222+
*DefaultApi* | [**submissions_detail_id_check_get**](docs/DefaultApi.md#submissions_detail_id_check_get) | **GET** /submissions/detail/{id}/check/ |
223+
224+
## Documentation For Models
225+
226+
- [BaseSubmissionResult](docs/BaseSubmissionResult.md)
227+
- [Difficulty](docs/Difficulty.md)
228+
- [GraphqlData](docs/GraphqlData.md)
229+
- [GraphqlQuery](docs/GraphqlQuery.md)
230+
- [GraphqlQueryVariables](docs/GraphqlQueryVariables.md)
231+
- [GraphqlQuestionCodeSnippet](docs/GraphqlQuestionCodeSnippet.md)
232+
- [GraphqlQuestionContributor](docs/GraphqlQuestionContributor.md)
233+
- [GraphqlQuestionDetail](docs/GraphqlQuestionDetail.md)
234+
- [GraphqlQuestionSolution](docs/GraphqlQuestionSolution.md)
235+
- [GraphqlQuestionTopicTag](docs/GraphqlQuestionTopicTag.md)
236+
- [GraphqlResponse](docs/GraphqlResponse.md)
237+
- [GraphqlUser](docs/GraphqlUser.md)
238+
- [Id](docs/Id.md)
239+
- [InlineResponse200](docs/InlineResponse200.md)
240+
- [Interpretation](docs/Interpretation.md)
241+
- [OneOfid](docs/OneOfid.md)
242+
- [OneOfinlineResponse200](docs/OneOfinlineResponse200.md)
243+
- [Problems](docs/Problems.md)
244+
- [Stat](docs/Stat.md)
245+
- [StatStatusPair](docs/StatStatusPair.md)
246+
- [Submission](docs/Submission.md)
247+
- [SubmissionId](docs/SubmissionId.md)
248+
- [SubmissionResult](docs/SubmissionResult.md)
249+
- [TestSubmission](docs/TestSubmission.md)
250+
- [TestSubmissionResult](docs/TestSubmissionResult.md)
251+
252+
## Documentation For Authorization
253+
254+
255+
## cookieCSRF
256+
257+
- **Type**: API key
258+
- **API key parameter name**: csrftoken
259+
- **Location**: URL query string
260+
261+
## cookieSession
262+
263+
- **Type**: API key
264+
- **API key parameter name**: LEETCODE_SESSION
265+
- **Location**: URL query string
266+
267+
## headerCSRF
268+
269+
- **Type**: API key
270+
- **API key parameter name**: x-csrftoken
271+
- **Location**: HTTP header
272+
273+
## referer
274+
275+
- **Type**: API key
276+
- **API key parameter name**: Referer
277+
- **Location**: HTTP header
278+
279+
280+
## Author
281+
282+
pv.safronov@gmail.com

0 commit comments

Comments
 (0)