BokaMera.API.Host

<back to all web services

GetVossPackage

The following routes are available for this service:
GET/voss/packagesget voss package
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


enum PackageStatusEnum : string
{
    case Draft = 'Draft';
    case Staged = 'Staged';
    case Published = 'Published';
    case Archived = 'Archived';
    case Discarded = 'Discarded';
}

enum ProductGroupTypeEnum : string
{
    case Optional = 'Optional';
    case Included = 'Included';
}

enum TypeEnum : string
{
    case AtSubscriptionBillingPeriodEnd = 'AtSubscriptionBillingPeriodEnd';
    case AtBindingPeriodEnd = 'AtBindingPeriodEnd';
}

// @DataContract(Name="ProductGroupTagDto")
class ProductGroupTagDto implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="type", IsRequired=true)
        /** @var TypeEnum|null */
        public ?TypeEnum $type=null,

        // @DataMember(Name="tag", IsRequired=true)
        /** @var string */
        public string $tag=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['type'])) $this->type = JsonConverters::from('TypeEnum', $o['type']);
        if (isset($o['tag'])) $this->tag = $o['tag'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->type)) $o['type'] = JsonConverters::to('TypeEnum', $this->type);
        if (isset($this->tag)) $o['tag'] = $this->tag;
        return empty($o) ? new class(){} : $o;
    }
}

enum ProductTypeEnum : string
{
    case Main = 'Main';
    case Addon = 'Addon';
    case License = 'License';
    case Usage = 'Usage';
}

enum StatusEnum : string
{
    case Active = 'Active';
    case Terminated = 'Terminated';
}

// @DataContract(Name="PackageProductDto")
class PackageProductDto implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="type", IsRequired=true)
        /** @var ProductTypeEnum|null */
        public ?ProductTypeEnum $type=null,

        // @DataMember(Name="status", IsRequired=true)
        /** @var StatusEnum|null */
        public ?StatusEnum $status=null,

        // @DataMember(Name="id", IsRequired=true)
        /** @var string */
        public string $id='',

        // @DataMember(Name="name", IsRequired=true)
        /** @var string */
        public string $name='',

        // @DataMember(Name="externalId")
        /** @var string */
        public string $externalId='',

        // @DataMember(Name="articleNumber")
        /** @var string */
        public string $articleNumber=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['type'])) $this->type = JsonConverters::from('ProductTypeEnum', $o['type']);
        if (isset($o['status'])) $this->status = JsonConverters::from('StatusEnum', $o['status']);
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['externalId'])) $this->externalId = $o['externalId'];
        if (isset($o['articleNumber'])) $this->articleNumber = $o['articleNumber'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->type)) $o['type'] = JsonConverters::to('ProductTypeEnum', $this->type);
        if (isset($this->status)) $o['status'] = JsonConverters::to('StatusEnum', $this->status);
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->externalId)) $o['externalId'] = $this->externalId;
        if (isset($this->articleNumber)) $o['articleNumber'] = $this->articleNumber;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="PackageProductGroupDto")
class PackageProductGroupDto implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="productGroupType", IsRequired=true)
        /** @var ProductGroupTypeEnum|null */
        public ?ProductGroupTypeEnum $productGroupType=null,

        // @DataMember(Name="id", IsRequired=true)
        /** @var string */
        public string $id='',

        // @DataMember(Name="name", IsRequired=true)
        /** @var string */
        public string $name='',

        // @DataMember(Name="externalId")
        /** @var string */
        public string $externalId='',

        // @DataMember(Name="tags", EmitDefaultValue=false)
        /** @var array<ProductGroupTagDto>|null */
        public ?array $tags=null,

        // @DataMember(Name="products", EmitDefaultValue=false)
        /** @var array<PackageProductDto>|null */
        public ?array $products=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['productGroupType'])) $this->productGroupType = JsonConverters::from('ProductGroupTypeEnum', $o['productGroupType']);
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['externalId'])) $this->externalId = $o['externalId'];
        if (isset($o['tags'])) $this->tags = JsonConverters::fromArray('ProductGroupTagDto', $o['tags']);
        if (isset($o['products'])) $this->products = JsonConverters::fromArray('PackageProductDto', $o['products']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->productGroupType)) $o['productGroupType'] = JsonConverters::to('ProductGroupTypeEnum', $this->productGroupType);
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->externalId)) $o['externalId'] = $this->externalId;
        if (isset($this->tags)) $o['tags'] = JsonConverters::toArray('ProductGroupTagDto', $this->tags);
        if (isset($this->products)) $o['products'] = JsonConverters::toArray('PackageProductDto', $this->products);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="PackageTierDto")
