Skip to content

Commit 9dd754e

Browse files
Generated API update (#3)
Co-authored-by: AuHau <[email protected]>
1 parent cb896ee commit 9dd754e

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

codex.yaml

+6-1
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,12 @@ components:
263263
description: Minimal number of nodes the content should be stored on
264264
type: integer
265265
default: 3
266+
minimum: 3
266267
tolerance:
267268
description: Additional number of nodes on top of the `nodes` property that can be lost before pronouncing the content lost
268269
type: integer
269270
default: 1
271+
minimum: 1
270272
collateralPerByte:
271273
type: string
272274
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:
282284
slots:
283285
description: Number of slots (eq. hosts) that the Request want to have the content spread over
284286
type: integer
287+
format: int64
285288
slotSize:
286-
type: string
289+
type: integer
290+
format: int64
287291
description: Amount of storage per slot (in bytes) as decimal string
288292
duration:
289293
$ref: "#/components/schemas/Duration"
@@ -293,6 +297,7 @@ components:
293297
$ref: "#/components/schemas/PricePerBytePerSecond"
294298
maxSlotLoss:
295299
type: integer
300+
format: int64
296301
description: Max slots that can be lost without data considered to be lost
297302

298303
StorageRequest:

codex_api_client/models/storage_ask.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class StorageAsk(BaseModel):
2727
StorageAsk
2828
""" # noqa: E501
2929
slots: Optional[StrictInt] = Field(default=None, description="Number of slots (eq. hosts) that the Request want to have the content spread over")
30-
slot_size: Optional[StrictStr] = Field(default=None, description="Amount of storage per slot (in bytes) as decimal string", alias="slotSize")
30+
slot_size: Optional[StrictInt] = Field(default=None, description="Amount of storage per slot (in bytes) as decimal string", alias="slotSize")
3131
duration: Optional[StrictInt] = Field(default=None, description="The duration of the request in seconds")
3232
proof_probability: Optional[StrictStr] = Field(default=None, description="How often storage proofs are required as decimal string", alias="proofProbability")
3333
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")

codex_api_client/models/storage_request_creation.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
2121
from typing import Any, ClassVar, Dict, List, Optional
22+
from typing_extensions import Annotated
2223
from typing import Optional, Set
2324
from typing_extensions import Self
2425

@@ -29,8 +30,8 @@ class StorageRequestCreation(BaseModel):
2930
duration: StrictInt = Field(description="The duration of the request in seconds")
3031
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")
3132
proof_probability: StrictStr = Field(description="How often storage proofs are required as decimal string", alias="proofProbability")
32-
nodes: Optional[StrictInt] = Field(default=3, description="Minimal number of nodes the content should be stored on")
33-
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")
33+
nodes: Optional[Annotated[int, Field(strict=True, ge=3)]] = Field(default=3, description="Minimal number of nodes the content should be stored on")
34+
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")
3435
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")
3536
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.")
3637
__properties: ClassVar[List[str]] = ["duration", "pricePerBytePerSecond", "proofProbability", "nodes", "tolerance", "collateralPerByte", "expiry"]

docs/StorageAsk.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**slots** | **int** | Number of slots (eq. hosts) that the Request want to have the content spread over | [optional]
9-
**slot_size** | **str** | Amount of storage per slot (in bytes) as decimal string | [optional]
9+
**slot_size** | **int** | Amount of storage per slot (in bytes) as decimal string | [optional]
1010
**duration** | **int** | The duration of the request in seconds | [optional]
1111
**proof_probability** | **str** | How often storage proofs are required as decimal string | [optional]
1212
**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 |

0 commit comments

Comments
 (0)