Skip to content

Commit 12674ea

Browse files
committed
Update SDK using contracts version 54617f8d9d4c874ae452ab15a9e46adfc2b5d72d
1 parent d1566bb commit 12674ea

7 files changed

Lines changed: 118 additions & 14 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by the protocol buffer compiler. DO NOT EDIT!
3+
# See https://github.com/eolymp/contracts/tree/main/cmd/protoc-gen-python-esdk for more details.
4+
"""Generated protocol buffer code."""
5+
6+
import urllib.parse
7+
from google.protobuf import symbol_database as _symbol_database
8+
9+
_sym_db = _symbol_database.Default()
10+
11+
12+
class FulfillmentServiceClient:
13+
def __init__(self, transport, url="https://api.eolymp.com"):
14+
self.transport = transport
15+
self.url = url
16+
17+
def AllocateStock(self, request, **kwargs):
18+
path = "/store/orders/"+urllib.parse.quote(request.order_id)+"/allocate"
19+
20+
# Cleanup URL parameters to avoid any ambiguity
21+
request.order_id = ""
22+
23+
return self.transport.request(
24+
method="POST",
25+
url=self.url+path,
26+
request_data=request,
27+
response_symbol=_sym_db.GetSymbol("eolymp.commerce.AllocateStockOutput"),
28+
**kwargs,
29+
)
30+

eolymp/commerce/fulfillment_server_pb2.py

Lines changed: 49 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from eolymp.annotations import http_pb2 as _http_pb2
2+
from eolymp.annotations import ratelimit_pb2 as _ratelimit_pb2
3+
from eolymp.annotations import scope_pb2 as _scope_pb2
4+
from eolymp.commerce import order_pb2 as _order_pb2
5+
from eolymp.wellknown import direction_pb2 as _direction_pb2
6+
from eolymp.wellknown import expression_pb2 as _expression_pb2
7+
from google.protobuf import descriptor as _descriptor
8+
from google.protobuf import message as _message
9+
from typing import ClassVar as _ClassVar, Optional as _Optional
10+
11+
DESCRIPTOR: _descriptor.FileDescriptor
12+
13+
class AllocateStockInput(_message.Message):
14+
__slots__ = ("order_id",)
15+
ORDER_ID_FIELD_NUMBER: _ClassVar[int]
16+
order_id: str
17+
def __init__(self, order_id: _Optional[str] = ...) -> None: ...
18+
19+
class AllocateStockOutput(_message.Message):
20+
__slots__ = ()
21+
def __init__(self) -> None: ...