class PackageTierDto implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="id", IsRequired=true)
        /** @var string */
        public string $id='',

        // @DataMember(Name="name", IsRequired=true)
        /** @var string */
        public string $name='',

        // @DataMember(Name="externalId")
        /** @var string */
        public string $externalId='',

        // @DataMember(Name="productGroups", EmitDefaultValue=false)
        /** @var array<PackageProductGroupDto>|null */
        public ?array $productGroups=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['externalId'])) $this->externalId = $o['externalId'];
        if (isset($o['productGroups'])) $this->productGroups = JsonConverters::fromArray('PackageProductGroupDto', $o['productGroups']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->externalId)) $o['externalId'] = $this->externalId;
        if (isset($this->productGroups)) $o['productGroups'] = JsonConverters::toArray('PackageProductGroupDto', $this->productGroups);
        return empty($o) ? new class(){} : $o;
    }
}

enum PeriodEndActionEnum : string
{
    case Renew = 'Renew';
    case Terminate = 'Terminate';
}

enum UnitEnum : string
{
    case Day = 'Day';
    case Month = 'Month';
    case Year = 'Year';
}

// @DataContract(Name="TimeLengthDto")
class TimeLengthDto implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="unit", IsRequired=true)
        /** @var UnitEnum|null */
        public ?UnitEnum $unit=null,

        // @DataMember(Name="value", EmitDefaultValue=false)
        /** @var int */
        public int $value=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['unit'])) $this->unit = JsonConverters::from('UnitEnum', $o['unit']);
        if (isset($o['value'])) $this->value = $o['value'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->unit)) $o['unit'] = JsonConverters::to('UnitEnum', $this->unit);
        if (isset($this->value)) $o['value'] = $this->value;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="BindingPeriodCycleDto")
class BindingPeriodCycleDto implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="periodEndAction", IsRequired=true)
        /** @var PeriodEndActionEnum|null */
        public ?PeriodEndActionEnum $periodEndAction=null,

        // @DataMember(Name="length", IsRequired=true)
        /** @var TimeLengthDto|null */
        public ?TimeLengthDto $length=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['periodEndAction'])) $this->periodEndAction = JsonConverters::from('PeriodEndActionEnum', $o['periodEndAction']);
        if (isset($o['length'])) $this->length = JsonConverters::from('TimeLengthDto', $o['length']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->periodEndAction)) $o['periodEndAction'] = JsonConverters::to('PeriodEndActionEnum', $this->periodEndAction);
        if (isset($this->length)) $o['length'] = JsonConverters::to('TimeLengthDto', $this->length);
        return empty($o) ? new class(){} : $o;
    }
}

enum PeriodAnchorEnum : string
{
    case PeriodCreated = 'PeriodCreated';
    case PeriodStart = 'PeriodStart';
    case PeriodEnd = 'PeriodEnd';
}

