Skip to content

Commit cff4edc

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

19 files changed

+72
-67
lines changed

codex.yaml

+28-23
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ components:
2727
maxLength: 66
2828
example: 0x...
2929

30-
BigInt:
31-
type: string
32-
description: Integer represented as decimal string
33-
3430
Cid:
3531
type: string
3632
description: Content Identifier as specified at https://github.com/multiformats/cid
@@ -55,17 +51,18 @@ components:
5551
description: The amount of tokens paid per byte per second per slot to hosts the client is willing to pay
5652

5753
Duration:
58-
type: string
59-
description: The duration of the request in seconds as decimal string
54+
type: integer
55+
format: int64
56+
description: The duration of the request in seconds
6057

6158
ProofProbability:
6259
type: string
6360
description: How often storage proofs are required as decimal string
6461

6562
Expiry:
66-
type: string
63+
type: integer
64+
format: int64
6765
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.
68-
default: 10 minutes
6966

7067
SPR:
7168
type: string
@@ -153,8 +150,9 @@ components:
153150
id:
154151
$ref: "#/components/schemas/Id"
155152
totalSize:
156-
type: string
157-
description: Total size of availability's storage in bytes as decimal string
153+
type: integer
154+
format: int64
155+
description: Total size of availability's storage in bytes
158156
duration:
159157
$ref: "#/components/schemas/Duration"
160158
minPricePerBytePerSecond:
@@ -170,8 +168,9 @@ components:
170168
- type: object
171169
properties:
172170
freeSize:
173-
type: string
174-
description: Unused size of availability's storage in bytes as decimal string
171+
type: integer
172+
format: int64
173+
description: Unused size of availability's storage in bytes
175174

176175
SalesAvailabilityCREATE:
177176
allOf:
@@ -190,17 +189,19 @@ components:
190189
request:
191190
$ref: "#/components/schemas/StorageRequest"
192191
slotIndex:
193-
type: string
194-
description: Slot Index as decimal string
192+
type: integer
193+
format: int64
194+
description: Slot Index number
195195

196196
SlotAgent:
197197
type: object
198198
properties:
199199
id:
200200
$ref: "#/components/schemas/SlotId"
201201
slotIndex:
202-
type: string
203-
description: Slot Index as decimal string
202+
type: integer
203+
format: int64
204+
description: Slot Index number
204205
requestId:
205206
$ref: "#/components/schemas/Id"
206207
request:
@@ -233,12 +234,15 @@ components:
233234
availabilityId:
234235
$ref: "#/components/schemas/Id"
235236
size:
236-
$ref: "#/components/schemas/BigInt"
237+
type: integer
238+
format: int64
239+
description: Size of the slot in bytes
237240
requestId:
238241
$ref: "#/components/schemas/Id"
239242
slotIndex:
240-
type: string
241-
description: Slot Index as decimal string
243+
type: integer
244+
format: int64
245+
description: Slot Index number
242246

243247
StorageRequestCreation:
244248
type: object
@@ -258,17 +262,18 @@ components:
258262
nodes:
259263
description: Minimal number of nodes the content should be stored on
260264
type: integer
261-
default: 1
265+
default: 3
262266
tolerance:
263267
description: Additional number of nodes on top of the `nodes` property that can be lost before pronouncing the content lost
264268
type: integer
265-
default: 0
269+
default: 1
266270
collateralPerByte:
267271
type: string
268272
description: Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots
269273
expiry:
270-
type: string
271-
description: Number as decimal string 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.
274+
type: integer
275+
format: int64
276+
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.
272277
StorageAsk:
273278
type: object
274279
required:

codex_api_client/models/reservation.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import re # noqa: F401
1818
import json
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictInt
2121
from typing import Any, ClassVar, Dict, List, Optional
2222
from typing_extensions import Annotated
2323
from typing import Optional, Set
@@ -29,9 +29,9 @@ class Reservation(BaseModel):
2929
""" # noqa: E501
3030
id: Optional[Annotated[str, Field(min_length=66, strict=True, max_length=66)]] = Field(default=None, description="32bits identifier encoded in hex-decimal string.")
3131
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")
32-
size: Optional[StrictStr] = Field(default=None, description="Integer represented as decimal string")
32+
size: Optional[StrictInt] = Field(default=None, description="Size of the slot in bytes")
3333
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")
34-
slot_index: Optional[StrictStr] = Field(default=None, description="Slot Index as decimal string", alias="slotIndex")
34+
slot_index: Optional[StrictInt] = Field(default=None, description="Slot Index number", alias="slotIndex")
3535
__properties: ClassVar[List[str]] = ["id", "availabilityId", "size", "requestId", "slotIndex"]
3636

3737
model_config = ConfigDict(

codex_api_client/models/sales_availability.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import re # noqa: F401
1818
import json
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
2121
from typing import Any, ClassVar, Dict, List, Optional
2222
from typing_extensions import Annotated
2323
from typing import Optional, Set
@@ -28,8 +28,8 @@ class SalesAvailability(BaseModel):
2828
SalesAvailability
2929
""" # noqa: E501
3030
id: Optional[Annotated[str, Field(min_length=66, strict=True, max_length=66)]] = Field(default=None, description="32bits identifier encoded in hex-decimal string.")
31-
total_size: Optional[StrictStr] = Field(default=None, description="Total size of availability's storage in bytes as decimal string", alias="totalSize")
32-
duration: Optional[StrictStr] = Field(default=None, description="The duration of the request in seconds as decimal string")
31+
total_size: Optional[StrictInt] = Field(default=None, description="Total size of availability's storage in bytes", alias="totalSize")
32+
duration: Optional[StrictInt] = Field(default=None, description="The duration of the request in seconds")
3333
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")
3434
total_collateral: Optional[StrictStr] = Field(default=None, description="Total collateral (in amount of tokens) that can be used for matching requests", alias="totalCollateral")
3535
__properties: ClassVar[List[str]] = ["id", "totalSize", "duration", "minPricePerBytePerSecond", "totalCollateral"]

