Skip to content

Added titleSlug field to question details and fixed totalNum field na… #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/GraphqlProblemsetQuestionList.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**total** | **int** | | [optional]
**total_num** | **int** | | [optional]
**questions** | [**list[GraphqlQuestionDetail]**](GraphqlQuestionDetail.md) | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
1 change: 1 addition & 0 deletions docs/GraphqlQuestionDetail.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Name | Type | Description | Notes
**question_frontend_id** | **str** | | [optional]
**bound_topic_id** | **str** | | [optional]
**title** | **str** | | [optional]
**title_slug** | **str** | | [optional]
**frequency** | **float** | | [optional]
**freq_bar** | **float** | | [optional]
**content** | **str** | | [optional]
Expand Down
30 changes: 15 additions & 15 deletions leetcode/models/graphql_problemset_question_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,40 +30,40 @@ class GraphqlProblemsetQuestionList(object):
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {"total": "int", "questions": "list[GraphqlQuestionDetail]"}
swagger_types = {"total_num": "int", "questions": "list[GraphqlQuestionDetail]"}

attribute_map = {"total": "total", "questions": "questions"}
attribute_map = {"total_num": "totalNum", "questions": "questions"}

def __init__(self, total=None, questions=None) -> None: # noqa: E501
def __init__(self, total_num=None, questions=None) -> None: # noqa: E501
"""GraphqlProblemsetQuestionList - a model defined in Swagger""" # noqa: E501
self._total = None
self._total_num = None
self._questions = None
self.discriminator = None
if total is not None:
self.total = total
if total_num is not None:
self.total_num = total_num
if questions is not None:
self.questions = questions

@property
def total(self):
"""Gets the total of this GraphqlProblemsetQuestionList. # noqa: E501
def total_num(self):
"""Gets the total_num of this GraphqlProblemsetQuestionList. # noqa: E501


:return: The total of this GraphqlProblemsetQuestionList. # noqa: E501
:return: The total_num of this GraphqlProblemsetQuestionList. # noqa: E501
:rtype: int
"""
return self._total
return self._total_num

@total.setter
def total(self, total):
"""Sets the total of this GraphqlProblemsetQuestionList.
@total_num.setter
def total_num(self, total_num):
"""Sets the total_num of this GraphqlProblemsetQuestionList.


:param total: The total of this GraphqlProblemsetQuestionList. # noqa: E501
:param total_num: The total_num of this GraphqlProblemsetQuestionList. # noqa: E501
:type: int
"""

self._total = total
self._total_num = total_num

@property
def questions(self):
Expand Down
27 changes: 27 additions & 0 deletions leetcode/models/graphql_question_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class GraphqlQuestionDetail(object):
"question_frontend_id": "str",
"bound_topic_id": "str",
"title": "str",
"title_slug": "str",
"frequency": "float",
"freq_bar": "float",
"content": "str",
Expand Down Expand Up @@ -74,6 +75,7 @@ class GraphqlQuestionDetail(object):
"question_frontend_id": "questionFrontendId",
"bound_topic_id": "boundTopicId",
"title": "title",
"title_slug": "titleSlug",
"frequency": "frequency",
"freq_bar": "freqBar",
"content": "content",
Expand Down Expand Up @@ -115,6 +117,7 @@ def __init__(
question_frontend_id=None,
bound_topic_id=None,
title=None,
title_slug=None,
frequency=None,
freq_bar=None,
content=None,
Expand Down Expand Up @@ -154,6 +157,7 @@ def __init__(
self._question_frontend_id = None
self._bound_topic_id = None
self._title = None
self._title_slug = None
self._frequency = None
self._freq_bar = None
self._content = None
Expand Down Expand Up @@ -196,6 +200,8 @@ def __init__(
self.bound_topic_id = bound_topic_id
if title is not None:
self.title = title
if title_slug is not None:
self.title_slug = title_slug
if frequency is not None:
self.frequency = frequency
if freq_bar is not None:
Expand Down Expand Up @@ -347,6 +353,27 @@ def title(self, title):

self._title = title

@property
def title_slug(self):
"""Gets the title_slug of this GraphqlQuestionDetail. # noqa: E501


:return: The title_slug of this GraphqlQuestionDetail. # noqa: E501
:rtype: str
"""
return self._title_slug

@title_slug.setter
def title_slug(self, title_slug):
"""Sets the title_slug of this GraphqlQuestionDetail.


:param title_slug: The title_slug of this GraphqlQuestionDetail. # noqa: E501
:type: str
"""

self._title_slug = title_slug

@property
def frequency(self):
"""Gets the frequency of this GraphqlQuestionDetail. # noqa: E501
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from setuptools import find_packages, setup # noqa: H301

NAME = "python-leetcode"
VERSION = "1.1.0"
VERSION = "1.2.0"

with open("README.md") as readme:
DESCRIPTION: str = readme.read()
Expand Down
2 changes: 2 additions & 0 deletions test/test_graphql_request_get_question_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def test_request(self) -> None:
questionFrontendId
boundTopicId
title
titleSlug
frequency
freqBar
content
Expand Down Expand Up @@ -98,6 +99,7 @@ def test_request(self) -> None:
assert question.question_frontend_id == "1"
assert question.bound_topic_id is None
assert question.title == "Two Sum"
assert question.title_slug == "two-sum"
assert question.frequency == 0.0
assert question.freq_bar > 0
assert len(question.content) > 10
Expand Down
4 changes: 2 additions & 2 deletions test/test_graphql_request_problemset_question_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_request(self) -> None:
skip: $skip
filters: $filters
) {
total: totalNum
totalNum
questions: data {
questionId
questionFrontendId
Expand Down Expand Up @@ -111,7 +111,7 @@ def test_request(self) -> None:

assert data

assert data.problemset_question_list.total > 0
assert data.problemset_question_list.total_num > 0

question_list = data.problemset_question_list.questions
user = data.user
Expand Down