// @DataContract(Name="PeriodDateOffsetDto")
class PeriodDateOffsetDto implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="periodAnchor", IsRequired=true)
        /** @var PeriodAnchorEnum|null */
        public ?PeriodAnchorEnum $periodAnchor=null,

        // @DataMember(Name="length", IsRequired=true)
        /** @var TimeLengthDto|null */
        public ?TimeLengthDto $length=null,

        // @DataMember(Name="valueAnchor")
        /** @var int|null */
        public ?int $valueAnchor=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['periodAnchor'])) $this->periodAnchor = JsonConverters::from('PeriodAnchorEnum', $o['periodAnchor']);
        if (isset($o['length'])) $this->length = JsonConverters::from('TimeLengthDto', $o['length']);
        if (isset($o['valueAnchor'])) $this->valueAnchor = $o['valueAnchor'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->periodAnchor)) $o['periodAnchor'] = JsonConverters::to('PeriodAnchorEnum', $this->periodAnchor);
        if (isset($this->length)) $o['length'] = JsonConverters::to('TimeLengthDto', $this->length);
        if (isset($this->valueAnchor)) $o['valueAnchor'] = $this->valueAnchor;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="BillingPeriodCycleDto")
class BillingPeriodCycleDto implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="length", IsRequired=true)
        /** @var TimeLengthDto|null */
        public ?TimeLengthDto $length=null,

        // @DataMember(Name="invoiceDateOffset", IsRequired=true)
        /** @var PeriodDateOffsetDto|null */
        public ?PeriodDateOffsetDto $invoiceDateOffset=null,

        // @DataMember(Name="renewalDateOffset", IsRequired=true)
        /** @var PeriodDateOffsetDto|null */
        public ?PeriodDateOffsetDto $renewalDateOffset=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['length'])) $this->length = JsonConverters::from('TimeLengthDto', $o['length']);
        if (isset($o['invoiceDateOffset'])) $this->invoiceDateOffset = JsonConverters::from('PeriodDateOffsetDto', $o['invoiceDateOffset']);
        if (isset($o['renewalDateOffset'])) $this->renewalDateOffset = JsonConverters::from('PeriodDateOffsetDto', $o['renewalDateOffset']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->length)) $o['length'] = JsonConverters::to('TimeLengthDto', $this->length);
        if (isset($this->invoiceDateOffset)) $o['invoiceDateOffset'] = JsonConverters::to('PeriodDateOffsetDto', $this->invoiceDateOffset);
        if (isset($this->renewalDateOffset)) $o['renewalDateOffset'] = JsonConverters::to('PeriodDateOffsetDto', $this->renewalDateOffset);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="PackagePlanDto")
class PackagePlanDto implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="id", IsRequired=true)
        /** @var string */
        public string $id='',

        // @DataMember(Name="name", IsRequired=true)
        /** @var string */
        public string $name='',

        // @DataMember(Name="externalId")
        /** @var string */
        public string $externalId='',

        // @DataMember(Name="bindingPeriodCycle", IsRequired=true)
        /** @var BindingPeriodCycleDto|null */
        public ?BindingPeriodCycleDto $bindingPeriodCycle=null,

        // @DataMember(Name="subscriptionBillingPeriodCycle", IsRequired=true)
        /** @var BillingPeriodCycleDto|null */
        public ?BillingPeriodCycleDto $subscriptionBillingPeriodCycle=null,

        // @DataMember(Name="usageBillingPeriodCycle", IsRequired=true)
        /** @var BillingPeriodCycleDto|null */
        public ?BillingPeriodCycleDto $usageBillingPeriodCycle=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['externalId'])) $this->externalId = $o['externalId'];
        if (isset($o['bindingPeriodCycle'])) $this->bindingPeriodCycle = JsonConverters::from('BindingPeriodCycleDto', $o['bindingPeriodCycle']);
        if (isset($o['subscriptionBillingPeriodCycle'])) $this->subscriptionBillingPeriodCycle = JsonConverters::from('BillingPeriodCycleDto', $o['subscriptionBillingPeriodCycle']);
        if (isset($o['usageBillingPeriodCycle'])) $this->usageBillingPeriodCycle = JsonConverters::from('BillingPeriodCycleDto', $o['usageBillingPeriodCycle']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->externalId)) $o['externalId'] = $this->externalId;
        if (isset($this->bindingPeriodCycle)) $o['bindingPeriodCycle'] = JsonConverters::to('BindingPeriodCycleDto', $this->bindingPeriodCycle);
        if (isset($this->subscriptionBillingPeriodCycle)) $o['subscriptionBillingPeriodCycle'] = JsonConverters::to('BillingPeriodCycleDto', $this->subscriptionBillingPeriodCycle);
        if (isset($this->usageBillingPeriodCycle)) $o['usageBillingPeriodCycle'] = JsonConverters::to('BillingPeriodCycleDto', $this->usageBillingPeriodCycle);
        return empty($o) ? new class(){} : $o;
    }
}

