isbnlab 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- isbnlab/__init__.py +102 -0
- isbnlab/api/__init__.py +10 -0
- isbnlab/api/authors_api.py +587 -0
- isbnlab/api/books_api.py +2285 -0
- isbnlab/api/genres_api.py +587 -0
- isbnlab/api/isbn_api.py +1957 -0
- isbnlab/api/publishers_api.py +879 -0
- isbnlab/api/subjects_api.py +587 -0
- isbnlab/api_client.py +802 -0
- isbnlab/api_response.py +21 -0
- isbnlab/configuration.py +611 -0
- isbnlab/exceptions.py +217 -0
- isbnlab/models/__init__.py +39 -0
- isbnlab/models/author.py +144 -0
- isbnlab/models/author_photo.py +128 -0
- isbnlab/models/book.py +435 -0
- isbnlab/models/book_cover.py +100 -0
- isbnlab/models/book_editions.py +128 -0
- isbnlab/models/category.py +107 -0
- isbnlab/models/contributor.py +114 -0
- isbnlab/models/edition_ref.py +142 -0
- isbnlab/models/entity_ref.py +107 -0
- isbnlab/models/genre.py +107 -0
- isbnlab/models/isbn_details.py +184 -0
- isbnlab/models/other_series.py +139 -0
- isbnlab/models/publisher.py +128 -0
- isbnlab/models/rating_counts.py +121 -0
- isbnlab/models/rating_summary.py +107 -0
- isbnlab/models/ratings.py +108 -0
- isbnlab/models/retail_link.py +100 -0
- isbnlab/models/series.py +175 -0
- isbnlab/models/series_book.py +135 -0
- isbnlab/models/series_parent.py +107 -0
- isbnlab/models/subject.py +121 -0
- isbnlab/models/subject_ref.py +114 -0
- isbnlab/py.typed +0 -0
- isbnlab/rest.py +259 -0
- isbnlab-0.1.0.dist-info/METADATA +126 -0
- isbnlab-0.1.0.dist-info/RECORD +41 -0
- isbnlab-0.1.0.dist-info/WHEEL +4 -0
- isbnlab-0.1.0.dist-info/licenses/LICENSE +21 -0
isbnlab/__init__.py
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
ISBNLab API
|
|
7
|
+
|
|
8
|
+
Book metadata by ISBN: books, editions, covers, authors, publishers, subjects, BISAC genres, and ISBN validation and conversion.
|
|
9
|
+
|
|
10
|
+
The version of the OpenAPI document: 1.0.0
|
|
11
|
+
Contact: hello@isbnlab.com
|
|
12
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
13
|
+
|
|
14
|
+
Do not edit the class manually.
|
|
15
|
+
""" # noqa: E501
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
__version__ = "0.1.0"
|
|
19
|
+
|
|
20
|
+
# Define package exports
|
|
21
|
+
__all__ = [
|
|
22
|
+
"AuthorsApi",
|
|
23
|
+
"BooksApi",
|
|
24
|
+
"GenresApi",
|
|
25
|
+
"IsbnApi",
|
|
26
|
+
"PublishersApi",
|
|
27
|
+
"SubjectsApi",
|
|
28
|
+
"ApiResponse",
|
|
29
|
+
"ApiClient",
|
|
30
|
+
"Configuration",
|
|
31
|
+
"OpenApiException",
|
|
32
|
+
"ApiTypeError",
|
|
33
|
+
"ApiValueError",
|
|
34
|
+
"ApiKeyError",
|
|
35
|
+
"ApiAttributeError",
|
|
36
|
+
"ApiException",
|
|
37
|
+
"Author",
|
|
38
|
+
"AuthorPhoto",
|
|
39
|
+
"Book",
|
|
40
|
+
"BookCover",
|
|
41
|
+
"BookEditions",
|
|
42
|
+
"Category",
|
|
43
|
+
"Contributor",
|
|
44
|
+
"EditionRef",
|
|
45
|
+
"EntityRef",
|
|
46
|
+
"Genre",
|
|
47
|
+
"IsbnDetails",
|
|
48
|
+
"OtherSeries",
|
|
49
|
+
"Publisher",
|
|
50
|
+
"RatingCounts",
|
|
51
|
+
"RatingSummary",
|
|
52
|
+
"Ratings",
|
|
53
|
+
"RetailLink",
|
|
54
|
+
"Series",
|
|
55
|
+
"SeriesBook",
|
|
56
|
+
"SeriesParent",
|
|
57
|
+
"Subject",
|
|
58
|
+
"SubjectRef",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
# import apis into sdk package
|
|
62
|
+
from isbnlab.api.authors_api import AuthorsApi as AuthorsApi
|
|
63
|
+
from isbnlab.api.books_api import BooksApi as BooksApi
|
|
64
|
+
from isbnlab.api.genres_api import GenresApi as GenresApi
|
|
65
|
+
from isbnlab.api.isbn_api import IsbnApi as IsbnApi
|
|
66
|
+
from isbnlab.api.publishers_api import PublishersApi as PublishersApi
|
|
67
|
+
from isbnlab.api.subjects_api import SubjectsApi as SubjectsApi
|
|
68
|
+
|
|
69
|
+
# import ApiClient
|
|
70
|
+
from isbnlab.api_response import ApiResponse as ApiResponse
|
|
71
|
+
from isbnlab.api_client import ApiClient as ApiClient
|
|
72
|
+
from isbnlab.configuration import Configuration as Configuration
|
|
73
|
+
from isbnlab.exceptions import OpenApiException as OpenApiException
|
|
74
|
+
from isbnlab.exceptions import ApiTypeError as ApiTypeError
|
|
75
|
+
from isbnlab.exceptions import ApiValueError as ApiValueError
|
|
76
|
+
from isbnlab.exceptions import ApiKeyError as ApiKeyError
|
|
77
|
+
from isbnlab.exceptions import ApiAttributeError as ApiAttributeError
|
|
78
|
+
from isbnlab.exceptions import ApiException as ApiException
|
|
79
|
+
|
|
80
|
+
# import models into sdk package
|
|
81
|
+
from isbnlab.models.author import Author as Author
|
|
82
|
+
from isbnlab.models.author_photo import AuthorPhoto as AuthorPhoto
|
|
83
|
+
from isbnlab.models.book import Book as Book
|
|
84
|
+
from isbnlab.models.book_cover import BookCover as BookCover
|
|
85
|
+
from isbnlab.models.book_editions import BookEditions as BookEditions
|
|
86
|
+
from isbnlab.models.category import Category as Category
|
|
87
|
+
from isbnlab.models.contributor import Contributor as Contributor
|
|
88
|
+
from isbnlab.models.edition_ref import EditionRef as EditionRef
|
|
89
|
+
from isbnlab.models.entity_ref import EntityRef as EntityRef
|
|
90
|
+
from isbnlab.models.genre import Genre as Genre
|
|
91
|
+
from isbnlab.models.isbn_details import IsbnDetails as IsbnDetails
|
|
92
|
+
from isbnlab.models.other_series import OtherSeries as OtherSeries
|
|
93
|
+
from isbnlab.models.publisher import Publisher as Publisher
|
|
94
|
+
from isbnlab.models.rating_counts import RatingCounts as RatingCounts
|
|
95
|
+
from isbnlab.models.rating_summary import RatingSummary as RatingSummary
|
|
96
|
+
from isbnlab.models.ratings import Ratings as Ratings
|
|
97
|
+
from isbnlab.models.retail_link import RetailLink as RetailLink
|
|
98
|
+
from isbnlab.models.series import Series as Series
|
|
99
|
+
from isbnlab.models.series_book import SeriesBook as SeriesBook
|
|
100
|
+
from isbnlab.models.series_parent import SeriesParent as SeriesParent
|
|
101
|
+
from isbnlab.models.subject import Subject as Subject
|
|
102
|
+
from isbnlab.models.subject_ref import SubjectRef as SubjectRef
|
isbnlab/api/__init__.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# flake8: noqa
|
|
2
|
+
|
|
3
|
+
# import apis into api package
|
|
4
|
+
from isbnlab.api.authors_api import AuthorsApi
|
|
5
|
+
from isbnlab.api.books_api import BooksApi
|
|
6
|
+
from isbnlab.api.genres_api import GenresApi
|
|
7
|
+
from isbnlab.api.isbn_api import IsbnApi
|
|
8
|
+
from isbnlab.api.publishers_api import PublishersApi
|
|
9
|
+
from isbnlab.api.subjects_api import SubjectsApi
|
|
10
|
+
|
|
@@ -0,0 +1,587 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
ISBNLab API
|
|
5
|
+
|
|
6
|
+
Book metadata by ISBN: books, editions, covers, authors, publishers, subjects, BISAC genres, and ISBN validation and conversion.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: hello@isbnlab.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
import warnings
|
|
16
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
17
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
18
|
+
from typing_extensions import Annotated
|
|
19
|
+
|
|
20
|
+
from pydantic import Field, StrictStr
|
|
21
|
+
from typing_extensions import Annotated
|
|
22
|
+
from isbnlab.models.author import Author
|
|
23
|
+
|
|
24
|
+
from isbnlab.api_client import ApiClient, RequestSerialized
|
|
25
|
+
from isbnlab.api_response import ApiResponse
|
|
26
|
+
from isbnlab.rest import RESTResponseType
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class AuthorsApi:
|
|
30
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
31
|
+
Ref: https://openapi-generator.tech
|
|
32
|
+
|
|
33
|
+
Do not edit the class manually.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
def __init__(self, api_client=None) -> None:
|
|
37
|
+
if api_client is None:
|
|
38
|
+
api_client = ApiClient.get_default()
|
|
39
|
+
self.api_client = api_client
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@validate_call
|
|
43
|
+
def find_author(
|
|
44
|
+
self,
|
|
45
|
+
search: Annotated[StrictStr, Field(description="Name to search for.")],
|
|
46
|
+
_request_timeout: Union[
|
|
47
|
+
None,
|
|
48
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
49
|
+
Tuple[
|
|
50
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
51
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
52
|
+
]
|
|
53
|
+
] = None,
|
|
54
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
55
|
+
_content_type: Optional[StrictStr] = None,
|
|
56
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
57
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
58
|
+
) -> Author:
|
|
59
|
+
"""Find an author by name.
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
:param search: Name to search for. (required)
|
|
63
|
+
:type search: str
|
|
64
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
65
|
+
number provided, it will be total request
|
|
66
|
+
timeout. It can also be a pair (tuple) of
|
|
67
|
+
(connection, read) timeouts.
|
|
68
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
69
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
70
|
+
request; this effectively ignores the
|
|
71
|
+
authentication in the spec for a single request.
|
|
72
|
+
:type _request_auth: dict, optional
|
|
73
|
+
:param _content_type: force content-type for the request.
|
|
74
|
+
:type _content_type: str, Optional
|
|
75
|
+
:param _headers: set to override the headers for a single
|
|
76
|
+
request; this effectively ignores the headers
|
|
77
|
+
in the spec for a single request.
|
|
78
|
+
:type _headers: dict, optional
|
|
79
|
+
:param _host_index: set to override the host_index for a single
|
|
80
|
+
request; this effectively ignores the host_index
|
|
81
|
+
in the spec for a single request.
|
|
82
|
+
:type _host_index: int, optional
|
|
83
|
+
:return: Returns the result object.
|
|
84
|
+
""" # noqa: E501
|
|
85
|
+
|
|
86
|
+
_param = self._find_author_serialize(
|
|
87
|
+
search=search,
|
|
88
|
+
_request_auth=_request_auth,
|
|
89
|
+
_content_type=_content_type,
|
|
90
|
+
_headers=_headers,
|
|
91
|
+
_host_index=_host_index
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
95
|
+
'200': "Author",
|
|
96
|
+
'400': None,
|
|
97
|
+
'401': None,
|
|
98
|
+
'403': None,
|
|
99
|
+
'404': None,
|
|
100
|
+
'429': None,
|
|
101
|
+
}
|
|
102
|
+
response_data = self.api_client.call_api(
|
|
103
|
+
*_param,
|
|
104
|
+
_request_timeout=_request_timeout
|
|
105
|
+
)
|
|
106
|
+
response_data.read()
|
|
107
|
+
return self.api_client.response_deserialize(
|
|
108
|
+
response_data=response_data,
|
|
109
|
+
response_types_map=_response_types_map,
|
|
110
|
+
).data
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
@validate_call
|
|
114
|
+
def find_author_with_http_info(
|
|
115
|
+
self,
|
|
116
|
+
search: Annotated[StrictStr, Field(description="Name to search for.")],
|
|
117
|
+
_request_timeout: Union[
|
|
118
|
+
None,
|
|
119
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
120
|
+
Tuple[
|
|
121
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
122
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
123
|
+
]
|
|
124
|
+
] = None,
|
|
125
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
126
|
+
_content_type: Optional[StrictStr] = None,
|
|
127
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
128
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
129
|
+
) -> ApiResponse[Author]:
|
|
130
|
+
"""Find an author by name.
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
:param search: Name to search for. (required)
|
|
134
|
+
:type search: str
|
|
135
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
136
|
+
number provided, it will be total request
|
|
137
|
+
timeout. It can also be a pair (tuple) of
|
|
138
|
+
(connection, read) timeouts.
|
|
139
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
140
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
141
|
+
request; this effectively ignores the
|
|
142
|
+
authentication in the spec for a single request.
|
|
143
|
+
:type _request_auth: dict, optional
|
|
144
|
+
:param _content_type: force content-type for the request.
|
|
145
|
+
:type _content_type: str, Optional
|
|
146
|
+
:param _headers: set to override the headers for a single
|
|
147
|
+
request; this effectively ignores the headers
|
|
148
|
+
in the spec for a single request.
|
|
149
|
+
:type _headers: dict, optional
|
|
150
|
+
:param _host_index: set to override the host_index for a single
|
|
151
|
+
request; this effectively ignores the host_index
|
|
152
|
+
in the spec for a single request.
|
|
153
|
+
:type _host_index: int, optional
|
|
154
|
+
:return: Returns the result object.
|
|
155
|
+
""" # noqa: E501
|
|
156
|
+
|
|
157
|
+
_param = self._find_author_serialize(
|
|
158
|
+
search=search,
|
|
159
|
+
_request_auth=_request_auth,
|
|
160
|
+
_content_type=_content_type,
|
|
161
|
+
_headers=_headers,
|
|
162
|
+
_host_index=_host_index
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
166
|
+
'200': "Author",
|
|
167
|
+
'400': None,
|
|
168
|
+
'401': None,
|
|
169
|
+
'403': None,
|
|
170
|
+
'404': None,
|
|
171
|
+
'429': None,
|
|
172
|
+
}
|
|
173
|
+
response_data = self.api_client.call_api(
|
|
174
|
+
*_param,
|
|
175
|
+
_request_timeout=_request_timeout
|
|
176
|
+
)
|
|
177
|
+
response_data.read()
|
|
178
|
+
return self.api_client.response_deserialize(
|
|
179
|
+
response_data=response_data,
|
|
180
|
+
response_types_map=_response_types_map,
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
@validate_call
|
|
185
|
+
def find_author_without_preload_content(
|
|
186
|
+
self,
|
|
187
|
+
search: Annotated[StrictStr, Field(description="Name to search for.")],
|
|
188
|
+
_request_timeout: Union[
|
|
189
|
+
None,
|
|
190
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
191
|
+
Tuple[
|
|
192
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
193
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
194
|
+
]
|
|
195
|
+
] = None,
|
|
196
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
197
|
+
_content_type: Optional[StrictStr] = None,
|
|
198
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
199
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
200
|
+
) -> RESTResponseType:
|
|
201
|
+
"""Find an author by name.
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
:param search: Name to search for. (required)
|
|
205
|
+
:type search: str
|
|
206
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
207
|
+
number provided, it will be total request
|
|
208
|
+
timeout. It can also be a pair (tuple) of
|
|
209
|
+
(connection, read) timeouts.
|
|
210
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
211
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
212
|
+
request; this effectively ignores the
|
|
213
|
+
authentication in the spec for a single request.
|
|
214
|
+
:type _request_auth: dict, optional
|
|
215
|
+
:param _content_type: force content-type for the request.
|
|
216
|
+
:type _content_type: str, Optional
|
|
217
|
+
:param _headers: set to override the headers for a single
|
|
218
|
+
request; this effectively ignores the headers
|
|
219
|
+
in the spec for a single request.
|
|
220
|
+
:type _headers: dict, optional
|
|
221
|
+
:param _host_index: set to override the host_index for a single
|
|
222
|
+
request; this effectively ignores the host_index
|
|
223
|
+
in the spec for a single request.
|
|
224
|
+
:type _host_index: int, optional
|
|
225
|
+
:return: Returns the result object.
|
|
226
|
+
""" # noqa: E501
|
|
227
|
+
|
|
228
|
+
_param = self._find_author_serialize(
|
|
229
|
+
search=search,
|
|
230
|
+
_request_auth=_request_auth,
|
|
231
|
+
_content_type=_content_type,
|
|
232
|
+
_headers=_headers,
|
|
233
|
+
_host_index=_host_index
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
237
|
+
'200': "Author",
|
|
238
|
+
'400': None,
|
|
239
|
+
'401': None,
|
|
240
|
+
'403': None,
|
|
241
|
+
'404': None,
|
|
242
|
+
'429': None,
|
|
243
|
+
}
|
|
244
|
+
response_data = self.api_client.call_api(
|
|
245
|
+
*_param,
|
|
246
|
+
_request_timeout=_request_timeout
|
|
247
|
+
)
|
|
248
|
+
return response_data.response
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
def _find_author_serialize(
|
|
252
|
+
self,
|
|
253
|
+
search,
|
|
254
|
+
_request_auth,
|
|
255
|
+
_content_type,
|
|
256
|
+
_headers,
|
|
257
|
+
_host_index,
|
|
258
|
+
) -> RequestSerialized:
|
|
259
|
+
|
|
260
|
+
_host = None
|
|
261
|
+
|
|
262
|
+
_collection_formats: Dict[str, str] = {
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
_path_params: Dict[str, str] = {}
|
|
266
|
+
_query_params: List[Tuple[str, str]] = []
|
|
267
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
268
|
+
_form_params: List[Tuple[str, str]] = []
|
|
269
|
+
_files: Dict[
|
|
270
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
271
|
+
] = {}
|
|
272
|
+
_body_params: Optional[bytes] = None
|
|
273
|
+
|
|
274
|
+
# process the path parameters
|
|
275
|
+
if search is not None:
|
|
276
|
+
_path_params['search'] = search
|
|
277
|
+
# process the query parameters
|
|
278
|
+
# process the header parameters
|
|
279
|
+
# process the form parameters
|
|
280
|
+
# process the body parameter
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
# set the HTTP header `Accept`
|
|
284
|
+
if 'Accept' not in _header_params:
|
|
285
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
286
|
+
[
|
|
287
|
+
'application/json'
|
|
288
|
+
]
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
# authentication setting
|
|
293
|
+
_auth_settings: List[str] = [
|
|
294
|
+
'UrlKey',
|
|
295
|
+
'Token'
|
|
296
|
+
]
|
|
297
|
+
|
|
298
|
+
return self.api_client.param_serialize(
|
|
299
|
+
method='GET',
|
|
300
|
+
resource_path='/api/author/search/{search}',
|
|
301
|
+
path_params=_path_params,
|
|
302
|
+
query_params=_query_params,
|
|
303
|
+
header_params=_header_params,
|
|
304
|
+
body=_body_params,
|
|
305
|
+
post_params=_form_params,
|
|
306
|
+
files=_files,
|
|
307
|
+
auth_settings=_auth_settings,
|
|
308
|
+
collection_formats=_collection_formats,
|
|
309
|
+
_host=_host,
|
|
310
|
+
_request_auth=_request_auth
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
@validate_call
|
|
317
|
+
def get_author(
|
|
318
|
+
self,
|
|
319
|
+
id: Annotated[StrictStr, Field(description="Author identifier")],
|
|
320
|
+
_request_timeout: Union[
|
|
321
|
+
None,
|
|
322
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
323
|
+
Tuple[
|
|
324
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
325
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
326
|
+
]
|
|
327
|
+
] = None,
|
|
328
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
329
|
+
_content_type: Optional[StrictStr] = None,
|
|
330
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
331
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
332
|
+
) -> Author:
|
|
333
|
+
"""Look up an author by id.
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
:param id: Author identifier (required)
|
|
337
|
+
:type id: str
|
|
338
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
339
|
+
number provided, it will be total request
|
|
340
|
+
timeout. It can also be a pair (tuple) of
|
|
341
|
+
(connection, read) timeouts.
|
|
342
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
343
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
344
|
+
request; this effectively ignores the
|
|
345
|
+
authentication in the spec for a single request.
|
|
346
|
+
:type _request_auth: dict, optional
|
|
347
|
+
:param _content_type: force content-type for the request.
|
|
348
|
+
:type _content_type: str, Optional
|
|
349
|
+
:param _headers: set to override the headers for a single
|
|
350
|
+
request; this effectively ignores the headers
|
|
351
|
+
in the spec for a single request.
|
|
352
|
+
:type _headers: dict, optional
|
|
353
|
+
:param _host_index: set to override the host_index for a single
|
|
354
|
+
request; this effectively ignores the host_index
|
|
355
|
+
in the spec for a single request.
|
|
356
|
+
:type _host_index: int, optional
|
|
357
|
+
:return: Returns the result object.
|
|
358
|
+
""" # noqa: E501
|
|
359
|
+
|
|
360
|
+
_param = self._get_author_serialize(
|
|
361
|
+
id=id,
|
|
362
|
+
_request_auth=_request_auth,
|
|
363
|
+
_content_type=_content_type,
|
|
364
|
+
_headers=_headers,
|
|
365
|
+
_host_index=_host_index
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
369
|
+
'200': "Author",
|
|
370
|
+
'400': None,
|
|
371
|
+
'401': None,
|
|
372
|
+
'403': None,
|
|
373
|
+
'404': None,
|
|
374
|
+
'429': None,
|
|
375
|
+
}
|
|
376
|
+
response_data = self.api_client.call_api(
|
|
377
|
+
*_param,
|
|
378
|
+
_request_timeout=_request_timeout
|
|
379
|
+
)
|
|
380
|
+
response_data.read()
|
|
381
|
+
return self.api_client.response_deserialize(
|
|
382
|
+
response_data=response_data,
|
|
383
|
+
response_types_map=_response_types_map,
|
|
384
|
+
).data
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
@validate_call
|
|
388
|
+
def get_author_with_http_info(
|
|
389
|
+
self,
|
|
390
|
+
id: Annotated[StrictStr, Field(description="Author identifier")],
|
|
391
|
+
_request_timeout: Union[
|
|
392
|
+
None,
|
|
393
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
394
|
+
Tuple[
|
|
395
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
396
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
397
|
+
]
|
|
398
|
+
] = None,
|
|
399
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
400
|
+
_content_type: Optional[StrictStr] = None,
|
|
401
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
402
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
403
|
+
) -> ApiResponse[Author]:
|
|
404
|
+
"""Look up an author by id.
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
:param id: Author identifier (required)
|
|
408
|
+
:type id: str
|
|
409
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
410
|
+
number provided, it will be total request
|
|
411
|
+
timeout. It can also be a pair (tuple) of
|
|
412
|
+
(connection, read) timeouts.
|
|
413
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
414
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
415
|
+
request; this effectively ignores the
|
|
416
|
+
authentication in the spec for a single request.
|
|
417
|
+
:type _request_auth: dict, optional
|
|
418
|
+
:param _content_type: force content-type for the request.
|
|
419
|
+
:type _content_type: str, Optional
|
|
420
|
+
:param _headers: set to override the headers for a single
|
|
421
|
+
request; this effectively ignores the headers
|
|
422
|
+
in the spec for a single request.
|
|
423
|
+
:type _headers: dict, optional
|
|
424
|
+
:param _host_index: set to override the host_index for a single
|
|
425
|
+
request; this effectively ignores the host_index
|
|
426
|
+
in the spec for a single request.
|
|
427
|
+
:type _host_index: int, optional
|
|
428
|
+
:return: Returns the result object.
|
|
429
|
+
""" # noqa: E501
|
|
430
|
+
|
|
431
|
+
_param = self._get_author_serialize(
|
|
432
|
+
id=id,
|
|
433
|
+
_request_auth=_request_auth,
|
|
434
|
+
_content_type=_content_type,
|
|
435
|
+
_headers=_headers,
|
|
436
|
+
_host_index=_host_index
|
|
437
|
+
)
|
|
438
|
+
|
|
439
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
440
|
+
'200': "Author",
|
|
441
|
+
'400': None,
|
|
442
|
+
'401': None,
|
|
443
|
+
'403': None,
|
|
444
|
+
'404': None,
|
|
445
|
+
'429': None,
|
|
446
|
+
}
|
|
447
|
+
response_data = self.api_client.call_api(
|
|
448
|
+
*_param,
|
|
449
|
+
_request_timeout=_request_timeout
|
|
450
|
+
)
|
|
451
|
+
response_data.read()
|
|
452
|
+
return self.api_client.response_deserialize(
|
|
453
|
+
response_data=response_data,
|
|
454
|
+
response_types_map=_response_types_map,
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
@validate_call
|
|
459
|
+
def get_author_without_preload_content(
|
|
460
|
+
self,
|
|
461
|
+
id: Annotated[StrictStr, Field(description="Author identifier")],
|
|
462
|
+
_request_timeout: Union[
|
|
463
|
+
None,
|
|
464
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
465
|
+
Tuple[
|
|
466
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
467
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
468
|
+
]
|
|
469
|
+
] = None,
|
|
470
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
471
|
+
_content_type: Optional[StrictStr] = None,
|
|
472
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
473
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
474
|
+
) -> RESTResponseType:
|
|
475
|
+
"""Look up an author by id.
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
:param id: Author identifier (required)
|
|
479
|
+
:type id: str
|
|
480
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
481
|
+
number provided, it will be total request
|
|
482
|
+
timeout. It can also be a pair (tuple) of
|
|
483
|
+
(connection, read) timeouts.
|
|
484
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
485
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
486
|
+
request; this effectively ignores the
|
|
487
|
+
authentication in the spec for a single request.
|
|
488
|
+
:type _request_auth: dict, optional
|
|
489
|
+
:param _content_type: force content-type for the request.
|
|
490
|
+
:type _content_type: str, Optional
|
|
491
|
+
:param _headers: set to override the headers for a single
|
|
492
|
+
request; this effectively ignores the headers
|
|
493
|
+
in the spec for a single request.
|
|
494
|
+
:type _headers: dict, optional
|
|
495
|
+
:param _host_index: set to override the host_index for a single
|
|
496
|
+
request; this effectively ignores the host_index
|
|
497
|
+
in the spec for a single request.
|
|
498
|
+
:type _host_index: int, optional
|
|
499
|
+
:return: Returns the result object.
|
|
500
|
+
""" # noqa: E501
|
|
501
|
+
|
|
502
|
+
_param = self._get_author_serialize(
|
|
503
|
+
id=id,
|
|
504
|
+
_request_auth=_request_auth,
|
|
505
|
+
_content_type=_content_type,
|
|
506
|
+
_headers=_headers,
|
|
507
|
+
_host_index=_host_index
|
|
508
|
+
)
|
|
509
|
+
|
|
510
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
511
|
+
'200': "Author",
|
|
512
|
+
'400': None,
|
|
513
|
+
'401': None,
|
|
514
|
+
'403': None,
|
|
515
|
+
'404': None,
|
|
516
|
+
'429': None,
|
|
517
|
+
}
|
|
518
|
+
response_data = self.api_client.call_api(
|
|
519
|
+
*_param,
|
|
520
|
+
_request_timeout=_request_timeout
|
|
521
|
+
)
|
|
522
|
+
return response_data.response
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
def _get_author_serialize(
|
|
526
|
+
self,
|
|
527
|
+
id,
|
|
528
|
+
_request_auth,
|
|
529
|
+
_content_type,
|
|
530
|
+
_headers,
|
|
531
|
+
_host_index,
|
|
532
|
+
) -> RequestSerialized:
|
|
533
|
+
|
|
534
|
+
_host = None
|
|
535
|
+
|
|
536
|
+
_collection_formats: Dict[str, str] = {
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
_path_params: Dict[str, str] = {}
|
|
540
|
+
_query_params: List[Tuple[str, str]] = []
|
|
541
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
542
|
+
_form_params: List[Tuple[str, str]] = []
|
|
543
|
+
_files: Dict[
|
|
544
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
545
|
+
] = {}
|
|
546
|
+
_body_params: Optional[bytes] = None
|
|
547
|
+
|
|
548
|
+
# process the path parameters
|
|
549
|
+
if id is not None:
|
|
550
|
+
_path_params['id'] = id
|
|
551
|
+
# process the query parameters
|
|
552
|
+
# process the header parameters
|
|
553
|
+
# process the form parameters
|
|
554
|
+
# process the body parameter
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
# set the HTTP header `Accept`
|
|
558
|
+
if 'Accept' not in _header_params:
|
|
559
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
560
|
+
[
|
|
561
|
+
'application/json'
|
|
562
|
+
]
|
|
563
|
+
)
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
# authentication setting
|
|
567
|
+
_auth_settings: List[str] = [
|
|
568
|
+
'UrlKey',
|
|
569
|
+
'Token'
|
|
570
|
+
]
|
|
571
|
+
|
|
572
|
+
return self.api_client.param_serialize(
|
|
573
|
+
method='GET',
|
|
574
|
+
resource_path='/api/author/{id}',
|
|
575
|
+
path_params=_path_params,
|
|
576
|
+
query_params=_query_params,
|
|
577
|
+
header_params=_header_params,
|
|
578
|
+
body=_body_params,
|
|
579
|
+
post_params=_form_params,
|
|
580
|
+
files=_files,
|
|
581
|
+
auth_settings=_auth_settings,
|
|
582
|
+
collection_formats=_collection_formats,
|
|
583
|
+
_host=_host,
|
|
584
|
+
_request_auth=_request_auth
|
|
585
|
+
)
|
|
586
|
+
|
|
587
|
+
|