GET | /voss/tiers/{TierId} | gets voss tiers |
---|
<?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 ProductGroupTypeEnum : string
{
case Optional = 'Optional';
case Included = 'Included';
}
enum TypeEnum : string
{
case AtSubscriptionBillingPeriodEnd = 'AtSubscriptionBillingPeriodEnd';
case AtBindingPeriodEnd = 'AtBindingPeriodEnd';
case Immediately = 'Immediately';
}
// @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="TierProductDto")
class TierProductDto 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", IsRequired=true)
/** @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="TierProductGroupDto")
class TierProductGroupDto 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<TierProductDto>|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('TierProductDto', $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('TierProductDto', $this->products);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="TierResult")
class TierResult 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='',
// @DataMember(Name="externalId")
/** @var string */
public string $externalId='',
// @DataMember(Name="rank")
/** @var int */
public int $rank=0,
// @DataMember(Name="productGroups", EmitDefaultValue=false)
/** @var array<TierProductGroupDto>|null */
public ?array $productGroups=null
) {
}
/** @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'];
if (isset($o['externalId'])) $this->externalId = $o['externalId'];
if (isset($o['rank'])) $this->rank = $o['rank'];
if (isset($o['productGroups'])) $this->productGroups = JsonConverters::fromArray('TierProductGroupDto', $o['productGroups']);
}
/** @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;
if (isset($this->externalId)) $o['externalId'] = $this->externalId;
if (isset($this->rank)) $o['rank'] = $this->rank;
if (isset($this->productGroups)) $o['productGroups'] = JsonConverters::toArray('TierProductGroupDto', $this->productGroups);
return empty($o) ? new class(){} : $o;
}
}
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class GetVossTier implements JsonSerializable
{
public function __construct(
/** @description The company id, if empty will use the company id for the user you are logged in with. */
// @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
/** @var string */
public string $TierId='',
/** @var string|null */
public ?string $PackageId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['TierId'])) $this->TierId = $o['TierId'];
if (isset($o['PackageId'])) $this->PackageId = $o['PackageId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->TierId)) $o['TierId'] = $this->TierId;
if (isset($this->PackageId)) $o['PackageId'] = $this->PackageId;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /voss/tiers/{TierId} HTTP/1.1 Host: testapi.bokamera.se Accept: text/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {Unable to show example output for type 'TierResult' using the custom 'other' filter}No parameterless constructor defined for type 'VossIntegration.ApiTools.Model.TierResult'.