enum PricingSchemeEnum : string
{
    case UnitPricing = 'UnitPricing';
    case TierPricing = 'TierPricing';
}

// @DataContract(Name="ProductTierPricingDto")
class ProductTierPricingDto implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="index", EmitDefaultValue=false)
        /** @var int */
        public int $index=0,

        // @DataMember(Name="unitPrice", EmitDefaultValue=false)
        /** @var float */
        public float $unitPrice=0.0,

        // @DataMember(Name="flatPrice", EmitDefaultValue=false)
        /** @var float */
        public float $flatPrice=0.0,

        // @DataMember(Name="repeatEvery")
        /** @var int|null */
        public ?int $repeatEvery=null,

        // @DataMember(Name="upperLimit")
        /** @var int|null */
        public ?int $upperLimit=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['index'])) $this->index = $o['index'];
        if (isset($o['unitPrice'])) $this->unitPrice = $o['unitPrice'];
        if (isset($o['flatPrice'])) $this->flatPrice = $o['flatPrice'];
        if (isset($o['repeatEvery'])) $this->repeatEvery = $o['repeatEvery'];
        if (isset($o['upperLimit'])) $this->upperLimit = $o['upperLimit'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->index)) $o['index'] = $this->index;
        if (isset($this->unitPrice)) $o['unitPrice'] = $this->unitPrice;
        if (isset($this->flatPrice)) $o['flatPrice'] = $this->flatPrice;
        if (isset($this->repeatEvery)) $o['repeatEvery'] = $this->repeatEvery;
        if (isset($this->upperLimit)) $o['upperLimit'] = $this->upperLimit;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="ProductPricingDto")
class ProductPricingDto implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="pricingScheme", IsRequired=true)
        /** @var PricingSchemeEnum|null */
        public ?PricingSchemeEnum $pricingScheme=null,

        // @DataMember(Name="productId", IsRequired=true)
        /** @var string */
        public string $productId='',

        // @DataMember(Name="includedQuantity")
        /** @var int|null */
        public ?int $includedQuantity=null,

        // @DataMember(Name="maxQuantity")
        /** @var int|null */
        public ?int $maxQuantity=null,

        // @DataMember(Name="unitPrice")
        /** @var float|null */
        public ?float $unitPrice=null,

        // @DataMember(Name="tierPricing", EmitDefaultValue=false)
        /** @var array<ProductTierPricingDto>|null */
        public ?array $tierPricing=null,

        // @DataMember(Name="articleNumber")
        /** @var string */
        public string $articleNumber=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['pricingScheme'])) $this->pricingScheme = JsonConverters::from('PricingSchemeEnum', $o['pricingScheme']);
        if (isset($o['productId'])) $this->productId = $o['productId'];
        if (isset($o['includedQuantity'])) $this->includedQuantity = $o['includedQuantity'];
        if (isset($o['maxQuantity'])) $this->maxQuantity = $o['maxQuantity'];
        if (isset($o['unitPrice'])) $this->unitPrice = $o['unitPrice'];
        if (isset($o['tierPricing'])) $this->tierPricing = JsonConverters::fromArray('ProductTierPricingDto', $o['tierPricing']);
        if (isset($o['articleNumber'])) $this->articleNumber = $o['articleNumber'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->pricingScheme)) $o['pricingScheme'] = JsonConverters::to('PricingSchemeEnum', $this->pricingScheme);
        if (isset($this->productId)) $o['productId'] = $this->productId;
        if (isset($this->includedQuantity)) $o['includedQuantity'] = $this->includedQuantity;
        if (isset($this->maxQuantity)) $o['maxQuantity'] = $this->maxQuantity;
        if (isset($this->unitPrice)) $o['unitPrice'] = $this->unitPrice;
        if (isset($this->tierPricing)) $o['tierPricing'] = JsonConverters::toArray('ProductTierPricingDto', $this->tierPricing);
        if (isset($this->articleNumber)) $o['articleNumber'] = $this->articleNumber;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="ProductGroupPricingDto")
