| Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
| PUT | /voss/subscriptions/{SubscriptionId}/scheduledChanges/{Id} | Update voss subscription scheduled change | Update a pending subscription scheduled change in the VOSS System. Already executed scheduled changes cannot be updated. |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
Object = TypeVar('Object')
class TypeEnum(str, Enum):
AT_SUBSCRIPTION_BILLING_PERIOD_END = 'AtSubscriptionBillingPeriodEnd'
AT_BINDING_PERIOD_END = 'AtBindingPeriodEnd'
class StatusEnum(str, Enum):
ACTIVE = 'Active'
TERMINATED = 'Terminated'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SubscriptionScheduledChangePackageResult:
id: Optional[str] = None
version_id: Optional[str] = None
name: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SubscriptionScheduledChangeTierResult:
id: Optional[str] = None
name: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SubscriptionScheduledChangePlanResult:
id: Optional[str] = None
name: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SubscriptionScheduledChangeSalesInformationResult:
sales_person_id: Optional[str] = None
sales_department_id: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SubscriptionScheduledChangeResult:
type: Optional[TypeEnum] = None
status: Optional[StatusEnum] = None
id: Optional[str] = None
package: Optional[SubscriptionScheduledChangePackageResult] = None
tier: Optional[SubscriptionScheduledChangeTierResult] = None
plan: Optional[SubscriptionScheduledChangePlanResult] = None
scheduled_date: datetime.datetime = datetime.datetime(1, 1, 1)
sales_information: Optional[SubscriptionScheduledChangeSalesInformationResult] = None
# @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpdateVossSubscriptionScheduledChange:
# @ApiMember(Description="The subscription id", IsRequired=true)
subscription_id: Optional[str] = None
"""
The subscription id
"""
# @ApiMember(Description="The subscription scheduled change id", IsRequired=true)
id: Optional[str] = None
"""
The subscription scheduled change id
"""
# @ApiMember(Description="Controls when the scheduled change will be executed: <br />AtSubscriptionBillingPeriodEnd - after the currently latest subscription billing period ends <br />AtBindingPeriodEnd - after the currently latest subscription binding period ends", IsRequired=true)
type: Optional[TypeEnum] = None
"""
Controls when the scheduled change will be executed: <br />AtSubscriptionBillingPeriodEnd - after the currently latest subscription billing period ends <br />AtBindingPeriodEnd - after the currently latest subscription binding period ends
"""
# @ApiMember(Description="Optional package version id; if omitted the current version of the subscription package is used")
version_id: Optional[str] = None
"""
Optional package version id; if omitted the current version of the subscription package is used
"""
# @ApiMember(Description="The id of a package which will be active after the scheduled change is executed; if provided the tier id and plan id have to be provided as well")
package_id: Optional[str] = None
"""
The id of a package which will be active after the scheduled change is executed; if provided the tier id and plan id have to be provided as well
"""
# @ApiMember(Description="The id of a tier which will be active after the scheduled change is executed; can be omitted if PlanId is provided instead")
tier_id: Optional[str] = None
"""
The id of a tier which will be active after the scheduled change is executed; can be omitted if PlanId is provided instead
"""
# @ApiMember(Description="The id of a plan which will be active after the scheduled change is executed; can be omitted if TierId is provided instead")
plan_id: Optional[str] = None
"""
The id of a plan which will be active after the scheduled change is executed; can be omitted if TierId is provided instead
"""
# @ApiMember(Description="How many periods (counting from the latest period) must pass before the scheduled change is executed; if omitted the change is executed on the latest period end")
period_iteration_count: Optional[int] = None
"""
How many periods (counting from the latest period) must pass before the scheduled change is executed; if omitted the change is executed on the latest period end
"""
Python UpdateVossSubscriptionScheduledChange DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /voss/subscriptions/{SubscriptionId}/scheduledChanges/{Id} HTTP/1.1
Host: testapi.bokamera.se
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"Type":"AtSubscriptionBillingPeriodEnd","VersionId":"00000000-0000-0000-0000-000000000000","PackageId":"00000000-0000-0000-0000-000000000000","TierId":"00000000-0000-0000-0000-000000000000","PlanId":"00000000-0000-0000-0000-000000000000","PeriodIterationCount":0}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"type":"AtSubscriptionBillingPeriodEnd","status":"Pending"}