From a524ccf5ffe6fd62024d0caa8b472140cba0a081 Mon Sep 17 00:00:00 2001 From: AuHau <6072250+AuHau@users.noreply.github.com> Date: Mon, 31 Mar 2025 16:47:37 +0000 Subject: [PATCH] Generated API update --- codex.yaml | 7 ++++++- codex_api_client/models/storage_ask.py | 2 +- codex_api_client/models/storage_request_creation.py | 5 +++-- docs/StorageAsk.md | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/codex.yaml b/codex.yaml index 6d2bc36..689e622 100644 --- a/codex.yaml +++ b/codex.yaml @@ -263,10 +263,12 @@ components: description: Minimal number of nodes the content should be stored on type: integer default: 3 + minimum: 3 tolerance: description: Additional number of nodes on top of the `nodes` property that can be lost before pronouncing the content lost type: integer 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 @@ -282,8 +284,10 @@ components: slots: description: Number of slots (eq. hosts) that the Request want to have the content spread over type: integer + format: int64 slotSize: - type: string + type: integer + format: int64 description: Amount of storage per slot (in bytes) as decimal string duration: $ref: "#/components/schemas/Duration" @@ -293,6 +297,7 @@ components: $ref: "#/components/schemas/PricePerBytePerSecond" maxSlotLoss: type: integer + format: int64 description: Max slots that can be lost without data considered to be lost StorageRequest: diff --git a/codex_api_client/models/storage_ask.py b/codex_api_client/models/storage_ask.py index 37d2a94..41624ee 100644 --- a/codex_api_client/models/storage_ask.py +++ b/codex_api_client/models/storage_ask.py @@ -27,7 +27,7 @@ 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[StrictStr] = Field(default=None, description="Amount of storage per slot (in bytes) as decimal string", alias="slotSize") + 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") 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") diff --git a/codex_api_client/models/storage_request_creation.py b/codex_api_client/models/storage_request_creation.py index e583445..21e1b9c 100644 --- a/codex_api_client/models/storage_request_creation.py +++ b/codex_api_client/models/storage_request_creation.py @@ -19,6 +19,7 @@ import json from pydantic import BaseModel, ConfigDict, Field, 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 @@ -29,8 +30,8 @@ class StorageRequestCreation(BaseModel): 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") 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") - 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") + 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[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") 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"] diff --git a/docs/StorageAsk.md b/docs/StorageAsk.md index 6e33fbb..fb92efb 100644 --- a/docs/StorageAsk.md +++ b/docs/StorageAsk.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **slots** | **int** | Number of slots (eq. hosts) that the Request want to have the content spread over | [optional] -**slot_size** | **str** | Amount of storage per slot (in bytes) as decimal string | [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] **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 |