class ProductGroupPricingDto implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="productGroupId", IsRequired=true)
        /** @var string */
        public string $productGroupId='',

        // @DataMember(Name="articleNumber", IsRequired=true)
        /** @var string */
        public string $articleNumber='',

        // @DataMember(Name="price", EmitDefaultValue=false)
        /** @var float */
        public float $price=0.0,

        // @DataMember(Name="productPricings", EmitDefaultValue=false)
        /** @var array<ProductPricingDto>|null */
        public ?array $productPricings=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['productGroupId'])) $this->productGroupId = $o['productGroupId'];
        if (isset($o['articleNumber'])) $this->articleNumber = $o['articleNumber'];
        if (isset($o['price'])) $this->price = $o['price'];
        if (isset($o['productPricings'])) $this->productPricings = JsonConverters::fromArray('ProductPricingDto', $o['productPricings']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->productGroupId)) $o['productGroupId'] = $this->productGroupId;
        if (isset($this->articleNumber)) $o['articleNumber'] = $this->articleNumber;
        if (isset($this->price)) $o['price'] = $this->price;
        if (isset($this->productPricings)) $o['productPricings'] = JsonConverters::toArray('ProductPricingDto', $this->productPricings);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="PackageChargePlanDto")
class PackageChargePlanDto implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="id", IsRequired=true)
        /** @var string */
        public string $id='',

        // @DataMember(Name="tierId", IsRequired=true)
        /** @var string */
        public string $tierId='',

        // @DataMember(Name="planId", IsRequired=true)
        /** @var string */
        public string $planId='',

        // @DataMember(Name="productGroupPricings", IsRequired=true)
        /** @var array<ProductGroupPricingDto>|null */
        public ?array $productGroupPricings=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['tierId'])) $this->tierId = $o['tierId'];
        if (isset($o['planId'])) $this->planId = $o['planId'];
        if (isset($o['productGroupPricings'])) $this->productGroupPricings = JsonConverters::fromArray('ProductGroupPricingDto', $o['productGroupPricings']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->tierId)) $o['tierId'] = $this->tierId;
        if (isset($this->planId)) $o['planId'] = $this->planId;
        if (isset($this->productGroupPricings)) $o['productGroupPricings'] = JsonConverters::toArray('ProductGroupPricingDto', $this->productGroupPricings);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="PackageSalesChannelDto")
class PackageSalesChannelDto implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="id", IsRequired=true)
        /** @var string */
        public string $id='',

        // @DataMember(Name="name", IsRequired=true)
        /** @var string */
        public string $name='',

        // @DataMember(Name="description")
        /** @var string */
        public string $description='',

        // @DataMember(Name="validFrom")
        /** @var DateTime|null */
        public ?DateTime $validFrom=null,

        // @DataMember(Name="validTo")
        /** @var DateTime|null */
        public ?DateTime $validTo=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['description'])) $this->description = $o['description'];
        if (isset($o['validFrom'])) $this->validFrom = JsonConverters::from('DateTime', $o['validFrom']);
        if (isset($o['validTo'])) $this->validTo = JsonConverters::from('DateTime', $o['validTo']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->description)) $o['description'] = $this->description;
        if (isset($this->validFrom)) $o['validFrom'] = JsonConverters::to('DateTime', $this->validFrom);
        if (isset($this->validTo)) $o['validTo'] = JsonConverters::to('DateTime', $this->validTo);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="PackageTargetGroupDto")
