Skip to content

Commit 131a9ea

Browse files
committed
Minor update
1 parent 8c3c1bd commit 131a9ea

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

+2811
-231
lines changed

.openapi-generator/FILES

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
.openapi-generator-ignore
44
.travis.yml
55
README.md
6+
docs/CheckResponse.md
7+
docs/CheckResponseValue.md
68
docs/Deal.md
79
docs/DeleteResponse.md
810
docs/ErrorResponse.md
@@ -30,6 +32,8 @@ nft_storage/apis/__init__.py
3032
nft_storage/configuration.py
3133
nft_storage/exceptions.py
3234
nft_storage/model/__init__.py
35+
nft_storage/model/check_response.py
36+
nft_storage/model/check_response_value.py
3337
nft_storage/model/deal.py
3438
nft_storage/model/delete_response.py
3539
nft_storage/model/error_response.py
@@ -55,6 +59,8 @@ setup.cfg
5559
setup.py
5660
test-requirements.txt
5761
test/__init__.py
62+
test/test_check_response.py
63+
test/test_check_response_value.py
5864
test/test_deal.py
5965
test/test_delete_response.py
6066
test/test_error_response.py

.openapi-generator/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.1.1-SNAPSHOT
1+
5.3.0-SNAPSHOT

README.md

+7-12
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import time
5050
import nft_storage
5151
from pprint import pprint
5252
from nft_storage.api import nft_storage_api
53+
from nft_storage.model.check_response import CheckResponse
5354
from nft_storage.model.delete_response import DeleteResponse
5455
from nft_storage.model.error_response import ErrorResponse
5556
from nft_storage.model.forbidden_error_response import ForbiddenErrorResponse
@@ -63,15 +64,6 @@ configuration = nft_storage.Configuration(
6364
host = "https://api.nft.storage"
6465
)
6566

66-
# The client must configure the authentication and authorization parameters
67-
# in accordance with the API server security policy.
68-
# Examples for each auth method are provided below, use the example that
69-
# satisfies your auth use case.
70-
71-
# Configure Bearer authorization (JWT): bearerAuth
72-
configuration = nft_storage.Configuration(
73-
access_token = 'YOUR_BEARER_TOKEN'
74-
)
7567

7668

7769
# Enter a context with an instance of the API client
@@ -81,11 +73,11 @@ with nft_storage.ApiClient(configuration) as api_client:
8173
cid = "bafkreidivzimqfqtoqxkrpge6bjyhlvxqs3rhe73owtmdulaxr5do5in7u" # str | CID for the NFT
8274

