Skip to content

Commit 9347d29

Browse files
Automated update by SDK Generator version:1.2.0 commit:2aee95e
1 parent 14c9ea1 commit 9347d29

File tree

8 files changed

+331
-1
lines changed

8 files changed

+331
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,6 +1431,7 @@ _WebhookApi_ | [**webhooks_update**](docs/apis/WebhookApi.md#webhooks_update) |
14311431
- [OrderRefunds](docs/models/OrderRefunds.md)
14321432
- [OrderTenders](docs/models/OrderTenders.md)
14331433
- [OrderType](docs/models/OrderType.md)
1434+
- [OrdersSort](docs/models/OrdersSort.md)
14341435
- [Owner](docs/models/Owner.md)
14351436
- [PaginationCoverage](docs/models/PaginationCoverage.md)
14361437
- [PassThroughQuery](docs/models/PassThroughQuery.md)

docs/apis/EcommerceApi.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ import apideck
251251
from apideck.api import ecommerce_api
252252
from apideck.model.pass_through_query import PassThroughQuery
253253
from apideck.model.ecommerce_orders_filter import EcommerceOrdersFilter
254+
from apideck.model.orders_sort import OrdersSort
254255
from apideck.model.bad_request_response import BadRequestResponse
255256
from apideck.model.get_ecommerce_orders_response import GetEcommerceOrdersResponse
256257
from apideck.model.payment_required_response import PaymentRequiredResponse
@@ -290,14 +291,18 @@ with apideck.ApiClient(configuration) as api_client:
290291
email="elon@musk.com",
291292
customer_id="123",
292293
) # EcommerceOrdersFilter | Apply filters (optional)
294+
sort = OrdersSort(
295+
by="created_at",
296+
direction=SortDirection("asc"),
297+
) # OrdersSort | Apply sorting (optional)
293298
pass_through = PassThroughQuery() # PassThroughQuery | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
294299
fields = "id,updated_at" # str, none_type | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. (optional)
295300

296301
# example passing only required values which don't have defaults set
297302
# and optional values
298303
try:
299304
# List Orders
300-
api_response = api_instance.orders_all(raw=raw, consumer_id=consumer_id, app_id=app_id, service_id=service_id, cursor=cursor, limit=limit, filter=filter, pass_through=pass_through, fields=fields)
305+
api_response = api_instance.orders_all(raw=raw, consumer_id=consumer_id, app_id=app_id, service_id=service_id, cursor=cursor, limit=limit, filter=filter, sort=sort, pass_through=pass_through, fields=fields)
301306
pprint(api_response)
302307
except apideck.ApiException as e:
303308
print("Exception when calling EcommerceApi->orders_all: %s\n" % e)
@@ -315,6 +320,7 @@ Name | Type | Description | Notes
315320
**cursor** | **str, none_type**| Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | [optional]
316321
**limit** | **int**| Number of results to return. Minimum 1, Maximum 200, Default 20 | [optional] if omitted the server will use the default value of 20
317322
**filter** | **EcommerceOrdersFilter**| Apply filters | [optional]
323+
**sort** | **OrdersSort**| Apply sorting | [optional]
318324
**pass_through** | **PassThroughQuery**| Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]&#x3D;leads becomes ?search&#x3D;leads | [optional]
319325
**fields** | **str, none_type**| The &#39;fields&#39; parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. &lt;br /&gt;&lt;br /&gt;Example: &#x60;fields&#x3D;name,email,addresses.city&#x60;&lt;br /&gt;&lt;br /&gt;In the example above, the response will only include the fields \&quot;name\&quot;, \&quot;email\&quot; and \&quot;addresses.city\&quot;. If any other fields are available, they will be excluded. | [optional]
320326

docs/models/OrdersSort.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# OrdersSort
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**by** | **str** | The field on which to sort the Orders | [optional]
8+
**direction** | [**SortDirection**](SortDirection.md) | | [optional]
9+
10+
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
11+
12+