class PackageTargetGroupDto implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="id", IsRequired=true)
        /** @var string */
        public string $id='',

        // @DataMember(Name="name", IsRequired=true)
        /** @var string */
        public string $name='',

        // @DataMember(Name="isDefault")
        /** @var bool|null */
        public ?bool $isDefault=null,

        // @DataMember(Name="externalId")
        /** @var string */
        public string $externalId=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['isDefault'])) $this->isDefault = $o['isDefault'];
        if (isset($o['externalId'])) $this->externalId = $o['externalId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->isDefault)) $o['isDefault'] = $this->isDefault;
        if (isset($this->externalId)) $o['externalId'] = $this->externalId;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="PackageScheduledChangeResultDto")
class PackageScheduledChangeResultDto implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="status")
        /** @var PackageStatusEnum|null */
        public ?PackageStatusEnum $status=null,

        // @DataMember(Name="name")
        /** @var string */
        public string $name=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['status'])) $this->status = JsonConverters::from('PackageStatusEnum', $o['status']);
        if (isset($o['name'])) $this->name = $o['name'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->status)) $o['status'] = JsonConverters::to('PackageStatusEnum', $this->status);
        if (isset($this->name)) $o['name'] = $this->name;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="PackageScheduledChangeResult")
class PackageScheduledChangeResult implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="status", IsRequired=true)
        /** @var StatusEnum|null */
        public ?StatusEnum $status=null,

        // @DataMember(Name="id", IsRequired=true)
        /** @var string */
        public string $id='',

        // @DataMember(Name="versionId", IsRequired=true)
        /** @var string */
        public string $versionId='',

        // @DataMember(Name="package", EmitDefaultValue=false)
        /** @var PackageScheduledChangeResultDto|null */
        public ?PackageScheduledChangeResultDto $package=null,

        // @DataMember(Name="scheduledDate", IsRequired=true)
        /** @var DateTime */
        public DateTime $scheduledDate=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['status'])) $this->status = JsonConverters::from('StatusEnum', $o['status']);
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['versionId'])) $this->versionId = $o['versionId'];
        if (isset($o['package'])) $this->package = JsonConverters::from('PackageScheduledChangeResultDto', $o['package']);
        if (isset($o['scheduledDate'])) $this->scheduledDate = JsonConverters::from('DateTime', $o['scheduledDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->status)) $o['status'] = JsonConverters::to('StatusEnum', $this->status);
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->versionId)) $o['versionId'] = $this->versionId;
        if (isset($this->package)) $o['package'] = JsonConverters::to('PackageScheduledChangeResultDto', $this->package);
        if (isset($this->scheduledDate)) $o['scheduledDate'] = JsonConverters::to('DateTime', $this->scheduledDate);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract(Name="PackageResult")