eolymp/commerce/order_pb2.py

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eolymp/commerce/order_pb2.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Order(_message.Message):
2828
CANCELED: Order.Status
2929
SHIPPED: Order.Status
3030
class Item(_message.Message):
31-
__slots__ = ("id", "name", "image_url", "product_id", "variant_id", "quantity_ordered", "quantity_cancelled", "quantity_shipped", "quantity_returned", "unit_amount", "total_amount", "discount_amount")
31+
__slots__ = ("id", "name", "image_url", "product_id", "variant_id", "quantity_ordered", "quantity_cancelled", "quantity_shipped", "quantity_returned", "quantity_allocated", "unit_amount", "total_amount", "discount_amount")
3232
ID_FIELD_NUMBER: _ClassVar[int]
3333
NAME_FIELD_NUMBER: _ClassVar[int]
3434
IMAGE_URL_FIELD_NUMBER: _ClassVar[int]
@@ -38,6 +38,7 @@ class Order(_message.Message):
3838
QUANTITY_CANCELLED_FIELD_NUMBER: _ClassVar[int]
3939
QUANTITY_SHIPPED_FIELD_NUMBER: _ClassVar[int]
4040
QUANTITY_RETURNED_FIELD_NUMBER: _ClassVar[int]
41+
QUANTITY_ALLOCATED_FIELD_NUMBER: _ClassVar[int]
4142
UNIT_AMOUNT_FIELD_NUMBER: _ClassVar[int]
4243
TOTAL_AMOUNT_FIELD_NUMBER: _ClassVar[int]
4344
DISCOUNT_AMOUNT_FIELD_NUMBER: _ClassVar[int]
@@ -50,10 +51,11 @@ class Order(_message.Message):
5051
quantity_cancelled: int
5152
quantity_shipped: int
5253
quantity_returned: int
54+
quantity_allocated: int
5355
unit_amount: int
5456
total_amount: int
5557
discount_amount: int
56-
def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., image_url: _Optional[str] = ..., product_id: _Optional[str] = ..., variant_id: _Optional[str] = ..., quantity_ordered: _Optional[int] = ..., quantity_cancelled: _Optional[int] = ..., quantity_shipped: _Optional[int] = ..., quantity_returned: _Optional[int] = ..., unit_amount: _Optional[int] = ..., total_amount: _Optional[int] = ..., discount_amount: _Optional[int] = ...) -> None: ...
58+
def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., image_url: _Optional[str] = ..., product_id: _Optional[str] = ..., variant_id: _Optional[str] = ..., quantity_ordered: _Optional[int] = ..., quantity_cancelled: _Optional[int] = ..., quantity_shipped: _Optional[int] = ..., quantity_returned: _Optional[int] = ..., quantity_allocated: _Optional[int] = ..., unit_amount: _Optional[int] = ..., total_amount: _Optional[int] = ..., discount_amount: _Optional[int] = ...) -> None: ...
5759
ID_FIELD_NUMBER: _ClassVar[int]
5860
REFERENCE_FIELD_NUMBER: _ClassVar[int]
5961
STATUS_FIELD_NUMBER: _ClassVar[int]

eolymp/commerce/product_pb2.py

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eolymp/commerce/product_pb2.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Product(_message.Message):
6666
label: str
6767
def __init__(self, key: _Optional[str] = ..., label: _Optional[str] = ...) -> None: ...
6868
class Variant(_message.Message):
69-
__slots__ = ("id", "name", "values", "images", "out_of_stock", "available_quantity")
69+
__slots__ = ("id", "name", "values", "images", "out_of_stock", "max_quantity", "available_quantity")
7070
class ValuesEntry(_message.Message):
7171
__slots__ = ("key", "value")
7272
KEY_FIELD_NUMBER: _ClassVar[int]
@@ -79,14 +79,16 @@ class Product(_message.Message):
7979
VALUES_FIELD_NUMBER: _ClassVar[int]
8080
IMAGES_FIELD_NUMBER: _ClassVar[int]
8181
OUT_OF_STOCK_FIELD_NUMBER: _ClassVar[int]
82+
MAX_QUANTITY_FIELD_NUMBER: _ClassVar[int]
8283
AVAILABLE_QUANTITY_FIELD_NUMBER: _ClassVar[int]
8384
id: str
8485
name: str
8586
values: _containers.ScalarMap[str, str]
8687
images: _containers.RepeatedScalarFieldContainer[str]
8788
out_of_stock: bool
89+
max_quantity: int
8890
available_quantity: int
89-
def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., values: _Optional[_Mapping[str, str]] = ..., images: _Optional[_Iterable[str]] = ..., out_of_stock: bool = ..., available_quantity: _Optional[int] = ...) -> None: ...
91+
def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., values: _Optional[_Mapping[str, str]] = ..., images: _Optional[_Iterable[str]] = ..., out_of_stock: bool = ..., max_quantity: _Optional[int] = ..., available_quantity: _Optional[int] = ...) -> None: ...
9092
ID_FIELD_NUMBER: _ClassVar[int]
9193
NAME_FIELD_NUMBER: _ClassVar[int]
9294
SUMMARY_FIELD_NUMBER: _ClassVar[int]

0 commit comments

Comments
 (0)