src/.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ apideck/model/order_pickup_details_recipient.py
527527
apideck/model/order_refunds.py
528528
apideck/model/order_tenders.py
529529
apideck/model/order_type.py
530+
apideck/model/orders_sort.py
530531
apideck/model/owner.py
531532
apideck/model/pagination_coverage.py
532533
apideck/model/pass_through_query.py
@@ -1198,6 +1199,7 @@ docs/OrderPickupDetailsRecipient.md
11981199
docs/OrderRefunds.md
11991200
docs/OrderTenders.md
12001201
docs/OrderType.md
1202+
docs/OrdersSort.md
12011203
docs/Owner.md
12021204
docs/PaginationCoverage.md
12031205
docs/PassThroughQuery.md
@@ -1876,6 +1878,7 @@ test/test_order_pickup_details_recipient.py
18761878
test/test_order_refunds.py
18771879
test/test_order_tenders.py
18781880
test/test_order_type.py
1881+
test/test_orders_sort.py
18791882
test/test_owner.py
18801883
test/test_pagination_coverage.py
18811884
test/test_pass_through_query.py

src/apideck/api/ecommerce_api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from apideck.model.get_products_response import GetProductsResponse
3333
from apideck.model.get_store_response import GetStoreResponse
3434
from apideck.model.not_found_response import NotFoundResponse
35+
from apideck.model.orders_sort import OrdersSort
3536
from apideck.model.pass_through_query import PassThroughQuery
3637
from apideck.model.payment_required_response import PaymentRequiredResponse
3738
from apideck.model.unauthorized_response import UnauthorizedResponse
@@ -244,6 +245,7 @@ def __init__(self, api_client=None):
244245
'cursor',
245246
'limit',
246247
'filter',
248+
'sort',
247249
'pass_through',
248250
'fields',
249251
],
@@ -283,6 +285,8 @@ def __init__(self, api_client=None):
283285
(int,),
284286
'filter':
285287
(EcommerceOrdersFilter,),
288+
'sort':
289+
(OrdersSort,),
286290
'pass_through':
287291
(PassThroughQuery,),
288292
'fields':
@@ -296,6 +300,7 @@ def __init__(self, api_client=None):
296300
'cursor': 'cursor',
297301
'limit': 'limit',
298302
'filter': 'filter',
303+
'sort': 'sort',
299304
'pass_through': 'pass_through',
300305
'fields': 'fields',
301306
},
@@ -307,6 +312,7 @@ def __init__(self, api_client=None):
307312
'cursor': 'query',
308313
'limit': 'query',
309314
'filter': 'query',
315+
'sort': 'query',
310316
'pass_through': 'query',
311317
'fields': 'query',
312318
},
@@ -825,6 +831,7 @@ def orders_all(
825831
cursor (str, none_type): Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response.. [optional]
826832
limit (int): Number of results to return. Minimum 1, Maximum 200, Default 20. [optional] if omitted the server will use the default value of 20
827833
filter (EcommerceOrdersFilter): Apply filters. [optional]
834+
sort (OrdersSort): Apply sorting. [optional]
828835
pass_through (PassThroughQuery): Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads. [optional]
829836
fields (str, none_type): The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded.. [optional]
830837
_return_http_data_only (bool): response data without head status

src/apideck/model/orders_sort.py

Lines changed: 263 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
1+
"""
2+
Apideck
3+
4+
The Apideck OpenAPI Spec: SDK Optimized # noqa: E501
5+
6+
The version of the OpenAPI document: 10.4.0
7+
Generated by: https://openapi-generator.tech
8+
"""
9+
10+
11+
import re # noqa: F401
12+
import sys # noqa: F401
13+
14+
from apideck.model_utils import ( # noqa: F401
15+
ApiTypeError,
16+
ModelComposed,
17+
ModelNormal,
18+
ModelSimple,
19+
cached_property,
20+
change_keys_js_to_python,
21+
convert_js_args_to_python_args,
22+
date,
23+
datetime,
24+
file_type,
25+
none_type,
26+
validate_get_composed_info,
27+
OpenApiModel
28+
)
29+
from apideck.exceptions import ApiAttributeError
30+
31+
32+
def lazy_import():
33+
from apideck.model.sort_direction import SortDirection
34+
globals()['SortDirection'] = SortDirection
35+
36+
37+
class OrdersSort(ModelNormal):
38+
"""NOTE: This class is auto generated by OpenAPI Generator.
39+
Ref: https://openapi-generator.tech
40+
41+
Do not edit the class manually.
42+
43+
Attributes:
44+
allowed_values (dict): The key is the tuple path to the attribute
45+
and the for var_name this is (var_name,). The value is a dict
46+
with a capitalized key describing the allowed value and an allowed
47+
value. These dicts store the allowed enum values.
48+
attribute_map (dict): The key is attribute name
49+
and the value is json key in definition.
50+
discriminator_value_class_map (dict): A dict to go from the discriminator
51+
variable value to the discriminator class name.
52+
validations (dict): The key is the tuple path to the attribute
53+
and the for var_name this is (var_name,). The value is a dict
54+
that stores validations for max_length, min_length, max_items,
55+
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
56+
inclusive_minimum, and regex.
57+
additional_properties_type (tuple): A tuple of classes accepted
58+
as additional properties values.
59+
"""
60+
61+
allowed_values = {
62+
('by',): {
63+
'CREATED_AT': "created_at",
64+
'UPDATED_AT': "updated_at",
65+
'NAME': "name",
66+
},
67+
}
68+
69+
validations = {
70+
}
71+
72+
additional_properties_type = None
73+
74+
_nullable = False
75+
76+
@cached_property
77+
def openapi_types():
78+
"""
79+
This must be a method because a model may have properties that are
80+
of type self, this must run after the class is loaded
81+
82+
Returns
83+
openapi_types (dict): The key is attribute name
84+
and the value is attribute type.
85+
"""
86+
lazy_import()
87+
return {
88+
'by': (str,), # noqa: E501
89+
'direction': (SortDirection,), # noqa: E501
90+
}
91+
92+
@cached_property
93+
def discriminator():
94+
return None
95+
96+
97+
attribute_map = {
98+
'by': 'by', # noqa: E501
99+
'direction': 'direction', # noqa: E501
100+
}
101+
102+
read_only_vars = {
103+
}
104+
105+
_composed_schemas = {}
106+
107+
@classmethod
108+
@convert_js_args_to_python_args
109+
def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
110+
"""OrdersSort - a model defined in OpenAPI
111+
112+
Keyword Args:
113+
_check_type (bool): if True, values for parameters in openapi_types
114+
will be type checked and a TypeError will be
115+
raised if the wrong type is input.
116+
Defaults to True
117+
_path_to_item (tuple/list): This is a list of keys or values to
118+
drill down to the model in received_data
119+
when deserializing a response
120+
_spec_property_naming (bool): True if the variable names in the input data
121+
are serialized names, as specified in the OpenAPI document.
122+
False if the variable names in the input data
123+
are pythonic names, e.g. snake case (default)
124+
_configuration (Configuration): the instance to use when
125+
deserializing a file_type parameter.
126+
If passed, type conversion is attempted
127+
If omitted no type conversion is done.
128+
_visited_composed_classes (tuple): This stores a tuple of
129+
classes that we have traveled through so that
130+
if we see that class again we will not use its
131+
discriminator again.
132+
When traveling through a discriminator, the
133+
composed schema that is
134+
is traveled through is added to this set.
135+
For example if Animal has a discriminator
136+
petType and we pass in "Dog", and the class Dog
137+
allOf includes Animal, we move through Animal
138+
once using the discriminator, and pick Dog.
139+
Then in Dog, we will make an instance of the
140+
Animal class but this time we won't travel
141+
through its discriminator because we passed in
142+
_visited_composed_classes = (Animal,)
143+
by (str): The field on which to sort the Orders. [optional] # noqa: E501
144+
direction (SortDirection): [optional] # noqa: E501
145+
"""
146+
147+
_check_type = kwargs.pop('_check_type', True)
148+
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
149+
_path_to_item = kwargs.pop('_path_to_item', ())
150+
_configuration = kwargs.pop('_configuration', None)
151+
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
152+
153+
self = super(OpenApiModel, cls).__new__(cls)
154+
155+
if args:
156+
raise ApiTypeError(
157+
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
158+
args,
159+
self.__class__.__name__,
160+
),
161+
path_to_item=_path_to_item,
162+
valid_classes=(self.__class__,),
163+
)
164+
165+
self._data_store = {}
166+
self._check_type = _check_type
167+
self._spec_property_naming = _spec_property_naming
168+
self._path_to_item = _path_to_item
169+
self._configuration = _configuration
170+
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
171+
172+
for var_name, var_value in kwargs.items():
173+
if var_name not in self.attribute_map and \
174+
self._configuration is not None and \
175+
self._configuration.discard_unknown_keys and \
176+
self.additional_properties_type is None:
177+
# discard variable.
178+
continue
179+
setattr(self, var_name, var_value)
180+
return self
181+
182+
required_properties = set([
183+
'_data_store',
184+
'_check_type',
185+
'_spec_property_naming',
186+
'_path_to_item',
187+
'_configuration',
188+
'_visited_composed_classes',
189+
])
190+
191+
@convert_js_args_to_python_args
192+
def __init__(self, *args, **kwargs): # noqa: E501
193+
"""OrdersSort - a model defined in OpenAPI
194+
195+
Keyword Args:
196+
_check_type (bool): if True, values for parameters in openapi_types
197+
will be type checked and a TypeError will be
198+
raised if the wrong type is input.
199+
Defaults to True
200+
_path_to_item (tuple/list): This is a list of keys or values to
201+
drill down to the model in received_data
202+
when deserializing a response
203+
_spec_property_naming (bool): True if the variable names in the input data
204+
are serialized names, as specified in the OpenAPI document.
205+
False if the variable names in the input data
206+
are pythonic names, e.g. snake case (default)
207+
_configuration (Configuration): the instance to use when
208+
deserializing a file_type parameter.
209+
If passed, type conversion is attempted
210+
If omitted no type conversion is done.
211+
_visited_composed_classes (tuple): This stores a tuple of
212+
classes that we have traveled through so that
213+
if we see that class again we will not use its
214+
discriminator again.
215+
When traveling through a discriminator, the
216+
composed schema that is
217+
is traveled through is added to this set.
218+
For example if Animal has a discriminator
219+
petType and we pass in "Dog", and the class Dog
220+
allOf includes Animal, we move through Animal
221+
once using the discriminator, and pick Dog.
222+
Then in Dog, we will make an instance of the
223+
Animal class but this time we won't travel
224+
through its discriminator because we passed in
225+
_visited_composed_classes = (Animal,)
226+
by (str): The field on which to sort the Orders. [optional] # noqa: E501
227+
direction (SortDirection): [optional] # noqa: E501
228+
"""
229+
230+
_check_type = kwargs.pop('_check_type', True)
231+
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
232+
_path_to_item = kwargs.pop('_path_to_item', ())
233+
_configuration = kwargs.pop('_configuration', None)
234+
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
235+
236+
if args:
237+
raise ApiTypeError(
238+
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
239+
args,
240+
self.__class__.__name__,
241+
),
242+
path_to_item=_path_to_item,
243+
valid_classes=(self.__class__,),
244+
)
245+
246+
self._data_store = {}
247+
self._check_type = _check_type
248+
self._spec_property_naming = _spec_property_naming
249+
self._path_to_item = _path_to_item
250+
self._configuration = _configuration
251+
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
252+
253+
for var_name, var_value in kwargs.items():
254+
if var_name not in self.attribute_map and \
255+
self._configuration is not None and \
256+
self._configuration.discard_unknown_keys and \
257+
self.additional_properties_type is None:
258+
# discard variable.
259+
continue
260+
setattr(self, var_name, var_value)
261+
if var_name in self.read_only_vars:
262+
raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
263+
f"class with read only attributes.")

0 commit comments

Comments
 (0)