codex_api_client/models/sales_availability_create.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import re # noqa: F401
1818
import json
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
2121
from typing import Any, ClassVar, Dict, List, Optional
2222
from typing_extensions import Annotated
2323
from typing import Optional, Set
@@ -28,8 +28,8 @@ class SalesAvailabilityCREATE(BaseModel):
2828
SalesAvailabilityCREATE
2929
""" # noqa: E501
3030
id: Optional[Annotated[str, Field(min_length=66, strict=True, max_length=66)]] = Field(default=None, description="32bits identifier encoded in hex-decimal string.")
31-
total_size: StrictStr = Field(description="Total size of availability's storage in bytes as decimal string", alias="totalSize")
32-
duration: StrictStr = Field(description="The duration of the request in seconds as decimal string")
31+
total_size: StrictInt = Field(description="Total size of availability's storage in bytes", alias="totalSize")
32+
duration: StrictInt = Field(description="The duration of the request in seconds")
3333
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")
3434
total_collateral: StrictStr = Field(description="Total collateral (in amount of tokens) that can be used for matching requests", alias="totalCollateral")
3535
__properties: ClassVar[List[str]] = ["id", "totalSize", "duration", "minPricePerBytePerSecond", "totalCollateral"]

codex_api_client/models/sales_availability_read.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import re # noqa: F401
1818
import json
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
2121
from typing import Any, ClassVar, Dict, List, Optional
2222
from typing_extensions import Annotated
2323
from typing import Optional, Set
@@ -28,11 +28,11 @@ class SalesAvailabilityREAD(BaseModel):
2828
SalesAvailabilityREAD
2929
""" # noqa: E501
3030
id: Optional[Annotated[str, Field(min_length=66, strict=True, max_length=66)]] = Field(default=None, description="32bits identifier encoded in hex-decimal string.")
31-
total_size: Optional[StrictStr] = Field(default=None, description="Total size of availability's storage in bytes as decimal string", alias="totalSize")
32-
duration: Optional[StrictStr] = Field(default=None, description="The duration of the request in seconds as decimal string")
31+
total_size: Optional[StrictInt] = Field(default=None, description="Total size of availability's storage in bytes", alias="totalSize")
32+
duration: Optional[StrictInt] = Field(default=None, description="The duration of the request in seconds")
3333
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")
3434
total_collateral: Optional[StrictStr] = Field(default=None, description="Total collateral (in amount of tokens) that can be used for matching requests", alias="totalCollateral")
35-
free_size: Optional[StrictStr] = Field(default=None, description="Unused size of availability's storage in bytes as decimal string", alias="freeSize")
35+
free_size: Optional[StrictInt] = Field(default=None, description="Unused size of availability's storage in bytes", alias="freeSize")
3636
__properties: ClassVar[List[str]] = ["id", "totalSize", "duration", "minPricePerBytePerSecond", "totalCollateral", "freeSize"]
3737

