BokaMera.API.Host

<back to all web services

UpdateVossSubscriptions

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/voss/subscriptionsPUT voss subscription
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 PeriodKindEnum(str, Enum):
    FIXED_TIME = 'FixedTime'
    ALIGNED_TO_BINDING_PERIOD = 'AlignedToBindingPeriod'
    ALIGNED_TO_SUBSCRIPTION_BILLING_PERIOD = 'AlignedToSubscriptionBillingPeriod'


class UnitEnum(str, Enum):
    DAY = 'Day'
    MONTH = 'Month'
    YEAR = 'Year'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DiscountAgreementTimeLengthRequestDto:
    unit: Optional[UnitEnum] = None
    value: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SubscriptionDiscountPeriodRequestDto:
    period_kind: Optional[PeriodKindEnum] = None
    length: Optional[DiscountAgreementTimeLengthRequestDto] = None
    period_iteration_count: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SubscriptionDiscountAgreementRequestDto:
    discount_agreement_id: Optional[str] = None
    period: Optional[SubscriptionDiscountPeriodRequestDto] = None


class DiscountAgreementsChangeTypeEnum(str, Enum):
    PROSPECTIVE = 'Prospective'
    RETROSPECTIVE = 'Retrospective'


# @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpdateVossSubscriptions:
    # @ApiMember(Description="The company id. Subscription will be fetched of this company")
    company_id: Optional[str] = None
    """
    The company id. Subscription will be fetched of this company
    """


    # @ApiMember(Description="Discount agreement data")
    discount_agreements: Optional[List[SubscriptionDiscountAgreementRequestDto]] = None
    """
    Discount agreement data
    """


    # @ApiMember(Description="    Discount agreements change type controls how already occured transactions are treated <br />Retrospective - all future and past not invoiced transactions will be recalculated with new discount agreements  <br />Prospective - discounts will apply only for future transactions\n")
    discount_agreements_change_type: Optional[DiscountAgreementsChangeTypeEnum] = None
    """
        Discount agreements change type controls how already occured transactions are treated <br />Retrospective - all future and past not invoiced transactions will be recalculated with new discount agreements  <br />Prospective - discounts will apply only for future transactions
    """


    # @ApiMember(Description="The company id. Subscription will be fetched of this company")
    company_owner_id: int = 0
    """
    The company id. Subscription will be fetched of this company
    """

Python UpdateVossSubscriptions DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

PUT /voss/subscriptions HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"DiscountAgreements":[{}],"DiscountAgreementsChangeType":"Prospective","CompanyOwnerId":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{}