Skip to content

Commit 8c3c1bd

Browse files
author
Alan Shaw
committed
feat: add list parameters and deals structure
1 parent b2e6f0e commit 8c3c1bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+103
-308
lines changed

.openapi-generator/FILES

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ docs/Links.md
1515
docs/LinksFile.md
1616
docs/ListResponse.md
1717
docs/NFT.md
18-
docs/NFTDeals.md
1918
docs/NFTStorageAPI.md
2019
docs/Pin.md
2120
docs/PinStatus.md
@@ -43,7 +42,6 @@ nft_storage/model/links.py
4342
nft_storage/model/links_file.py
4443
nft_storage/model/list_response.py
4544
nft_storage/model/nft.py
46-
nft_storage/model/nft_deals.py
4745
nft_storage/model/pin.py
4846
nft_storage/model/pin_status.py
4947
nft_storage/model/unauthorized_error_response.py
@@ -69,7 +67,6 @@ test/test_links.py
6967
test/test_links_file.py
7068
test/test_list_response.py
7169
test/test_nft.py
72-
test/test_nft_deals.py
7370
test/test_nft_storage_api.py
7471
test/test_pin.py
7572
test/test_pin_status.py

README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# nft.storage
2-
# API Reference
3-
2+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
43

54
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
65

76
- API version: 1.0
87
- Package version: 1.0.0
98
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
10-
For more information, please visit [https://nft.storage](https://nft.storage)
119

1210
## Requirements.
1311

@@ -59,10 +57,10 @@ from nft_storage.model.get_response import GetResponse
5957
from nft_storage.model.list_response import ListResponse
6058
from nft_storage.model.unauthorized_error_response import UnauthorizedErrorResponse
6159
from nft_storage.model.upload_response import UploadResponse
62-
# Defining the host is optional and defaults to https://nft.storage/api
60+
# Defining the host is optional and defaults to https://api.nft.storage
6361
# See configuration.py for a list of all supported configuration parameters.
6462
configuration = nft_storage.Configuration(
65-
host = "https://nft.storage/api"
63+
host = "https://api.nft.storage"
6664
)
6765

6866
# The client must configure the authentication and authorization parameters
@@ -92,7 +90,7 @@ with nft_storage.ApiClient(configuration) as api_client:
9290

9391
## Documentation for API Endpoints
9492

95-
All URIs are relative to *https://nft.storage/api*
93+
All URIs are relative to *https://api.nft.storage*
9694

9795
Class | Method | HTTP request | Description
9896
------------ | ------------- | ------------- | -------------
@@ -116,7 +114,6 @@ Class | Method | HTTP request | Description
116114
- [LinksFile](docs/LinksFile.md)
117115
- [ListResponse](docs/ListResponse.md)
118116
- [NFT](docs/NFT.md)
119-
- [NFTDeals](docs/NFTDeals.md)
120117
- [Pin](docs/Pin.md)
121118
- [PinStatus](docs/PinStatus.md)
122119
- [UnauthorizedErrorResponse](docs/UnauthorizedErrorResponse.md)

docs/Deal.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**last_change** | **str** | This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ. |
8-
**status** | **str** | Deal Status |
8+
**status** | **str** | Deal status |
99
**batch_root_cid** | **str** | | [optional]
1010
**miner** | **str** | Miner ID | [optional]
1111
**network** | **str** | Filecoin network for this Deal | [optional]
1212
**piece_cid** | **str** | Piece CID string | [optional]
13-
**status_text** | **str** | Deal Status Description | [optional]
13+
**status_text** | **str** | Deal status description. | [optional]
14+
**chain_deal_id** | **float** | Identifier for the deal stored on chain. | [optional]
1415
**deal_activation** | **str** | This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ. | [optional]
1516
**deal_expiration** | **str** | This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ. | [optional]
1617

docs/NFT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Name | Type | Description | Notes
1111
**scope** | **str** | Name of the JWT token used to create this NFT. | [optional] if omitted the server will use the default value of "default"
1212
**pin** | [**Pin**](Pin.md) | | [optional]
1313
**files** | [**Files**](Files.md) | | [optional]
14-
**deals** | [**NFTDeals**](NFTDeals.md) | | [optional]
14+
**deals** | [**[Deal]**](Deal.md) | | [optional]
1515

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

docs/NFTDeals.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/NFTStorageAPI.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# nft_storage.NFTStorageAPI
22

3-
All URIs are relative to *https://nft.storage/api*
3+
All URIs are relative to *https://api.nft.storage*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
@@ -29,10 +29,10 @@ from nft_storage.model.delete_response import DeleteResponse
2929
from nft_storage.model.unauthorized_error_response import UnauthorizedErrorResponse
3030
from nft_storage.model.forbidden_error_response import ForbiddenErrorResponse
3131
from pprint import pprint
32-
# Defining the host is optional and defaults to https://nft.storage/api
32+
# Defining the host is optional and defaults to https://api.nft.storage
3333
# See configuration.py for a list of all supported configuration parameters.
3434
configuration = nft_storage.Configuration(
35-
host = "https://nft.storage/api"
35+
host = "https://api.nft.storage"
3636
)
3737

3838
# The client must configure the authentication and authorization parameters
@@ -108,10 +108,10 @@ from nft_storage.model.list_response import ListResponse
108108
from nft_storage.model.unauthorized_error_response import UnauthorizedErrorResponse
109109
from nft_storage.model.forbidden_error_response import ForbiddenErrorResponse
110110
from pprint import pprint
111-
# Defining the host is optional and defaults to https://nft.storage/api
111+
# Defining the host is optional and defaults to https://api.nft.storage
112112
# See configuration.py for a list of all supported configuration parameters.
113113
configuration = nft_storage.Configuration(
114-
host = "https://nft.storage/api"
114+
host = "https://api.nft.storage"
115115
)
116116

117117
# The client must configure the authentication and authorization parameters
@@ -128,19 +128,26 @@ configuration = nft_storage.Configuration(
128128
with nft_storage.ApiClient(configuration) as api_client:
129129
# Create an instance of the API class
130130
api_instance = nft_storage_api.NFTStorageAPI(api_client)
131+
before = dateutil_parser('2020-07-27T17:32:28Z') # datetime | Return results created before provided timestamp (optional)
132+
limit = 10 # int | Max records to return (optional) if omitted the server will use the default value of 10
131133

132-
# example, this endpoint has no required or optional parameters
134+
# example passing only required values which don't have defaults set
135+
# and optional values
133136
try:
134137
# List all stored files
135-
api_response = api_instance.list()
138+
api_response = api_instance.list(before=before, limit=limit)
136139
pprint(api_response)
137140
except nft_storage.ApiException as e:
138141
print("Exception when calling NFTStorageAPI->list: %s\n" % e)
139142
```
140143

141144

142145
### Parameters
143-
This endpoint does not need any parameter.
146+
147+
Name | Type | Description | Notes
148+
------------- | ------------- | ------------- | -------------
149+
**before** | **datetime**| Return results created before provided timestamp | [optional]
150+
**limit** | **int**| Max records to return | [optional] if omitted the server will use the default value of 10
144151

145152
### Return type
146153

@@ -185,10 +192,10 @@ from nft_storage.model.unauthorized_error_response import UnauthorizedErrorRespo
185192
from nft_storage.model.get_response import GetResponse
186193
from nft_storage.model.forbidden_error_response import ForbiddenErrorResponse
187194
from pprint import pprint
188-
# Defining the host is optional and defaults to https://nft.storage/api
195+
# Defining the host is optional and defaults to https://api.nft.storage
189196
# See configuration.py for a list of all supported configuration parameters.
190197
configuration = nft_storage.Configuration(
191-
host = "https://nft.storage/api"
198+
host = "https://api.nft.storage"
192199
)
193200

194201
# The client must configure the authentication and authorization parameters
@@ -266,10 +273,10 @@ from nft_storage.model.upload_response import UploadResponse
266273
from nft_storage.model.unauthorized_error_response import UnauthorizedErrorResponse
267274
from nft_storage.model.forbidden_error_response import ForbiddenErrorResponse
268275
from pprint import pprint
269-
# Defining the host is optional and defaults to https://nft.storage/api
276+
# Defining the host is optional and defaults to https://api.nft.storage
270277
# See configuration.py for a list of all supported configuration parameters.
271278
configuration = nft_storage.Configuration(
272-
host = "https://nft.storage/api"
279+
host = "https://api.nft.storage"
273280
)
274281

275282
# The client must configure the authentication and authorization parameters

nft_storage/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
NFT Storage API
55
6-
# API Reference # noqa: E501
6+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
77
88
The version of the OpenAPI document: 1.0
99
Generated by: https://openapi-generator.tech

nft_storage/api/nft_storage_api.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
NFT Storage API
33
4-
# API Reference # noqa: E501
4+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
55
66
The version of the OpenAPI document: 1.0
77
Generated by: https://openapi-generator.tech
@@ -175,6 +175,8 @@ def __list(
175175
176176
177177
Keyword Args:
178+
before (datetime): Return results created before provided timestamp. [optional]
179+
limit (int): Max records to return. [optional] if omitted the server will use the default value of 10
178180
_return_http_data_only (bool): response data without head status
179181
code and headers. Default is True.
180182
_preload_content (bool): if False, the urllib3.HTTPResponse object
@@ -234,25 +236,41 @@ def __list(
234236
},
235237
params_map={
236238
'all': [
239+
'before',
240+
'limit',
237241
],
238242
'required': [],
239243
'nullable': [
240244
],
241245
'enum': [
242246
],
243247
'validation': [
248+
'limit',
244249
]
245250
},
246251
root_map={
247252
'validations': {
253+
('limit',): {
254+
255+
'inclusive_maximum': 100,
256+
'inclusive_minimum': 1,
257+
},
248258
},
249259
'allowed_values': {
250260
},
251261
'openapi_types': {
262+
'before':
263+
(datetime,),
264+
'limit':
265+
(int,),
252266
},
253267
'attribute_map': {
268+
'before': 'before',
269+
'limit': 'limit',
254270
},
255271
'location_map': {
272+
'before': 'query',
273+
'limit': 'query',
256274
},
257275
'collection_format_map': {
258276
}

nft_storage/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
NFT Storage API
33
4-
# API Reference # noqa: E501
4+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
55
66
The version of the OpenAPI document: 1.0
77
Generated by: https://openapi-generator.tech

nft_storage/configuration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
NFT Storage API
33
4-
# API Reference # noqa: E501
4+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
55
66
The version of the OpenAPI document: 1.0
77
Generated by: https://openapi-generator.tech
@@ -93,7 +93,7 @@ def __init__(self, host=None,
9393
):
9494
"""Constructor
9595
"""
96-
self._base_path = "https://nft.storage/api" if host is None else host
96+
self._base_path = "https://api.nft.storage" if host is None else host
9797
"""Default Base url
9898
"""
9999
self.server_index = 0 if server_index is None and host is None else server_index
@@ -396,7 +396,7 @@ def get_host_settings(self):
396396
"""
397397
return [
398398
{
399-
'url': "https://nft.storage/api",
399+
'url': "https://api.nft.storage",
400400
'description': "No description provided",
401401
}
402402
]

0 commit comments

Comments
 (0)