Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
AuHau committed Aug 25, 2024
1 parent c4562c8 commit 87afa99
Show file tree
Hide file tree
Showing 18 changed files with 324 additions and 49 deletions.
3 changes: 3 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ codex_client/models/sales_availability.py
codex_client/models/sales_availability_create.py
codex_client/models/sales_availability_read.py
codex_client/models/slot.py
codex_client/models/slot_agent.py
codex_client/models/space.py
codex_client/models/spr_read.py
codex_client/models/storage_ask.py
Expand All @@ -54,6 +55,7 @@ docs/SalesAvailability.md
docs/SalesAvailabilityCREATE.md
docs/SalesAvailabilityREAD.md
docs/Slot.md
docs/SlotAgent.md
docs/Space.md
docs/StorageAsk.md
docs/StorageRequest.md
Expand All @@ -65,4 +67,5 @@ setup.cfg
setup.py
test-requirements.txt
test/__init__.py
test/test_slot_agent.py
tox.ini
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Class | Method | HTTP request | Description
- [SalesAvailabilityCREATE](docs/SalesAvailabilityCREATE.md)
- [SalesAvailabilityREAD](docs/SalesAvailabilityREAD.md)
- [Slot](docs/Slot.md)
- [SlotAgent](docs/SlotAgent.md)
- [Space](docs/Space.md)
- [StorageAsk](docs/StorageAsk.md)
- [StorageRequest](docs/StorageRequest.md)
Expand Down
74 changes: 54 additions & 20 deletions codex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ components:
Id:
type: string
description: 32bits identifier encoded in hex-decimal string.
minLength: 66
maxLength: 66
example: 0x...

BigInt:
Expand Down Expand Up @@ -168,7 +170,39 @@ components:
$ref: "#/components/schemas/StorageRequest"
slotIndex:
type: string
description: Slot Index as hexadecimal string
description: Slot Index as decimal string

SlotAgent:
type: object
properties:
id:
$ref: "#/components/schemas/SlotId"
slotIndex:
type: string
description: Slot Index as decimal string
requestId:
$ref: "#/components/schemas/Id"
request:
$ref: "#/components/schemas/StorageRequest"
reservation:
$ref: "#/components/schemas/Reservation"
state:
type: string
description: Description of the slot's
enum:
- SaleCancelled
- SaleDownloading
- SaleErrored
- SaleFailed
- SaleFilled
- SaleFilling
- SaleFinished
- SaleIgnored
- SaleInitialProving
- SalePayout
- SalePreparing
- SaleProving
- SaleUnknown

Reservation:
type: object
Expand All @@ -183,7 +217,7 @@ components:
$ref: "#/components/schemas/Id"
slotIndex:
type: string
description: Slot Index as hexadecimal string
description: Slot Index as decimal string

StorageRequestCreation:
type: object
Expand Down Expand Up @@ -260,14 +294,14 @@ components:
type: string
description: Description of the Request's state
enum:
- cancelled
- error
- failed
- finished
- pending
- started
- submitted
- unknown
- PurchaseCancelled
- PurchaseError
- PurchaseFailed
- PurchaseFinished
- PurchasePending
- PurchaseStarted
- PurchaseSubmitted
- PurchaseUnknown
error:
type: string
description: If Request failed, then here is presented the error message
Expand Down Expand Up @@ -500,7 +534,7 @@ paths:
$ref: "#/components/schemas/Slot"

"503":
description: Sales are unavailable
description: Persistence is not enabled

"/sales/slots/{slotId}":
get:
Expand All @@ -520,7 +554,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/Slot"
$ref: "#/components/schemas/SlotAgent"

"400":
description: Invalid or missing SlotId
Expand All @@ -529,7 +563,7 @@ paths:
description: Host is not in an active sale for the slot

"503":
description: Sales are unavailable
description: Persistence is not enabled

"/sales/availability":
get:
Expand All @@ -548,7 +582,7 @@ paths:
"500":
description: Error getting unused availabilities
"503":
description: Sales are unavailable
description: Persistence is not enabled