class PackageResult implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="status", IsRequired=true)
        /** @var PackageStatusEnum|null */
        public ?PackageStatusEnum $status=null,

        // @DataMember(Name="id", IsRequired=true)
        /** @var string */
        public string $id='',

        // @DataMember(Name="versionId", IsRequired=true)
        /** @var string */
        public string $versionId='',

        // @DataMember(Name="sourceVersionId")
        /** @var string|null */
        public ?string $sourceVersionId=null,

        // @DataMember(Name="name", IsRequired=true)
        /** @var string */
        public string $name='',

        // @DataMember(Name="externalId")
        /** @var string */
        public string $externalId='',

        // @DataMember(Name="tiers", IsRequired=true)
        /** @var array<PackageTierDto>|null */
        public ?array $tiers=null,

        // @DataMember(Name="plans", IsRequired=true)
        /** @var array<PackagePlanDto>|null */
        public ?array $plans=null,

        // @DataMember(Name="chargePlans", IsRequired=true)
        /** @var array<PackageChargePlanDto>|null */
        public ?array $chargePlans=null,

        // @DataMember(Name="salesChannels", IsRequired=true)
        /** @var array<PackageSalesChannelDto>|null */
        public ?array $salesChannels=null,

        // @DataMember(Name="targetGroups", IsRequired=true)
        /** @var array<PackageTargetGroupDto>|null */
        public ?array $targetGroups=null,

        // @DataMember(Name="scheduledChanges", IsRequired=true)
        /** @var array<PackageScheduledChangeResult>|null */
        public ?array $scheduledChanges=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['status'])) $this->status = JsonConverters::from('PackageStatusEnum', $o['status']);
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['versionId'])) $this->versionId = $o['versionId'];
        if (isset($o['sourceVersionId'])) $this->sourceVersionId = $o['sourceVersionId'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['externalId'])) $this->externalId = $o['externalId'];
        if (isset($o['tiers'])) $this->tiers = JsonConverters::fromArray('PackageTierDto', $o['tiers']);
        if (isset($o['plans'])) $this->plans = JsonConverters::fromArray('PackagePlanDto', $o['plans']);
        if (isset($o['chargePlans'])) $this->chargePlans = JsonConverters::fromArray('PackageChargePlanDto', $o['chargePlans']);
        if (isset($o['salesChannels'])) $this->salesChannels = JsonConverters::fromArray('PackageSalesChannelDto', $o['salesChannels']);
        if (isset($o['targetGroups'])) $this->targetGroups = JsonConverters::fromArray('PackageTargetGroupDto', $o['targetGroups']);
        if (isset($o['scheduledChanges'])) $this->scheduledChanges = JsonConverters::fromArray('PackageScheduledChangeResult', $o['scheduledChanges']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->status)) $o['status'] = JsonConverters::to('PackageStatusEnum', $this->status);
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->versionId)) $o['versionId'] = $this->versionId;
        if (isset($this->sourceVersionId)) $o['sourceVersionId'] = $this->sourceVersionId;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->externalId)) $o['externalId'] = $this->externalId;
        if (isset($this->tiers)) $o['tiers'] = JsonConverters::toArray('PackageTierDto', $this->tiers);
        if (isset($this->plans)) $o['plans'] = JsonConverters::toArray('PackagePlanDto', $this->plans);
        if (isset($this->chargePlans)) $o['chargePlans'] = JsonConverters::toArray('PackageChargePlanDto', $this->chargePlans);
        if (isset($this->salesChannels)) $o['salesChannels'] = JsonConverters::toArray('PackageSalesChannelDto', $this->salesChannels);
        if (isset($this->targetGroups)) $o['targetGroups'] = JsonConverters::toArray('PackageTargetGroupDto', $this->targetGroups);
        if (isset($this->scheduledChanges)) $o['scheduledChanges'] = JsonConverters::toArray('PackageScheduledChangeResult', $this->scheduledChanges);
        return empty($o) ? new class(){} : $o;
    }
}

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class GetVossPackage implements JsonSerializable
{
    public function __construct(
        /** @description The package id; if not passed the configured BokaMera package will be used. */
        // @ApiMember(Description="The package id; if not passed the configured BokaMera package will be used.")
        /** @var string|null */
        public ?string $PackageId=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['PackageId'])) $this->PackageId = $o['PackageId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->PackageId)) $o['PackageId'] = $this->PackageId;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetVossPackage DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

GET /voss/packages HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"status":"Draft","sourceVersionId":"00000000-0000-0000-0000-000000000000","name":"String","externalId":"String","tiers":[{}],"plans":[{}],"chargePlans":[{}],"salesChannels":[{}],"targetGroups":[{}],"scheduledChanges":[{}]}