8375
try:
84-
# Stop storing the content with the passed CID
85-
api_response = api_instance.delete(cid)
76+
# Check if a CID of an NFT is being stored by nft.storage.
77+
api_response = api_instance.check(cid)
8678
pprint(api_response)
8779
except nft_storage.ApiException as e:
88-
print("Exception when calling NFTStorageAPI->delete: %s\n" % e)
80+
print("Exception when calling NFTStorageAPI->check: %s\n" % e)
8981
```
9082

9183
## Documentation for API Endpoints
@@ -94,6 +86,7 @@ All URIs are relative to *https://api.nft.storage*
9486

9587
Class | Method | HTTP request | Description
9688
------------ | ------------- | ------------- | -------------
89+
*NFTStorageAPI* | [**check**](docs/NFTStorageAPI.md#check) | **GET** /check/{cid} | Check if a CID of an NFT is being stored by nft.storage.
9790
*NFTStorageAPI* | [**delete**](docs/NFTStorageAPI.md#delete) | **DELETE** /{cid} | Stop storing the content with the passed CID
9891
*NFTStorageAPI* | [**list**](docs/NFTStorageAPI.md#list) | **GET** / | List all stored files
9992
*NFTStorageAPI* | [**status**](docs/NFTStorageAPI.md#status) | **GET** /{cid} | Get information for the stored file CID
@@ -102,6 +95,8 @@ Class | Method | HTTP request | Description
10295

10396
## Documentation For Models
10497

98+
- [CheckResponse](docs/CheckResponse.md)
99+
- [CheckResponseValue](docs/CheckResponseValue.md)
105100
- [Deal](docs/Deal.md)
106101
- [DeleteResponse](docs/DeleteResponse.md)
107102
- [ErrorResponse](docs/ErrorResponse.md)

docs/CheckResponse.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# CheckResponse
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**ok** | **bool** | | [optional] if omitted the server will use the default value of True
8+
**value** | [**CheckResponseValue**](CheckResponseValue.md) | | [optional]
9+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+
13+

docs/CheckResponseValue.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# CheckResponseValue
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**cid** | **str** | Self-describing content-addressed identifiers for distributed systems. Check [spec](https://github.com/multiformats/cid) for more info. | [optional]
8+
**pin** | [**Pin**](Pin.md) | | [optional]
9+
**deals** | [**[Deal]**](Deal.md) | | [optional]
10+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
11+
12+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
13+
14+

docs/Deal.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Name | Type | Description | Notes
1414
**chain_deal_id** | **float** | Identifier for the deal stored on chain. | [optional]
1515
**deal_activation** | **str** | This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ. | [optional]
1616
**deal_expiration** | **str** | This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ. | [optional]
17+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
1718

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

docs/DeleteResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**ok** | **bool** | | [optional]
8+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
89

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

docs/ErrorResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**ok** | **bool** | | [optional] if omitted the server will use the default value of False
88
**error** | [**ErrorResponseError**](ErrorResponseError.md) | | [optional]
9+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
910

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

docs/ErrorResponseError.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**name** | **str** | | [optional]
88
**message** | **str** | | [optional]
9+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
910

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

docs/Files.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Files in the directory (only if this NFT is a directory).
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**value** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]** | Files in the directory (only if this NFT is a directory). |
9+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
910

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

docs/ForbiddenErrorResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**ok** | **bool** | | [optional] if omitted the server will use the default value of False
88
**error** | [**ForbiddenErrorResponseError**](ForbiddenErrorResponseError.md) | | [optional]
9+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
910

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

docs/ForbiddenErrorResponseError.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**name** | **str** | | [optional] if omitted the server will use the default value of "HTTP Error"
88
**message** | **str** | | [optional]
9+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
910

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

docs/GetResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**ok** | **bool** | | [optional] if omitted the server will use the default value of True
88
**value** | **NFT** | | [optional]
9+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
910

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

docs/Links.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Name | Type | Description | Notes
77
**ipfs** | **str** | | [optional]
88
**http** | **str** | | [optional]
99
**file** | [**[LinksFile]**](LinksFile.md) | | [optional]
10+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
1011

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

docs/LinksFile.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**ipfs** | **str** | | [optional]
88
**http** | **str** | | [optional]
9+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
910

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

docs/ListResponse.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**ok** | **bool** | | [optional] if omitted the server will use the default value of True
88
**value** | [**[NFT]**](NFT.md) | | [optional]
9+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
910

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

docs/NFT.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Name | Type | Description | Notes
1212
**pin** | [**Pin**](Pin.md) | | [optional]
1313
**files** | [**Files**](Files.md) | | [optional]
1414
**deals** | [**[Deal]**](Deal.md) | | [optional]
15+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
1516

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

docs/NFTStorageAPI.md

+82-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,83 @@ All URIs are relative to *https://api.nft.storage*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7+
[**check**](NFTStorageAPI.md#check) | **GET** /check/{cid} | Check if a CID of an NFT is being stored by nft.storage.
78
[**delete**](NFTStorageAPI.md#delete) | **DELETE** /{cid} | Stop storing the content with the passed CID
89
[**list**](NFTStorageAPI.md#list) | **GET** / | List all stored files
910
[**status**](NFTStorageAPI.md#status) | **GET** /{cid} | Get information for the stored file CID
1011
[**store**](NFTStorageAPI.md#store) | **POST** /upload | Store a file
1112

1213

14+
# **check**
15+
> CheckResponse check(cid)
16+
17+
Check if a CID of an NFT is being stored by nft.storage.
18+
19+
Includes the IPFS pinning state and the Filecoin deal state.
20+
21+
### Example
22+
23+
24+
```python
25+
import time
26+
import nft_storage
27+
from nft_storage.api import nft_storage_api
28+
from nft_storage.model.error_response import ErrorResponse
29+
from nft_storage.model.check_response import CheckResponse
30+
from pprint import pprint
31+
# Defining the host is optional and defaults to https://api.nft.storage
32+
# See configuration.py for a list of all supported configuration parameters.
33+
configuration = nft_storage.Configuration(
34+
host = "https://api.nft.storage"
35+
)
36+
37+
38+
# Enter a context with an instance of the API client
39+
with nft_storage.ApiClient() as api_client:
40+
# Create an instance of the API class
41+
api_instance = nft_storage_api.NFTStorageAPI(api_client)
42+
cid = "bafkreidivzimqfqtoqxkrpge6bjyhlvxqs3rhe73owtmdulaxr5do5in7u" # str | CID for the NFT
43+
44+
# example passing only required values which don't have defaults set
45+
try:
46+
# Check if a CID of an NFT is being stored by nft.storage.
47+
api_response = api_instance.check(cid)
48+
pprint(api_response)
49+
except nft_storage.ApiException as e:
50+
print("Exception when calling NFTStorageAPI->check: %s\n" % e)
51+
```
52+
53+
54+
### Parameters
55+
56+
Name | Type | Description | Notes
57+
------------- | ------------- | ------------- | -------------
58+
**cid** | **str**| CID for the NFT |
59+
60+
### Return type
61+
62+
[**CheckResponse**](CheckResponse.md)
63+
64+
### Authorization
65+
66+
No authorization required
67+
68+
### HTTP request headers
69+
70+
- **Content-Type**: Not defined
71+
- **Accept**: application/json
72+
73+
74+
### HTTP response details
75+
76+
| Status code | Description | Response headers |
77+
|-------------|-------------|------------------|
78+
**200** | OK | - |
79+
**404** | Not Found | - |
80+
**5XX** | Internal Server Error | - |
81+
82+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
83+
1384
# **delete**
1485
> DeleteResponse delete(cid)
1586
@@ -20,6 +91,7 @@ Stop storing the content with the passed CID on nft.storage. - Unpin the item fr
2091
### Example
2192

2293
* Bearer (JWT) Authentication (bearerAuth):
94+
2395
```python
2496
import time
2597
import nft_storage
@@ -82,6 +154,7 @@ Name | Type | Description | Notes
82154