post:
summary: "Offers storage for sale"
Expand All @@ -573,7 +607,7 @@ paths:
"500":
description: Error reserving availability
"503":
description: Sales are unavailable
description: Persistence is not enabled
"/sales/availability/{id}":
patch:
summary: "Updates availability"
Expand Down Expand Up @@ -606,7 +640,7 @@ paths:
"500":
description: Error reserving availability
"503":
description: Sales are unavailable
description: Persistence is not enabled

"/sales/availability/{id}/reservations":
get:
Expand Down Expand Up @@ -637,7 +671,7 @@ paths:
"500":
description: Error getting reservations
"503":
description: Sales are unavailable
description: Persistence is not enabled

"/storage/request/{cid}":
post:
Expand Down Expand Up @@ -668,7 +702,7 @@ paths:
"404":
description: Request ID not found
"503":
description: Purchasing is unavailable
description: Persistence is not enabled

"/storage/purchases":
get:
Expand All @@ -685,7 +719,7 @@ paths:
items:
type: string
"503":
description: Purchasing is unavailable
description: Persistence is not enabled

"/storage/purchases/{id}":
get:
Expand All @@ -711,7 +745,7 @@ paths:
"404":
description: Purchase not found
"503":
description: Purchasing is unavailable
description: Persistence is not enabled

"/node/spr":
get:
Expand Down
1 change: 1 addition & 0 deletions codex_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
from codex_client.models.sales_availability_create import SalesAvailabilityCREATE
from codex_client.models.sales_availability_read import SalesAvailabilityREAD
from codex_client.models.slot import Slot
from codex_client.models.slot_agent import SlotAgent
from codex_client.models.space import Space
from codex_client.models.storage_ask import StorageAsk
from codex_client.models.storage_request import StorageRequest
Expand Down
11 changes: 6 additions & 5 deletions codex_client/api/marketplace_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from codex_client.models.sales_availability_create import SalesAvailabilityCREATE
from codex_client.models.sales_availability_read import SalesAvailabilityREAD
from codex_client.models.slot import Slot
from codex_client.models.slot_agent import SlotAgent
from codex_client.models.storage_request_creation import StorageRequestCreation

