Skip to content

Commit 205c018

Browse files
authored
Merge pull request #15 from prius/dev-problemset-query
Added titleSlug field to question details and fixed totalNum field na…
2 parents c6d6cce + 7fdb28d commit 205c018

7 files changed

+49
-19
lines changed

docs/GraphqlProblemsetQuestionList.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**total** | **int** | | [optional]
6+
**total_num** | **int** | | [optional]
77
**questions** | [**list[GraphqlQuestionDetail]**](GraphqlQuestionDetail.md) | | [optional]
88

99
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

docs/GraphqlQuestionDetail.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Name | Type | Description | Notes
77
**question_frontend_id** | **str** | | [optional]
88
**bound_topic_id** | **str** | | [optional]
99
**title** | **str** | | [optional]
10+
**title_slug** | **str** | | [optional]
1011
**frequency** | **float** | | [optional]
1112
**freq_bar** | **float** | | [optional]
1213
**content** | **str** | | [optional]

leetcode/models/graphql_problemset_question_list.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,40 +30,40 @@ class GraphqlProblemsetQuestionList(object):
3030
attribute_map (dict): The key is attribute name
3131
and the value is json key in definition.
3232
"""
33-
swagger_types = {"total": "int", "questions": "list[GraphqlQuestionDetail]"}
33+
swagger_types = {"total_num": "int", "questions": "list[GraphqlQuestionDetail]"}
3434

35-
attribute_map = {"total": "total", "questions": "questions"}
35+
attribute_map = {"total_num": "totalNum", "questions": "questions"}
3636

37-
def __init__(self, total=None, questions=None) -> None: # noqa: E501
37+
def __init__(self, total_num=None, questions=None) -> None: # noqa: E501
3838
"""GraphqlProblemsetQuestionList - a model defined in Swagger""" # noqa: E501
39-
self._total = None
39+
self._total_num = None
4040
self._questions = None
4141
self.discriminator = None
42-
if total is not None:
43-
self.total = total
42+
if total_num is not None:
43+
self.total_num = total_num
4444
if questions is not None:
4545
self.questions = questions
4646

4747
@property
48-
def total(self):
49-
"""Gets the total of this GraphqlProblemsetQuestionList. # noqa: E501
48+
def total_num(self):
49+
"""Gets the total_num of this GraphqlProblemsetQuestionList. # noqa: E501
5050
5151
52-
:return: The total of this GraphqlProblemsetQuestionList. # noqa: E501
52+
:return: The total_num of this GraphqlProblemsetQuestionList. # noqa: E501
5353
:rtype: int
5454
"""
55-
return self._total
55+
return self._total_num
5656

57-
@total.setter
58-
def total(self, total):
59-
"""Sets the total of this GraphqlProblemsetQuestionList.
57+
@total_num.setter
58+
def total_num(self, total_num):
59+
"""Sets the total_num of this GraphqlProblemsetQuestionList.
6060
6161
62-
:param total: The total of this GraphqlProblemsetQuestionList. # noqa: E501
62+
:param total_num: The total_num of this GraphqlProblemsetQuestionList. # noqa: E501
6363
:type: int
6464
"""
6565

66-
self._total = total
66+
self._total_num = total_num
6767

6868
@property
6969
def questions(self):

leetcode/models/graphql_question_detail.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class GraphqlQuestionDetail(object):
3434
"question_frontend_id": "str",
3535
"bound_topic_id": "str",
3636
"title": "str",
37+
"title_slug": "str",
3738
"frequency": "float",
3839
"freq_bar": "float",
3940
"content": "str",
@@ -74,6 +75,7 @@ class GraphqlQuestionDetail(object):
7475
"question_frontend_id": "questionFrontendId",
7576
"bound_topic_id": "boundTopicId",
7677
"title": "title",
78+
"title_slug": "titleSlug",
7779
"frequency": "frequency",
7880
"freq_bar": "freqBar",
7981
"content": "content",
@@ -115,6 +117,7 @@ def __init__(
115117
question_frontend_id=None,
116118
bound_topic_id=None,
117119
title=None,
120+
title_slug=None,
118121
frequency=None,
119122
freq_bar=None,
120123
content=None,
@@ -154,6 +157,7 @@ def __init__(
154157
self._question_frontend_id = None
155158
self._bound_topic_id = None
156159
self._title = None
160+
self._title_slug = None
157161
self._frequency = None
158162
self._freq_bar = None
159163
self._content = None
@@ -196,6 +200,8 @@ def __init__(
196200
self.bound_topic_id = bound_topic_id
197201
if title is not None:
198202
self.title = title
203+
if title_slug is not None:
204+
self.title_slug = title_slug
199205
if frequency is not None:
200206
self.frequency = frequency
201207
if freq_bar is not None:
@@ -347,6 +353,27 @@ def title(self, title):
347353

348354
self._title = title
349355

356+
@property
357+
def title_slug(self):
358+
"""Gets the title_slug of this GraphqlQuestionDetail. # noqa: E501
359+
360+
361+
:return: The title_slug of this GraphqlQuestionDetail. # noqa: E501
362+
:rtype: str
363+
"""
364+
return self._title_slug
365+
366+
@title_slug.setter
367+
def title_slug(self, title_slug):
368+
"""Sets the title_slug of this GraphqlQuestionDetail.
369+
370+
371+
:param title_slug: The title_slug of this GraphqlQuestionDetail. # noqa: E501
372+
:type: str
373+
"""
374+
375+
self._title_slug = title_slug
376+
350377
@property
351378
def frequency(self):
352379
"""Gets the frequency of this GraphqlQuestionDetail. # noqa: E501

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from setuptools import find_packages, setup # noqa: H301
1515

1616
NAME = "python-leetcode"
17-
VERSION = "1.1.0"
17+
VERSION = "1.2.0"
1818

1919
with open("README.md") as readme:
2020
DESCRIPTION: str = readme.read()

test/test_graphql_request_get_question_detail.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def test_request(self) -> None:
1919
questionFrontendId
2020
boundTopicId
2121
title
22+
titleSlug
2223
frequency
2324
freqBar
2425
content
@@ -98,6 +99,7 @@ def test_request(self) -> None:
9899
assert question.question_frontend_id == "1"
99100
assert question.bound_topic_id is None
100101
assert question.title == "Two Sum"
102+
assert question.title_slug == "two-sum"
101103
assert question.frequency == 0.0
102104
assert question.freq_bar > 0
103105
assert len(question.content) > 10

test/test_graphql_request_problemset_question_list.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_request(self) -> None:
2323
skip: $skip
2424
filters: $filters
2525
) {
26-
total: totalNum
26+
totalNum
2727
questions: data {
2828
questionId
2929
questionFrontendId
@@ -111,7 +111,7 @@ def test_request(self) -> None:
111111

112112
assert data
113113

114-
assert data.problemset_question_list.total > 0
114+
assert data.problemset_question_list.total_num > 0
115115

116116
question_list = data.problemset_question_list.questions
117117
user = data.user

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy