| 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. |
|---|
<?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 TypeEnum : string
{
case AtSubscriptionBillingPeriodEnd = 'AtSubscriptionBillingPeriodEnd';
case AtBindingPeriodEnd = 'AtBindingPeriodEnd';
}
enum StatusEnum : string
{
case Active = 'Active';
case Terminated = 'Terminated';
}
// @DataContract(Name="SubscriptionScheduledChangePackageResult")
class SubscriptionScheduledChangePackageResult implements JsonSerializable
{
public function __construct(
// @DataMember(Name="id", IsRequired=true)
/** @var string */
public string $id='',
// @DataMember(Name="versionId", IsRequired=true)
/** @var string */
public string $versionId='',
// @DataMember(Name="name", IsRequired=true)
/** @var string */
public string $name=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['versionId'])) $this->versionId = $o['versionId'];
if (isset($o['name'])) $this->name = $o['name'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->versionId)) $o['versionId'] = $this->versionId;
if (isset($this->name)) $o['name'] = $this->name;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="SubscriptionScheduledChangeTierResult")
class SubscriptionScheduledChangeTierResult 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=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['name'])) $this->name = $o['name'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->name)) $o['name'] = $this->name;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="SubscriptionScheduledChangePlanResult")
class SubscriptionScheduledChangePlanResult 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=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['name'])) $this->name = $o['name'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->name)) $o['name'] = $this->name;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="SubscriptionScheduledChangeSalesInformationResult")
class SubscriptionScheduledChangeSalesInformationResult implements JsonSerializable
{
public function __construct(
// @DataMember(Name="salesPersonId")
/** @var string */
public string $salesPersonId='',
// @DataMember(Name="salesDepartmentId")
/** @var string */
public string $salesDepartmentId=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['salesPersonId'])) $this->salesPersonId = $o['salesPersonId'];
if (isset($o['salesDepartmentId'])) $this->salesDepartmentId = $o['salesDepartmentId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->salesPersonId)) $o['salesPersonId'] = $this->salesPersonId;
if (isset($this->salesDepartmentId)) $o['salesDepartmentId'] = $this->salesDepartmentId;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="SubscriptionScheduledChangeResult")
class SubscriptionScheduledChangeResult implements JsonSerializable
{
public function __construct(
// @DataMember(Name="type")
/** @var TypeEnum|null */
public ?TypeEnum $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="package")
/** @var SubscriptionScheduledChangePackageResult|null */
public ?SubscriptionScheduledChangePackageResult $package=null,
// @DataMember(Name="tier")
/** @var SubscriptionScheduledChangeTierResult|null */
public ?SubscriptionScheduledChangeTierResult $tier=null,
// @DataMember(Name="plan")
/** @var SubscriptionScheduledChangePlanResult|null */
public ?SubscriptionScheduledChangePlanResult $plan=null,
// @DataMember(Name="scheduledDate", IsRequired=true)
/** @var DateTime */
public DateTime $scheduledDate=new DateTime(),
// @DataMember(Name="salesInformation")
/** @var SubscriptionScheduledChangeSalesInformationResult|null */
public ?SubscriptionScheduledChangeSalesInformationResult $salesInformation=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['type'])) $this->type = JsonConverters::from('TypeEnum', $o['type']);
if (isset($o['status'])) $this->status = JsonConverters::from('StatusEnum', $o['status']);
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['package'])) $this->package = JsonConverters::from('SubscriptionScheduledChangePackageResult', $o['package']);
if (isset($o['tier'])) $this->tier = JsonConverters::from('SubscriptionScheduledChangeTierResult', $o['tier']);
if (isset($o['plan'])) $this->plan = JsonConverters::from('SubscriptionScheduledChangePlanResult', $o['plan']);
if (isset($o['scheduledDate'])) $this->scheduledDate = JsonConverters::from('DateTime', $o['scheduledDate']);
if (isset($o['salesInformation'])) $this->salesInformation = JsonConverters::from('SubscriptionScheduledChangeSalesInformationResult', $o['salesInformation']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->type)) $o['type'] = JsonConverters::to('TypeEnum', $this->type);
if (isset($this->status)) $o['status'] = JsonConverters::to('StatusEnum', $this->status);
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->package)) $o['package'] = JsonConverters::to('SubscriptionScheduledChangePackageResult', $this->package);
if (isset($this->tier)) $o['tier'] = JsonConverters::to('SubscriptionScheduledChangeTierResult', $this->tier);
if (isset($this->plan)) $o['plan'] = JsonConverters::to('SubscriptionScheduledChangePlanResult', $this->plan);
if (isset($this->scheduledDate)) $o['scheduledDate'] = JsonConverters::to('DateTime', $this->scheduledDate);
if (isset($this->salesInformation)) $o['salesInformation'] = JsonConverters::to('SubscriptionScheduledChangeSalesInformationResult', $this->salesInformation);
return empty($o) ? new class(){} : $o;
}
}
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class UpdateVossSubscriptionScheduledChange implements JsonSerializable
{
public function __construct(
/** @description The subscription id */
// @ApiMember(Description="The subscription id", IsRequired=true)
/** @var string */
public string $SubscriptionId='',
/** @description The subscription scheduled change id */
// @ApiMember(Description="The subscription scheduled change id", IsRequired=true)
/** @var string */
public string $Id='',
/** @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 */
// @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)
/** @var TypeEnum|null */
public ?TypeEnum $Type=null,
/** @description Optional package version id; if omitted the current version of the subscription package is used */
// @ApiMember(Description="Optional package version id; if omitted the current version of the subscription package is used")
/** @var string|null */
public ?string $VersionId=null,
/** @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 */
// @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")
/** @var string|null */
public ?string $PackageId=null,
/** @description 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 tier which will be active after the scheduled change is executed; can be omitted if PlanId is provided instead")
/** @var string|null */
public ?string $TierId=null,
/** @description 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="The id of a plan which will be active after the scheduled change is executed; can be omitted if TierId is provided instead")
/** @var string|null */
public ?string $PlanId=null,
/** @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 */
// @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")
/** @var int|null */
public ?int $PeriodIterationCount=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['SubscriptionId'])) $this->SubscriptionId = $o['SubscriptionId'];
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Type'])) $this->Type = JsonConverters::from('TypeEnum', $o['Type']);
if (isset($o['VersionId'])) $this->VersionId = $o['VersionId'];
if (isset($o['PackageId'])) $this->PackageId = $o['PackageId'];
if (isset($o['TierId'])) $this->TierId = $o['TierId'];
if (isset($o['PlanId'])) $this->PlanId = $o['PlanId'];
if (isset($o['PeriodIterationCount'])) $this->PeriodIterationCount = $o['PeriodIterationCount'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->SubscriptionId)) $o['SubscriptionId'] = $this->SubscriptionId;
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Type)) $o['Type'] = JsonConverters::to('TypeEnum', $this->Type);
if (isset($this->VersionId)) $o['VersionId'] = $this->VersionId;
if (isset($this->PackageId)) $o['PackageId'] = $this->PackageId;
if (isset($this->TierId)) $o['TierId'] = $this->TierId;
if (isset($this->PlanId)) $o['PlanId'] = $this->PlanId;
if (isset($this->PeriodIterationCount)) $o['PeriodIterationCount'] = $this->PeriodIterationCount;
return empty($o) ? new class(){} : $o;
}
}
PHP UpdateVossSubscriptionScheduledChange DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<UpdateVossSubscriptionScheduledChange xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<Id>00000000-0000-0000-0000-000000000000</Id>
<PackageId>00000000-0000-0000-0000-000000000000</PackageId>
<PeriodIterationCount>0</PeriodIterationCount>
<PlanId>00000000-0000-0000-0000-000000000000</PlanId>
<SubscriptionId>00000000-0000-0000-0000-000000000000</SubscriptionId>
<TierId>00000000-0000-0000-0000-000000000000</TierId>
<Type>AtSubscriptionBillingPeriodEnd</Type>
<VersionId>00000000-0000-0000-0000-000000000000</VersionId>
</UpdateVossSubscriptionScheduledChange>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <SubscriptionScheduledChangeResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.VossIntegration.ApiTools.Model"> <id>00000000-0000-0000-0000-000000000000</id> <package i:nil="true" /> <plan i:nil="true" /> <salesInformation i:nil="true" /> <scheduledDate>0001-01-01T00:00:00</scheduledDate> <status>Pending</status> <tier i:nil="true" /> <type>AtSubscriptionBillingPeriodEnd</type> </SubscriptionScheduledChangeResult>