from codex_client.api_client import ApiClient, RequestSerialized
Expand Down Expand Up @@ -353,7 +354,7 @@ def get_active_slot_by_id(
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> Slot:
) -> SlotAgent:
"""Returns active slot with id {slotId} for the host
Expand Down Expand Up @@ -390,7 +391,7 @@ def get_active_slot_by_id(
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "Slot",
'200': "SlotAgent",
'400': None,
'404': None,
'503': None,
Expand Down Expand Up @@ -422,7 +423,7 @@ def get_active_slot_by_id_with_http_info(
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[Slot]:
) -> ApiResponse[SlotAgent]:
"""Returns active slot with id {slotId} for the host
Expand Down Expand Up @@ -459,7 +460,7 @@ def get_active_slot_by_id_with_http_info(
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "Slot",
'200': "SlotAgent",
'400': None,
'404': None,
'503': None,
Expand Down Expand Up @@ -528,7 +529,7 @@ def get_active_slot_by_id_without_preload_content(
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "Slot",
'200': "SlotAgent",
'400': None,
'404': None,
'503': None,
Expand Down
1 change: 1 addition & 0 deletions codex_client/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from codex_client.models.sales_availability_create import SalesAvailabilityCREATE
from codex_client.models.sales_availability_read import SalesAvailabilityREAD
from codex_client.models.slot import Slot
from codex_client.models.slot_agent import SlotAgent
from codex_client.models.space import Space
from codex_client.models.storage_ask import StorageAsk
from codex_client.models.storage_request import StorageRequest
Expand Down
4 changes: 2 additions & 2 deletions codex_client/models/purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def state_validate_enum(cls, value):
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(['PurchaseCancelled', 'PurchaseError', 'PurchaseFailed', 'PurchaseFinished', 'PurchasePending', 'PurchaseStarted', 'PurchaseSubmitted', 'PurchaseUnknown']):
raise ValueError("must be one of enum values ('PurchaseCancelled', 'PurchaseError', 'PurchaseFailed', 'PurchaseFinished', 'PurchasePending', 'PurchaseStarted', 'PurchaseSubmitted', 'PurchaseUnknown')")
return value

model_config = ConfigDict(
Expand Down
9 changes: 5 additions & 4 deletions codex_client/models/reservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self

class Reservation(BaseModel):
"""
Reservation
""" # noqa: E501
id: Optional[StrictStr] = Field(default=None, description="32bits identifier encoded in hex-decimal string.")
availability_id: Optional[StrictStr] = Field(default=None, description="32bits identifier encoded in hex-decimal string.", alias="availabilityId")
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[StrictStr] = Field(default=None, description="Integer represented as decimal string")
request_id: Optional[StrictStr] = Field(default=None, description="32bits identifier encoded in hex-decimal string.", alias="requestId")
slot_index: Optional[StrictStr] = Field(default=None, description="Slot Index as hexadecimal string", 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: Optional[StrictStr] = Field(default=None, description="Slot Index as decimal string", alias="slotIndex")
__properties: ClassVar[List[str]] = ["id", "availabilityId", "size", "requestId", "slotIndex"]

model_config = ConfigDict(
Expand Down
3 changes: 2 additions & 1 deletion codex_client/models/sales_availability.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self

class SalesAvailability(BaseModel):
"""
SalesAvailability
""" # noqa: E501
id: Optional[StrictStr] = Field(default=None, description="32bits identifier encoded in hex-decimal string.")
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[StrictStr] = Field(default=None, description="Total size of availability's storage in bytes as decimal string", alias="totalSize")
duration: Optional[StrictStr] = Field(default=None, description="The duration of the request in seconds as decimal string")
min_price: Optional[StrictStr] = Field(default=None, description="Minimum price to be paid (in amount of tokens) as decimal string", alias="minPrice")
Expand Down
3 changes: 2 additions & 1 deletion codex_client/models/sales_availability_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self

class SalesAvailabilityCREATE(BaseModel):
"""
SalesAvailabilityCREATE
""" # noqa: E501
id: Optional[StrictStr] = Field(default=None, description="32bits identifier encoded in hex-decimal string.")
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: StrictStr = Field(description="Total size of availability's storage in bytes as decimal string", alias="totalSize")
duration: StrictStr = Field(description="The duration of the request in seconds as decimal string")
min_price: StrictStr = Field(description="Minimum price to be paid (in amount of tokens) as decimal string", alias="minPrice")
Expand Down
3 changes: 2 additions & 1 deletion codex_client/models/sales_availability_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self

class SalesAvailabilityREAD(BaseModel):
"""
SalesAvailabilityREAD
""" # noqa: E501
id: Optional[StrictStr] = Field(default=None, description="32bits identifier encoded in hex-decimal string.")
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[StrictStr] = Field(default=None, description="Total size of availability's storage in bytes as decimal string", alias="totalSize")
duration: Optional[StrictStr] = Field(default=None, description="The duration of the request in seconds as decimal string")
min_price: Optional[StrictStr] = Field(default=None, description="Minimum price to be paid (in amount of tokens) as decimal string", alias="minPrice")
Expand Down
2 changes: 1 addition & 1 deletion codex_client/models/slot.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Slot(BaseModel):
""" # 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[StrictStr] = Field(default=None, description="Slot Index as hexadecimal string", alias="slotIndex")
slot_index: Optional[StrictStr] = Field(default=None, description="Slot Index as decimal string", alias="slotIndex")
__properties: ClassVar[List[str]] = ["id", "request", "slotIndex"]

model_config = ConfigDict(
Expand Down
Loading

0 comments on commit 87afa99

Please sign in to comment.