83155

84156
### HTTP response details
157+
85158
| Status code | Description | Response headers |
86159
|-------------|-------------|------------------|
87160
**200** | OK | - |
@@ -99,6 +172,7 @@ List all stored files
99172
### Example
100173

101174
* Bearer (JWT) Authentication (bearerAuth):
175+
102176
```python
103177
import time
104178
import nft_storage
@@ -164,6 +238,7 @@ Name | Type | Description | Notes
164238

165239

166240
### HTTP response details
241+
167242
| Status code | Description | Response headers |
168243
|-------------|-------------|------------------|
169244
**200** | OK | - |
@@ -183,6 +258,7 @@ Includes the IPFS pinning state and the Filecoin deal state.
183258
### Example
184259

185260
* Bearer (JWT) Authentication (bearerAuth):
261+
186262
```python
187263
import time
188264
import nft_storage
@@ -245,6 +321,7 @@ Name | Type | Description | Notes
245321

246322

247323
### HTTP response details
324+
248325
| Status code | Description | Response headers |
249326
|-------------|-------------|------------------|
250327
**200** | OK | - |
@@ -259,11 +336,12 @@ Name | Type | Description | Notes
259336
260337
Store a file
261338

262-
Store a file with nft.storage. - Submit a HTTP `POST` request passing the file data in the request body. - To store multiple files in a directory, submit a `multipart/form-data` HTTP `POST` request. Use the `Content-Disposition` header for each part to specify a filename.
339+
Store a file with nft.storage. You can upload either a single file or multiple files in a directory Send the POST request with one of: - a single file as a single Blob/File Object as the body - multiple files as FormData with `Content-Disposition` headers for each part to specify filenames and the request header `Content-Type: multipart/form-data`. You can also upload a Content Addressed Archive (CAR) file, by setting the request body as a single CAR Blob/File object and providing the request header `Content-Type: application/car` Providing a CAR file allows you to pre-compute the root CID for 1 or more files, ensures that the nft.storage will store and provide your assets with the same CID.
263340

264341
### Example
265342

266343
* Bearer (JWT) Authentication (bearerAuth):
344+
267345
```python
268346
import time
269347
import nft_storage
@@ -321,14 +399,16 @@ Name | Type | Description | Notes
321399

322400
### HTTP request headers
323401

324-
- **Content-Type**: image/png, application/octet-stream, multipart/form-data
402+
- **Content-Type**: image/*, application/car, multipart/form-data
325403
- **Accept**: application/json
326404

327405

328406
### HTTP response details
407+
329408
| Status code | Description | Response headers |
330409
|-------------|-------------|------------------|
331410
**200** | OK | - |
411+
**400** | Bad Request | - |
332412
**401** | Unauthorized | - |
333413
**403** | Forbidden | - |
334414
**5XX** | Internal Server Error | - |

docs/Pin.md

+2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**cid** | **str** | Self-describing content-addressed identifiers for distributed systems. Check [spec](https://github.com/multiformats/cid) for more info. | [optional]
88
**name** | **str** | | [optional]
9+
**meta** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional]
910
**status** | [**PinStatus**](PinStatus.md) | | [optional]
1011
**created** | **datetime** | This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ. | [optional]
1112
**size** | **float** | | [optional]
13+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
1214

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

docs/PinStatus.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**value** | **str** | | must be one of ["queued", "pinning", "pinned", "failed", ]
8+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
89

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

0 commit comments

Comments
 (0)