POST | /voss/presetBehaviour | create preset behaviour in voss |
---|
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
class ChangeTypeEnum(str, Enum):
SUBSCRIPTION = 'Subscription'
PRODUCT_GROUP = 'ProductGroup'
LICENSE = 'License'
class ChangeOperationEnum(str, Enum):
CREATE = 'Create'
TERMINATE = 'Terminate'
UPGRADE = 'Upgrade'
SIDEGRADE = 'Sidegrade'
DOWNGRADE = 'Downgrade'
MIGRATION = 'Migration'
class SubscriptionTimingEnum(str, Enum):
AT_SUBSCRIPTION_BILLING_PERIOD_END = 'AtSubscriptionBillingPeriodEnd'
AT_BINDING_PERIOD_END = 'AtBindingPeriodEnd'
IMMEDIATELY = 'Immediately'
class PeriodAnchorEnum(str, Enum):
LATEST_PERIOD = 'LatestPeriod'
CURRENT_PERIOD = 'CurrentPeriod'
class RenewalTimingEnum(str, Enum):
USE_CURRENT_PLAN_RENEWAL_DATE = 'UseCurrentPlanRenewalDate'
USE_SCHEDULED_PLAN_RENEWAL_DATE = 'UseScheduledPlanRenewalDate'
class SubscriptionBehaviourEnum(str, Enum):
PRORATE = 'Prorate'
FULL = 'Full'
NONE = 'None'
class CreditKindEnum(str, Enum):
NORMAL = 'Normal'
INTERNAL = 'Internal'
# @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreatePresetBehaviour:
# @ApiMember(Description="Company ids to create invoice. If none added invoice for all will be created")
change_type: Optional[ChangeTypeEnum] = None
"""
Company ids to create invoice. If none added invoice for all will be created
"""
change_operation: Optional[ChangeOperationEnum] = None
timing: Optional[SubscriptionTimingEnum] = None
period_anchor: Optional[PeriodAnchorEnum] = None
renewal_timing: Optional[RenewalTimingEnum] = None
debit_behaviour: Optional[SubscriptionBehaviourEnum] = None
credit_behaviour: Optional[SubscriptionBehaviourEnum] = None
credit_kind: Optional[CreditKindEnum] = None
period_iteration_count: Optional[int] = None
Python CreatePresetBehaviour 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.
POST /voss/presetBehaviour HTTP/1.1
Host: testapi.bokamera.se
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"ChangeType":"Subscription","ChangeOperation":"Create","Timing":"AtSubscriptionBillingPeriodEnd","PeriodAnchor":"LatestPeriod","RenewalTiming":"UseCurrentPlanRenewalDate","DebitBehaviour":"Prorate","CreditBehaviour":"Prorate","CreditKind":"Normal","PeriodIterationCount":0}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {}