Skip to content

Commit b9ebea0

Browse files
committed
Incorporate the changes induced by patching the OpenAPI spec for swagger-codegen -l python (swagger-api/swagger-codegen#10906).
1 parent 0505b2d commit b9ebea0

File tree

5 files changed

+70
-77
lines changed

5 files changed

+70
-77
lines changed

bin/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fi
1717

1818
for lockss_svc in "${LOCKSS_REST_SERVICES[@]}"; do
1919
PROJECT_DIR="${LAAWS_BUILD_DIR}/${lockss_svc}"
20-
PYTHON_CLIENT_SRC="${PROJECT_DIR}/target/swagger_client"
20+
PYTHON_CLIENT_SRC="${PROJECT_DIR}/target/swagger_codegen_python"
2121

2222
# Invoke Swagger codegen plugin in Maven to generate Python clients
2323
( cd ${PROJECT_DIR} && mvn generate-sources -DskipSwagger=true -DskipSwaggerPython=false )

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lockss/pyclient/crawler/models/page_info.py

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,33 @@ class PageInfo(object):
2929
"""
3030
swagger_types = {
3131
'total_count': 'int',
32-
'results_per_page': 'int',
32+
'items_in_page': 'int',
3333
'continuation_token': 'str',
3434
'cur_link': 'str',
3535
'next_link': 'str'
3636
}
3737

3838
attribute_map = {
3939
'total_count': 'totalCount',
40-
'results_per_page': 'resultsPerPage',
40+
'items_in_page': 'itemsInPage',
4141
'continuation_token': 'continuationToken',
4242
'cur_link': 'curLink',
4343
'next_link': 'nextLink'
4444
}
4545

46-
def __init__(self, total_count=None, results_per_page=None, continuation_token=None, cur_link=None, next_link=None): # noqa: E501
46+
def __init__(self, total_count=None, items_in_page=None, continuation_token=None, cur_link=None, next_link=None): # noqa: E501
4747
"""PageInfo - a model defined in Swagger""" # noqa: E501
4848
self._total_count = None
49-
self._results_per_page = None
49+
self._items_in_page = None
5050
self._continuation_token = None
5151
self._cur_link = None
5252
self._next_link = None
5353
self.discriminator = None
54-
self.total_count = total_count
55-
self.results_per_page = results_per_page
56-
self.continuation_token = continuation_token
54+
if total_count is not None:
55+
self.total_count = total_count
56+
self.items_in_page = items_in_page
57+
if continuation_token is not None:
58+
self.continuation_token = continuation_token
5759
self.cur_link = cur_link
5860
if next_link is not None:
5961
self.next_link = next_link
@@ -78,35 +80,33 @@ def total_count(self, total_count):
7880
:param total_count: The total_count of this PageInfo. # noqa: E501
7981
:type: int
8082
"""
81-
if total_count is None:
82-
raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501
8383

8484
self._total_count = total_count
8585

8686
@property
87-
def results_per_page(self):
88-
"""Gets the results_per_page of this PageInfo. # noqa: E501
87+
def items_in_page(self):
88+
"""Gets the items_in_page of this PageInfo. # noqa: E501
8989
90-
The number of results per page. # noqa: E501
90+
The number of items in page. # noqa: E501
9191
92-
:return: The results_per_page of this PageInfo. # noqa: E501
92+
:return: The items_in_page of this PageInfo. # noqa: E501
9393
:rtype: int
9494
"""
95-
return self._results_per_page
95+
return self._items_in_page
9696

97-
@results_per_page.setter
98-
def results_per_page(self, results_per_page):
99-
"""Sets the results_per_page of this PageInfo.
97+
@items_in_page.setter
98+
def items_in_page(self, items_in_page):
99+
"""Sets the items_in_page of this PageInfo.
100100
101-
The number of results per page. # noqa: E501
101+
The number of items in page. # noqa: E501
102102
103-
:param results_per_page: The results_per_page of this PageInfo. # noqa: E501
103+
:param items_in_page: The items_in_page of this PageInfo. # noqa: E501
104104
:type: int
105105
"""
106-
if results_per_page is None:
107-
raise ValueError("Invalid value for `results_per_page`, must not be `None`") # noqa: E501
106+
if items_in_page is None:
107+
raise ValueError("Invalid value for `items_in_page`, must not be `None`") # noqa: E501
108108

109-
self._results_per_page = results_per_page
109+
self._items_in_page = items_in_page
110110

111111
@property
112112
def continuation_token(self):
@@ -128,8 +128,6 @@ def continuation_token(self, continuation_token):
128128
:param continuation_token: The continuation_token of this PageInfo. # noqa: E501
129129
:type: str
130130
"""
131-
if continuation_token is None:
132-
raise ValueError("Invalid value for `continuation_token`, must not be `None`") # noqa: E501
133131

134132
self._continuation_token = continuation_token
135133

src/lockss/pyclient/md/models/page_info.py

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,33 @@ class PageInfo(object):
2929
"""
3030
swagger_types = {
3131
'total_count': 'int',
32-
'results_per_page': 'int',
32+
'items_in_page': 'int',
3333
'continuation_token': 'str',
3434
'cur_link': 'str',
3535
'next_link': 'str'
3636
}
3737

3838
attribute_map = {
3939
'total_count': 'totalCount',
40-
'results_per_page': 'resultsPerPage',
40+
'items_in_page': 'itemsInPage',
4141
'continuation_token': 'continuationToken',
4242
'cur_link': 'curLink',
4343
'next_link': 'nextLink'
4444
}
4545

46-
def __init__(self, total_count=None, results_per_page=None, continuation_token=None, cur_link=None, next_link=None): # noqa: E501
46+
def __init__(self, total_count=None, items_in_page=None, continuation_token=None, cur_link=None, next_link=None): # noqa: E501
4747
"""PageInfo - a model defined in Swagger""" # noqa: E501
4848
self._total_count = None
49-
self._results_per_page = None
49+
self._items_in_page = None
5050
self._continuation_token = None
5151
self._cur_link = None
5252
self._next_link = None
5353
self.discriminator = None
54-
self.total_count = total_count
55-
self.results_per_page = results_per_page
56-
self.continuation_token = continuation_token
54+
if total_count is not None:
55+
self.total_count = total_count
56+
self.items_in_page = items_in_page
57+
if continuation_token is not None:
58+
self.continuation_token = continuation_token
5759
self.cur_link = cur_link
5860
if next_link is not None:
5961
self.next_link = next_link
@@ -78,35 +80,33 @@ def total_count(self, total_count):
7880
:param total_count: The total_count of this PageInfo. # noqa: E501
7981
:type: int
8082
"""
81-
if total_count is None:
82-
raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501
8383

8484
self._total_count = total_count
8585

8686
@property
87-
def results_per_page(self):
88-
"""Gets the results_per_page of this PageInfo. # noqa: E501
87+
def items_in_page(self):
88+
"""Gets the items_in_page of this PageInfo. # noqa: E501
8989
90-
The number of results per page # noqa: E501
90+
The number of items in page # noqa: E501
9191
92-
:return: The results_per_page of this PageInfo. # noqa: E501
92+
:return: The items_in_page of this PageInfo. # noqa: E501
9393
:rtype: int
9494
"""
95-
return self._results_per_page
95+
return self._items_in_page
9696

97-
@results_per_page.setter
98-
def results_per_page(self, results_per_page):
99-
"""Sets the results_per_page of this PageInfo.
97+
@items_in_page.setter
98+
def items_in_page(self, items_in_page):
99+
"""Sets the items_in_page of this PageInfo.
100100
101-
The number of results per page # noqa: E501
101+
The number of items in page # noqa: E501
102102
103-
:param results_per_page: The results_per_page of this PageInfo. # noqa: E501
103+
:param items_in_page: The items_in_page of this PageInfo. # noqa: E501
104104
:type: int
105105
"""
106-
if results_per_page is None:
107-
raise ValueError("Invalid value for `results_per_page`, must not be `None`") # noqa: E501
106+
if items_in_page is None:
107+
raise ValueError("Invalid value for `items_in_page`, must not be `None`") # noqa: E501
108108

109-
self._results_per_page = results_per_page
109+
self._items_in_page = items_in_page
110110

111111
@property
112112
def continuation_token(self):
@@ -128,8 +128,6 @@ def continuation_token(self, continuation_token):
128128
:param continuation_token: The continuation_token of this PageInfo. # noqa: E501
129129
:type: str
130130
"""
131-
if continuation_token is None:
132-
raise ValueError("Invalid value for `continuation_token`, must not be `None`") # noqa: E501
133131

134132
self._continuation_token = continuation_token
135133

src/lockss/pyclient/rs/models/page_info.py

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,36 @@ class PageInfo(object):
2929
"""
3030
swagger_types = {
3131
'total_count': 'int',
32-
'results_per_page': 'int',
32+
'items_in_page': 'int',
3333
'continuation_token': 'str',
3434
'cur_link': 'str',
3535
'next_link': 'str'
3636
}
3737

3838
attribute_map = {
3939
'total_count': 'totalCount',
40-
'results_per_page': 'resultsPerPage',
40+
'items_in_page': 'itemsInPage',
4141
'continuation_token': 'continuationToken',
4242
'cur_link': 'curLink',
4343
'next_link': 'nextLink'
4444
}
4545

46-
def __init__(self, total_count=None, results_per_page=None, continuation_token=None, cur_link=None, next_link=None): # noqa: E501
46+
def __init__(self, total_count=None, items_in_page=None, continuation_token=None, cur_link=None, next_link=None): # noqa: E501
4747
"""PageInfo - a model defined in Swagger""" # noqa: E501
4848
self._total_count = None
49-
self._results_per_page = None
49+
self._items_in_page = None
5050
self._continuation_token = None
5151
self._cur_link = None
5252
self._next_link = None
5353
self.discriminator = None
54-
self.total_count = total_count
55-
self.results_per_page = results_per_page
56-
self.continuation_token = continuation_token
54+
if total_count is not None:
55+
self.total_count = total_count
56+
self.items_in_page = items_in_page
57+
if continuation_token is not None:
58+
self.continuation_token = continuation_token
5759
self.cur_link = cur_link
58-
self.next_link = next_link
60+
if next_link is not None:
61+
self.next_link = next_link
5962

6063
@property
6164
def total_count(self):
@@ -77,35 +80,33 @@ def total_count(self, total_count):
7780
:param total_count: The total_count of this PageInfo. # noqa: E501
7881
:type: int
7982
"""
80-
if total_count is None:
81-
raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501
8283

8384
self._total_count = total_count
8485

8586
@property
86-
def results_per_page(self):
87-
"""Gets the results_per_page of this PageInfo. # noqa: E501
87+
def items_in_page(self):
88+
"""Gets the items_in_page of this PageInfo. # noqa: E501
8889
89-
The number of results per page # noqa: E501
90+
The number of items in page # noqa: E501
9091
91-
:return: The results_per_page of this PageInfo. # noqa: E501
92+
:return: The items_in_page of this PageInfo. # noqa: E501
9293
:rtype: int
9394
"""
94-
return self._results_per_page
95+
return self._items_in_page
9596

96-
@results_per_page.setter
97-
def results_per_page(self, results_per_page):
98-
"""Sets the results_per_page of this PageInfo.
97+
@items_in_page.setter
98+
def items_in_page(self, items_in_page):
99+
"""Sets the items_in_page of this PageInfo.
99100
100-
The number of results per page # noqa: E501
101+
The number of items in page # noqa: E501
101102
102-
:param results_per_page: The results_per_page of this PageInfo. # noqa: E501
103+
:param items_in_page: The items_in_page of this PageInfo. # noqa: E501
103104
:type: int
104105
"""
105-
if results_per_page is None:
106-
raise ValueError("Invalid value for `results_per_page`, must not be `None`") # noqa: E501
106+
if items_in_page is None:
107+
raise ValueError("Invalid value for `items_in_page`, must not be `None`") # noqa: E501
107108

108-
self._results_per_page = results_per_page
109+
self._items_in_page = items_in_page
109110

110111
@property
111112
def continuation_token(self):
@@ -127,8 +128,6 @@ def continuation_token(self, continuation_token):
127128
:param continuation_token: The continuation_token of this PageInfo. # noqa: E501
128129
:type: str
129130
"""
130-
if continuation_token is None:
131-
raise ValueError("Invalid value for `continuation_token`, must not be `None`") # noqa: E501
132131

133132
self._continuation_token = continuation_token
134133

@@ -177,8 +176,6 @@ def next_link(self, next_link):
177176
:param next_link: The next_link of this PageInfo. # noqa: E501
178177
:type: str
179178
"""
180-
if next_link is None:
181-
raise ValueError("Invalid value for `next_link`, must not be `None`") # noqa: E501
182179

183180
self._next_link = next_link
184181

0 commit comments

Comments
 (0)