text stringlengths 0 828 |
|---|
return cls._get_discount_promotion_by_id_with_http_info(discount_promotion_id, **kwargs) |
else: |
(data) = cls._get_discount_promotion_by_id_with_http_info(discount_promotion_id, **kwargs) |
return data" |
3855,"def list_all_discount_promotions(cls, **kwargs): |
""""""List DiscountPromotions |
Return a list of DiscountPromotions |
This method makes a synchronous HTTP request by default. To make an |
asynchronous HTTP request, please pass async=True |
>>> thread = api.list_all_discount_promotions(async=True) |
>>> result = thread.get() |
:param async bool |
:param int page: page number |
:param int size: page size |
:param str sort: page order |
:return: page[DiscountPromotion] |
If the method is called asynchronously, |
returns the request thread. |
"""""" |
kwargs['_return_http_data_only'] = True |
if kwargs.get('async'): |
return cls._list_all_discount_promotions_with_http_info(**kwargs) |
else: |
(data) = cls._list_all_discount_promotions_with_http_info(**kwargs) |
return data" |
3856,"def replace_discount_promotion_by_id(cls, discount_promotion_id, discount_promotion, **kwargs): |
""""""Replace DiscountPromotion |
Replace all attributes of DiscountPromotion |
This method makes a synchronous HTTP request by default. To make an |
asynchronous HTTP request, please pass async=True |
>>> thread = api.replace_discount_promotion_by_id(discount_promotion_id, discount_promotion, async=True) |
>>> result = thread.get() |
:param async bool |
:param str discount_promotion_id: ID of discountPromotion to replace (required) |
:param DiscountPromotion discount_promotion: Attributes of discountPromotion to replace (required) |
:return: DiscountPromotion |
If the method is called asynchronously, |
returns the request thread. |
"""""" |
kwargs['_return_http_data_only'] = True |
if kwargs.get('async'): |
return cls._replace_discount_promotion_by_id_with_http_info(discount_promotion_id, discount_promotion, **kwargs) |
else: |
(data) = cls._replace_discount_promotion_by_id_with_http_info(discount_promotion_id, discount_promotion, **kwargs) |
return data" |
3857,"def update_discount_promotion_by_id(cls, discount_promotion_id, discount_promotion, **kwargs): |
""""""Update DiscountPromotion |
Update attributes of DiscountPromotion |
This method makes a synchronous HTTP request by default. To make an |
asynchronous HTTP request, please pass async=True |
>>> thread = api.update_discount_promotion_by_id(discount_promotion_id, discount_promotion, async=True) |
>>> result = thread.get() |
:param async bool |
:param str discount_promotion_id: ID of discountPromotion to update. (required) |
:param DiscountPromotion discount_promotion: Attributes of discountPromotion to update. (required) |
:return: DiscountPromotion |
If the method is called asynchronously, |
returns the request thread. |
"""""" |
kwargs['_return_http_data_only'] = True |
if kwargs.get('async'): |
return cls._update_discount_promotion_by_id_with_http_info(discount_promotion_id, discount_promotion, **kwargs) |
else: |
(data) = cls._update_discount_promotion_by_id_with_http_info(discount_promotion_id, discount_promotion, **kwargs) |
return data" |
3858,"def make_code_readable(s): |
""""""Add newlines at strategic places in code string for printing. |
Args: |
s: str, piece of code. If not str, will attempt to convert to str. |
Returns: |
str |
"""""" |
s = s if isinstance(s, str) else str(s) |
MAP = {"","": "",\n"", ""{"": ""{\n "", ""}"": ""\n}""} |
ll = [] |
state = ""open"" |
flag_single = False |
flag_double = False |
flag_backslash = False |
for ch in s: |
if flag_backslash: |
flag_backslash = False |
continue |
if ch == ""\\"": |
flag_backslash = True |
continue |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.