diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index eae67d9..8eef485 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -23,7 +23,6 @@ codex_api_client/models/peers_table.py codex_api_client/models/purchase.py codex_api_client/models/reservation.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/slot.py codex_api_client/models/slot_agent.py @@ -51,7 +50,6 @@ docs/Purchase.md docs/Reservation.md docs/SPRRead.md docs/SalesAvailability.md -docs/SalesAvailabilityCREATE.md docs/SalesAvailabilityREAD.md docs/Slot.md docs/SlotAgent.md diff --git a/README.md b/README.md index af2f2a0..05e5edb 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,6 @@ Class | Method | HTTP request | Description - [Reservation](docs/Reservation.md) - [SPRRead](docs/SPRRead.md) - [SalesAvailability](docs/SalesAvailability.md) - - [SalesAvailabilityCREATE](docs/SalesAvailabilityCREATE.md) - [SalesAvailabilityREAD](docs/SalesAvailabilityREAD.md) - [Slot](docs/Slot.md) - [SlotAgent](docs/SlotAgent.md) diff --git a/codex.yaml b/codex.yaml index 689e622..0c3ca9f 100644 --- a/codex.yaml +++ b/codex.yaml @@ -50,6 +50,10 @@ components: type: string 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: type: integer format: int64 @@ -70,6 +74,8 @@ components: SPRRead: type: object + required: + - spr properties: spr: $ref: "#/components/schemas/SPR" @@ -82,6 +88,8 @@ components: Content: type: object + required: + - cid description: Parameters specifying the content properties: cid: @@ -89,6 +97,12 @@ components: Node: type: object + required: + - nodeId + - peerId + - record + - address + - seen properties: nodeId: type: string @@ -110,9 +124,15 @@ components: revision: type: string example: 0c647d8 + contracts: + type: string + example: 0b537c7 PeersTable: type: object + required: + - localNode + - nodes properties: localNode: $ref: "#/components/schemas/Node" @@ -123,6 +143,14 @@ components: DebugInfo: type: object + required: + - id + - addrs + - repo + - spr + - announceAddresses + - table + - codex properties: id: $ref: "#/components/schemas/PeerId" @@ -146,9 +174,12 @@ components: SalesAvailability: type: object + required: + - totalSize + - duration + - minPricePerBytePerSecond + - totalCollateral properties: - id: - $ref: "#/components/schemas/Id" totalSize: type: integer format: int64 @@ -161,28 +192,42 @@ components: totalCollateral: type: string 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: + required: + - id + - totalRemainingCollateral allOf: - $ref: "#/components/schemas/SalesAvailability" - type: object properties: + id: + $ref: "#/components/schemas/Id" + readonly: true freeSize: type: integer format: int64 - description: Unused size of availability's storage in bytes - - SalesAvailabilityCREATE: - allOf: - - $ref: "#/components/schemas/SalesAvailability" - - required: - - totalSize - - minPricePerBytePerSecond - - totalCollateral - - duration + description: Unused size of availability's storage in bytes as decimal string + readOnly: true + totalRemainingCollateral: + type: string + description: Total collateral effective (in amount of tokens) that can be used for matching requests + readOnly: true Slot: type: object + required: + - id + - request + - slotIndex properties: id: $ref: "#/components/schemas/SlotId" @@ -195,9 +240,11 @@ components: SlotAgent: type: object + required: + - state + - requestId + - slotIndex properties: - id: - $ref: "#/components/schemas/SlotId" slotIndex: type: integer format: int64 @@ -228,6 +275,13 @@ components: Reservation: type: object + required: + - id + - availabilityId + - size + - requestId + - slotIndex + - validUntil properties: id: $ref: "#/components/schemas/Id" @@ -243,6 +297,9 @@ components: type: integer format: int64 description: Slot Index number + validUntil: + type: integer + description: Timestamp after which the reservation will no longer be valid. StorageRequestCreation: type: object @@ -270,8 +327,7 @@ components: default: 1 minimum: 1 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 + $ref: "#/components/schemas/CollateralPerByte" expiry: type: integer format: int64 @@ -279,7 +335,13 @@ components: StorageAsk: type: object required: + - slots + - slotSize + - duration + - proofProbability - pricePerBytePerSecond + - collateralPerByte + - maxSlotLoss properties: slots: description: Number of slots (eq. hosts) that the Request want to have the content spread over @@ -288,13 +350,15 @@ components: slotSize: type: integer format: int64 - description: Amount of storage per slot (in bytes) as decimal string + description: Amount of storage per slot in bytes duration: $ref: "#/components/schemas/Duration" proofProbability: $ref: "#/components/schemas/ProofProbability" pricePerBytePerSecond: $ref: "#/components/schemas/PricePerBytePerSecond" + collateralPerByte: + $ref: "#/components/schemas/CollateralPerByte" maxSlotLoss: type: integer format: int64 @@ -302,6 +366,13 @@ components: StorageRequest: type: object + required: + - id + - client + - ask + - content + - expiry + - nonce properties: id: type: string @@ -320,13 +391,16 @@ components: Purchase: type: object + required: + - state + - requestId properties: state: type: string description: Description of the Request's state enum: - cancelled - - error + - errored - failed - finished - pending @@ -335,12 +409,17 @@ components: - unknown error: type: string + nullable: true description: If Request failed, then here is presented the error message request: $ref: "#/components/schemas/StorageRequest" + requestId: + $ref: "#/components/schemas/Id" DataList: type: object + required: + - content properties: content: type: array @@ -349,6 +428,9 @@ components: DataItem: type: object + required: + - cid + - manifest properties: cid: $ref: "#/components/schemas/Cid" @@ -357,6 +439,11 @@ components: ManifestItem: type: object + required: + - treeCid + - datasetSize + - blockSize + - protected properties: treeCid: $ref: "#/components/schemas/Cid" @@ -384,6 +471,11 @@ components: Space: type: object + required: + - totalBlocks + - quotaMaxBytes + - quotaUsedBytes + - quotaReservedBytes properties: totalBlocks: description: "Number of blocks stored by the node" @@ -502,6 +594,8 @@ paths: text/plain: schema: type: string + "422": + description: The mimetype of the filename is invalid "500": description: Well it was bad-bad and the upload did not work out @@ -702,7 +796,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/SalesAvailabilityCREATE" + $ref: "#/components/schemas/SalesAvailability" responses: "201": description: Created storage availability @@ -713,7 +807,7 @@ paths: "400": description: Invalid data input "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": description: Error reserving availability "503": @@ -746,7 +840,7 @@ paths: "404": description: Availability not found "422": - description: Not enough node's storage quota available + description: The provided parameters did not pass validation "500": description: Error reserving availability "503": @@ -809,6 +903,8 @@ paths: type: string "400": description: Invalid or missing Request ID + "422": + description: The storage request parameters are not valid "404": description: Request ID not found "503": @@ -866,7 +962,7 @@ paths: "200": description: Node's SPR content: - plain/text: + text/plain: schema: $ref: "#/components/schemas/SPR" application/json: @@ -884,7 +980,7 @@ paths: "200": description: Node's Peer ID content: - plain/text: + text/plain: schema: $ref: "#/components/schemas/PeerId" application/json: diff --git a/codex_api_client/__init__.py b/codex_api_client/__init__.py index d6dd5d6..259a994 100644 --- a/codex_api_client/__init__.py +++ b/codex_api_client/__init__.py @@ -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.spr_read import SPRRead 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.slot import Slot from codex_api_client.models.slot_agent import SlotAgent diff --git a/codex_api_client/api/data_api.py b/codex_api_client/api/data_api.py index 085adc4..7641560 100644 --- a/codex_api_client/api/data_api.py +++ b/codex_api_client/api/data_api.py @@ -1666,6 +1666,7 @@ class DataApi: _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '422': None, '500': None, } response_data = self.api_client.call_api( @@ -1741,6 +1742,7 @@ class DataApi: _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '422': None, '500': None, } response_data = self.api_client.call_api( @@ -1816,6 +1818,7 @@ class DataApi: _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '422': None, '500': None, } response_data = self.api_client.call_api( diff --git a/codex_api_client/api/marketplace_api.py b/codex_api_client/api/marketplace_api.py index e34a3c9..c59797b 100644 --- a/codex_api_client/api/marketplace_api.py +++ b/codex_api_client/api/marketplace_api.py @@ -22,7 +22,6 @@ from typing_extensions import Annotated from codex_api_client.models.purchase import Purchase from codex_api_client.models.reservation import Reservation 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.slot import Slot from codex_api_client.models.slot_agent import SlotAgent @@ -105,6 +104,7 @@ class MarketplaceApi: _response_types_map: Dict[str, Optional[str]] = { '200': "str", '400': None, + '422': None, '404': None, '503': None, } @@ -178,6 +178,7 @@ class MarketplaceApi: _response_types_map: Dict[str, Optional[str]] = { '200': "str", '400': None, + '422': None, '404': None, '503': None, } @@ -251,6 +252,7 @@ class MarketplaceApi: _response_types_map: Dict[str, Optional[str]] = { '200': "str", '400': None, + '422': None, '404': None, '503': None, } @@ -1885,7 +1887,7 @@ class MarketplaceApi: @validate_call def offer_storage( self, - sales_availability_create: Optional[SalesAvailabilityCREATE] = None, + sales_availability: Optional[SalesAvailability] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1902,8 +1904,8 @@ class MarketplaceApi: """Offers storage for sale - :param sales_availability_create: - :type sales_availability_create: SalesAvailabilityCREATE + :param sales_availability: + :type sales_availability: SalesAvailability :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 @@ -1927,7 +1929,7 @@ class MarketplaceApi: """ # noqa: E501 _param = self._offer_storage_serialize( - sales_availability_create=sales_availability_create, + sales_availability=sales_availability, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1955,7 +1957,7 @@ class MarketplaceApi: @validate_call def offer_storage_with_http_info( self, - sales_availability_create: Optional[SalesAvailabilityCREATE] = None, + sales_availability: Optional[SalesAvailability] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1972,8 +1974,8 @@ class MarketplaceApi: """Offers storage for sale - :param sales_availability_create: - :type sales_availability_create: SalesAvailabilityCREATE + :param sales_availability: + :type sales_availability: SalesAvailability :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 @@ -1997,7 +1999,7 @@ class MarketplaceApi: """ # noqa: E501 _param = self._offer_storage_serialize( - sales_availability_create=sales_availability_create, + sales_availability=sales_availability, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2025,7 +2027,7 @@ class MarketplaceApi: @validate_call def offer_storage_without_preload_content( self, - sales_availability_create: Optional[SalesAvailabilityCREATE] = None, + sales_availability: Optional[SalesAvailability] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2042,8 +2044,8 @@ class MarketplaceApi: """Offers storage for sale - :param sales_availability_create: - :type sales_availability_create: SalesAvailabilityCREATE + :param sales_availability: + :type sales_availability: SalesAvailability :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 @@ -2067,7 +2069,7 @@ class MarketplaceApi: """ # noqa: E501 _param = self._offer_storage_serialize( - sales_availability_create=sales_availability_create, + sales_availability=sales_availability, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2090,7 +2092,7 @@ class MarketplaceApi: def _offer_storage_serialize( self, - sales_availability_create, + sales_availability, _request_auth, _content_type, _headers, @@ -2116,8 +2118,8 @@ class MarketplaceApi: # process the header parameters # process the form parameters # process the body parameter - if sales_availability_create is not None: - _body_params = sales_availability_create + if sales_availability is not None: + _body_params = sales_availability # set the HTTP header `Accept` diff --git a/codex_api_client/api/node_api.py b/codex_api_client/api/node_api.py index f7c8f4f..4027d22 100644 --- a/codex_api_client/api/node_api.py +++ b/codex_api_client/api/node_api.py @@ -527,7 +527,7 @@ class NodeApi: if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ - 'plain/text', + 'text/plain', 'application/json' ] ) @@ -773,7 +773,7 @@ class NodeApi: if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( [ - 'plain/text', + 'text/plain', 'application/json' ] ) diff --git a/codex_api_client/models/__init__.py b/codex_api_client/models/__init__.py index be83794..9faa706 100644 --- a/codex_api_client/models/__init__.py +++ b/codex_api_client/models/__init__.py @@ -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.spr_read import SPRRead 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.slot import Slot from codex_api_client.models.slot_agent import SlotAgent diff --git a/codex_api_client/models/codex_version.py b/codex_api_client/models/codex_version.py index 3dc5e5f..6168012 100644 --- a/codex_api_client/models/codex_version.py +++ b/codex_api_client/models/codex_version.py @@ -28,7 +28,8 @@ class CodexVersion(BaseModel): """ # noqa: E501 version: 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( populate_by_name=True, @@ -82,7 +83,8 @@ class CodexVersion(BaseModel): _obj = cls.model_validate({ "version": obj.get("version"), - "revision": obj.get("revision") + "revision": obj.get("revision"), + "contracts": obj.get("contracts") }) return _obj diff --git a/codex_api_client/models/content.py b/codex_api_client/models/content.py index 9383f80..b89c264 100644 --- a/codex_api_client/models/content.py +++ b/codex_api_client/models/content.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json 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_extensions import Self @@ -26,7 +26,7 @@ class Content(BaseModel): """ Parameters specifying the content """ # 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"] model_config = ConfigDict( diff --git a/codex_api_client/models/data_item.py b/codex_api_client/models/data_item.py index c8b7fcc..8fd49f0 100644 --- a/codex_api_client/models/data_item.py +++ b/codex_api_client/models/data_item.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json 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 typing import Optional, Set from typing_extensions import Self @@ -27,8 +27,8 @@ class DataItem(BaseModel): """ DataItem """ # noqa: E501 - cid: Optional[StrictStr] = Field(default=None, description="Content Identifier as specified at https://github.com/multiformats/cid") - manifest: Optional[ManifestItem] = None + cid: StrictStr = Field(description="Content Identifier as specified at https://github.com/multiformats/cid") + manifest: ManifestItem __properties: ClassVar[List[str]] = ["cid", "manifest"] model_config = ConfigDict( diff --git a/codex_api_client/models/data_list.py b/codex_api_client/models/data_list.py index d50bbc7..4c8fae7 100644 --- a/codex_api_client/models/data_list.py +++ b/codex_api_client/models/data_list.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json 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 typing import Optional, Set from typing_extensions import Self @@ -27,7 +27,7 @@ class DataList(BaseModel): """ DataList """ # noqa: E501 - content: Optional[List[DataItem]] = None + content: List[DataItem] __properties: ClassVar[List[str]] = ["content"] model_config = ConfigDict( diff --git a/codex_api_client/models/debug_info.py b/codex_api_client/models/debug_info.py index 6c76280..b0647ef 100644 --- a/codex_api_client/models/debug_info.py +++ b/codex_api_client/models/debug_info.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json 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.peers_table import PeersTable from typing import Optional, Set @@ -28,13 +28,13 @@ class DebugInfo(BaseModel): """ DebugInfo """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Peer Identity reference as specified at https://docs.libp2p.io/concepts/fundamentals/peers/") - addrs: Optional[List[StrictStr]] = None - repo: Optional[StrictStr] = Field(default=None, description="Path of the data repository where all nodes data are stored") - spr: Optional[StrictStr] = Field(default=None, description="Signed Peer Record (libp2p)") - announce_addresses: Optional[List[StrictStr]] = Field(default=None, alias="announceAddresses") - table: Optional[PeersTable] = None - codex: Optional[CodexVersion] = None + id: StrictStr = Field(description="Peer Identity reference as specified at https://docs.libp2p.io/concepts/fundamentals/peers/") + addrs: List[StrictStr] + repo: StrictStr = Field(description="Path of the data repository where all nodes data are stored") + spr: StrictStr = Field(description="Signed Peer Record (libp2p)") + announce_addresses: List[StrictStr] = Field(alias="announceAddresses") + table: PeersTable + codex: CodexVersion __properties: ClassVar[List[str]] = ["id", "addrs", "repo", "spr", "announceAddresses", "table", "codex"] model_config = ConfigDict( diff --git a/codex_api_client/models/manifest_item.py b/codex_api_client/models/manifest_item.py index a25e6c2..1fe1972 100644 --- a/codex_api_client/models/manifest_item.py +++ b/codex_api_client/models/manifest_item.py @@ -26,10 +26,10 @@ class ManifestItem(BaseModel): """ ManifestItem """ # noqa: E501 - tree_cid: Optional[StrictStr] = Field(default=None, 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") - block_size: Optional[StrictInt] = Field(default=None, description="Size of blocks", alias="blockSize") - protected: Optional[StrictBool] = Field(default=None, description="Indicates if content is protected by erasure-coding") + tree_cid: StrictStr = Field(description="Content Identifier as specified at https://github.com/multiformats/cid", alias="treeCid") + dataset_size: StrictInt = Field(description="Length of original content in bytes", alias="datasetSize") + block_size: StrictInt = Field(description="Size of blocks", alias="blockSize") + 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)") 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"] diff --git a/codex_api_client/models/node.py b/codex_api_client/models/node.py index 37cc66c..97b53b1 100644 --- a/codex_api_client/models/node.py +++ b/codex_api_client/models/node.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json 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_extensions import Self @@ -26,11 +26,11 @@ class Node(BaseModel): """ Node """ # noqa: E501 - node_id: Optional[StrictStr] = Field(default=None, alias="nodeId") - peer_id: Optional[StrictStr] = Field(default=None, alias="peerId") - record: Optional[StrictStr] = None - address: Optional[StrictStr] = None - seen: Optional[StrictBool] = None + node_id: StrictStr = Field(alias="nodeId") + peer_id: StrictStr = Field(alias="peerId") + record: StrictStr + address: StrictStr + seen: StrictBool __properties: ClassVar[List[str]] = ["nodeId", "peerId", "record", "address", "seen"] model_config = ConfigDict( diff --git a/codex_api_client/models/peers_table.py b/codex_api_client/models/peers_table.py index 759420b..26a1892 100644 --- a/codex_api_client/models/peers_table.py +++ b/codex_api_client/models/peers_table.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json 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 typing import Optional, Set from typing_extensions import Self @@ -27,8 +27,8 @@ class PeersTable(BaseModel): """ PeersTable """ # noqa: E501 - local_node: Optional[Node] = Field(default=None, alias="localNode") - nodes: Optional[List[Node]] = None + local_node: Node = Field(alias="localNode") + nodes: List[Node] __properties: ClassVar[List[str]] = ["localNode", "nodes"] model_config = ConfigDict( diff --git a/codex_api_client/models/purchase.py b/codex_api_client/models/purchase.py index 45d72ef..1cb7024 100644 --- a/codex_api_client/models/purchase.py +++ b/codex_api_client/models/purchase.py @@ -19,6 +19,7 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from codex_api_client.models.storage_request import StorageRequest from typing import Optional, Set from typing_extensions import Self @@ -27,19 +28,17 @@ class Purchase(BaseModel): """ Purchase """ # 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") 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') def state_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - - 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')") + if value not in set(['cancelled', 'errored', 'failed', 'finished', 'pending', 'started', 'submitted', 'unknown']): + raise ValueError("must be one of enum values ('cancelled', 'errored', 'failed', 'finished', 'pending', 'started', 'submitted', 'unknown')") return value model_config = ConfigDict( @@ -84,6 +83,11 @@ class Purchase(BaseModel): # override the default output from pydantic by calling `to_dict()` of request if self.request: _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 @classmethod @@ -98,7 +102,8 @@ class Purchase(BaseModel): _obj = cls.model_validate({ "state": obj.get("state"), "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 diff --git a/codex_api_client/models/reservation.py b/codex_api_client/models/reservation.py index edb2f10..aa70819 100644 --- a/codex_api_client/models/reservation.py +++ b/codex_api_client/models/reservation.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json 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 import Optional, Set from typing_extensions import Self @@ -27,12 +27,13 @@ class Reservation(BaseModel): """ Reservation """ # 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.") - 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") - size: Optional[StrictInt] = Field(default=None, 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") - slot_index: Optional[StrictInt] = Field(default=None, description="Slot Index number", alias="slotIndex") - __properties: ClassVar[List[str]] = ["id", "availabilityId", "size", "requestId", "slotIndex"] + id: Annotated[str, Field(min_length=66, strict=True, max_length=66)] = Field(description="32bits identifier encoded in hex-decimal string.") + 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: StrictInt = Field(description="Size of the slot in bytes") + 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: StrictInt = Field(description="Slot Index number", alias="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( populate_by_name=True, @@ -89,7 +90,8 @@ class Reservation(BaseModel): "availabilityId": obj.get("availabilityId"), "size": obj.get("size"), "requestId": obj.get("requestId"), - "slotIndex": obj.get("slotIndex") + "slotIndex": obj.get("slotIndex"), + "validUntil": obj.get("validUntil") }) return _obj diff --git a/codex_api_client/models/sales_availability.py b/codex_api_client/models/sales_availability.py index 7ef7f15..60e3b5c 100644 --- a/codex_api_client/models/sales_availability.py +++ b/codex_api_client/models/sales_availability.py @@ -17,9 +17,8 @@ import pprint import re # noqa: F401 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_extensions import Annotated from typing import Optional, Set from typing_extensions import Self @@ -27,12 +26,13 @@ class SalesAvailability(BaseModel): """ SalesAvailability """ # 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: Optional[StrictInt] = Field(default=None, description="Total size of availability's storage in bytes", alias="totalSize") - duration: Optional[StrictInt] = Field(default=None, description="The duration of the request in seconds") - 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: Optional[StrictStr] = Field(default=None, description="Total collateral (in amount of tokens) that can be used for matching requests", alias="totalCollateral") - __properties: ClassVar[List[str]] = ["id", "totalSize", "duration", "minPricePerBytePerSecond", "totalCollateral"] + total_size: StrictInt = Field(description="Total size of availability's storage in bytes", alias="totalSize") + duration: StrictInt = Field(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") + total_collateral: StrictStr = Field(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.") + 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( populate_by_name=True, @@ -85,11 +85,12 @@ class SalesAvailability(BaseModel): return cls.model_validate(obj) _obj = cls.model_validate({ - "id": obj.get("id"), "totalSize": obj.get("totalSize"), "duration": obj.get("duration"), "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 diff --git a/codex_api_client/models/sales_availability_read.py b/codex_api_client/models/sales_availability_read.py index 761dd13..6a32119 100644 --- a/codex_api_client/models/sales_availability_read.py +++ b/codex_api_client/models/sales_availability_read.py @@ -17,7 +17,7 @@ import pprint import re # noqa: F401 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_extensions import Annotated from typing import Optional, Set @@ -27,13 +27,16 @@ class SalesAvailabilityREAD(BaseModel): """ SalesAvailabilityREAD """ # 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: Optional[StrictInt] = Field(default=None, description="Total size of availability's storage in bytes", alias="totalSize") - duration: Optional[StrictInt] = Field(default=None, description="The duration of the request in seconds") - 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: Optional[StrictStr] = Field(default=None, description="Total collateral (in amount of tokens) that can be used for matching requests", alias="totalCollateral") - free_size: Optional[StrictInt] = Field(default=None, description="Unused size of availability's storage in bytes", alias="freeSize") - __properties: ClassVar[List[str]] = ["id", "totalSize", "duration", "minPricePerBytePerSecond", "totalCollateral", "freeSize"] + total_size: StrictInt = Field(description="Total size of availability's storage in bytes", alias="totalSize") + duration: StrictInt = Field(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") + total_collateral: StrictStr = Field(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.") + 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.") + id: Annotated[str, Field(min_length=66, strict=True, max_length=66)] = Field(description="32bits identifier encoded in hex-decimal string.") + free_size: Optional[StrictInt] = Field(default=None, 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( populate_by_name=True, @@ -65,8 +68,12 @@ class SalesAvailabilityREAD(BaseModel): * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ + "free_size", + "total_remaining_collateral", ]) _dict = self.model_dump( @@ -86,12 +93,15 @@ class SalesAvailabilityREAD(BaseModel): return cls.model_validate(obj) _obj = cls.model_validate({ - "id": obj.get("id"), "totalSize": obj.get("totalSize"), "duration": obj.get("duration"), "minPricePerBytePerSecond": obj.get("minPricePerBytePerSecond"), "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 diff --git a/codex_api_client/models/slot.py b/codex_api_client/models/slot.py index 480be36..633a357 100644 --- a/codex_api_client/models/slot.py +++ b/codex_api_client/models/slot.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json 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 typing import Optional, Set from typing_extensions import Self @@ -27,9 +27,9 @@ class Slot(BaseModel): """ Slot """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Keccak hash of the abi encoded tuple (RequestId, slot index)") - request: Optional[StorageRequest] = None - slot_index: Optional[StrictInt] = Field(default=None, description="Slot Index number", alias="slotIndex") + id: StrictStr = Field(description="Keccak hash of the abi encoded tuple (RequestId, slot index)") + request: StorageRequest + slot_index: StrictInt = Field(description="Slot Index number", alias="slotIndex") __properties: ClassVar[List[str]] = ["id", "request", "slotIndex"] model_config = ConfigDict( diff --git a/codex_api_client/models/slot_agent.py b/codex_api_client/models/slot_agent.py index 6fc109f..767fd9f 100644 --- a/codex_api_client/models/slot_agent.py +++ b/codex_api_client/models/slot_agent.py @@ -29,20 +29,16 @@ class SlotAgent(BaseModel): """ SlotAgent """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Keccak hash of the abi encoded tuple (RequestId, slot index)") - slot_index: Optional[StrictInt] = Field(default=None, description="Slot Index number", alias="slotIndex") - 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") + slot_index: StrictInt = Field(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: Optional[StorageRequest] = None reservation: Optional[Reservation] = None - state: Optional[StrictStr] = Field(default=None, description="Description of the slot's") - __properties: ClassVar[List[str]] = ["id", "slotIndex", "requestId", "request", "reservation", "state"] + state: StrictStr = Field(description="Description of the slot's") + __properties: ClassVar[List[str]] = ["slotIndex", "requestId", "request", "reservation", "state"] @field_validator('state') def state_validate_enum(cls, value): """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']): raise ValueError("must be one of enum values ('SaleCancelled', 'SaleDownloading', 'SaleErrored', 'SaleFailed', 'SaleFilled', 'SaleFilling', 'SaleFinished', 'SaleIgnored', 'SaleInitialProving', 'SalePayout', 'SalePreparing', 'SaleProving', 'SaleUnknown')") return value @@ -104,7 +100,6 @@ class SlotAgent(BaseModel): return cls.model_validate(obj) _obj = cls.model_validate({ - "id": obj.get("id"), "slotIndex": obj.get("slotIndex"), "requestId": obj.get("requestId"), "request": StorageRequest.from_dict(obj["request"]) if obj.get("request") is not None else None, diff --git a/codex_api_client/models/space.py b/codex_api_client/models/space.py index 5f02c41..17532ae 100644 --- a/codex_api_client/models/space.py +++ b/codex_api_client/models/space.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json 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_extensions import Self @@ -26,10 +26,10 @@ class Space(BaseModel): """ Space """ # noqa: E501 - total_blocks: Optional[StrictInt] = Field(default=None, 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_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_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") + total_blocks: StrictInt = Field(description="Number of blocks stored by the node", alias="totalBlocks") + 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: StrictInt = Field(description="Amount of storage space (in bytes) currently used for storing files in Codex's local repository.", alias="quotaUsedBytes") + 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"] model_config = ConfigDict( diff --git a/codex_api_client/models/spr_read.py b/codex_api_client/models/spr_read.py index 0b03f5f..915df11 100644 --- a/codex_api_client/models/spr_read.py +++ b/codex_api_client/models/spr_read.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json 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_extensions import Self @@ -26,7 +26,7 @@ class SPRRead(BaseModel): """ SPRRead """ # 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"] model_config = ConfigDict( diff --git a/codex_api_client/models/storage_ask.py b/codex_api_client/models/storage_ask.py index 41624ee..13e0110 100644 --- a/codex_api_client/models/storage_ask.py +++ b/codex_api_client/models/storage_ask.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json 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_extensions import Self @@ -26,13 +26,14 @@ class StorageAsk(BaseModel): """ StorageAsk """ # noqa: E501 - slots: Optional[StrictInt] = Field(default=None, description="Number of slots (eq. hosts) that the Request want to have the content spread over") - slot_size: Optional[StrictInt] = Field(default=None, description="Amount of storage per slot (in bytes) as decimal string", alias="slotSize") - duration: Optional[StrictInt] = Field(default=None, 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") + slots: StrictInt = Field(description="Number of slots (eq. hosts) that the Request want to have the content spread over") + slot_size: StrictInt = Field(description="Amount of storage per slot in bytes", alias="slotSize") + duration: StrictInt = Field(description="The duration of the request in seconds") + 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") - max_slot_loss: Optional[StrictInt] = Field(default=None, description="Max slots that can be lost without data considered to be lost", alias="maxSlotLoss") - __properties: ClassVar[List[str]] = ["slots", "slotSize", "duration", "proofProbability", "pricePerBytePerSecond", "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") + 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( populate_by_name=True, @@ -90,6 +91,7 @@ class StorageAsk(BaseModel): "duration": obj.get("duration"), "proofProbability": obj.get("proofProbability"), "pricePerBytePerSecond": obj.get("pricePerBytePerSecond"), + "collateralPerByte": obj.get("collateralPerByte"), "maxSlotLoss": obj.get("maxSlotLoss") }) return _obj diff --git a/codex_api_client/models/storage_request.py b/codex_api_client/models/storage_request.py index d6c7b50..5a05695 100644 --- a/codex_api_client/models/storage_request.py +++ b/codex_api_client/models/storage_request.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json 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.storage_ask import StorageAsk from typing import Optional, Set @@ -28,12 +28,12 @@ class StorageRequest(BaseModel): """ StorageRequest """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Request ID") - client: Optional[StrictStr] = Field(default=None, description="Address of Ethereum address") - ask: Optional[StorageAsk] = None - content: Optional[Content] = None - 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.") - nonce: Optional[StrictStr] = Field(default=None, description="Random data") + id: StrictStr = Field(description="Request ID") + client: StrictStr = Field(description="Address of Ethereum address") + ask: StorageAsk + content: Content + 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: StrictStr = Field(description="Random data") __properties: ClassVar[List[str]] = ["id", "client", "ask", "content", "expiry", "nonce"] model_config = ConfigDict( diff --git a/docs/CodexVersion.md b/docs/CodexVersion.md index c8cd8d9..a2a47d0 100644 --- a/docs/CodexVersion.md +++ b/docs/CodexVersion.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **version** | **str** | | [optional] **revision** | **str** | | [optional] +**contracts** | **str** | | [optional] ## Example diff --git a/docs/Content.md b/docs/Content.md index a0d9c85..ec72521 100644 --- a/docs/Content.md +++ b/docs/Content.md @@ -6,7 +6,7 @@ Parameters specifying the content 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 diff --git a/docs/DataApi.md b/docs/DataApi.md index 7de9b87..c6ca770 100644 --- a/docs/DataApi.md +++ b/docs/DataApi.md @@ -482,6 +482,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| **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 | - | [[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) diff --git a/docs/DataItem.md b/docs/DataItem.md index 38a87fb..9539e07 100644 --- a/docs/DataItem.md +++ b/docs/DataItem.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**cid** | **str** | Content Identifier as specified at https://github.com/multiformats/cid | [optional] -**manifest** | [**ManifestItem**](ManifestItem.md) | | [optional] +**cid** | **str** | Content Identifier as specified at https://github.com/multiformats/cid | +**manifest** | [**ManifestItem**](ManifestItem.md) | | ## Example diff --git a/docs/DataList.md b/docs/DataList.md index 5b619d3..0781642 100644 --- a/docs/DataList.md +++ b/docs/DataList.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**content** | [**List[DataItem]**](DataItem.md) | | [optional] +**content** | [**List[DataItem]**](DataItem.md) | | ## Example diff --git a/docs/DebugInfo.md b/docs/DebugInfo.md index 89b77ec..4194f61 100644 --- a/docs/DebugInfo.md +++ b/docs/DebugInfo.md @@ -5,13 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | Peer Identity reference as specified at https://docs.libp2p.io/concepts/fundamentals/peers/ | [optional] -**addrs** | **List[str]** | | [optional] -**repo** | **str** | Path of the data repository where all nodes data are stored | [optional] -**spr** | **str** | Signed Peer Record (libp2p) | [optional] -**announce_addresses** | **List[str]** | | [optional] -**table** | [**PeersTable**](PeersTable.md) | | [optional] -**codex** | [**CodexVersion**](CodexVersion.md) | | [optional] +**id** | **str** | Peer Identity reference as specified at https://docs.libp2p.io/concepts/fundamentals/peers/ | +**addrs** | **List[str]** | | +**repo** | **str** | Path of the data repository where all nodes data are stored | +**spr** | **str** | Signed Peer Record (libp2p) | +**announce_addresses** | **List[str]** | | +**table** | [**PeersTable**](PeersTable.md) | | +**codex** | [**CodexVersion**](CodexVersion.md) | | ## Example diff --git a/docs/ManifestItem.md b/docs/ManifestItem.md index 22ec7bc..b90381e 100644 --- a/docs/ManifestItem.md +++ b/docs/ManifestItem.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**tree_cid** | **str** | Content Identifier as specified at https://github.com/multiformats/cid | [optional] -**dataset_size** | **int** | Length of original content in bytes | [optional] -**block_size** | **int** | Size of blocks | [optional] -**protected** | **bool** | Indicates if content is protected by erasure-coding | [optional] +**tree_cid** | **str** | Content Identifier as specified at https://github.com/multiformats/cid | +**dataset_size** | **int** | Length of original content in bytes | +**block_size** | **int** | Size of blocks | +**protected** | **bool** | Indicates if content is protected by erasure-coding | **filename** | **str** | The original name of the uploaded content (optional) | [optional] **mimetype** | **str** | The original mimetype of the uploaded content (optional) | [optional] diff --git a/docs/MarketplaceApi.md b/docs/MarketplaceApi.md index 97224a0..0ecc66a 100644 --- a/docs/MarketplaceApi.md +++ b/docs/MarketplaceApi.md @@ -81,6 +81,7 @@ No authorization required |-------------|-------------|------------------| **200** | Returns the Request ID as decimal string | - | **400** | Invalid or missing Request ID | - | +**422** | The storage request parameters are not valid | - | **404** | Request ID not found | - | **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) # **offer_storage** -> SalesAvailabilityREAD offer_storage(sales_availability_create=sales_availability_create) +> SalesAvailabilityREAD offer_storage(sales_availability=sales_availability) Offers storage for sale @@ -495,7 +496,7 @@ Offers storage for sale ```python 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.rest import ApiException from pprint import pprint @@ -511,11 +512,11 @@ configuration = codex_api_client.Configuration( with codex_api_client.ApiClient(configuration) as api_client: # Create an instance of the API class 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: # 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") pprint(api_response) except Exception as e: @@ -529,7 +530,7 @@ with codex_api_client.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **sales_availability_create** | [**SalesAvailabilityCREATE**](SalesAvailabilityCREATE.md)| | [optional] + **sales_availability** | [**SalesAvailability**](SalesAvailability.md)| | [optional] ### Return type @@ -550,7 +551,7 @@ No authorization required |-------------|-------------|------------------| **201** | Created storage availability | - | **400** | Invalid data input | - | -**422** | Not enough node's storage quota available | - | +**422** | Not enough node's storage quota available or the provided parameters did not pass validation | - | **500** | Error reserving availability | - | **503** | Persistence is not enabled | - | @@ -623,7 +624,7 @@ No authorization required **204** | Availability successfully updated | - | **400** | Invalid data input | - | **404** | Availability not found | - | -**422** | Not enough node's storage quota available | - | +**422** | The provided parameters did not pass validation | - | **500** | Error reserving availability | - | **503** | Persistence is not enabled | - | diff --git a/docs/Node.md b/docs/Node.md index 1f6efb8..938aabf 100644 --- a/docs/Node.md +++ b/docs/Node.md @@ -5,11 +5,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**node_id** | **str** | | [optional] -**peer_id** | **str** | | [optional] -**record** | **str** | | [optional] -**address** | **str** | | [optional] -**seen** | **bool** | | [optional] +**node_id** | **str** | | +**peer_id** | **str** | | +**record** | **str** | | +**address** | **str** | | +**seen** | **bool** | | ## Example diff --git a/docs/NodeApi.md b/docs/NodeApi.md index 3915ce9..40424b5 100644 --- a/docs/NodeApi.md +++ b/docs/NodeApi.md @@ -128,7 +128,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: plain/text, application/json + - **Accept**: text/plain, application/json ### HTTP response details @@ -189,7 +189,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: plain/text, application/json + - **Accept**: text/plain, application/json ### HTTP response details diff --git a/docs/PeersTable.md b/docs/PeersTable.md index 111e4f0..a5f3f06 100644 --- a/docs/PeersTable.md +++ b/docs/PeersTable.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**local_node** | [**Node**](Node.md) | | [optional] -**nodes** | [**List[Node]**](Node.md) | | [optional] +**local_node** | [**Node**](Node.md) | | +**nodes** | [**List[Node]**](Node.md) | | ## Example diff --git a/docs/Purchase.md b/docs/Purchase.md index b2ab419..d602552 100644 --- a/docs/Purchase.md +++ b/docs/Purchase.md @@ -5,9 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**state** | **str** | Description of the Request's state | [optional] +**state** | **str** | Description of the Request's state | **error** | **str** | If Request failed, then here is presented the error message | [optional] **request** | [**StorageRequest**](StorageRequest.md) | | [optional] +**request_id** | **str** | 32bits identifier encoded in hex-decimal string. | ## Example diff --git a/docs/Reservation.md b/docs/Reservation.md index 408703e..5e6f416 100644 --- a/docs/Reservation.md +++ b/docs/Reservation.md @@ -5,11 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional] -**availability_id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional] -**size** | **int** | Size of the slot in bytes | [optional] -**request_id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional] -**slot_index** | **int** | Slot Index number | [optional] +**id** | **str** | 32bits identifier encoded in hex-decimal string. | +**availability_id** | **str** | 32bits identifier encoded in hex-decimal string. | +**size** | **int** | Size of the slot in bytes | +**request_id** | **str** | 32bits identifier encoded in hex-decimal string. | +**slot_index** | **int** | Slot Index number | +**valid_until** | **int** | Timestamp after which the reservation will no longer be valid. | ## Example diff --git a/docs/SPRRead.md b/docs/SPRRead.md index a9e5478..f1d9843 100644 --- a/docs/SPRRead.md +++ b/docs/SPRRead.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**spr** | **str** | Signed Peer Record (libp2p) | [optional] +**spr** | **str** | Signed Peer Record (libp2p) | ## Example diff --git a/docs/SalesAvailability.md b/docs/SalesAvailability.md index bdec623..119df53 100644 --- a/docs/SalesAvailability.md +++ b/docs/SalesAvailability.md @@ -5,11 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional] -**total_size** | **int** | Total size of availability's storage in bytes | [optional] -**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's slot for the request's duration as decimal string | [optional] -**total_collateral** | **str** | Total collateral (in amount of tokens) that can be used for matching requests | [optional] +**total_size** | **int** | Total size of availability's storage in bytes | +**duration** | **int** | The duration of the request in seconds | +**min_price_per_byte_per_second** | **str** | 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 | +**total_collateral** | **str** | Total collateral (in amount of tokens) that can be used for matching requests | +**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 diff --git a/docs/SalesAvailabilityREAD.md b/docs/SalesAvailabilityREAD.md index cb2f484..95d80e4 100644 --- a/docs/SalesAvailabilityREAD.md +++ b/docs/SalesAvailabilityREAD.md @@ -5,12 +5,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional] -**total_size** | **int** | Total size of availability's storage in bytes | [optional] -**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's slot for the request's duration as decimal string | [optional] -**total_collateral** | **str** | Total collateral (in amount of tokens) that can be used for matching requests | [optional] -**free_size** | **int** | Unused size of availability's storage in bytes | [optional] +**total_size** | **int** | Total size of availability's storage in bytes | +**duration** | **int** | The duration of the request in seconds | +**min_price_per_byte_per_second** | **str** | 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 | +**total_collateral** | **str** | Total collateral (in amount of tokens) that can be used for matching requests | +**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] +**id** | **str** | 32bits identifier encoded in hex-decimal string. | +**free_size** | **int** | Unused size of availability's storage in bytes as decimal string | [optional] [readonly] +**total_remaining_collateral** | **str** | Total collateral effective (in amount of tokens) that can be used for matching requests | [readonly] ## Example diff --git a/docs/Slot.md b/docs/Slot.md index 943204e..9032853 100644 --- a/docs/Slot.md +++ b/docs/Slot.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | Keccak hash of the abi encoded tuple (RequestId, slot index) | [optional] -**request** | [**StorageRequest**](StorageRequest.md) | | [optional] -**slot_index** | **int** | Slot Index number | [optional] +**id** | **str** | Keccak hash of the abi encoded tuple (RequestId, slot index) | +**request** | [**StorageRequest**](StorageRequest.md) | | +**slot_index** | **int** | Slot Index number | ## Example diff --git a/docs/SlotAgent.md b/docs/SlotAgent.md index 3039547..374bd4c 100644 --- a/docs/SlotAgent.md +++ b/docs/SlotAgent.md @@ -5,12 +5,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | Keccak hash of the abi encoded tuple (RequestId, slot index) | [optional] -**slot_index** | **int** | Slot Index number | [optional] -**request_id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional] +**slot_index** | **int** | Slot Index number | +**request_id** | **str** | 32bits identifier encoded in hex-decimal string. | **request** | [**StorageRequest**](StorageRequest.md) | | [optional] **reservation** | [**Reservation**](Reservation.md) | | [optional] -**state** | **str** | Description of the slot's | [optional] +**state** | **str** | Description of the slot's | ## Example diff --git a/docs/Space.md b/docs/Space.md index 447b7fd..b1258e4 100644 --- a/docs/Space.md +++ b/docs/Space.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**total_blocks** | **int** | Number of blocks stored by the node | [optional] -**quota_max_bytes** | **int** | Maximum storage space (in bytes) available for the node in Codex's local repository. | [optional] -**quota_used_bytes** | **int** | Amount of storage space (in bytes) currently used for storing files in Codex's local repository. | [optional] -**quota_reserved_bytes** | **int** | 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. | [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's local repository. | +**quota_used_bytes** | **int** | Amount of storage space (in bytes) currently used for storing files in Codex's local repository. | +**quota_reserved_bytes** | **int** | 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. | ## Example diff --git a/docs/StorageAsk.md b/docs/StorageAsk.md index fb92efb..4c89c35 100644 --- a/docs/StorageAsk.md +++ b/docs/StorageAsk.md @@ -5,12 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**slots** | **int** | Number of slots (eq. hosts) that the Request want to have the content spread over | [optional] -**slot_size** | **int** | Amount of storage per slot (in bytes) as decimal string | [optional] -**duration** | **int** | The duration of the request in seconds | [optional] -**proof_probability** | **str** | How often storage proofs are required as decimal string | [optional] +**slots** | **int** | Number of slots (eq. hosts) that the Request want to have the content spread over | +**slot_size** | **int** | Amount of storage per slot in bytes | +**duration** | **int** | The duration of the request in seconds | +**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 | -**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 diff --git a/docs/StorageRequest.md b/docs/StorageRequest.md index c105254..5f36afa 100644 --- a/docs/StorageRequest.md +++ b/docs/StorageRequest.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | Request ID | [optional] -**client** | **str** | Address of Ethereum address | [optional] -**ask** | [**StorageAsk**](StorageAsk.md) | | [optional] -**content** | [**Content**](Content.md) | | [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. | [optional] -**nonce** | **str** | Random data | [optional] +**id** | **str** | Request ID | +**client** | **str** | Address of Ethereum address | +**ask** | [**StorageAsk**](StorageAsk.md) | | +**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. | +**nonce** | **str** | Random data | ## Example