Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions com/alipay/ams/api/model/billing_subscription_status_change.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import json




class BillingSubscriptionStatusChange:
def __init__(self):

self.__action = None # type: str


@property
def action(self):
"""
The subscription status change action. The currently supported value is PAUSE, which pauses payment collection and changes the subscription status from ACTIVE to PAUSED. To reactivate a paused subscription, call the resume subscription API. Maximum length: 10 characters.
"""
return self.__action

@action.setter
def action(self, value):
self.__action = value




def to_ams_dict(self):
params = dict()
if hasattr(self, "action") and self.action is not None:
params['action'] = self.action
return params


def parse_rsp_body(self, response_body):
if isinstance(response_body, str):
response_body = json.loads(response_body)
if 'action' in response_body:
self.__action = response_body['action']
8 changes: 4 additions & 4 deletions com/alipay/ams/api/model/paginator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self):
@property
def current_page(self):
"""
The current page number, start from 1.
The current page number, starting from 1. If currentPage exceeds totalPage, transactions is returned as an empty array.
"""
return self.__current_page

Expand All @@ -25,7 +25,7 @@ def current_page(self, value):
@property
def page_size(self):
"""
The maximum records returned per page.
The number of records returned per page. The value must be a positive integer; otherwise, PARAM_ILLEGAL is returned.
"""
return self.__page_size

Expand All @@ -35,7 +35,7 @@ def page_size(self, value):
@property
def total_page(self):
"""
Total number of pages.
The total number of pages in the query result.
"""
return self.__total_page

Expand All @@ -45,7 +45,7 @@ def total_page(self, value):
@property
def total_count(self):
"""
Total items that match the criteria.
The total number of tax transactions that match the query criteria.
"""
return self.__total_count

Expand Down
4 changes: 2 additions & 2 deletions com/alipay/ams/api/model/tax_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def type(self, value):
@property
def tax_amount(self):
"""
The tax amount. Maximum length: 19 characters.
The non-negative tax amount in the smallest currency unit, without leading zeros. For TRANSACTION and REVERSAL records, this value is always a positive absolute amount. Reconcile a business scope by subtracting the sum of REVERSAL amounts from the sum of TRANSACTION amounts. Maximum length: 19 characters.
"""
return self.__tax_amount

Expand All @@ -62,7 +62,7 @@ def tax_amount(self, value):
@property
def currency(self):
"""
The 3-letter currency code that follows the ISO 4217 standard. Maximum length: 3 characters.
The 3-letter currency code that follows the ISO 4217 standard. This field is returned together with taxAmount. Maximum length: 3 characters.
"""
return self.__currency

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self):
@property
def status(self):
"""
The current status. Maximum length: 20 characters.
Filters subscriptions by status. To provide multiple values, use a comma-separated string such as ACTIVE,PAUSED. Up to eight values are supported. Valid values are INCOMPLETE, TRIALING, ACTIVE, PAST_DUE, PAUSED, CANCELLED, TERMINATED, and UNPAID. Each status value has a maximum length of 20 characters.
"""
return self.__status

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
from com.alipay.ams.api.model.price_item_change import PriceItemChange
from com.alipay.ams.api.model.billing_trial_settings import BillingTrialSettings
from com.alipay.ams.api.model.billing_subscription_status_change import BillingSubscriptionStatusChange
from com.alipay.ams.api.model.billing_subscription_cancellation_details import BillingSubscriptionCancellationDetails


Expand All @@ -16,6 +17,7 @@ def __init__(self):
self.__proration_behavior = None # type: str
self.__reset_billing_cycle_anchor = None # type: bool
self.__trial_settings = None # type: BillingTrialSettings
self.__status_change = None # type: BillingSubscriptionStatusChange
self.__cancel_at_period_end = None # type: bool
self.__cancel_at = None # type: str
self.__cancellation_details = None # type: BillingSubscriptionCancellationDetails
Expand Down Expand Up @@ -76,6 +78,16 @@ def trial_settings(self):
def trial_settings(self, value):
self.__trial_settings = value
@property
def status_change(self):
"""Gets the status_change of this AlipayBillingSubscriptionUpdateRequest.

"""
return self.__status_change

