Compare commits

...

9 Commits

Author SHA1 Message Date
AuHau
7fd5545959 Version bump 2025-05-22 06:52:43 +00:00
Adam Uhlíř
ed88a74c73
fix: update openapi generator (#6) 2025-05-22 08:41:00 +02:00
github-actions[bot]
00a3c7a086
Generated API update (#7)
Co-authored-by: codex-storage-bot <154258435+codex-storage-bot@users.noreply.github.com>
2025-05-22 08:35:56 +02:00
Adam Uhlíř
9e0759658a
ci: cleanup generate yaml (#5) 2025-04-23 11:19:37 +02:00
AuHau
60aaa4696a Version bump 2025-04-23 09:00:38 +00:00
github-actions[bot]
ef4f7a9b3d
Generated API update (#4)
Co-authored-by: codex-storage-bot <154258435+codex-storage-bot@users.noreply.github.com>
2025-04-23 10:59:04 +02:00
AuHau
bd67201dac Version bump 2025-03-31 16:48:52 +00:00
github-actions[bot]
9dd754e2d9
Generated API update (#3)
Co-authored-by: AuHau <6072250+AuHau@users.noreply.github.com>
2025-03-31 18:47:51 +02:00
AuHau
cb896ee083 Version bump 2025-03-31 15:53:21 +00:00
57 changed files with 741 additions and 246 deletions

View File

@ -6,7 +6,7 @@ permissions:
on: on:
repository_dispatch: repository_dispatch:
types: [generate, release] types: [generate]
workflow_dispatch: workflow_dispatch:
inputs: inputs:
openapi_url: openapi_url:
@ -25,10 +25,6 @@ jobs:
echo "Error: 'openapi_url' is missing in client_payload." echo "Error: 'openapi_url' is missing in client_payload."
exit 1 exit 1
fi fi
if [ "${{ github.event.action }}" == "release" ] && [ -z "${{ github.event.client_payload.version }}" ]; then
echo "Error: We are supposed to release, but 'version' is missing in client_payload."
exit 1
fi
echo "OPENAPI_URL=${{ github.event.client_payload.openapi_url }}" >> $GITHUB_ENV echo "OPENAPI_URL=${{ github.event.client_payload.openapi_url }}" >> $GITHUB_ENV
else else

View File

@ -23,7 +23,6 @@ codex_api_client/models/peers_table.py
codex_api_client/models/purchase.py codex_api_client/models/purchase.py
codex_api_client/models/reservation.py codex_api_client/models/reservation.py
codex_api_client/models/sales_availability.py codex_api_client/models/sales_availability.py
codex_api_client/models/sales_availability_create.py
codex_api_client/models/sales_availability_read.py codex_api_client/models/sales_availability_read.py
codex_api_client/models/slot.py codex_api_client/models/slot.py
codex_api_client/models/slot_agent.py codex_api_client/models/slot_agent.py
@ -51,7 +50,6 @@ docs/Purchase.md
docs/Reservation.md docs/Reservation.md
docs/SPRRead.md docs/SPRRead.md
docs/SalesAvailability.md docs/SalesAvailability.md
docs/SalesAvailabilityCREATE.md
docs/SalesAvailabilityREAD.md docs/SalesAvailabilityREAD.md
docs/Slot.md docs/Slot.md
docs/SlotAgent.md docs/SlotAgent.md

View File

@ -1 +1 @@
7.10.0 7.12.0

View File

@ -4,8 +4,8 @@ List of endpoints and interfaces available to Codex API users
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 0.0.1 - API version: 0.0.1
- Package version: 0.2.0 - Package version: 0.4.0
- Generator version: 7.10.0 - Generator version: 7.12.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen - Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements. ## Requirements.
@ -45,15 +45,13 @@ configuration = codex_api_client.Configuration(
with codex_api_client.ApiClient(configuration) as api_client: with codex_api_client.ApiClient(configuration) as api_client:
# Create an instance of the API class # Create an instance of the API class
api_instance = codex_api_client.DataApi(api_client) api_instance = codex_api_client.DataApi(api_client)
cid = 'cid_example' # str | File to be downloaded. cid = 'cid_example' # str | Block or dataset to be deleted.
try: try:
# Download a file from the local node in a streaming manner. If the file is not available locally, a 404 is returned. # Deletes either a single block or an entire dataset from the local node.
api_response = api_instance.download_local(cid) api_instance.delete_local(cid)
print("The response of DataApi->download_local:\n")
pprint(api_response)
except ApiException as e: except ApiException as e:
print("Exception when calling DataApi->download_local: %s\n" % e) print("Exception when calling DataApi->delete_local: %s\n" % e)
``` ```
@ -63,6 +61,7 @@ All URIs are relative to *http://localhost:8080/api/codex/v1*
Class | Method | HTTP request | Description Class | Method | HTTP request | Description
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
*DataApi* | [**delete_local**](docs/DataApi.md#delete_local) | **DELETE** /data/{cid} | Deletes either a single block or an entire dataset from the local node.
*DataApi* | [**download_local**](docs/DataApi.md#download_local) | **GET** /data/{cid} | Download a file from the local node in a streaming manner. If the file is not available locally, a 404 is returned. *DataApi* | [**download_local**](docs/DataApi.md#download_local) | **GET** /data/{cid} | Download a file from the local node in a streaming manner. If the file is not available locally, a 404 is returned.
*DataApi* | [**download_network**](docs/DataApi.md#download_network) | **POST** /data/{cid}/network | Download a file from the network to the local node if it&#39;s not available locally. Note: Download is performed async. Call can return before download is completed. *DataApi* | [**download_network**](docs/DataApi.md#download_network) | **POST** /data/{cid}/network | Download a file from the network to the local node if it&#39;s not available locally. Note: Download is performed async. Call can return before download is completed.
*DataApi* | [**download_network_manifest**](docs/DataApi.md#download_network_manifest) | **GET** /data/{cid}/network/manifest | Download only the dataset manifest from the network to the local node if it&#39;s not available locally. *DataApi* | [**download_network_manifest**](docs/DataApi.md#download_network_manifest) | **GET** /data/{cid}/network/manifest | Download only the dataset manifest from the network to the local node if it&#39;s not available locally.
@ -101,7 +100,6 @@ Class | Method | HTTP request | Description
- [Reservation](docs/Reservation.md) - [Reservation](docs/Reservation.md)
- [SPRRead](docs/SPRRead.md) - [SPRRead](docs/SPRRead.md)
- [SalesAvailability](docs/SalesAvailability.md) - [SalesAvailability](docs/SalesAvailability.md)
- [SalesAvailabilityCREATE](docs/SalesAvailabilityCREATE.md)
- [SalesAvailabilityREAD](docs/SalesAvailabilityREAD.md) - [SalesAvailabilityREAD](docs/SalesAvailabilityREAD.md)
- [Slot](docs/Slot.md) - [Slot](docs/Slot.md)
- [SlotAgent](docs/SlotAgent.md) - [SlotAgent](docs/SlotAgent.md)

View File

@ -50,6 +50,10 @@ components:
type: string type: string
description: The amount of tokens paid per byte per second per slot to hosts the client is willing to pay description: The amount of tokens paid per byte per second per slot to hosts the client is willing to pay
CollateralPerByte:
type: string
description: Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots
Duration: Duration:
type: integer type: integer
format: int64 format: int64
@ -70,6 +74,8 @@ components:
SPRRead: SPRRead:
type: object type: object
required:
- spr
properties: properties:
spr: spr:
$ref: "#/components/schemas/SPR" $ref: "#/components/schemas/SPR"
@ -82,6 +88,8 @@ components:
Content: Content:
type: object type: object
required:
- cid
description: Parameters specifying the content description: Parameters specifying the content
properties: properties:
cid: cid:
@ -89,6 +97,12 @@ components:
Node: Node:
type: object type: object
required:
- nodeId
- peerId
- record
- address
- seen
properties: properties:
nodeId: nodeId:
type: string type: string
@ -110,9 +124,15 @@ components:
revision: revision:
type: string type: string
example: 0c647d8 example: 0c647d8
contracts:
type: string
example: 0b537c7
PeersTable: PeersTable:
type: object type: object
required:
- localNode
- nodes
properties: properties:
localNode: localNode:
$ref: "#/components/schemas/Node" $ref: "#/components/schemas/Node"
@ -123,6 +143,14 @@ components:
DebugInfo: DebugInfo:
type: object type: object
required:
- id
- addrs
- repo
- spr
- announceAddresses
- table
- codex
properties: properties:
id: id:
$ref: "#/components/schemas/PeerId" $ref: "#/components/schemas/PeerId"
@ -146,9 +174,12 @@ components:
SalesAvailability: SalesAvailability:
type: object type: object
required:
- totalSize
- duration
- minPricePerBytePerSecond
- totalCollateral
properties: properties:
id:
$ref: "#/components/schemas/Id"
totalSize: totalSize:
type: integer type: integer
format: int64 format: int64
@ -161,28 +192,43 @@ components:
totalCollateral: totalCollateral:
type: string type: string
description: Total collateral (in amount of tokens) that can be used for matching requests description: Total collateral (in amount of tokens) that can be used for matching requests
enabled:
type: boolean
description: Enable the ability to receive sales on this availability.
default: true
until:
type: integer
description: Specifies the latest timestamp, after which the availability will no longer host any slots. If set to 0, there will be no restrictions.
default: 0
SalesAvailabilityREAD: SalesAvailabilityREAD:
required:
- id
- totalRemainingCollateral
- freeSize
allOf: allOf:
- $ref: "#/components/schemas/SalesAvailability" - $ref: "#/components/schemas/SalesAvailability"
- type: object - type: object
properties: properties:
id:
$ref: "#/components/schemas/Id"
readonly: true
freeSize: freeSize:
type: integer type: integer
format: int64 format: int64
description: Unused size of availability's storage in bytes description: Unused size of availability's storage in bytes as decimal string
readOnly: true
SalesAvailabilityCREATE: totalRemainingCollateral:
allOf: type: string
- $ref: "#/components/schemas/SalesAvailability" description: Total collateral effective (in amount of tokens) that can be used for matching requests
- required: readOnly: true
- totalSize
- minPricePerBytePerSecond
- totalCollateral
- duration
Slot: Slot:
type: object type: object
required:
- id
- request
- slotIndex
properties: properties:
id: id:
$ref: "#/components/schemas/SlotId" $ref: "#/components/schemas/SlotId"
@ -195,9 +241,11 @@ components:
SlotAgent: SlotAgent:
type: object type: object
required:
- state
- requestId
- slotIndex
properties: properties:
id:
$ref: "#/components/schemas/SlotId"
slotIndex: slotIndex:
type: integer type: integer
format: int64 format: int64
@ -228,6 +276,13 @@ components:
Reservation: Reservation:
type: object type: object
required:
- id
- availabilityId
- size
- requestId
- slotIndex
- validUntil
properties: properties:
id: id:
$ref: "#/components/schemas/Id" $ref: "#/components/schemas/Id"
@ -243,6 +298,9 @@ components:
type: integer type: integer
format: int64 format: int64
description: Slot Index number description: Slot Index number
validUntil:
type: integer
description: Timestamp after which the reservation will no longer be valid.
StorageRequestCreation: StorageRequestCreation:
type: object type: object
@ -263,13 +321,14 @@ components:
description: Minimal number of nodes the content should be stored on description: Minimal number of nodes the content should be stored on
type: integer type: integer
default: 3 default: 3
minimum: 3
tolerance: tolerance:
description: Additional number of nodes on top of the `nodes` property that can be lost before pronouncing the content lost description: Additional number of nodes on top of the `nodes` property that can be lost before pronouncing the content lost
type: integer type: integer
default: 1 default: 1
minimum: 1
collateralPerByte: collateralPerByte:
type: string $ref: "#/components/schemas/CollateralPerByte"
description: Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots
expiry: expiry:
type: integer type: integer
format: int64 format: int64
@ -277,26 +336,44 @@ components:
StorageAsk: StorageAsk:
type: object type: object
required: required:
- slots
- slotSize
- duration
- proofProbability
- pricePerBytePerSecond - pricePerBytePerSecond
- collateralPerByte
- maxSlotLoss
properties: properties:
slots: slots:
description: Number of slots (eq. hosts) that the Request want to have the content spread over description: Number of slots (eq. hosts) that the Request want to have the content spread over
type: integer type: integer
format: int64
slotSize: slotSize:
type: string type: integer
description: Amount of storage per slot (in bytes) as decimal string format: int64
description: Amount of storage per slot in bytes
duration: duration:
$ref: "#/components/schemas/Duration" $ref: "#/components/schemas/Duration"
proofProbability: proofProbability:
$ref: "#/components/schemas/ProofProbability" $ref: "#/components/schemas/ProofProbability"
pricePerBytePerSecond: pricePerBytePerSecond:
$ref: "#/components/schemas/PricePerBytePerSecond" $ref: "#/components/schemas/PricePerBytePerSecond"
collateralPerByte:
$ref: "#/components/schemas/CollateralPerByte"
maxSlotLoss: maxSlotLoss:
type: integer type: integer
format: int64
description: Max slots that can be lost without data considered to be lost description: Max slots that can be lost without data considered to be lost
StorageRequest: StorageRequest:
type: object type: object
required:
- id
- client
- ask
- content
- expiry
- nonce
properties: properties:
id: id:
type: string type: string
@ -315,13 +392,16 @@ components:
Purchase: Purchase:
type: object type: object
required:
- state
- requestId
properties: properties:
state: state:
type: string type: string
description: Description of the Request's state description: Description of the Request's state
enum: enum:
- cancelled - cancelled
- error - errored
- failed - failed
- finished - finished
- pending - pending
@ -330,12 +410,17 @@ components:
- unknown - unknown
error: error:
type: string type: string
nullable: true
description: If Request failed, then here is presented the error message description: If Request failed, then here is presented the error message
request: request:
$ref: "#/components/schemas/StorageRequest" $ref: "#/components/schemas/StorageRequest"
requestId:
$ref: "#/components/schemas/Id"
DataList: DataList:
type: object type: object
required:
- content
properties: properties:
content: content:
type: array type: array
@ -344,6 +429,9 @@ components:
DataItem: DataItem:
type: object type: object
required:
- cid
- manifest
properties: properties:
cid: cid:
$ref: "#/components/schemas/Cid" $ref: "#/components/schemas/Cid"
@ -352,6 +440,11 @@ components:
ManifestItem: ManifestItem:
type: object type: object
required:
- treeCid
- datasetSize
- blockSize
- protected
properties: properties:
treeCid: treeCid:
$ref: "#/components/schemas/Cid" $ref: "#/components/schemas/Cid"
@ -379,6 +472,11 @@ components:
Space: Space:
type: object type: object
required:
- totalBlocks
- quotaMaxBytes
- quotaUsedBytes
- quotaReservedBytes
properties: properties:
totalBlocks: totalBlocks:
description: "Number of blocks stored by the node" description: "Number of blocks stored by the node"
@ -497,6 +595,8 @@ paths:
text/plain: text/plain:
schema: schema:
type: string type: string
"422":
description: The mimetype of the filename is invalid
"500": "500":
description: Well it was bad-bad and the upload did not work out description: Well it was bad-bad and the upload did not work out
@ -528,6 +628,26 @@ paths:
"500": "500":
description: Well it was bad-bad description: Well it was bad-bad
delete:
summary: "Deletes either a single block or an entire dataset from the local node."
tags: [Data]
operationId: deleteLocal
parameters:
- in: path
name: cid
required: true
schema:
$ref: "#/components/schemas/Cid"
description: Block or dataset to be deleted.
responses:
"204":
description: Data was successfully deleted.
"400":
description: Invalid CID is specified
"500":
description: There was an error during deletion
"/data/{cid}/network": "/data/{cid}/network":
post: post:
summary: "Download a file from the network to the local node if it's not available locally. Note: Download is performed async. Call can return before download is completed." summary: "Download a file from the network to the local node if it's not available locally. Note: Download is performed async. Call can return before download is completed."
@ -697,7 +817,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/SalesAvailabilityCREATE" $ref: "#/components/schemas/SalesAvailability"
responses: responses:
"201": "201":
description: Created storage availability description: Created storage availability
@ -708,7 +828,7 @@ paths:
"400": "400":
description: Invalid data input description: Invalid data input
"422": "422":
description: Not enough node's storage quota available description: Not enough node's storage quota available or the provided parameters did not pass validation
"500": "500":
description: Error reserving availability description: Error reserving availability
"503": "503":
@ -741,7 +861,7 @@ paths:
"404": "404":
description: Availability not found description: Availability not found
"422": "422":
description: Not enough node's storage quota available description: The provided parameters did not pass validation
"500": "500":
description: Error reserving availability description: Error reserving availability
"503": "503":
@ -804,6 +924,8 @@ paths:
type: string type: string
"400": "400":
description: Invalid or missing Request ID description: Invalid or missing Request ID
"422":
description: The storage request parameters are not valid
"404": "404":
description: Request ID not found description: Request ID not found
"503": "503":
@ -861,7 +983,7 @@ paths:
"200": "200":
description: Node's SPR description: Node's SPR
content: content:
plain/text: text/plain:
schema: schema:
$ref: "#/components/schemas/SPR" $ref: "#/components/schemas/SPR"
application/json: application/json:
@ -879,7 +1001,7 @@ paths:
"200": "200":
description: Node's Peer ID description: Node's Peer ID
content: content:
plain/text: text/plain:
schema: schema:
$ref: "#/components/schemas/PeerId" $ref: "#/components/schemas/PeerId"
application/json: application/json:

View File

@ -14,7 +14,7 @@
""" # noqa: E501 """ # noqa: E501
__version__ = "0.2.0" __version__ = "0.4.0"
# import apis into sdk package # import apis into sdk package
from codex_api_client.api.data_api import DataApi from codex_api_client.api.data_api import DataApi
@ -47,7 +47,6 @@ from codex_api_client.models.purchase import Purchase
from codex_api_client.models.reservation import Reservation from codex_api_client.models.reservation import Reservation
from codex_api_client.models.spr_read import SPRRead from codex_api_client.models.spr_read import SPRRead
from codex_api_client.models.sales_availability import SalesAvailability from codex_api_client.models.sales_availability import SalesAvailability
from codex_api_client.models.sales_availability_create import SalesAvailabilityCREATE
from codex_api_client.models.sales_availability_read import SalesAvailabilityREAD from codex_api_client.models.sales_availability_read import SalesAvailabilityREAD
from codex_api_client.models.slot import Slot from codex_api_client.models.slot import Slot
from codex_api_client.models.slot_agent import SlotAgent from codex_api_client.models.slot_agent import SlotAgent

View File

@ -41,6 +41,262 @@ class DataApi:
self.api_client = api_client self.api_client = api_client
@validate_call
def delete_local(
self,
cid: Annotated[StrictStr, Field(description="Block or dataset to be deleted.")],
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> None:
"""Deletes either a single block or an entire dataset from the local node.
:param cid: Block or dataset to be deleted. (required)
:type cid: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._delete_local_serialize(
cid=cid,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'204': None,
'400': None,
'500': None,
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def delete_local_with_http_info(
self,
cid: Annotated[StrictStr, Field(description="Block or dataset to be deleted.")],
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[None]:
"""Deletes either a single block or an entire dataset from the local node.
:param cid: Block or dataset to be deleted. (required)
:type cid: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._delete_local_serialize(
cid=cid,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'204': None,
'400': None,
'500': None,
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def delete_local_without_preload_content(
self,
cid: Annotated[StrictStr, Field(description="Block or dataset to be deleted.")],
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Deletes either a single block or an entire dataset from the local node.
:param cid: Block or dataset to be deleted. (required)
:type cid: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._delete_local_serialize(
cid=cid,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'204': None,
'400': None,
'500': None,
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _delete_local_serialize(
self,
cid,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
if cid is not None:
_path_params['cid'] = cid
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
# authentication setting
_auth_settings: List[str] = [
]
return self.api_client.param_serialize(
method='DELETE',
resource_path='/data/{cid}',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
@validate_call @validate_call
def download_local( def download_local(
self, self,
@ -1666,6 +1922,7 @@ class DataApi:
_response_types_map: Dict[str, Optional[str]] = { _response_types_map: Dict[str, Optional[str]] = {
'200': "str", '200': "str",
'422': None,
'500': None, '500': None,
} }
response_data = self.api_client.call_api( response_data = self.api_client.call_api(
@ -1741,6 +1998,7 @@ class DataApi:
_response_types_map: Dict[str, Optional[str]] = { _response_types_map: Dict[str, Optional[str]] = {
'200': "str", '200': "str",
'422': None,
'500': None, '500': None,
} }
response_data = self.api_client.call_api( response_data = self.api_client.call_api(
@ -1816,6 +2074,7 @@ class DataApi:
_response_types_map: Dict[str, Optional[str]] = { _response_types_map: Dict[str, Optional[str]] = {
'200': "str", '200': "str",
'422': None,
'500': None, '500': None,
} }
response_data = self.api_client.call_api( response_data = self.api_client.call_api(

View File

@ -22,7 +22,6 @@ from typing_extensions import Annotated
from codex_api_client.models.purchase import Purchase from codex_api_client.models.purchase import Purchase
from codex_api_client.models.reservation import Reservation from codex_api_client.models.reservation import Reservation
from codex_api_client.models.sales_availability import SalesAvailability from codex_api_client.models.sales_availability import SalesAvailability
from codex_api_client.models.sales_availability_create import SalesAvailabilityCREATE
from codex_api_client.models.sales_availability_read import SalesAvailabilityREAD from codex_api_client.models.sales_availability_read import SalesAvailabilityREAD
from codex_api_client.models.slot import Slot from codex_api_client.models.slot import Slot
from codex_api_client.models.slot_agent import SlotAgent from codex_api_client.models.slot_agent import SlotAgent
@ -105,6 +104,7 @@ class MarketplaceApi:
_response_types_map: Dict[str, Optional[str]] = { _response_types_map: Dict[str, Optional[str]] = {
'200': "str", '200': "str",
'400': None, '400': None,
'422': None,
'404': None, '404': None,
'503': None, '503': None,
} }
@ -178,6 +178,7 @@ class MarketplaceApi:
_response_types_map: Dict[str, Optional[str]] = { _response_types_map: Dict[str, Optional[str]] = {
'200': "str", '200': "str",
'400': None, '400': None,
'422': None,
'404': None, '404': None,
'503': None, '503': None,
} }
@ -251,6 +252,7 @@ class MarketplaceApi:
_response_types_map: Dict[str, Optional[str]] = { _response_types_map: Dict[str, Optional[str]] = {
'200': "str", '200': "str",
'400': None, '400': None,
'422': None,
'404': None, '404': None,
'503': None, '503': None,
} }
@ -1885,7 +1887,7 @@ class MarketplaceApi:
@validate_call @validate_call
def offer_storage( def offer_storage(
self, self,
sales_availability_create: Optional[SalesAvailabilityCREATE] = None, sales_availability: Optional[SalesAvailability] = None,
_request_timeout: Union[ _request_timeout: Union[
None, None,
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)],
@ -1902,8 +1904,8 @@ class MarketplaceApi:
"""Offers storage for sale """Offers storage for sale
:param sales_availability_create: :param sales_availability:
:type sales_availability_create: SalesAvailabilityCREATE :type sales_availability: SalesAvailability
:param _request_timeout: timeout setting for this request. If one :param _request_timeout: timeout setting for this request. If one
number provided, it will be total request number provided, it will be total request
timeout. It can also be a pair (tuple) of timeout. It can also be a pair (tuple) of
@ -1927,7 +1929,7 @@ class MarketplaceApi:
""" # noqa: E501 """ # noqa: E501
_param = self._offer_storage_serialize( _param = self._offer_storage_serialize(
sales_availability_create=sales_availability_create, sales_availability=sales_availability,
_request_auth=_request_auth, _request_auth=_request_auth,
_content_type=_content_type, _content_type=_content_type,
_headers=_headers, _headers=_headers,
@ -1955,7 +1957,7 @@ class MarketplaceApi:
@validate_call @validate_call
def offer_storage_with_http_info( def offer_storage_with_http_info(
self, self,
sales_availability_create: Optional[SalesAvailabilityCREATE] = None, sales_availability: Optional[SalesAvailability] = None,
_request_timeout: Union[ _request_timeout: Union[
None, None,
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)],
@ -1972,8 +1974,8 @@ class MarketplaceApi:
"""Offers storage for sale """Offers storage for sale
:param sales_availability_create: :param sales_availability:
:type sales_availability_create: SalesAvailabilityCREATE :type sales_availability: SalesAvailability
:param _request_timeout: timeout setting for this request. If one :param _request_timeout: timeout setting for this request. If one
number provided, it will be total request number provided, it will be total request
timeout. It can also be a pair (tuple) of timeout. It can also be a pair (tuple) of
@ -1997,7 +1999,7 @@ class MarketplaceApi:
""" # noqa: E501 """ # noqa: E501
_param = self._offer_storage_serialize( _param = self._offer_storage_serialize(
sales_availability_create=sales_availability_create, sales_availability=sales_availability,
_request_auth=_request_auth, _request_auth=_request_auth,
_content_type=_content_type, _content_type=_content_type,
_headers=_headers, _headers=_headers,
@ -2025,7 +2027,7 @@ class MarketplaceApi:
@validate_call @validate_call
def offer_storage_without_preload_content( def offer_storage_without_preload_content(
self, self,
sales_availability_create: Optional[SalesAvailabilityCREATE] = None, sales_availability: Optional[SalesAvailability] = None,
_request_timeout: Union[ _request_timeout: Union[
None, None,
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)],
@ -2042,8 +2044,8 @@ class MarketplaceApi:
"""Offers storage for sale """Offers storage for sale
:param sales_availability_create: :param sales_availability:
:type sales_availability_create: SalesAvailabilityCREATE :type sales_availability: SalesAvailability
:param _request_timeout: timeout setting for this request. If one :param _request_timeout: timeout setting for this request. If one
number provided, it will be total request number provided, it will be total request
timeout. It can also be a pair (tuple) of timeout. It can also be a pair (tuple) of
@ -2067,7 +2069,7 @@ class MarketplaceApi:
""" # noqa: E501 """ # noqa: E501
_param = self._offer_storage_serialize( _param = self._offer_storage_serialize(
sales_availability_create=sales_availability_create, sales_availability=sales_availability,
_request_auth=_request_auth, _request_auth=_request_auth,
_content_type=_content_type, _content_type=_content_type,
_headers=_headers, _headers=_headers,
@ -2090,7 +2092,7 @@ class MarketplaceApi:
def _offer_storage_serialize( def _offer_storage_serialize(
self, self,
sales_availability_create, sales_availability,
_request_auth, _request_auth,
_content_type, _content_type,
_headers, _headers,
@ -2116,8 +2118,8 @@ class MarketplaceApi:
# process the header parameters # process the header parameters
# process the form parameters # process the form parameters
# process the body parameter # process the body parameter
if sales_availability_create is not None: if sales_availability is not None:
_body_params = sales_availability_create _body_params = sales_availability
# set the HTTP header `Accept` # set the HTTP header `Accept`

View File

@ -527,7 +527,7 @@ class NodeApi:
if 'Accept' not in _header_params: if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept( _header_params['Accept'] = self.api_client.select_header_accept(
[ [
'plain/text', 'text/plain',
'application/json' 'application/json'
] ]
) )
@ -773,7 +773,7 @@ class NodeApi:
if 'Accept' not in _header_params: if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept( _header_params['Accept'] = self.api_client.select_header_accept(
[ [
'plain/text', 'text/plain',
'application/json' 'application/json'
] ]
) )

View File

@ -517,7 +517,7 @@ class ApiClient:
if k in collection_formats: if k in collection_formats:
collection_format = collection_formats[k] collection_format = collection_formats[k]
if collection_format == 'multi': if collection_format == 'multi':
new_params.extend((k, str(value)) for value in v) new_params.extend((k, quote(str(value))) for value in v)
else: else:
if collection_format == 'ssv': if collection_format == 'ssv':
delimiter = ' ' delimiter = ' '

View File

@ -18,7 +18,7 @@ import logging
from logging import FileHandler from logging import FileHandler
import multiprocessing import multiprocessing
import sys import sys
from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
from typing_extensions import NotRequired, Self from typing_extensions import NotRequired, Self
import urllib3 import urllib3
@ -160,6 +160,8 @@ class Configuration:
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
in PEM format. in PEM format.
:param retries: Number of retries for API requests. :param retries: Number of retries for API requests.
:param ca_cert_data: verify the peer using concatenated CA certificate data
in PEM (str) or DER (bytes) format.
""" """
@ -173,13 +175,14 @@ class Configuration:
username: Optional[str]=None, username: Optional[str]=None,
password: Optional[str]=None, password: Optional[str]=None,
access_token: Optional[str]=None, access_token: Optional[str]=None,
server_index: Optional[int]=None, server_index: Optional[int]=None,
server_variables: Optional[ServerVariablesT]=None, server_variables: Optional[ServerVariablesT]=None,
server_operation_index: Optional[Dict[int, int]]=None, server_operation_index: Optional[Dict[int, int]]=None,
server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
ignore_operation_servers: bool=False, ignore_operation_servers: bool=False,
ssl_ca_cert: Optional[str]=None, ssl_ca_cert: Optional[str]=None,
retries: Optional[int] = None, retries: Optional[int] = None,
ca_cert_data: Optional[Union[str, bytes]] = None,
*, *,
debug: Optional[bool] = None, debug: Optional[bool] = None,
) -> None: ) -> None:
@ -257,6 +260,10 @@ class Configuration:
self.ssl_ca_cert = ssl_ca_cert self.ssl_ca_cert = ssl_ca_cert
"""Set this to customize the certificate file to verify the peer. """Set this to customize the certificate file to verify the peer.
""" """
self.ca_cert_data = ca_cert_data
"""Set this to verify the peer using PEM (str) or DER (bytes)
certificate data.
"""
self.cert_file = None self.cert_file = None
"""client certificate file """client certificate file
""" """
@ -494,7 +501,7 @@ class Configuration:
"OS: {env}\n"\ "OS: {env}\n"\
"Python Version: {pyversion}\n"\ "Python Version: {pyversion}\n"\
"Version of the API: 0.0.1\n"\ "Version of the API: 0.0.1\n"\
"SDK Package Version: 0.2.0".\ "SDK Package Version: 0.4.0".\
format(env=sys.platform, pyversion=sys.version) format(env=sys.platform, pyversion=sys.version)
def get_host_settings(self) -> List[HostSetting]: def get_host_settings(self) -> List[HostSetting]:

View File

@ -150,6 +150,13 @@ class ApiException(OpenApiException):
if http_resp.status == 404: if http_resp.status == 404:
raise NotFoundException(http_resp=http_resp, body=body, data=data) raise NotFoundException(http_resp=http_resp, body=body, data=data)
# Added new conditions for 409 and 422
if http_resp.status == 409:
raise ConflictException(http_resp=http_resp, body=body, data=data)
if http_resp.status == 422:
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
if 500 <= http_resp.status <= 599: if 500 <= http_resp.status <= 599:
raise ServiceException(http_resp=http_resp, body=body, data=data) raise ServiceException(http_resp=http_resp, body=body, data=data)
raise ApiException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data)
@ -188,6 +195,16 @@ class ServiceException(ApiException):
pass pass
class ConflictException(ApiException):
"""Exception for HTTP 409 Conflict."""
pass
class UnprocessableEntityException(ApiException):
"""Exception for HTTP 422 Unprocessable Entity."""
pass
def render_path(path_to_item): def render_path(path_to_item):
"""Returns a string representation of a path""" """Returns a string representation of a path"""
result = "" result = ""

View File

@ -27,7 +27,6 @@ from codex_api_client.models.purchase import Purchase
from codex_api_client.models.reservation import Reservation from codex_api_client.models.reservation import Reservation
from codex_api_client.models.spr_read import SPRRead from codex_api_client.models.spr_read import SPRRead
from codex_api_client.models.sales_availability import SalesAvailability from codex_api_client.models.sales_availability import SalesAvailability
from codex_api_client.models.sales_availability_create import SalesAvailabilityCREATE
from codex_api_client.models.sales_availability_read import SalesAvailabilityREAD from codex_api_client.models.sales_availability_read import SalesAvailabilityREAD
from codex_api_client.models.slot import Slot from codex_api_client.models.slot import Slot
from codex_api_client.models.slot_agent import SlotAgent from codex_api_client.models.slot_agent import SlotAgent

View File

@ -28,7 +28,8 @@ class CodexVersion(BaseModel):
""" # noqa: E501 """ # noqa: E501
version: Optional[StrictStr] = None version: Optional[StrictStr] = None
revision: Optional[StrictStr] = None revision: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["version", "revision"] contracts: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["version", "revision", "contracts"]
model_config = ConfigDict( model_config = ConfigDict(
populate_by_name=True, populate_by_name=True,
@ -82,7 +83,8 @@ class CodexVersion(BaseModel):
_obj = cls.model_validate({ _obj = cls.model_validate({
"version": obj.get("version"), "version": obj.get("version"),
"revision": obj.get("revision") "revision": obj.get("revision"),
"contracts": obj.get("contracts")
}) })
return _obj return _obj

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List
from typing import Optional, Set from typing import Optional, Set
from typing_extensions import Self from typing_extensions import Self
@ -26,7 +26,7 @@ class Content(BaseModel):
""" """
Parameters specifying the content Parameters specifying the content
""" # noqa: E501 """ # noqa: E501
cid: Optional[StrictStr] = Field(default=None, description="Content Identifier as specified at https://github.com/multiformats/cid") cid: StrictStr = Field(description="Content Identifier as specified at https://github.com/multiformats/cid")
__properties: ClassVar[List[str]] = ["cid"] __properties: ClassVar[List[str]] = ["cid"]
model_config = ConfigDict( model_config = ConfigDict(

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List
from codex_api_client.models.manifest_item import ManifestItem from codex_api_client.models.manifest_item import ManifestItem
from typing import Optional, Set from typing import Optional, Set
from typing_extensions import Self from typing_extensions import Self
@ -27,8 +27,8 @@ class DataItem(BaseModel):
""" """
DataItem DataItem
""" # noqa: E501 """ # noqa: E501
cid: Optional[StrictStr] = Field(default=None, description="Content Identifier as specified at https://github.com/multiformats/cid") cid: StrictStr = Field(description="Content Identifier as specified at https://github.com/multiformats/cid")
manifest: Optional[ManifestItem] = None manifest: ManifestItem
__properties: ClassVar[List[str]] = ["cid", "manifest"] __properties: ClassVar[List[str]] = ["cid", "manifest"]
model_config = ConfigDict( model_config = ConfigDict(

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json import json
from pydantic import BaseModel, ConfigDict from pydantic import BaseModel, ConfigDict
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List
from codex_api_client.models.data_item import DataItem from codex_api_client.models.data_item import DataItem
from typing import Optional, Set from typing import Optional, Set
from typing_extensions import Self from typing_extensions import Self
@ -27,7 +27,7 @@ class DataList(BaseModel):
""" """
DataList DataList
""" # noqa: E501 """ # noqa: E501
content: Optional[List[DataItem]] = None content: List[DataItem]
__properties: ClassVar[List[str]] = ["content"] __properties: ClassVar[List[str]] = ["content"]
model_config = ConfigDict( model_config = ConfigDict(

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List
from codex_api_client.models.codex_version import CodexVersion from codex_api_client.models.codex_version import CodexVersion
from codex_api_client.models.peers_table import PeersTable from codex_api_client.models.peers_table import PeersTable
from typing import Optional, Set from typing import Optional, Set
@ -28,13 +28,13 @@ class DebugInfo(BaseModel):
""" """
DebugInfo DebugInfo
""" # noqa: E501 """ # noqa: E501
id: Optional[StrictStr] = Field(default=None, description="Peer Identity reference as specified at https://docs.libp2p.io/concepts/fundamentals/peers/") id: StrictStr = Field(description="Peer Identity reference as specified at https://docs.libp2p.io/concepts/fundamentals/peers/")
addrs: Optional[List[StrictStr]] = None addrs: List[StrictStr]
repo: Optional[StrictStr] = Field(default=None, description="Path of the data repository where all nodes data are stored") repo: StrictStr = Field(description="Path of the data repository where all nodes data are stored")
spr: Optional[StrictStr] = Field(default=None, description="Signed Peer Record (libp2p)") spr: StrictStr = Field(description="Signed Peer Record (libp2p)")
announce_addresses: Optional[List[StrictStr]] = Field(default=None, alias="announceAddresses") announce_addresses: List[StrictStr] = Field(alias="announceAddresses")
table: Optional[PeersTable] = None table: PeersTable
codex: Optional[CodexVersion] = None codex: CodexVersion
__properties: ClassVar[List[str]] = ["id", "addrs", "repo", "spr", "announceAddresses", "table", "codex"] __properties: ClassVar[List[str]] = ["id", "addrs", "repo", "spr", "announceAddresses", "table", "codex"]
model_config = ConfigDict( model_config = ConfigDict(

View File

@ -26,10 +26,10 @@ class ManifestItem(BaseModel):
""" """
ManifestItem ManifestItem
""" # noqa: E501 """ # noqa: E501
tree_cid: Optional[StrictStr] = Field(default=None, description="Content Identifier as specified at https://github.com/multiformats/cid", alias="treeCid") tree_cid: StrictStr = Field(description="Content Identifier as specified at https://github.com/multiformats/cid", alias="treeCid")
dataset_size: Optional[StrictInt] = Field(default=None, description="Length of original content in bytes", alias="datasetSize") dataset_size: StrictInt = Field(description="Length of original content in bytes", alias="datasetSize")
block_size: Optional[StrictInt] = Field(default=None, description="Size of blocks", alias="blockSize") block_size: StrictInt = Field(description="Size of blocks", alias="blockSize")
protected: Optional[StrictBool] = Field(default=None, description="Indicates if content is protected by erasure-coding") protected: StrictBool = Field(description="Indicates if content is protected by erasure-coding")
filename: Optional[StrictStr] = Field(default=None, description="The original name of the uploaded content (optional)") filename: Optional[StrictStr] = Field(default=None, description="The original name of the uploaded content (optional)")
mimetype: Optional[StrictStr] = Field(default=None, description="The original mimetype of the uploaded content (optional)") mimetype: Optional[StrictStr] = Field(default=None, description="The original mimetype of the uploaded content (optional)")
__properties: ClassVar[List[str]] = ["treeCid", "datasetSize", "blockSize", "protected", "filename", "mimetype"] __properties: ClassVar[List[str]] = ["treeCid", "datasetSize", "blockSize", "protected", "filename", "mimetype"]

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List
from typing import Optional, Set from typing import Optional, Set
from typing_extensions import Self from typing_extensions import Self
@ -26,11 +26,11 @@ class Node(BaseModel):
""" """
Node Node
""" # noqa: E501 """ # noqa: E501
node_id: Optional[StrictStr] = Field(default=None, alias="nodeId") node_id: StrictStr = Field(alias="nodeId")
peer_id: Optional[StrictStr] = Field(default=None, alias="peerId") peer_id: StrictStr = Field(alias="peerId")
record: Optional[StrictStr] = None record: StrictStr
address: Optional[StrictStr] = None address: StrictStr
seen: Optional[StrictBool] = None seen: StrictBool
__properties: ClassVar[List[str]] = ["nodeId", "peerId", "record", "address", "seen"] __properties: ClassVar[List[str]] = ["nodeId", "peerId", "record", "address", "seen"]
model_config = ConfigDict( model_config = ConfigDict(

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json import json
from pydantic import BaseModel, ConfigDict, Field from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List
from codex_api_client.models.node import Node from codex_api_client.models.node import Node
from typing import Optional, Set from typing import Optional, Set
from typing_extensions import Self from typing_extensions import Self
@ -27,8 +27,8 @@ class PeersTable(BaseModel):
""" """
PeersTable PeersTable
""" # noqa: E501 """ # noqa: E501
local_node: Optional[Node] = Field(default=None, alias="localNode") local_node: Node = Field(alias="localNode")
nodes: Optional[List[Node]] = None nodes: List[Node]
__properties: ClassVar[List[str]] = ["localNode", "nodes"] __properties: ClassVar[List[str]] = ["localNode", "nodes"]
model_config = ConfigDict( model_config = ConfigDict(

View File

@ -19,6 +19,7 @@ import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from codex_api_client.models.storage_request import StorageRequest from codex_api_client.models.storage_request import StorageRequest
from typing import Optional, Set from typing import Optional, Set
from typing_extensions import Self from typing_extensions import Self
@ -27,19 +28,17 @@ class Purchase(BaseModel):
""" """
Purchase Purchase
""" # noqa: E501 """ # noqa: E501
state: Optional[StrictStr] = Field(default=None, description="Description of the Request's state") state: StrictStr = Field(description="Description of the Request's state")
error: Optional[StrictStr] = Field(default=None, description="If Request failed, then here is presented the error message") error: Optional[StrictStr] = Field(default=None, description="If Request failed, then here is presented the error message")
request: Optional[StorageRequest] = None request: Optional[StorageRequest] = None
__properties: ClassVar[List[str]] = ["state", "error", "request"] request_id: Annotated[str, Field(min_length=66, strict=True, max_length=66)] = Field(description="32bits identifier encoded in hex-decimal string.", alias="requestId")
__properties: ClassVar[List[str]] = ["state", "error", "request", "requestId"]
@field_validator('state') @field_validator('state')
def state_validate_enum(cls, value): def state_validate_enum(cls, value):
"""Validates the enum""" """Validates the enum"""
if value is None: if value not in set(['cancelled', 'errored', 'failed', 'finished', 'pending', 'started', 'submitted', 'unknown']):
return value raise ValueError("must be one of enum values ('cancelled', 'errored', 'failed', 'finished', 'pending', 'started', 'submitted', 'unknown')")
if value not in set(['cancelled', 'error', 'failed', 'finished', 'pending', 'started', 'submitted', 'unknown']):
raise ValueError("must be one of enum values ('cancelled', 'error', 'failed', 'finished', 'pending', 'started', 'submitted', 'unknown')")
return value return value
model_config = ConfigDict( model_config = ConfigDict(
@ -84,6 +83,11 @@ class Purchase(BaseModel):
# override the default output from pydantic by calling `to_dict()` of request # override the default output from pydantic by calling `to_dict()` of request
if self.request: if self.request:
_dict['request'] = self.request.to_dict() _dict['request'] = self.request.to_dict()
# set to None if error (nullable) is None
# and model_fields_set contains the field
if self.error is None and "error" in self.model_fields_set:
_dict['error'] = None
return _dict return _dict
@classmethod @classmethod
@ -98,7 +102,8 @@ class Purchase(BaseModel):
_obj = cls.model_validate({ _obj = cls.model_validate({
"state": obj.get("state"), "state": obj.get("state"),
"error": obj.get("error"), "error": obj.get("error"),
"request": StorageRequest.from_dict(obj["request"]) if obj.get("request") is not None else None "request": StorageRequest.from_dict(obj["request"]) if obj.get("request") is not None else None,
"requestId": obj.get("requestId")
}) })
return _obj return _obj

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt from pydantic import BaseModel, ConfigDict, Field, StrictInt
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated from typing_extensions import Annotated
from typing import Optional, Set from typing import Optional, Set
from typing_extensions import Self from typing_extensions import Self
@ -27,12 +27,13 @@ class Reservation(BaseModel):
""" """
Reservation Reservation
""" # noqa: E501 """ # noqa: E501
id: Optional[Annotated[str, Field(min_length=66, strict=True, max_length=66)]] = Field(default=None, description="32bits identifier encoded in hex-decimal string.") id: Annotated[str, Field(min_length=66, strict=True, max_length=66)] = Field(description="32bits identifier encoded in hex-decimal string.")
availability_id: Optional[Annotated[str, Field(min_length=66, strict=True, max_length=66)]] = Field(default=None, description="32bits identifier encoded in hex-decimal string.", alias="availabilityId") availability_id: Annotated[str, Field(min_length=66, strict=True, max_length=66)] = Field(description="32bits identifier encoded in hex-decimal string.", alias="availabilityId")
size: Optional[StrictInt] = Field(default=None, description="Size of the slot in bytes") size: StrictInt = Field(description="Size of the slot in bytes")
request_id: Optional[Annotated[str, Field(min_length=66, strict=True, max_length=66)]] = Field(default=None, description="32bits identifier encoded in hex-decimal string.", alias="requestId") request_id: Annotated[str, Field(min_length=66, strict=True, max_length=66)] = Field(description="32bits identifier encoded in hex-decimal string.", alias="requestId")
slot_index: Optional[StrictInt] = Field(default=None, description="Slot Index number", alias="slotIndex") slot_index: StrictInt = Field(description="Slot Index number", alias="slotIndex")
__properties: ClassVar[List[str]] = ["id", "availabilityId", "size", "requestId", "slotIndex"] valid_until: StrictInt = Field(description="Timestamp after which the reservation will no longer be valid.", alias="validUntil")
__properties: ClassVar[List[str]] = ["id", "availabilityId", "size", "requestId", "slotIndex", "validUntil"]
model_config = ConfigDict( model_config = ConfigDict(
populate_by_name=True, populate_by_name=True,
@ -89,7 +90,8 @@ class Reservation(BaseModel):
"availabilityId": obj.get("availabilityId"), "availabilityId": obj.get("availabilityId"),
"size": obj.get("size"), "size": obj.get("size"),
"requestId": obj.get("requestId"), "requestId": obj.get("requestId"),
"slotIndex": obj.get("slotIndex") "slotIndex": obj.get("slotIndex"),
"validUntil": obj.get("validUntil")
}) })
return _obj return _obj

View File

@ -17,9 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from typing import Optional, Set from typing import Optional, Set
from typing_extensions import Self from typing_extensions import Self
@ -27,12 +26,13 @@ class SalesAvailability(BaseModel):
""" """
SalesAvailability SalesAvailability
""" # noqa: E501 """ # noqa: E501
id: Optional[Annotated[str, Field(min_length=66, strict=True, max_length=66)]] = Field(default=None, description="32bits identifier encoded in hex-decimal string.") total_size: StrictInt = Field(description="Total size of availability's storage in bytes", alias="totalSize")
total_size: Optional[StrictInt] = Field(default=None, description="Total size of availability's storage in bytes", alias="totalSize") duration: StrictInt = Field(description="The duration of the request in seconds")
duration: Optional[StrictInt] = Field(default=None, description="The duration of the request in seconds") min_price_per_byte_per_second: StrictStr = Field(description="Minimal price per byte per second paid (in amount of tokens) for the hosted request's slot for the request's duration as decimal string", alias="minPricePerBytePerSecond")
min_price_per_byte_per_second: Optional[StrictStr] = Field(default=None, description="Minimal price per byte per second paid (in amount of tokens) for the hosted request's slot for the request's duration as decimal string", alias="minPricePerBytePerSecond") total_collateral: StrictStr = Field(description="Total collateral (in amount of tokens) that can be used for matching requests", alias="totalCollateral")
total_collateral: Optional[StrictStr] = Field(default=None, description="Total collateral (in amount of tokens) that can be used for matching requests", alias="totalCollateral") enabled: Optional[StrictBool] = Field(default=True, description="Enable the ability to receive sales on this availability.")
__properties: ClassVar[List[str]] = ["id", "totalSize", "duration", "minPricePerBytePerSecond", "totalCollateral"] until: Optional[StrictInt] = Field(default=0, description="Specifies the latest timestamp, after which the availability will no longer host any slots. If set to 0, there will be no restrictions.")
__properties: ClassVar[List[str]] = ["totalSize", "duration", "minPricePerBytePerSecond", "totalCollateral", "enabled", "until"]
model_config = ConfigDict( model_config = ConfigDict(
populate_by_name=True, populate_by_name=True,
@ -85,11 +85,12 @@ class SalesAvailability(BaseModel):
return cls.model_validate(obj) return cls.model_validate(obj)
_obj = cls.model_validate({ _obj = cls.model_validate({
"id": obj.get("id"),
"totalSize": obj.get("totalSize"), "totalSize": obj.get("totalSize"),
"duration": obj.get("duration"), "duration": obj.get("duration"),
"minPricePerBytePerSecond": obj.get("minPricePerBytePerSecond"), "minPricePerBytePerSecond": obj.get("minPricePerBytePerSecond"),
"totalCollateral": obj.get("totalCollateral") "totalCollateral": obj.get("totalCollateral"),
"enabled": obj.get("enabled") if obj.get("enabled") is not None else True,
"until": obj.get("until") if obj.get("until") is not None else 0
}) })
return _obj return _obj

View File

@ -17,7 +17,7 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated from typing_extensions import Annotated
from typing import Optional, Set from typing import Optional, Set
@ -27,13 +27,16 @@ class SalesAvailabilityREAD(BaseModel):
""" """
SalesAvailabilityREAD SalesAvailabilityREAD
""" # noqa: E501 """ # noqa: E501
id: Optional[Annotated[str, Field(min_length=66, strict=True, max_length=66)]] = Field(default=None, description="32bits identifier encoded in hex-decimal string.") total_size: StrictInt = Field(description="Total size of availability's storage in bytes", alias="totalSize")
total_size: Optional[StrictInt] = Field(default=None, description="Total size of availability's storage in bytes", alias="totalSize") duration: StrictInt = Field(description="The duration of the request in seconds")
duration: Optional[StrictInt] = Field(default=None, description="The duration of the request in seconds") min_price_per_byte_per_second: StrictStr = Field(description="Minimal price per byte per second paid (in amount of tokens) for the hosted request's slot for the request's duration as decimal string", alias="minPricePerBytePerSecond")
min_price_per_byte_per_second: Optional[StrictStr] = Field(default=None, description="Minimal price per byte per second paid (in amount of tokens) for the hosted request's slot for the request's duration as decimal string", alias="minPricePerBytePerSecond") total_collateral: StrictStr = Field(description="Total collateral (in amount of tokens) that can be used for matching requests", alias="totalCollateral")
total_collateral: Optional[StrictStr] = Field(default=None, description="Total collateral (in amount of tokens) that can be used for matching requests", alias="totalCollateral") enabled: Optional[StrictBool] = Field(default=True, description="Enable the ability to receive sales on this availability.")
free_size: Optional[StrictInt] = Field(default=None, description="Unused size of availability's storage in bytes", alias="freeSize") until: Optional[StrictInt] = Field(default=0, description="Specifies the latest timestamp, after which the availability will no longer host any slots. If set to 0, there will be no restrictions.")
__properties: ClassVar[List[str]] = ["id", "totalSize", "duration", "minPricePerBytePerSecond", "totalCollateral", "freeSize"] id: Annotated[str, Field(min_length=66, strict=True, max_length=66)] = Field(description="32bits identifier encoded in hex-decimal string.")
free_size: StrictInt = Field(description="Unused size of availability's storage in bytes as decimal string", alias="freeSize")
total_remaining_collateral: StrictStr = Field(description="Total collateral effective (in amount of tokens) that can be used for matching requests", alias="totalRemainingCollateral")
__properties: ClassVar[List[str]] = ["totalSize", "duration", "minPricePerBytePerSecond", "totalCollateral", "enabled", "until", "id", "freeSize", "totalRemainingCollateral"]
model_config = ConfigDict( model_config = ConfigDict(
populate_by_name=True, populate_by_name=True,
@ -65,8 +68,12 @@ class SalesAvailabilityREAD(BaseModel):
* `None` is only added to the output dict for nullable fields that * `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None` were set at model initialization. Other fields with value `None`
are ignored. are ignored.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
""" """
excluded_fields: Set[str] = set([ excluded_fields: Set[str] = set([
"free_size",
"total_remaining_collateral",
]) ])
_dict = self.model_dump( _dict = self.model_dump(
@ -86,12 +93,15 @@ class SalesAvailabilityREAD(BaseModel):
return cls.model_validate(obj) return cls.model_validate(obj)
_obj = cls.model_validate({ _obj = cls.model_validate({
"id": obj.get("id"),
"totalSize": obj.get("totalSize"), "totalSize": obj.get("totalSize"),
"duration": obj.get("duration"), "duration": obj.get("duration"),
"minPricePerBytePerSecond": obj.get("minPricePerBytePerSecond"), "minPricePerBytePerSecond": obj.get("minPricePerBytePerSecond"),
"totalCollateral": obj.get("totalCollateral"), "totalCollateral": obj.get("totalCollateral"),
"freeSize": obj.get("freeSize") "enabled": obj.get("enabled") if obj.get("enabled") is not None else True,
"until": obj.get("until") if obj.get("until") is not None else 0,
"id": obj.get("id"),
"freeSize": obj.get("freeSize"),
"totalRemainingCollateral": obj.get("totalRemainingCollateral")
}) })
return _obj return _obj

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List
from codex_api_client.models.storage_request import StorageRequest from codex_api_client.models.storage_request import StorageRequest
from typing import Optional, Set from typing import Optional, Set
from typing_extensions import Self from typing_extensions import Self
@ -27,9 +27,9 @@ class Slot(BaseModel):
""" """
Slot Slot
""" # noqa: E501 """ # noqa: E501
id: Optional[StrictStr] = Field(default=None, description="Keccak hash of the abi encoded tuple (RequestId, slot index)") id: StrictStr = Field(description="Keccak hash of the abi encoded tuple (RequestId, slot index)")
request: Optional[StorageRequest] = None request: StorageRequest
slot_index: Optional[StrictInt] = Field(default=None, description="Slot Index number", alias="slotIndex") slot_index: StrictInt = Field(description="Slot Index number", alias="slotIndex")
__properties: ClassVar[List[str]] = ["id", "request", "slotIndex"] __properties: ClassVar[List[str]] = ["id", "request", "slotIndex"]
model_config = ConfigDict( model_config = ConfigDict(

View File

@ -29,20 +29,16 @@ class SlotAgent(BaseModel):
""" """
SlotAgent SlotAgent
""" # noqa: E501 """ # noqa: E501
id: Optional[StrictStr] = Field(default=None, description="Keccak hash of the abi encoded tuple (RequestId, slot index)") slot_index: StrictInt = Field(description="Slot Index number", alias="slotIndex")
slot_index: Optional[StrictInt] = Field(default=None, description="Slot Index number", alias="slotIndex") request_id: Annotated[str, Field(min_length=66, strict=True, max_length=66)] = Field(description="32bits identifier encoded in hex-decimal string.", alias="requestId")
request_id: Optional[Annotated[str, Field(min_length=66, strict=True, max_length=66)]] = Field(default=None, description="32bits identifier encoded in hex-decimal string.", alias="requestId")
request: Optional[StorageRequest] = None request: Optional[StorageRequest] = None
reservation: Optional[Reservation] = None reservation: Optional[Reservation] = None
state: Optional[StrictStr] = Field(default=None, description="Description of the slot's") state: StrictStr = Field(description="Description of the slot's")
__properties: ClassVar[List[str]] = ["id", "slotIndex", "requestId", "request", "reservation", "state"] __properties: ClassVar[List[str]] = ["slotIndex", "requestId", "request", "reservation", "state"]
@field_validator('state') @field_validator('state')
def state_validate_enum(cls, value): def state_validate_enum(cls, value):
"""Validates the enum""" """Validates the enum"""
if value is None:
return value
if value not in set(['SaleCancelled', 'SaleDownloading', 'SaleErrored', 'SaleFailed', 'SaleFilled', 'SaleFilling', 'SaleFinished', 'SaleIgnored', 'SaleInitialProving', 'SalePayout', 'SalePreparing', 'SaleProving', 'SaleUnknown']): if value not in set(['SaleCancelled', 'SaleDownloading', 'SaleErrored', 'SaleFailed', 'SaleFilled', 'SaleFilling', 'SaleFinished', 'SaleIgnored', 'SaleInitialProving', 'SalePayout', 'SalePreparing', 'SaleProving', 'SaleUnknown']):
raise ValueError("must be one of enum values ('SaleCancelled', 'SaleDownloading', 'SaleErrored', 'SaleFailed', 'SaleFilled', 'SaleFilling', 'SaleFinished', 'SaleIgnored', 'SaleInitialProving', 'SalePayout', 'SalePreparing', 'SaleProving', 'SaleUnknown')") raise ValueError("must be one of enum values ('SaleCancelled', 'SaleDownloading', 'SaleErrored', 'SaleFailed', 'SaleFilled', 'SaleFilling', 'SaleFinished', 'SaleIgnored', 'SaleInitialProving', 'SalePayout', 'SalePreparing', 'SaleProving', 'SaleUnknown')")
return value return value
@ -104,7 +100,6 @@ class SlotAgent(BaseModel):
return cls.model_validate(obj) return cls.model_validate(obj)
_obj = cls.model_validate({ _obj = cls.model_validate({
"id": obj.get("id"),
"slotIndex": obj.get("slotIndex"), "slotIndex": obj.get("slotIndex"),
"requestId": obj.get("requestId"), "requestId": obj.get("requestId"),
"request": StorageRequest.from_dict(obj["request"]) if obj.get("request") is not None else None, "request": StorageRequest.from_dict(obj["request"]) if obj.get("request") is not None else None,

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt from pydantic import BaseModel, ConfigDict, Field, StrictInt
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List
from typing import Optional, Set from typing import Optional, Set
from typing_extensions import Self from typing_extensions import Self
@ -26,10 +26,10 @@ class Space(BaseModel):
""" """
Space Space
""" # noqa: E501 """ # noqa: E501
total_blocks: Optional[StrictInt] = Field(default=None, description="Number of blocks stored by the node", alias="totalBlocks") total_blocks: StrictInt = Field(description="Number of blocks stored by the node", alias="totalBlocks")
quota_max_bytes: Optional[StrictInt] = Field(default=None, description="Maximum storage space (in bytes) available for the node in Codex's local repository.", alias="quotaMaxBytes") quota_max_bytes: StrictInt = Field(description="Maximum storage space (in bytes) available for the node in Codex's local repository.", alias="quotaMaxBytes")
quota_used_bytes: Optional[StrictInt] = Field(default=None, description="Amount of storage space (in bytes) currently used for storing files in Codex's local repository.", alias="quotaUsedBytes") quota_used_bytes: StrictInt = Field(description="Amount of storage space (in bytes) currently used for storing files in Codex's local repository.", alias="quotaUsedBytes")
quota_reserved_bytes: Optional[StrictInt] = Field(default=None, description="Amount of storage reserved (in bytes) in the Codex's local repository for future use when storage requests will be picked up and hosted by the node using node's availabilities. This does not include the storage currently in use.", alias="quotaReservedBytes") quota_reserved_bytes: StrictInt = Field(description="Amount of storage reserved (in bytes) in the Codex's local repository for future use when storage requests will be picked up and hosted by the node using node's availabilities. This does not include the storage currently in use.", alias="quotaReservedBytes")
__properties: ClassVar[List[str]] = ["totalBlocks", "quotaMaxBytes", "quotaUsedBytes", "quotaReservedBytes"] __properties: ClassVar[List[str]] = ["totalBlocks", "quotaMaxBytes", "quotaUsedBytes", "quotaReservedBytes"]
model_config = ConfigDict( model_config = ConfigDict(

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List
from typing import Optional, Set from typing import Optional, Set
from typing_extensions import Self from typing_extensions import Self
@ -26,7 +26,7 @@ class SPRRead(BaseModel):
""" """
SPRRead SPRRead
""" # noqa: E501 """ # noqa: E501
spr: Optional[StrictStr] = Field(default=None, description="Signed Peer Record (libp2p)") spr: StrictStr = Field(description="Signed Peer Record (libp2p)")
__properties: ClassVar[List[str]] = ["spr"] __properties: ClassVar[List[str]] = ["spr"]
model_config = ConfigDict( model_config = ConfigDict(

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List
from typing import Optional, Set from typing import Optional, Set
from typing_extensions import Self from typing_extensions import Self
@ -26,13 +26,14 @@ class StorageAsk(BaseModel):
""" """
StorageAsk StorageAsk
""" # noqa: E501 """ # noqa: E501
slots: Optional[StrictInt] = Field(default=None, description="Number of slots (eq. hosts) that the Request want to have the content spread over") slots: StrictInt = Field(description="Number of slots (eq. hosts) that the Request want to have the content spread over")
slot_size: Optional[StrictStr] = Field(default=None, description="Amount of storage per slot (in bytes) as decimal string", alias="slotSize") slot_size: StrictInt = Field(description="Amount of storage per slot in bytes", alias="slotSize")
duration: Optional[StrictInt] = Field(default=None, description="The duration of the request in seconds") duration: StrictInt = Field(description="The duration of the request in seconds")
proof_probability: Optional[StrictStr] = Field(default=None, description="How often storage proofs are required as decimal string", alias="proofProbability") proof_probability: StrictStr = Field(description="How often storage proofs are required as decimal string", alias="proofProbability")
price_per_byte_per_second: StrictStr = Field(description="The amount of tokens paid per byte per second per slot to hosts the client is willing to pay", alias="pricePerBytePerSecond") price_per_byte_per_second: StrictStr = Field(description="The amount of tokens paid per byte per second per slot to hosts the client is willing to pay", alias="pricePerBytePerSecond")
max_slot_loss: Optional[StrictInt] = Field(default=None, description="Max slots that can be lost without data considered to be lost", alias="maxSlotLoss") collateral_per_byte: StrictStr = Field(description="Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots", alias="collateralPerByte")
__properties: ClassVar[List[str]] = ["slots", "slotSize", "duration", "proofProbability", "pricePerBytePerSecond", "maxSlotLoss"] max_slot_loss: StrictInt = Field(description="Max slots that can be lost without data considered to be lost", alias="maxSlotLoss")
__properties: ClassVar[List[str]] = ["slots", "slotSize", "duration", "proofProbability", "pricePerBytePerSecond", "collateralPerByte", "maxSlotLoss"]
model_config = ConfigDict( model_config = ConfigDict(
populate_by_name=True, populate_by_name=True,
@ -90,6 +91,7 @@ class StorageAsk(BaseModel):
"duration": obj.get("duration"), "duration": obj.get("duration"),
"proofProbability": obj.get("proofProbability"), "proofProbability": obj.get("proofProbability"),
"pricePerBytePerSecond": obj.get("pricePerBytePerSecond"), "pricePerBytePerSecond": obj.get("pricePerBytePerSecond"),
"collateralPerByte": obj.get("collateralPerByte"),
"maxSlotLoss": obj.get("maxSlotLoss") "maxSlotLoss": obj.get("maxSlotLoss")
}) })
return _obj return _obj

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List
from codex_api_client.models.content import Content from codex_api_client.models.content import Content
from codex_api_client.models.storage_ask import StorageAsk from codex_api_client.models.storage_ask import StorageAsk
from typing import Optional, Set from typing import Optional, Set
@ -28,12 +28,12 @@ class StorageRequest(BaseModel):
""" """
StorageRequest StorageRequest
""" # noqa: E501 """ # noqa: E501
id: Optional[StrictStr] = Field(default=None, description="Request ID") id: StrictStr = Field(description="Request ID")
client: Optional[StrictStr] = Field(default=None, description="Address of Ethereum address") client: StrictStr = Field(description="Address of Ethereum address")
ask: Optional[StorageAsk] = None ask: StorageAsk
content: Optional[Content] = None content: Content
expiry: Optional[StrictInt] = Field(default=None, description="A timestamp as seconds since unix epoch at which this request expires if the Request does not find requested amount of nodes to host the data.") expiry: StrictInt = Field(description="A timestamp as seconds since unix epoch at which this request expires if the Request does not find requested amount of nodes to host the data.")
nonce: Optional[StrictStr] = Field(default=None, description="Random data") nonce: StrictStr = Field(description="Random data")
__properties: ClassVar[List[str]] = ["id", "client", "ask", "content", "expiry", "nonce"] __properties: ClassVar[List[str]] = ["id", "client", "ask", "content", "expiry", "nonce"]
model_config = ConfigDict( model_config = ConfigDict(

View File

@ -19,6 +19,7 @@ import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from typing import Optional, Set from typing import Optional, Set
from typing_extensions import Self from typing_extensions import Self
@ -29,8 +30,8 @@ class StorageRequestCreation(BaseModel):
duration: StrictInt = Field(description="The duration of the request in seconds") duration: StrictInt = Field(description="The duration of the request in seconds")
price_per_byte_per_second: StrictStr = Field(description="The amount of tokens paid per byte per second per slot to hosts the client is willing to pay", alias="pricePerBytePerSecond") price_per_byte_per_second: StrictStr = Field(description="The amount of tokens paid per byte per second per slot to hosts the client is willing to pay", alias="pricePerBytePerSecond")
proof_probability: StrictStr = Field(description="How often storage proofs are required as decimal string", alias="proofProbability") proof_probability: StrictStr = Field(description="How often storage proofs are required as decimal string", alias="proofProbability")
nodes: Optional[StrictInt] = Field(default=3, description="Minimal number of nodes the content should be stored on") nodes: Optional[Annotated[int, Field(strict=True, ge=3)]] = Field(default=3, description="Minimal number of nodes the content should be stored on")
tolerance: Optional[StrictInt] = Field(default=1, description="Additional number of nodes on top of the `nodes` property that can be lost before pronouncing the content lost") tolerance: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=1, description="Additional number of nodes on top of the `nodes` property that can be lost before pronouncing the content lost")
collateral_per_byte: StrictStr = Field(description="Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots", alias="collateralPerByte") collateral_per_byte: StrictStr = Field(description="Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots", alias="collateralPerByte")
expiry: StrictInt = Field(description="Number that represents expiry threshold in seconds from when the Request is submitted. When the threshold is reached and the Request does not find requested amount of nodes to host the data, the Request is voided. The number of seconds can not be higher then the Request's duration itself.") expiry: StrictInt = Field(description="Number that represents expiry threshold in seconds from when the Request is submitted. When the threshold is reached and the Request does not find requested amount of nodes to host the data, the Request is voided. The number of seconds can not be higher then the Request's duration itself.")
__properties: ClassVar[List[str]] = ["duration", "pricePerBytePerSecond", "proofProbability", "nodes", "tolerance", "collateralPerByte", "expiry"] __properties: ClassVar[List[str]] = ["duration", "pricePerBytePerSecond", "proofProbability", "nodes", "tolerance", "collateralPerByte", "expiry"]

View File

@ -76,6 +76,7 @@ class RESTClientObject:
"ca_certs": configuration.ssl_ca_cert, "ca_certs": configuration.ssl_ca_cert,
"cert_file": configuration.cert_file, "cert_file": configuration.cert_file,
"key_file": configuration.key_file, "key_file": configuration.key_file,
"ca_cert_data": configuration.ca_cert_data,
} }
if configuration.assert_hostname is not None: if configuration.assert_hostname is not None:
pool_args['assert_hostname'] = ( pool_args['assert_hostname'] = (

View File

@ -7,6 +7,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**version** | **str** | | [optional] **version** | **str** | | [optional]
**revision** | **str** | | [optional] **revision** | **str** | | [optional]
**contracts** | **str** | | [optional]
## Example ## Example

View File

@ -6,7 +6,7 @@ Parameters specifying the content
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**cid** | **str** | Content Identifier as specified at https://github.com/multiformats/cid | [optional] **cid** | **str** | Content Identifier as specified at https://github.com/multiformats/cid |
## Example ## Example

View File

@ -4,6 +4,7 @@ All URIs are relative to *http://localhost:8080/api/codex/v1*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**delete_local**](DataApi.md#delete_local) | **DELETE** /data/{cid} | Deletes either a single block or an entire dataset from the local node.
[**download_local**](DataApi.md#download_local) | **GET** /data/{cid} | Download a file from the local node in a streaming manner. If the file is not available locally, a 404 is returned. [**download_local**](DataApi.md#download_local) | **GET** /data/{cid} | Download a file from the local node in a streaming manner. If the file is not available locally, a 404 is returned.
[**download_network**](DataApi.md#download_network) | **POST** /data/{cid}/network | Download a file from the network to the local node if it&#39;s not available locally. Note: Download is performed async. Call can return before download is completed. [**download_network**](DataApi.md#download_network) | **POST** /data/{cid}/network | Download a file from the network to the local node if it&#39;s not available locally. Note: Download is performed async. Call can return before download is completed.
[**download_network_manifest**](DataApi.md#download_network_manifest) | **GET** /data/{cid}/network/manifest | Download only the dataset manifest from the network to the local node if it&#39;s not available locally. [**download_network_manifest**](DataApi.md#download_network_manifest) | **GET** /data/{cid}/network/manifest | Download only the dataset manifest from the network to the local node if it&#39;s not available locally.
@ -13,6 +14,71 @@ Method | HTTP request | Description
[**upload**](DataApi.md#upload) | **POST** /data | Upload a file in a streaming manner. Once finished, the file is stored in the node and can be retrieved by any node in the network using the returned CID. [**upload**](DataApi.md#upload) | **POST** /data | Upload a file in a streaming manner. Once finished, the file is stored in the node and can be retrieved by any node in the network using the returned CID.
# **delete_local**
> delete_local(cid)
Deletes either a single block or an entire dataset from the local node.
### Example
```python
import codex_api_client
from codex_api_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:8080/api/codex/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = codex_api_client.Configuration(
host = "http://localhost:8080/api/codex/v1"
)
# Enter a context with an instance of the API client
with codex_api_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = codex_api_client.DataApi(api_client)
cid = 'cid_example' # str | Block or dataset to be deleted.
try:
# Deletes either a single block or an entire dataset from the local node.
api_instance.delete_local(cid)
except Exception as e:
print("Exception when calling DataApi->delete_local: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**cid** | **str**| Block or dataset to be deleted. |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | Data was successfully deleted. | - |
**400** | Invalid CID is specified | - |
**500** | There was an error during deletion | - |
[[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)
# **download_local** # **download_local**
> bytearray download_local(cid) > bytearray download_local(cid)
@ -482,6 +548,7 @@ No authorization required
| Status code | Description | Response headers | | Status code | Description | Response headers |
|-------------|-------------|------------------| |-------------|-------------|------------------|
**200** | CID of uploaded file | - | **200** | CID of uploaded file | - |
**422** | The mimetype of the filename is invalid | - |
**500** | Well it was bad-bad and the upload did not work out | - | **500** | Well it was bad-bad and the upload did not work out | - |
[[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) [[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)

View File

@ -5,8 +5,8 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**cid** | **str** | Content Identifier as specified at https://github.com/multiformats/cid | [optional] **cid** | **str** | Content Identifier as specified at https://github.com/multiformats/cid |
**manifest** | [**ManifestItem**](ManifestItem.md) | | [optional] **manifest** | [**ManifestItem**](ManifestItem.md) | |
## Example ## Example

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**content** | [**List[DataItem]**](DataItem.md) | | [optional] **content** | [**List[DataItem]**](DataItem.md) | |
## Example ## Example

View File

@ -5,13 +5,13 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**id** | **str** | Peer Identity reference as specified at https://docs.libp2p.io/concepts/fundamentals/peers/ | [optional] **id** | **str** | Peer Identity reference as specified at https://docs.libp2p.io/concepts/fundamentals/peers/ |
**addrs** | **List[str]** | | [optional] **addrs** | **List[str]** | |
**repo** | **str** | Path of the data repository where all nodes data are stored | [optional] **repo** | **str** | Path of the data repository where all nodes data are stored |
**spr** | **str** | Signed Peer Record (libp2p) | [optional] **spr** | **str** | Signed Peer Record (libp2p) |
**announce_addresses** | **List[str]** | | [optional] **announce_addresses** | **List[str]** | |
**table** | [**PeersTable**](PeersTable.md) | | [optional] **table** | [**PeersTable**](PeersTable.md) | |
**codex** | [**CodexVersion**](CodexVersion.md) | | [optional] **codex** | [**CodexVersion**](CodexVersion.md) | |
## Example ## Example

View File

@ -5,10 +5,10 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**tree_cid** | **str** | Content Identifier as specified at https://github.com/multiformats/cid | [optional] **tree_cid** | **str** | Content Identifier as specified at https://github.com/multiformats/cid |
**dataset_size** | **int** | Length of original content in bytes | [optional] **dataset_size** | **int** | Length of original content in bytes |
**block_size** | **int** | Size of blocks | [optional] **block_size** | **int** | Size of blocks |
**protected** | **bool** | Indicates if content is protected by erasure-coding | [optional] **protected** | **bool** | Indicates if content is protected by erasure-coding |
**filename** | **str** | The original name of the uploaded content (optional) | [optional] **filename** | **str** | The original name of the uploaded content (optional) | [optional]
**mimetype** | **str** | The original mimetype of the uploaded content (optional) | [optional] **mimetype** | **str** | The original mimetype of the uploaded content (optional) | [optional]

View File

@ -81,6 +81,7 @@ No authorization required
|-------------|-------------|------------------| |-------------|-------------|------------------|
**200** | Returns the Request ID as decimal string | - | **200** | Returns the Request ID as decimal string | - |
**400** | Invalid or missing Request ID | - | **400** | Invalid or missing Request ID | - |
**422** | The storage request parameters are not valid | - |
**404** | Request ID not found | - | **404** | Request ID not found | - |
**503** | Persistence is not enabled | - | **503** | Persistence is not enabled | - |
@ -486,7 +487,7 @@ No authorization required
[[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) [[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)
# **offer_storage** # **offer_storage**
> SalesAvailabilityREAD offer_storage(sales_availability_create=sales_availability_create) > SalesAvailabilityREAD offer_storage(sales_availability=sales_availability)
Offers storage for sale Offers storage for sale
@ -495,7 +496,7 @@ Offers storage for sale
```python ```python
import codex_api_client import codex_api_client
from codex_api_client.models.sales_availability_create import SalesAvailabilityCREATE from codex_api_client.models.sales_availability import SalesAvailability
from codex_api_client.models.sales_availability_read import SalesAvailabilityREAD from codex_api_client.models.sales_availability_read import SalesAvailabilityREAD
from codex_api_client.rest import ApiException from codex_api_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -511,11 +512,11 @@ configuration = codex_api_client.Configuration(
with codex_api_client.ApiClient(configuration) as api_client: with codex_api_client.ApiClient(configuration) as api_client:
# Create an instance of the API class # Create an instance of the API class
api_instance = codex_api_client.MarketplaceApi(api_client) api_instance = codex_api_client.MarketplaceApi(api_client)
sales_availability_create = codex_api_client.SalesAvailabilityCREATE() # SalesAvailabilityCREATE | (optional) sales_availability = codex_api_client.SalesAvailability() # SalesAvailability | (optional)
try: try:
# Offers storage for sale # Offers storage for sale
api_response = api_instance.offer_storage(sales_availability_create=sales_availability_create) api_response = api_instance.offer_storage(sales_availability=sales_availability)
print("The response of MarketplaceApi->offer_storage:\n") print("The response of MarketplaceApi->offer_storage:\n")
pprint(api_response) pprint(api_response)
except Exception as e: except Exception as e:
@ -529,7 +530,7 @@ with codex_api_client.ApiClient(configuration) as api_client:
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**sales_availability_create** | [**SalesAvailabilityCREATE**](SalesAvailabilityCREATE.md)| | [optional] **sales_availability** | [**SalesAvailability**](SalesAvailability.md)| | [optional]
### Return type ### Return type
@ -550,7 +551,7 @@ No authorization required
|-------------|-------------|------------------| |-------------|-------------|------------------|
**201** | Created storage availability | - | **201** | Created storage availability | - |
**400** | Invalid data input | - | **400** | Invalid data input | - |
**422** | Not enough node&#39;s storage quota available | - | **422** | Not enough node&#39;s storage quota available or the provided parameters did not pass validation | - |
**500** | Error reserving availability | - | **500** | Error reserving availability | - |
**503** | Persistence is not enabled | - | **503** | Persistence is not enabled | - |
@ -561,7 +562,9 @@ No authorization required
Updates availability Updates availability
The new parameters will be only considered for new requests. Existing Requests linked to this Availability will continue as is. The new parameters will be only considered for new requests.
Existing Requests linked to this Availability will continue as is.
### Example ### Example
@ -623,7 +626,7 @@ No authorization required
**204** | Availability successfully updated | - | **204** | Availability successfully updated | - |
**400** | Invalid data input | - | **400** | Invalid data input | - |
**404** | Availability not found | - | **404** | Availability not found | - |
**422** | Not enough node&#39;s storage quota available | - | **422** | The provided parameters did not pass validation | - |
**500** | Error reserving availability | - | **500** | Error reserving availability | - |
**503** | Persistence is not enabled | - | **503** | Persistence is not enabled | - |

View File

@ -5,11 +5,11 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**node_id** | **str** | | [optional] **node_id** | **str** | |
**peer_id** | **str** | | [optional] **peer_id** | **str** | |
**record** | **str** | | [optional] **record** | **str** | |
**address** | **str** | | [optional] **address** | **str** | |
**seen** | **bool** | | [optional] **seen** | **bool** | |
## Example ## Example

View File

@ -14,7 +14,9 @@ Method | HTTP request | Description
Connect to a peer Connect to a peer
If `addrs` param is supplied, it will be used to dial the peer, otherwise the `peerId` is used to invoke peer discovery, if it succeeds the returned addresses will be used to dial. If `addrs` param is supplied, it will be used to dial the peer, otherwise the `peerId` is used
to invoke peer discovery, if it succeeds the returned addresses will be used to dial.
### Example ### Example
@ -128,7 +130,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: plain/text, application/json - **Accept**: text/plain, application/json
### HTTP response details ### HTTP response details
@ -189,7 +191,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: plain/text, application/json - **Accept**: text/plain, application/json
### HTTP response details ### HTTP response details

View File

@ -5,8 +5,8 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**local_node** | [**Node**](Node.md) | | [optional] **local_node** | [**Node**](Node.md) | |
**nodes** | [**List[Node]**](Node.md) | | [optional] **nodes** | [**List[Node]**](Node.md) | |
## Example ## Example

View File

@ -5,9 +5,10 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**state** | **str** | Description of the Request&#39;s state | [optional] **state** | **str** | Description of the Request&#39;s state |
**error** | **str** | If Request failed, then here is presented the error message | [optional] **error** | **str** | If Request failed, then here is presented the error message | [optional]
**request** | [**StorageRequest**](StorageRequest.md) | | [optional] **request** | [**StorageRequest**](StorageRequest.md) | | [optional]
**request_id** | **str** | 32bits identifier encoded in hex-decimal string. |
## Example ## Example

View File

@ -5,11 +5,12 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional] **id** | **str** | 32bits identifier encoded in hex-decimal string. |
**availability_id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional] **availability_id** | **str** | 32bits identifier encoded in hex-decimal string. |
**size** | **int** | Size of the slot in bytes | [optional] **size** | **int** | Size of the slot in bytes |
**request_id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional] **request_id** | **str** | 32bits identifier encoded in hex-decimal string. |
**slot_index** | **int** | Slot Index number | [optional] **slot_index** | **int** | Slot Index number |
**valid_until** | **int** | Timestamp after which the reservation will no longer be valid. |
## Example ## Example

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**spr** | **str** | Signed Peer Record (libp2p) | [optional] **spr** | **str** | Signed Peer Record (libp2p) |
## Example ## Example

View File

@ -5,11 +5,12 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional] **total_size** | **int** | Total size of availability&#39;s storage in bytes |
**total_size** | **int** | Total size of availability&#39;s storage in bytes | [optional] **duration** | **int** | The duration of the request in seconds |
**duration** | **int** | The duration of the request in seconds | [optional] **min_price_per_byte_per_second** | **str** | Minimal price per byte per second paid (in amount of tokens) for the hosted request&#39;s slot for the request&#39;s duration as decimal string |
**min_price_per_byte_per_second** | **str** | Minimal price per byte per second paid (in amount of tokens) for the hosted request&#39;s slot for the request&#39;s duration as decimal string | [optional] **total_collateral** | **str** | Total collateral (in amount of tokens) that can be used for matching requests |
**total_collateral** | **str** | Total collateral (in amount of tokens) that can be used for matching requests | [optional] **enabled** | **bool** | Enable the ability to receive sales on this availability. | [optional] [default to True]
**until** | **int** | Specifies the latest timestamp, after which the availability will no longer host any slots. If set to 0, there will be no restrictions. | [optional] [default to 0]
## Example ## Example

View File

@ -5,12 +5,15 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional] **total_size** | **int** | Total size of availability&#39;s storage in bytes |
**total_size** | **int** | Total size of availability&#39;s storage in bytes | [optional] **duration** | **int** | The duration of the request in seconds |
**duration** | **int** | The duration of the request in seconds | [optional] **min_price_per_byte_per_second** | **str** | Minimal price per byte per second paid (in amount of tokens) for the hosted request&#39;s slot for the request&#39;s duration as decimal string |
**min_price_per_byte_per_second** | **str** | Minimal price per byte per second paid (in amount of tokens) for the hosted request&#39;s slot for the request&#39;s duration as decimal string | [optional] **total_collateral** | **str** | Total collateral (in amount of tokens) that can be used for matching requests |
**total_collateral** | **str** | Total collateral (in amount of tokens) that can be used for matching requests | [optional] **enabled** | **bool** | Enable the ability to receive sales on this availability. | [optional] [default to True]
**free_size** | **int** | Unused size of availability&#39;s storage in bytes | [optional] **until** | **int** | Specifies the latest timestamp, after which the availability will no longer host any slots. If set to 0, there will be no restrictions. | [optional] [default to 0]
**id** | **str** | 32bits identifier encoded in hex-decimal string. |
**free_size** | **int** | Unused size of availability&#39;s storage in bytes as decimal string | [readonly]
**total_remaining_collateral** | **str** | Total collateral effective (in amount of tokens) that can be used for matching requests | [readonly]
## Example ## Example

View File

@ -5,9 +5,9 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**id** | **str** | Keccak hash of the abi encoded tuple (RequestId, slot index) | [optional] **id** | **str** | Keccak hash of the abi encoded tuple (RequestId, slot index) |
**request** | [**StorageRequest**](StorageRequest.md) | | [optional] **request** | [**StorageRequest**](StorageRequest.md) | |
**slot_index** | **int** | Slot Index number | [optional] **slot_index** | **int** | Slot Index number |
## Example ## Example

View File

@ -5,12 +5,11 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**id** | **str** | Keccak hash of the abi encoded tuple (RequestId, slot index) | [optional] **slot_index** | **int** | Slot Index number |
**slot_index** | **int** | Slot Index number | [optional] **request_id** | **str** | 32bits identifier encoded in hex-decimal string. |
**request_id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional]
**request** | [**StorageRequest**](StorageRequest.md) | | [optional] **request** | [**StorageRequest**](StorageRequest.md) | | [optional]
**reservation** | [**Reservation**](Reservation.md) | | [optional] **reservation** | [**Reservation**](Reservation.md) | | [optional]
**state** | **str** | Description of the slot&#39;s | [optional] **state** | **str** | Description of the slot&#39;s |
## Example ## Example

View File

@ -5,10 +5,10 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**total_blocks** | **int** | Number of blocks stored by the node | [optional] **total_blocks** | **int** | Number of blocks stored by the node |
**quota_max_bytes** | **int** | Maximum storage space (in bytes) available for the node in Codex&#39;s local repository. | [optional] **quota_max_bytes** | **int** | Maximum storage space (in bytes) available for the node in Codex&#39;s local repository. |
**quota_used_bytes** | **int** | Amount of storage space (in bytes) currently used for storing files in Codex&#39;s local repository. | [optional] **quota_used_bytes** | **int** | Amount of storage space (in bytes) currently used for storing files in Codex&#39;s local repository. |
**quota_reserved_bytes** | **int** | Amount of storage reserved (in bytes) in the Codex&#39;s local repository for future use when storage requests will be picked up and hosted by the node using node&#39;s availabilities. This does not include the storage currently in use. | [optional] **quota_reserved_bytes** | **int** | Amount of storage reserved (in bytes) in the Codex&#39;s local repository for future use when storage requests will be picked up and hosted by the node using node&#39;s availabilities. This does not include the storage currently in use. |
## Example ## Example

View File

@ -5,12 +5,13 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**slots** | **int** | Number of slots (eq. hosts) that the Request want to have the content spread over | [optional] **slots** | **int** | Number of slots (eq. hosts) that the Request want to have the content spread over |
**slot_size** | **str** | Amount of storage per slot (in bytes) as decimal string | [optional] **slot_size** | **int** | Amount of storage per slot in bytes |
**duration** | **int** | The duration of the request in seconds | [optional] **duration** | **int** | The duration of the request in seconds |
**proof_probability** | **str** | How often storage proofs are required as decimal string | [optional] **proof_probability** | **str** | How often storage proofs are required as decimal string |
**price_per_byte_per_second** | **str** | The amount of tokens paid per byte per second per slot to hosts the client is willing to pay | **price_per_byte_per_second** | **str** | The amount of tokens paid per byte per second per slot to hosts the client is willing to pay |
**max_slot_loss** | **int** | Max slots that can be lost without data considered to be lost | [optional] **collateral_per_byte** | **str** | Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots |
**max_slot_loss** | **int** | Max slots that can be lost without data considered to be lost |
## Example ## Example

View File

@ -5,12 +5,12 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**id** | **str** | Request ID | [optional] **id** | **str** | Request ID |
**client** | **str** | Address of Ethereum address | [optional] **client** | **str** | Address of Ethereum address |
**ask** | [**StorageAsk**](StorageAsk.md) | | [optional] **ask** | [**StorageAsk**](StorageAsk.md) | |
**content** | [**Content**](Content.md) | | [optional] **content** | [**Content**](Content.md) | |
**expiry** | **int** | A timestamp as seconds since unix epoch at which this request expires if the Request does not find requested amount of nodes to host the data. | [optional] **expiry** | **int** | A timestamp as seconds since unix epoch at which this request expires if the Request does not find requested amount of nodes to host the data. |
**nonce** | **str** | Random data | [optional] **nonce** | **str** | Random data |
## Example ## Example

View File

@ -2,6 +2,6 @@
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2, "spaces": 2,
"generator-cli": { "generator-cli": {
"version": "7.10.0" "version": "7.12.0"
} }
} }

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "codex_api_client" name = "codex_api_client"
version = "0.2.0" version = "0.4.0"
description = "Codex API" description = "Codex API"
authors = ["OpenAPI Generator Community <team@openapitools.org>"] authors = ["OpenAPI Generator Community <team@openapitools.org>"]
license = "NoLicense" license = "NoLicense"
@ -12,7 +12,7 @@ include = ["codex_api_client/py.typed"]
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.8" python = "^3.8"
urllib3 = ">= 1.25.3 < 3.0.0" urllib3 = ">= 1.25.3, < 3.0.0"
python-dateutil = ">= 2.8.2" python-dateutil = ">= 2.8.2"
pydantic = ">= 2" pydantic = ">= 2"
typing-extensions = ">= 4.7.1" typing-extensions = ">= 4.7.1"

View File

@ -21,7 +21,7 @@ from setuptools import setup, find_packages # noqa: H301
# prerequisite: setuptools # prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools # http://pypi.python.org/pypi/setuptools
NAME = "codex-api-client" NAME = "codex-api-client"
VERSION = "0.2.0" VERSION = "0.4.0"
PYTHON_REQUIRES = ">= 3.8" PYTHON_REQUIRES = ">= 3.8"
REQUIRES = [ REQUIRES = [
"urllib3 >= 1.25.3, < 3.0.0", "urllib3 >= 1.25.3, < 3.0.0",
@ -46,4 +46,4 @@ setup(
List of endpoints and interfaces available to Codex API users List of endpoints and interfaces available to Codex API users
""", # noqa: E501 """, # noqa: E501
package_data={"codex_api_client": ["py.typed"]}, package_data={"codex_api_client": ["py.typed"]},
) )