funapi-sciencedb 1.0.1__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.
- funapi_sciencedb-1.0.1.dist-info/LICENSE +21 -0
- funapi_sciencedb-1.0.1.dist-info/METADATA +10 -0
- funapi_sciencedb-1.0.1.dist-info/RECORD +54 -0
- funapi_sciencedb-1.0.1.dist-info/WHEEL +5 -0
- funapi_sciencedb-1.0.1.dist-info/top_level.txt +1 -0
- sciencedb/__init__.py +8 -0
- sciencedb/api/__init__.py +1 -0
- sciencedb/api/open_api_controller/__init__.py +0 -0
- sciencedb/api/open_api_controller/harvest_using_get.py +211 -0
- sciencedb/api/open_api_controller/json_using_get.py +164 -0
- sciencedb/api/open_api_controller/metrics_using_get.py +166 -0
- sciencedb/api/open_api_controller/search_using_get.py +196 -0
- sciencedb/api/sushi_controller/__init__.py +0 -0
- sciencedb/api/sushi_controller/get_api_status.py +171 -0
- sciencedb/api/sushi_controller/get_report_by_id_using_get.py +173 -0
- sciencedb/api/sushi_controller/get_reports.py +181 -0
- sciencedb/client.py +286 -0
- sciencedb/errors.py +16 -0
- sciencedb/models/__init__.py +75 -0
- sciencedb/models/api_result_metrics_result.py +99 -0
- sciencedb/models/api_result_search_result.py +99 -0
- sciencedb/models/counter_dataset_attributes.py +69 -0
- sciencedb/models/counter_dataset_attributes_type.py +10 -0
- sciencedb/models/counter_dataset_contributors.py +68 -0
- sciencedb/models/counter_dataset_contributors_type.py +10 -0
- sciencedb/models/counter_dataset_dates.py +68 -0
- sciencedb/models/counter_dataset_dates_type.py +10 -0
- sciencedb/models/counter_dataset_identifiers.py +68 -0
- sciencedb/models/counter_dataset_identifiers_type.py +10 -0
- sciencedb/models/counter_dataset_instance.py +98 -0
- sciencedb/models/counter_dataset_instance_access_method.py +9 -0
- sciencedb/models/counter_dataset_instance_metric_type.py +11 -0
- sciencedb/models/counter_dataset_performance.py +82 -0
- sciencedb/models/counter_dataset_period.py +83 -0
- sciencedb/models/counter_dataset_report.py +106 -0
- sciencedb/models/counter_dataset_usage.py +230 -0
- sciencedb/models/counter_dataset_usage_data_type.py +8 -0
- sciencedb/models/counter_publisher_identifiers.py +68 -0
- sciencedb/models/counter_publisher_identifiers_type.py +10 -0
- sciencedb/models/metrics_result.py +95 -0
- sciencedb/models/search_record.py +150 -0
- sciencedb/models/search_result.py +111 -0
- sciencedb/models/sushi_error_model.py +97 -0
- sciencedb/models/sushi_error_model_severity.py +11 -0
- sciencedb/models/sushi_page_meta.py +77 -0
- sciencedb/models/sushi_report.py +72 -0
- sciencedb/models/sushi_report_header.py +189 -0
- sciencedb/models/sushi_report_header_report_attributes_item.py +43 -0
- sciencedb/models/sushi_report_header_report_filters_item.py +43 -0
- sciencedb/models/sushi_report_list.py +82 -0
- sciencedb/models/sushi_report_page.py +93 -0
- sciencedb/models/sushi_service_status.py +118 -0
- sciencedb/models/sushi_service_status_alerts_item.py +43 -0
- sciencedb/types.py +53 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.api_result_search_result import APIResultSearchResult
|
|
9
|
+
from ...types import UNSET, Response, Unset
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
*,
|
|
14
|
+
page: Union[Unset, int] = 1,
|
|
15
|
+
range_: Union[Unset, int] = UNSET,
|
|
16
|
+
size: Union[Unset, int] = 10,
|
|
17
|
+
) -> Dict[str, Any]:
|
|
18
|
+
params: Dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
params["page"] = page
|
|
21
|
+
|
|
22
|
+
params["range"] = range_
|
|
23
|
+
|
|
24
|
+
params["size"] = size
|
|
25
|
+
|
|
26
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
27
|
+
|
|
28
|
+
_kwargs: Dict[str, Any] = {
|
|
29
|
+
"method": "get",
|
|
30
|
+
"url": "/search",
|
|
31
|
+
"params": params,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return _kwargs
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _parse_response(
|
|
38
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
39
|
+
) -> Optional[APIResultSearchResult]:
|
|
40
|
+
if response.status_code == 200:
|
|
41
|
+
response_200 = APIResultSearchResult.from_dict(response.json())
|
|
42
|
+
|
|
43
|
+
return response_200
|
|
44
|
+
if client.raise_on_unexpected_status:
|
|
45
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
46
|
+
else:
|
|
47
|
+
return None
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _build_response(
|
|
51
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
52
|
+
) -> Response[APIResultSearchResult]:
|
|
53
|
+
return Response(
|
|
54
|
+
status_code=HTTPStatus(response.status_code),
|
|
55
|
+
content=response.content,
|
|
56
|
+
headers=response.headers,
|
|
57
|
+
parsed=_parse_response(client=client, response=response),
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def sync_detailed(
|
|
62
|
+
*,
|
|
63
|
+
client: Union[AuthenticatedClient, Client],
|
|
64
|
+
page: Union[Unset, int] = 1,
|
|
65
|
+
range_: Union[Unset, int] = UNSET,
|
|
66
|
+
size: Union[Unset, int] = 10,
|
|
67
|
+
) -> Response[APIResultSearchResult]:
|
|
68
|
+
"""search dataset by page
|
|
69
|
+
|
|
70
|
+
result is order by publish time desc
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
page (Union[Unset, int]): Default: 1.
|
|
74
|
+
range_ (Union[Unset, int]):
|
|
75
|
+
size (Union[Unset, int]): Default: 10.
|
|
76
|
+
|
|
77
|
+
Raises:
|
|
78
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
79
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
Response[APIResultSearchResult]
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
kwargs = _get_kwargs(
|
|
86
|
+
page=page,
|
|
87
|
+
range_=range_,
|
|
88
|
+
size=size,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
response = client.get_httpx_client().request(
|
|
92
|
+
**kwargs,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
return _build_response(client=client, response=response)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def sync(
|
|
99
|
+
*,
|
|
100
|
+
client: Union[AuthenticatedClient, Client],
|
|
101
|
+
page: Union[Unset, int] = 1,
|
|
102
|
+
range_: Union[Unset, int] = UNSET,
|
|
103
|
+
size: Union[Unset, int] = 10,
|
|
104
|
+
) -> Optional[APIResultSearchResult]:
|
|
105
|
+
"""search dataset by page
|
|
106
|
+
|
|
107
|
+
result is order by publish time desc
|
|
108
|
+
|
|
109
|
+
Args:
|
|
110
|
+
page (Union[Unset, int]): Default: 1.
|
|
111
|
+
range_ (Union[Unset, int]):
|
|
112
|
+
size (Union[Unset, int]): Default: 10.
|
|
113
|
+
|
|
114
|
+
Raises:
|
|
115
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
116
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
117
|
+
|
|
118
|
+
Returns:
|
|
119
|
+
APIResultSearchResult
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
return sync_detailed(
|
|
123
|
+
client=client,
|
|
124
|
+
page=page,
|
|
125
|
+
range_=range_,
|
|
126
|
+
size=size,
|
|
127
|
+
).parsed
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
async def asyncio_detailed(
|
|
131
|
+
*,
|
|
132
|
+
client: Union[AuthenticatedClient, Client],
|
|
133
|
+
page: Union[Unset, int] = 1,
|
|
134
|
+
range_: Union[Unset, int] = UNSET,
|
|
135
|
+
size: Union[Unset, int] = 10,
|
|
136
|
+
) -> Response[APIResultSearchResult]:
|
|
137
|
+
"""search dataset by page
|
|
138
|
+
|
|
139
|
+
result is order by publish time desc
|
|
140
|
+
|
|
141
|
+
Args:
|
|
142
|
+
page (Union[Unset, int]): Default: 1.
|
|
143
|
+
range_ (Union[Unset, int]):
|
|
144
|
+
size (Union[Unset, int]): Default: 10.
|
|
145
|
+
|
|
146
|
+
Raises:
|
|
147
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
148
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
149
|
+
|
|
150
|
+
Returns:
|
|
151
|
+
Response[APIResultSearchResult]
|
|
152
|
+
"""
|
|
153
|
+
|
|
154
|
+
kwargs = _get_kwargs(
|
|
155
|
+
page=page,
|
|
156
|
+
range_=range_,
|
|
157
|
+
size=size,
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
161
|
+
|
|
162
|
+
return _build_response(client=client, response=response)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
async def asyncio(
|
|
166
|
+
*,
|
|
167
|
+
client: Union[AuthenticatedClient, Client],
|
|
168
|
+
page: Union[Unset, int] = 1,
|
|
169
|
+
range_: Union[Unset, int] = UNSET,
|
|
170
|
+
size: Union[Unset, int] = 10,
|
|
171
|
+
) -> Optional[APIResultSearchResult]:
|
|
172
|
+
"""search dataset by page
|
|
173
|
+
|
|
174
|
+
result is order by publish time desc
|
|
175
|
+
|
|
176
|
+
Args:
|
|
177
|
+
page (Union[Unset, int]): Default: 1.
|
|
178
|
+
range_ (Union[Unset, int]):
|
|
179
|
+
size (Union[Unset, int]): Default: 10.
|
|
180
|
+
|
|
181
|
+
Raises:
|
|
182
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
183
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
184
|
+
|
|
185
|
+
Returns:
|
|
186
|
+
APIResultSearchResult
|
|
187
|
+
"""
|
|
188
|
+
|
|
189
|
+
return (
|
|
190
|
+
await asyncio_detailed(
|
|
191
|
+
client=client,
|
|
192
|
+
page=page,
|
|
193
|
+
range_=range_,
|
|
194
|
+
size=size,
|
|
195
|
+
)
|
|
196
|
+
).parsed
|
|
File without changes
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, List, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.sushi_service_status import SUSHIServiceStatus
|
|
9
|
+
from ...types import UNSET, Response, Unset
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
*,
|
|
14
|
+
platform: Union[Unset, str] = UNSET,
|
|
15
|
+
) -> Dict[str, Any]:
|
|
16
|
+
params: Dict[str, Any] = {}
|
|
17
|
+
|
|
18
|
+
params["platform"] = platform
|
|
19
|
+
|
|
20
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
21
|
+
|
|
22
|
+
_kwargs: Dict[str, Any] = {
|
|
23
|
+
"method": "get",
|
|
24
|
+
"url": "/status",
|
|
25
|
+
"params": params,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return _kwargs
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _parse_response(
|
|
32
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
33
|
+
) -> Optional[List["SUSHIServiceStatus"]]:
|
|
34
|
+
if response.status_code == 200:
|
|
35
|
+
response_200 = []
|
|
36
|
+
_response_200 = response.json()
|
|
37
|
+
for response_200_item_data in _response_200:
|
|
38
|
+
response_200_item = SUSHIServiceStatus.from_dict(response_200_item_data)
|
|
39
|
+
|
|
40
|
+
response_200.append(response_200_item)
|
|
41
|
+
|
|
42
|
+
return response_200
|
|
43
|
+
if client.raise_on_unexpected_status:
|
|
44
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
45
|
+
else:
|
|
46
|
+
return None
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _build_response(
|
|
50
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
51
|
+
) -> Response[List["SUSHIServiceStatus"]]:
|
|
52
|
+
return Response(
|
|
53
|
+
status_code=HTTPStatus(response.status_code),
|
|
54
|
+
content=response.content,
|
|
55
|
+
headers=response.headers,
|
|
56
|
+
parsed=_parse_response(client=client, response=response),
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def sync_detailed(
|
|
61
|
+
*,
|
|
62
|
+
client: Union[AuthenticatedClient, Client],
|
|
63
|
+
platform: Union[Unset, str] = UNSET,
|
|
64
|
+
) -> Response[List["SUSHIServiceStatus"]]:
|
|
65
|
+
"""getAPIStatus
|
|
66
|
+
|
|
67
|
+
This resource returns the current status of the reporting service supported by this API.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
platform (Union[Unset, str]):
|
|
71
|
+
|
|
72
|
+
Raises:
|
|
73
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
74
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
Response[List['SUSHIServiceStatus']]
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
kwargs = _get_kwargs(
|
|
81
|
+
platform=platform,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
response = client.get_httpx_client().request(
|
|
85
|
+
**kwargs,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
return _build_response(client=client, response=response)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def sync(
|
|
92
|
+
*,
|
|
93
|
+
client: Union[AuthenticatedClient, Client],
|
|
94
|
+
platform: Union[Unset, str] = UNSET,
|
|
95
|
+
) -> Optional[List["SUSHIServiceStatus"]]:
|
|
96
|
+
"""getAPIStatus
|
|
97
|
+
|
|
98
|
+
This resource returns the current status of the reporting service supported by this API.
|
|
99
|
+
|
|
100
|
+
Args:
|
|
101
|
+
platform (Union[Unset, str]):
|
|
102
|
+
|
|
103
|
+
Raises:
|
|
104
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
105
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
List['SUSHIServiceStatus']
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
return sync_detailed(
|
|
112
|
+
client=client,
|
|
113
|
+
platform=platform,
|
|
114
|
+
).parsed
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
async def asyncio_detailed(
|
|
118
|
+
*,
|
|
119
|
+
client: Union[AuthenticatedClient, Client],
|
|
120
|
+
platform: Union[Unset, str] = UNSET,
|
|
121
|
+
) -> Response[List["SUSHIServiceStatus"]]:
|
|
122
|
+
"""getAPIStatus
|
|
123
|
+
|
|
124
|
+
This resource returns the current status of the reporting service supported by this API.
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
platform (Union[Unset, str]):
|
|
128
|
+
|
|
129
|
+
Raises:
|
|
130
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
131
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
132
|
+
|
|
133
|
+
Returns:
|
|
134
|
+
Response[List['SUSHIServiceStatus']]
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
kwargs = _get_kwargs(
|
|
138
|
+
platform=platform,
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
142
|
+
|
|
143
|
+
return _build_response(client=client, response=response)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
async def asyncio(
|
|
147
|
+
*,
|
|
148
|
+
client: Union[AuthenticatedClient, Client],
|
|
149
|
+
platform: Union[Unset, str] = UNSET,
|
|
150
|
+
) -> Optional[List["SUSHIServiceStatus"]]:
|
|
151
|
+
"""getAPIStatus
|
|
152
|
+
|
|
153
|
+
This resource returns the current status of the reporting service supported by this API.
|
|
154
|
+
|
|
155
|
+
Args:
|
|
156
|
+
platform (Union[Unset, str]):
|
|
157
|
+
|
|
158
|
+
Raises:
|
|
159
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
160
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
161
|
+
|
|
162
|
+
Returns:
|
|
163
|
+
List['SUSHIServiceStatus']
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
return (
|
|
167
|
+
await asyncio_detailed(
|
|
168
|
+
client=client,
|
|
169
|
+
platform=platform,
|
|
170
|
+
)
|
|
171
|
+
).parsed
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.sushi_report import SUSHIReport
|
|
9
|
+
from ...types import UNSET, Response, Unset
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
id: str,
|
|
14
|
+
*,
|
|
15
|
+
publisher: Union[Unset, str] = UNSET,
|
|
16
|
+
) -> Dict[str, Any]:
|
|
17
|
+
params: Dict[str, Any] = {}
|
|
18
|
+
|
|
19
|
+
params["publisher"] = publisher
|
|
20
|
+
|
|
21
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
22
|
+
|
|
23
|
+
_kwargs: Dict[str, Any] = {
|
|
24
|
+
"method": "get",
|
|
25
|
+
"url": "/report/{id}".format(
|
|
26
|
+
id=id,
|
|
27
|
+
),
|
|
28
|
+
"params": params,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return _kwargs
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _parse_response(
|
|
35
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
36
|
+
) -> Optional[SUSHIReport]:
|
|
37
|
+
if response.status_code == 200:
|
|
38
|
+
response_200 = SUSHIReport.from_dict(response.json())
|
|
39
|
+
|
|
40
|
+
return response_200
|
|
41
|
+
if client.raise_on_unexpected_status:
|
|
42
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
43
|
+
else:
|
|
44
|
+
return None
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _build_response(
|
|
48
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
49
|
+
) -> Response[SUSHIReport]:
|
|
50
|
+
return Response(
|
|
51
|
+
status_code=HTTPStatus(response.status_code),
|
|
52
|
+
content=response.content,
|
|
53
|
+
headers=response.headers,
|
|
54
|
+
parsed=_parse_response(client=client, response=response),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def sync_detailed(
|
|
59
|
+
id: str,
|
|
60
|
+
*,
|
|
61
|
+
client: Union[AuthenticatedClient, Client],
|
|
62
|
+
publisher: Union[Unset, str] = UNSET,
|
|
63
|
+
) -> Response[SUSHIReport]:
|
|
64
|
+
"""This resource returns the COUNTER Dataset Report by id
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
id (str):
|
|
68
|
+
publisher (Union[Unset, str]):
|
|
69
|
+
|
|
70
|
+
Raises:
|
|
71
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
72
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
73
|
+
|
|
74
|
+
Returns:
|
|
75
|
+
Response[SUSHIReport]
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
kwargs = _get_kwargs(
|
|
79
|
+
id=id,
|
|
80
|
+
publisher=publisher,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
response = client.get_httpx_client().request(
|
|
84
|
+
**kwargs,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
return _build_response(client=client, response=response)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def sync(
|
|
91
|
+
id: str,
|
|
92
|
+
*,
|
|
93
|
+
client: Union[AuthenticatedClient, Client],
|
|
94
|
+
publisher: Union[Unset, str] = UNSET,
|
|
95
|
+
) -> Optional[SUSHIReport]:
|
|
96
|
+
"""This resource returns the COUNTER Dataset Report by id
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
id (str):
|
|
100
|
+
publisher (Union[Unset, str]):
|
|
101
|
+
|
|
102
|
+
Raises:
|
|
103
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
104
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
SUSHIReport
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
return sync_detailed(
|
|
111
|
+
id=id,
|
|
112
|
+
client=client,
|
|
113
|
+
publisher=publisher,
|
|
114
|
+
).parsed
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
async def asyncio_detailed(
|
|
118
|
+
id: str,
|
|
119
|
+
*,
|
|
120
|
+
client: Union[AuthenticatedClient, Client],
|
|
121
|
+
publisher: Union[Unset, str] = UNSET,
|
|
122
|
+
) -> Response[SUSHIReport]:
|
|
123
|
+
"""This resource returns the COUNTER Dataset Report by id
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
id (str):
|
|
127
|
+
publisher (Union[Unset, str]):
|
|
128
|
+
|
|
129
|
+
Raises:
|
|
130
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
131
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
132
|
+
|
|
133
|
+
Returns:
|
|
134
|
+
Response[SUSHIReport]
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
kwargs = _get_kwargs(
|
|
138
|
+
id=id,
|
|
139
|
+
publisher=publisher,
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
143
|
+
|
|
144
|
+
return _build_response(client=client, response=response)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
async def asyncio(
|
|
148
|
+
id: str,
|
|
149
|
+
*,
|
|
150
|
+
client: Union[AuthenticatedClient, Client],
|
|
151
|
+
publisher: Union[Unset, str] = UNSET,
|
|
152
|
+
) -> Optional[SUSHIReport]:
|
|
153
|
+
"""This resource returns the COUNTER Dataset Report by id
|
|
154
|
+
|
|
155
|
+
Args:
|
|
156
|
+
id (str):
|
|
157
|
+
publisher (Union[Unset, str]):
|
|
158
|
+
|
|
159
|
+
Raises:
|
|
160
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
161
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
SUSHIReport
|
|
165
|
+
"""
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
await asyncio_detailed(
|
|
169
|
+
id=id,
|
|
170
|
+
client=client,
|
|
171
|
+
publisher=publisher,
|
|
172
|
+
)
|
|
173
|
+
).parsed
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.sushi_report_page import SUSHIReportPage
|
|
9
|
+
from ...types import UNSET, Response, Unset
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
*,
|
|
14
|
+
pagenumber: Union[Unset, int] = 1,
|
|
15
|
+
pagesize: Union[Unset, int] = 10,
|
|
16
|
+
) -> Dict[str, Any]:
|
|
17
|
+
params: Dict[str, Any] = {}
|
|
18
|
+
|
|
19
|
+
params["page[number]"] = pagenumber
|
|
20
|
+
|
|
21
|
+
params["page[size]"] = pagesize
|
|
22
|
+
|
|
23
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
24
|
+
|
|
25
|
+
_kwargs: Dict[str, Any] = {
|
|
26
|
+
"method": "get",
|
|
27
|
+
"url": "/reports",
|
|
28
|
+
"params": params,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return _kwargs
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _parse_response(
|
|
35
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
36
|
+
) -> Optional[SUSHIReportPage]:
|
|
37
|
+
if response.status_code == 200:
|
|
38
|
+
response_200 = SUSHIReportPage.from_dict(response.json())
|
|
39
|
+
|
|
40
|
+
return response_200
|
|
41
|
+
if client.raise_on_unexpected_status:
|
|
42
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
43
|
+
else:
|
|
44
|
+
return None
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _build_response(
|
|
48
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
49
|
+
) -> Response[SUSHIReportPage]:
|
|
50
|
+
return Response(
|
|
51
|
+
status_code=HTTPStatus(response.status_code),
|
|
52
|
+
content=response.content,
|
|
53
|
+
headers=response.headers,
|
|
54
|
+
parsed=_parse_response(client=client, response=response),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def sync_detailed(
|
|
59
|
+
*,
|
|
60
|
+
client: Union[AuthenticatedClient, Client],
|
|
61
|
+
pagenumber: Union[Unset, int] = 1,
|
|
62
|
+
pagesize: Union[Unset, int] = 10,
|
|
63
|
+
) -> Response[SUSHIReportPage]:
|
|
64
|
+
"""getReports
|
|
65
|
+
|
|
66
|
+
This resource returns a list of reports supported by the API for a given application.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
pagenumber (Union[Unset, int]): Default: 1.
|
|
70
|
+
pagesize (Union[Unset, int]): Default: 10.
|
|
71
|
+
|
|
72
|
+
Raises:
|
|
73
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
74
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
Response[SUSHIReportPage]
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
kwargs = _get_kwargs(
|
|
81
|
+
pagenumber=pagenumber,
|
|
82
|
+
pagesize=pagesize,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
response = client.get_httpx_client().request(
|
|
86
|
+
**kwargs,
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
return _build_response(client=client, response=response)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def sync(
|
|
93
|
+
*,
|
|
94
|
+
client: Union[AuthenticatedClient, Client],
|
|
95
|
+
pagenumber: Union[Unset, int] = 1,
|
|
96
|
+
pagesize: Union[Unset, int] = 10,
|
|
97
|
+
) -> Optional[SUSHIReportPage]:
|
|
98
|
+
"""getReports
|
|
99
|
+
|
|
100
|
+
This resource returns a list of reports supported by the API for a given application.
|
|
101
|
+
|
|
102
|
+
Args:
|
|
103
|
+
pagenumber (Union[Unset, int]): Default: 1.
|
|
104
|
+
pagesize (Union[Unset, int]): Default: 10.
|
|
105
|
+
|
|
106
|
+
Raises:
|
|
107
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
108
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
109
|
+
|
|
110
|
+
Returns:
|
|
111
|
+
SUSHIReportPage
|
|
112
|
+
"""
|
|
113
|
+
|
|
114
|
+
return sync_detailed(
|
|
115
|
+
client=client,
|
|
116
|
+
pagenumber=pagenumber,
|
|
117
|
+
pagesize=pagesize,
|
|
118
|
+
).parsed
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
async def asyncio_detailed(
|
|
122
|
+
*,
|
|
123
|
+
client: Union[AuthenticatedClient, Client],
|
|
124
|
+
pagenumber: Union[Unset, int] = 1,
|
|
125
|
+
pagesize: Union[Unset, int] = 10,
|
|
126
|
+
) -> Response[SUSHIReportPage]:
|
|
127
|
+
"""getReports
|
|
128
|
+
|
|
129
|
+
This resource returns a list of reports supported by the API for a given application.
|
|
130
|
+
|
|
131
|
+
Args:
|
|
132
|
+
pagenumber (Union[Unset, int]): Default: 1.
|
|
133
|
+
pagesize (Union[Unset, int]): Default: 10.
|
|
134
|
+
|
|
135
|
+
Raises:
|
|
136
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
137
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
138
|
+
|
|
139
|
+
Returns:
|
|
140
|
+
Response[SUSHIReportPage]
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
kwargs = _get_kwargs(
|
|
144
|
+
pagenumber=pagenumber,
|
|
145
|
+
pagesize=pagesize,
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
149
|
+
|
|
150
|
+
return _build_response(client=client, response=response)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
async def asyncio(
|
|
154
|
+
*,
|
|
155
|
+
client: Union[AuthenticatedClient, Client],
|
|
156
|
+
pagenumber: Union[Unset, int] = 1,
|
|
157
|
+
pagesize: Union[Unset, int] = 10,
|
|
158
|
+
) -> Optional[SUSHIReportPage]:
|
|
159
|
+
"""getReports
|
|
160
|
+
|
|
161
|
+
This resource returns a list of reports supported by the API for a given application.
|
|
162
|
+
|
|
163
|
+
Args:
|
|
164
|
+
pagenumber (Union[Unset, int]): Default: 1.
|
|
165
|
+
pagesize (Union[Unset, int]): Default: 10.
|
|
166
|
+
|
|
167
|
+
Raises:
|
|
168
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
169
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
170
|
+
|
|
171
|
+
Returns:
|
|
172
|
+
SUSHIReportPage
|
|
173
|
+
"""
|
|
174
|
+
|
|
175
|
+
return (
|
|
176
|
+
await asyncio_detailed(
|
|
177
|
+
client=client,
|
|
178
|
+
pagenumber=pagenumber,
|
|
179
|
+
pagesize=pagesize,
|
|
180
|
+
)
|
|
181
|
+
).parsed
|