@status_change.setter
def status_change(self, value):
self.__status_change = value
@property
def cancel_at_period_end(self):
"""
The cancel at period end. Note: See documentation for details.
Expand Down Expand Up @@ -164,6 +176,8 @@ def to_ams_dict(self):
params['resetBillingCycleAnchor'] = self.reset_billing_cycle_anchor
if hasattr(self, "trial_settings") and self.trial_settings is not None:
params['trialSettings'] = self.trial_settings
if hasattr(self, "status_change") and self.status_change is not None:
params['statusChange'] = self.status_change
if hasattr(self, "cancel_at_period_end") and self.cancel_at_period_end is not None:
params['cancelAtPeriodEnd'] = self.cancel_at_period_end
if hasattr(self, "cancel_at") and self.cancel_at is not None:
Expand Down Expand Up @@ -199,6 +213,9 @@ def parse_rsp_body(self, response_body):
if 'trialSettings' in response_body:
self.__trial_settings = BillingTrialSettings()
self.__trial_settings.parse_rsp_body(response_body['trialSettings'])
if 'statusChange' in response_body:
self.__status_change = BillingSubscriptionStatusChange()
self.__status_change.parse_rsp_body(response_body['statusChange'])
if 'cancelAtPeriodEnd' in response_body:
self.__cancel_at_period_end = response_body['cancelAtPeriodEnd']
if 'cancelAt' in response_body:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self):
@property
def customer_id(self):
"""
Customer ID to target. When both `customerId` and `email` are supplied, `customerId` takes precedence.
Customer ID to target. Either `customerId` or `email` must be provided. When both are provided, `email` must match the registered account email of this customer; otherwise, the API returns `PARAM_ILLEGAL`. Maximum length: 64 characters.
"""
return self.__customer_id

Expand All @@ -28,7 +28,7 @@ def customer_id(self, value):
@property
def email(self):
"""
Customer email for lookup. When multiple customers share the email, the most recently created (by `gmtCreate DESC`) is selected. Maximum length: 254 characters (RFC 5322).
Customer email for lookup. Either `customerId` or `email` must be provided. When multiple customers share the email, the most recently created customer by `gmtCreate` descending is selected. When both fields are provided, this value must match the registered account email of the specified customer; otherwise, the API returns `PARAM_ILLEGAL`. Maximum length: 254 characters (RFC 5322).
"""
return self.__email

Expand All @@ -38,7 +38,7 @@ def email(self, value):
@property
def features(self):
"""
Feature set enabled for this portal session. Allowed values: `SUBSCRIPTION`, `INVOICE`, `PAYMENT_METHOD`. Empty/absent list -> ALL features enabled by default (NOT an intersection with settingId features, as previously documented). The portal settings referenced by `settingId` may further restrict which features are shown at render time.
Feature set enabled for this portal session. Allowed values: `SUBSCRIPTION`, `INVOICE`, `PAYMENT_METHOD`. An empty or absent list enables all features by default. The portal settings referenced by `settingId` may further restrict which features are shown at render time. Maximum size: 3 elements.
"""
return self.__features

Expand All @@ -58,7 +58,7 @@ def auto_send(self, value):
@property
def setting_id(self):
"""
Portal setting configuration ID. Passed through token payload, parsed by iexpfront.
Portal setting configuration ID passed through the token payload. Maximum length: 64 characters.
"""
return self.__setting_id

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def country_code(self, value):
@property
def billing_email(self):
"""
Invoice recipient email address (independent of account `email`). Maximum length: 256 characters.
Email address used to receive bills and invoices. It can differ from the account `email`. If omitted during customer creation, it defaults to `email`. Maximum length: 256 characters.
"""
return self.__billing_email

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def alipay_user_id(self, value):
@property
def email(self):
"""
Updated email address. Optional - `null`/omitted means no change (PATCH semantics). No email-format validation is applied. Maximum length: 256 characters.
Updated account email address. Optional - `null` or omitted means no change (PATCH semantics). Updating this field does not change `billingEmail`, including when `billingEmail` originally defaulted from `email` during customer creation. No email-format validation is applied. Maximum length: 256 characters.
"""
return self.__email

Expand Down Expand Up @@ -303,7 +303,7 @@ def country_code(self, value):
@property
def billing_email(self):
"""
Updated invoice recipient email. Maximum length: 256 characters.
Updated email address used to receive bills and invoices. Send this field explicitly when the invoice-recipient email must change; updating `email` alone does not change it. Maximum length: 256 characters.
"""
return self.__billing_email

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def pricing_model(self, value):
@property
def usage_type(self):
"""
Usage type. O - Optional. When provided, must be a valid enum value (LICENSED or METERED). Can be null; default null. Enum: LICENSED(fixed quantity billing - subscription item quantity is set at subscription creation and changed manually via update API; system bills unitAmount x quantity automatically each period), METERED(metered usage billing - quantity is tracked by external metering system iusage and reported via Usage Report API; system bills based on actual reported usage in arrears at end of billing period)
Usage type that identifies how subscription items are billed. Valid values are: `LICENSED` - fixed-quantity billing; the quantity is set when the subscription is created and can be changed through the update API, and `unitAmount` multiplied by `quantity` is billed each period. `METERED` - metered billing based on the actual usage quantity at the end of each billing period. Maximum length: 16 characters.
"""
return self.__usage_type

Expand Down Expand Up @@ -100,7 +100,7 @@ def unit_label(self, value):
@property
def meter_id(self):
"""
External meter reference. C - Required when usageType=METERED; otherwise forbidden. References external metering system contract. Format: alphanumeric + underscore, max 32 chars. Validated at price creation: format check (regex: ^[a-zA-Z0-9_]{1,32}$) AND existence check against iusage meter registry. Returns METER_NOT_FOUND if meter definition does not exist in iusage. This ensures fail-fast validation - merchants are alerted to invalid meter references immediately rather than discovering the error at subscription creation time
Meter ID. Required when `usageType` is `METERED`; otherwise, it must not be provided. The value must match `^[a-zA-Z0-9_]{1,32}$` and must exist in the meter registry. The API returns `METER_NOT_FOUND` when the meter does not exist. Maximum length: 32 characters.
"""
return self.__meter_id

Expand Down Expand Up @@ -160,7 +160,7 @@ def metadata(self, value):
@property
def default_price(self):
"""
Whether this price is the default price for the product. O - Optional. Only `true` is accepted; `false` or absent means the price is not the default. Only one price per product can be the default price - creating a new default price automatically un-defaults any previous default price of that product. Can be null; default null
Whether to set this price as the default price for the product. When provided, only `true` is accepted. The first price created for a product must be set as the default price; otherwise, the API returns `FIRST_PRICE_NOT_DEFAULT`. A product can have only one default price, and creating a new default price automatically removes the default status from the previous one.
"""
return self.__default_price

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def active(self, value):
@property
def default_price(self):
"""
Whether this price is the default price for the product. O - Only `true` is accepted; `false` or absent means no change. When set to true, this price becomes the default price of the product and any previous default price of that product is automatically un-defaulted. Cannot be combined with active=false in the same request - a default price must remain active
Whether to set this price as the default price for the product. When provided, only `true` is accepted; `false` is rejected with `DEFAULT_PRICE_REMOVAL_FORBIDDEN`, while omission means no change. When set to `true`, this price becomes the product default and the previous default price is automatically unset. `defaultPrice=true` cannot be combined with `active=false` in the same request because the default price must remain active. A product must always retain a default price.
"""
return self.__default_price

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self):
@property
def tax_calculation_id(self):
"""
The unique ID assigned by Antom to identify a tax calculation. Maximum length: 64 characters. Note: See documentation for details.
The unique ID assigned by Antom to identify a tax calculation. Exactly one of taxCalculationId, paymentId, and refundId must be provided. Omit the unused query keys; do not send them with null values. Maximum length: 64 characters.
"""
return self.__tax_calculation_id

Expand All @@ -28,7 +28,7 @@ def tax_calculation_id(self, value):
@property
def payment_id(self):
"""
The unique ID assigned by Antom to identify a payment. Maximum length: 64 characters. Note: See documentation for details.
The unique ID assigned by Antom to identify a payment. Exactly one of taxCalculationId, paymentId, and refundId must be provided. Omit the unused query keys; do not send them with null values. Maximum length: 64 characters.
"""
return self.__payment_id

Expand All @@ -38,7 +38,7 @@ def payment_id(self, value):
@property
def refund_id(self):
"""
The refund ID. Maximum length: 64 characters. Note: See documentation for details.
The unique ID assigned by Antom to identify a refund. Exactly one of taxCalculationId, paymentId, and refundId must be provided. Omit the unused query keys; do not send them with null values. Maximum length: 64 characters.
"""
return self.__refund_id

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def create_time(self, value):
@property
def status(self):
"""
The current status. Maximum length: 20 characters.
The current subscription status. Valid values are INCOMPLETE, TRIALING, ACTIVE, PAST_DUE, PAUSED, CANCELLED, TERMINATED, and UNPAID. PAST_DUE means the latest renewal payment failed and collection retry is in progress. PAUSED means payment collection is suspended and the subscription can be resumed. CANCELLED remains reversible before the current billing period ends. TERMINATED is a permanent final state. UNPAID means all collection retries have been exhausted and collection remains suspended until the outstanding invoice is paid. Clients must tolerate future unknown status values and should log and alert on them instead of failing response parsing. Maximum length: 20 characters.
"""
return self.__status

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def subscription_id(self, value):
@property
def status(self):
"""
The current status. Maximum length: 20 characters.
The subscription status after the update. PAST_DUE means the latest renewal payment failed and collection retry is in progress. PAUSED means payment collection is suspended and can be entered by setting statusChange.action to PAUSE. CANCELLED means the subscription remains active until the current period ends and can be reverted before then by setting cancelAtPeriodEnd to false. TERMINATED is a permanent final state. Maximum length: 20 characters.
"""
return self.__status

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def result(self, value):
@property
def token(self):
"""
Opaque URL-safe bearer token. Treat it as a credential: do not log, parse, or store its internal structure - the format may change without notice. Returned only when result.resultCode is SUCCESS.
Opaque URL-safe bearer token. Treat it as a credential: do not log, parse, or store its internal structure because the format may change without notice. Maximum length: 4096 characters. Returned only when result.resultCode is SUCCESS.
"""
return self.__token

Expand All @@ -40,7 +40,7 @@ def token(self, value):
@property
def portal_url(self):
"""
Fully-qualified portal URL. Null when the portal base URL is not configured for the merchant - in that case build the URL from `token`. Returned only when result.resultCode is SUCCESS.
Fully-qualified portal URL. Null when the portal base URL is not configured for the merchant; in that case, build the URL from `token`. Maximum length: 2048 characters. Returned only when result.resultCode is SUCCESS.
"""
return self.__portal_url

Expand All @@ -50,7 +50,7 @@ def portal_url(self, value):
@property
def expires_at(self):
"""
Token expiration timestamp. Format: `yyyy-MM-dd HH:mm:ss` (NOT ISO 8601). Returned only when result.resultCode is SUCCESS.
Expiration time of the portal link, returned as a string. Maximum length: 32 characters. Returned only when result.resultCode is SUCCESS.
"""
return self.__expires_at

Expand All @@ -60,7 +60,7 @@ def expires_at(self, value):
@property
def send_status(self):
"""
`SENT` / `FAILED`. Populated only when request `autoSend=true`. Best-effort: failure never blocks link creation. Null when `autoSend=false`. Returned only when result.resultCode is SUCCESS.
Email send status. Valid values are `SENT` and `FAILED`. Populated only when request `autoSend=true`; a send failure never blocks link creation. Null when `autoSend=false`. Maximum length: 16 characters. Returned only when result.resultCode is SUCCESS.
"""
return self.__send_status

Expand Down
Loading