3838
model_config = ConfigDict(

codex_api_client/models/slot.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import re # noqa: F401
1818
import json
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
2121
from typing import Any, ClassVar, Dict, List, Optional
2222
from codex_api_client.models.storage_request import StorageRequest
2323
from typing import Optional, Set
@@ -29,7 +29,7 @@ class Slot(BaseModel):
2929
""" # noqa: E501
3030
id: Optional[StrictStr] = Field(default=None, description="Keccak hash of the abi encoded tuple (RequestId, slot index)")
3131
request: Optional[StorageRequest] = None
32-
slot_index: Optional[StrictStr] = Field(default=None, description="Slot Index as decimal string", alias="slotIndex")
32+
slot_index: Optional[StrictInt] = Field(default=None, description="Slot Index number", alias="slotIndex")
3333
__properties: ClassVar[List[str]] = ["id", "request", "slotIndex"]
3434

3535
model_config = ConfigDict(

codex_api_client/models/slot_agent.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import re # noqa: F401
1818
import json
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
20+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
2121
from typing import Any, ClassVar, Dict, List, Optional
2222
from typing_extensions import Annotated
2323
from codex_api_client.models.reservation import Reservation
@@ -30,7 +30,7 @@ class SlotAgent(BaseModel):
3030
SlotAgent
3131
""" # noqa: E501
3232
id: Optional[StrictStr] = Field(default=None, description="Keccak hash of the abi encoded tuple (RequestId, slot index)")
33-
slot_index: Optional[StrictStr] = Field(default=None, description="Slot Index as decimal string", alias="slotIndex")
33+
slot_index: Optional[StrictInt] = Field(default=None, description="Slot Index number", alias="slotIndex")
3434
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")
3535
request: Optional[StorageRequest] = None
3636
reservation: Optional[Reservation] = None

codex_api_client/models/storage_ask.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class StorageAsk(BaseModel):
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")
3030
slot_size: Optional[StrictStr] = Field(default=None, description="Amount of storage per slot (in bytes) as decimal string", alias="slotSize")
31-
duration: Optional[StrictStr] = Field(default=None, description="The duration of the request in seconds as decimal string")
31+
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")
3434
max_slot_loss: Optional[StrictInt] = Field(default=None, description="Max slots that can be lost without data considered to be lost", alias="maxSlotLoss")

codex_api_client/models/storage_request.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import re # noqa: F401
1818
import json
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
2121
from typing import Any, ClassVar, Dict, List, Optional
2222
from codex_api_client.models.content import Content
2323
from codex_api_client.models.storage_ask import StorageAsk
@@ -32,7 +32,7 @@ class StorageRequest(BaseModel):
3232
client: Optional[StrictStr] = Field(default=None, description="Address of Ethereum address")
3333
ask: Optional[StorageAsk] = None
3434
content: Optional[Content] = None
35-
expiry: Optional[StrictStr] = Field(default='10 minutes', 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.")
35+
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.")
3636
nonce: Optional[StrictStr] = Field(default=None, description="Random data")
3737
__properties: ClassVar[List[str]] = ["id", "client", "ask", "content", "expiry", "nonce"]
3838

@@ -97,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
9797
"client": obj.get("client"),
9898
"ask": StorageAsk.from_dict(obj["ask"]) if obj.get("ask") is not None else None,
9999
"content": Content.from_dict(obj["content"]) if obj.get("content") is not None else None,
100-
"expiry": obj.get("expiry") if obj.get("expiry") is not None else '10 minutes',
100+
"expiry": obj.get("expiry"),
101101
"nonce": obj.get("nonce")
102102
})
103103
return _obj

codex_api_client/models/storage_request_creation.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ class StorageRequestCreation(BaseModel):
2626
"""
2727
StorageRequestCreation
2828
""" # noqa: E501
29-
duration: StrictStr = Field(description="The duration of the request in seconds as decimal string")
29+
duration: StrictInt = Field(description="The duration of the request in seconds")
3030
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")
3131
proof_probability: StrictStr = Field(description="How often storage proofs are required as decimal string", alias="proofProbability")
32-
nodes: Optional[StrictInt] = Field(default=1, description="Minimal number of nodes the content should be stored on")
33-
tolerance: Optional[StrictInt] = Field(default=0, description="Additional number of nodes on top of the `nodes` property that can be lost before pronouncing the content lost")
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")
3434
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")
35-
expiry: StrictStr = Field(description="Number as decimal string 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.")
35+
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.")
3636
__properties: ClassVar[List[str]] = ["duration", "pricePerBytePerSecond", "proofProbability", "nodes", "tolerance", "collateralPerByte", "expiry"]
3737

3838
model_config = ConfigDict(
@@ -89,8 +89,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
8989
"duration": obj.get("duration"),
9090
"pricePerBytePerSecond": obj.get("pricePerBytePerSecond"),
9191
"proofProbability": obj.get("proofProbability"),
92-
"nodes": obj.get("nodes") if obj.get("nodes") is not None else 1,
93-
"tolerance": obj.get("tolerance") if obj.get("tolerance") is not None else 0,
92+
"nodes": obj.get("nodes") if obj.get("nodes") is not None else 3,
93+
"tolerance": obj.get("tolerance") if obj.get("tolerance") is not None else 1,
9494
"collateralPerByte": obj.get("collateralPerByte"),
9595
"expiry": obj.get("expiry")
9696
})

docs/Reservation.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional]
99
**availability_id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional]
10-
**size** | **str** | Integer represented as decimal string | [optional]
10+
**size** | **int** | Size of the slot in bytes | [optional]
1111
**request_id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional]
12-
**slot_index** | **str** | Slot Index as decimal string | [optional]
12+
**slot_index** | **int** | Slot Index number | [optional]
1313

1414
## Example
1515

0 commit comments

Comments
 (0)