ServiceStack Home (Live)

<back to all web services

PricingOrmLite

The following routes are available for this service:
All Verbs/ormlite
GET/PricingOrmLite
<?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 SkuType : string
{
    case Product = 'Product';
    case PerDev = 'PerDev';
    case PerCore = 'PerCore';
    case Site = 'Site';
    case Support = 'Support';
    case Training = 'Training';
    case Register = 'Register';
    case Payment = 'Payment';
}

// @Flags()
enum LicenseFeature : int
{
    case None = 0;
    case Free = 0;
    case Premium = 1;
    case Text = 2;
    case Client = 4;
    case Common = 8;
    case Redis = 16;
    case RedisSku = 18;
    case OrmLite = 32;
    case OrmLiteSku = 34;
    case ServiceStack = 64;
    case Server = 128;
    case Razor = 256;
    case Admin = 512;
    case Aws = 1024;
    case AwsSku = 1026;
    case All = 2047;
}

enum LicenseType : string
{
    case Free = 'Free';
    case FreeIndividual = 'FreeIndividual';
    case FreeOpenSource = 'FreeOpenSource';
    case Indie = 'Indie';
    case Business = 'Business';
    case Enterprise = 'Enterprise';
    case TextIndie = 'TextIndie';
    case TextBusiness = 'TextBusiness';
    case OrmLiteIndie = 'OrmLiteIndie';
    case OrmLiteBusiness = 'OrmLiteBusiness';
    case RedisIndie = 'RedisIndie';
    case RedisBusiness = 'RedisBusiness';
    case AwsIndie = 'AwsIndie';
    case AwsBusiness = 'AwsBusiness';
    case Trial = 'Trial';
    case Site = 'Site';
    case TextSite = 'TextSite';
    case RedisSite = 'RedisSite';
    case OrmLiteSite = 'OrmLiteSite';
}

class Sku implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $id=0,
        /** @var int */
        public int $productId=0,
        /** @var SkuType|null */
        public ?SkuType $type=null,
        /** @var LicenseFeature|null */
        public ?LicenseFeature $feature=null,
        /** @var string|null */
        public ?string $code=null,
        /** @var string|null */
        public ?string $name=null,
        /** @var string|null */
        public ?string $notes=null,
        // @Ignore()
        /** @var int|null */
        public ?int $minQty=null,

        /** @var int|null */
        public ?int $maxQty=null,
        /** @var int */
        public int $price=0,
        /** @var string|null */
        public ?string $plan=null,
        /** @var int */
        public int $discountOff=0,
        /** @var string|null */
        public ?string $discountLabelOff=null,
        /** @var int */
        public int $actualPrice=0,
        /** @var bool|null */
        public ?bool $isPlan=null,
        /** @var bool|null */
        public ?bool $isRenewal=null,
        /** @var int|null */
        public ?int $subscriptionDurationDays=null,
        /** @var int|null */
        public ?int $expiryDurationDays=null,
        /** @var int|null */
        public ?int $trialPeriodDays=null,
        /** @var int */
        public int $supportQty=0,
        /** @var int|null */
        public ?int $coresQty=null,
        /** @var DateTime */
        public DateTime $createdDate=new DateTime(),
        /** @var DateTime */
        public DateTime $modifiedDate=new DateTime(),
        /** @var LicenseType|null */
        public ?LicenseType $licenseType=null,
        /** @var bool|null */
        public ?bool $active=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['productId'])) $this->productId = $o['productId'];
        if (isset($o['type'])) $this->type = JsonConverters::from('SkuType', $o['type']);
        if (isset($o['feature'])) $this->feature = JsonConverters::from('LicenseFeature', $o['feature']);
        if (isset($o['code'])) $this->code = $o['code'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['notes'])) $this->notes = $o['notes'];
        if (isset($o['minQty'])) $this->minQty = $o['minQty'];
        if (isset($o['maxQty'])) $this->maxQty = $o['maxQty'];
        if (isset($o['price'])) $this->price = $o['price'];
        if (isset($o['plan'])) $this->plan = $o['plan'];
        if (isset($o['discountOff'])) $this->discountOff = $o['discountOff'];
        if (isset($o['discountLabelOff'])) $this->discountLabelOff = $o['discountLabelOff'];
        if (isset($o['actualPrice'])) $this->actualPrice = $o['actualPrice'];
        if (isset($o['isPlan'])) $this->isPlan = $o['isPlan'];
        if (isset($o['isRenewal'])) $this->isRenewal = $o['isRenewal'];
        if (isset($o['subscriptionDurationDays'])) $this->subscriptionDurationDays = $o['subscriptionDurationDays'];
        if (isset($o['expiryDurationDays'])) $this->expiryDurationDays = $o['expiryDurationDays'];
        if (isset($o['trialPeriodDays'])) $this->trialPeriodDays = $o['trialPeriodDays'];
        if (isset($o['supportQty'])) $this->supportQty = $o['supportQty'];
        if (isset($o['coresQty'])) $this->coresQty = $o['coresQty'];
        if (isset($o['createdDate'])) $this->createdDate = JsonConverters::from('DateTime', $o['createdDate']);
        if (isset($o['modifiedDate'])) $this->modifiedDate = JsonConverters::from('DateTime', $o['modifiedDate']);
        if (isset($o['licenseType'])) $this->licenseType = JsonConverters::from('LicenseType', $o['licenseType']);
        if (isset($o['active'])) $this->active = $o['active'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->productId)) $o['productId'] = $this->productId;
        if (isset($this->type)) $o['type'] = JsonConverters::to('SkuType', $this->type);
        if (isset($this->feature)) $o['feature'] = JsonConverters::to('LicenseFeature', $this->feature);
        if (isset($this->code)) $o['code'] = $this->code;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->notes)) $o['notes'] = $this->notes;
        if (isset($this->minQty)) $o['minQty'] = $this->minQty;
        if (isset($this->maxQty)) $o['maxQty'] = $this->maxQty;
        if (isset($this->price)) $o['price'] = $this->price;
        if (isset($this->plan)) $o['plan'] = $this->plan;
        if (isset($this->discountOff)) $o['discountOff'] = $this->discountOff;
        if (isset($this->discountLabelOff)) $o['discountLabelOff'] = $this->discountLabelOff;
        if (isset($this->actualPrice)) $o['actualPrice'] = $this->actualPrice;
        if (isset($this->isPlan)) $o['isPlan'] = $this->isPlan;
        if (isset($this->isRenewal)) $o['isRenewal'] = $this->isRenewal;
        if (isset($this->subscriptionDurationDays)) $o['subscriptionDurationDays'] = $this->subscriptionDurationDays;
        if (isset($this->expiryDurationDays)) $o['expiryDurationDays'] = $this->expiryDurationDays;
        if (isset($this->trialPeriodDays)) $o['trialPeriodDays'] = $this->trialPeriodDays;
        if (isset($this->supportQty)) $o['supportQty'] = $this->supportQty;
        if (isset($this->coresQty)) $o['coresQty'] = $this->coresQty;
        if (isset($this->createdDate)) $o['createdDate'] = JsonConverters::to('DateTime', $this->createdDate);
        if (isset($this->modifiedDate)) $o['modifiedDate'] = JsonConverters::to('DateTime', $this->modifiedDate);
        if (isset($this->licenseType)) $o['licenseType'] = JsonConverters::to('LicenseType', $this->licenseType);
        if (isset($this->active)) $o['active'] = $this->active;
        return empty($o) ? new class(){} : $o;
    }
}

class PricingResponse implements JsonSerializable
{
    public function __construct(
        /** @var Sku|null */
        public ?Sku $indie=null,
        /** @var Sku|null */
        public ?Sku $indieRenewal=null,
        /** @var Sku|null */
        public ?Sku $business=null,
        /** @var Sku|null */
        public ?Sku $businessRenewal=null,
        /** @var Sku|null */
        public ?Sku $enterprise=null,
        /** @var Sku|null */
        public ?Sku $indieSubscription=null,
        /** @var Sku|null */
        public ?Sku $businessSubscription=null,
        /** @var Sku|null */
        public ?Sku $enterpriseSubscription=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['indie'])) $this->indie = JsonConverters::from('Sku', $o['indie']);
        if (isset($o['indieRenewal'])) $this->indieRenewal = JsonConverters::from('Sku', $o['indieRenewal']);
        if (isset($o['business'])) $this->business = JsonConverters::from('Sku', $o['business']);
        if (isset($o['businessRenewal'])) $this->businessRenewal = JsonConverters::from('Sku', $o['businessRenewal']);
        if (isset($o['enterprise'])) $this->enterprise = JsonConverters::from('Sku', $o['enterprise']);
        if (isset($o['indieSubscription'])) $this->indieSubscription = JsonConverters::from('Sku', $o['indieSubscription']);
        if (isset($o['businessSubscription'])) $this->businessSubscription = JsonConverters::from('Sku', $o['businessSubscription']);
        if (isset($o['enterpriseSubscription'])) $this->enterpriseSubscription = JsonConverters::from('Sku', $o['enterpriseSubscription']);
        if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->indie)) $o['indie'] = JsonConverters::to('Sku', $this->indie);
        if (isset($this->indieRenewal)) $o['indieRenewal'] = JsonConverters::to('Sku', $this->indieRenewal);
        if (isset($this->business)) $o['business'] = JsonConverters::to('Sku', $this->business);
        if (isset($this->businessRenewal)) $o['businessRenewal'] = JsonConverters::to('Sku', $this->businessRenewal);
        if (isset($this->enterprise)) $o['enterprise'] = JsonConverters::to('Sku', $this->enterprise);
        if (isset($this->indieSubscription)) $o['indieSubscription'] = JsonConverters::to('Sku', $this->indieSubscription);
        if (isset($this->businessSubscription)) $o['businessSubscription'] = JsonConverters::to('Sku', $this->businessSubscription);
        if (isset($this->enterpriseSubscription)) $o['enterpriseSubscription'] = JsonConverters::to('Sku', $this->enterpriseSubscription);
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class PricingOrmLite implements IGet, JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP PricingOrmLite DTOs

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

HTTP + XML

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

POST /ormlite HTTP/1.1 
Host: account.servicestack.net 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<PricingOrmLite xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MyApp.ServiceModel" />
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<PricingResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MyApp.ServiceModel">
  <Business>
    <Active>false</Active>
    <Code>String</Code>
    <CoresQty>0</CoresQty>
    <CreatedDate>0001-01-01T00:00:00</CreatedDate>
    <DiscountLabelOff>String</DiscountLabelOff>
    <DiscountOff>0</DiscountOff>
    <ExpiryDurationDays>0</ExpiryDurationDays>
    <Feature>None</Feature>
    <Id>0</Id>
    <IsPlan>false</IsPlan>
    <IsRenewal>false</IsRenewal>
    <LicenseType>Free</LicenseType>
    <MaxQty>0</MaxQty>
    <ModifiedDate>0001-01-01T00:00:00</ModifiedDate>
    <Name>String</Name>
    <Notes>String</Notes>
    <Plan>String</Plan>
    <Price>0</Price>
    <ProductId>0</ProductId>
    <SubscriptionDurationDays>0</SubscriptionDurationDays>
    <SupportQty>0</SupportQty>
    <TrialPeriodDays>0</TrialPeriodDays>
    <Type>Product</Type>
  </Business>
  <BusinessRenewal>
    <Active>false</Active>
    <Code>String</Code>
    <CoresQty>0</CoresQty>
    <CreatedDate>0001-01-01T00:00:00</CreatedDate>
    <DiscountLabelOff>String</DiscountLabelOff>
    <DiscountOff>0</DiscountOff>
    <ExpiryDurationDays>0</ExpiryDurationDays>
    <Feature>None</Feature>
    <Id>0</Id>
    <IsPlan>false</IsPlan>
    <IsRenewal>false</IsRenewal>
    <LicenseType>Free</LicenseType>
    <MaxQty>0</MaxQty>
    <ModifiedDate>0001-01-01T00:00:00</ModifiedDate>
    <Name>String</Name>
    <Notes>String</Notes>
    <Plan>String</Plan>
    <Price>0</Price>
    <ProductId>0</ProductId>
    <SubscriptionDurationDays>0</SubscriptionDurationDays>
    <SupportQty>0</SupportQty>
    <TrialPeriodDays>0</TrialPeriodDays>
    <Type>Product</Type>
  </BusinessRenewal>
  <BusinessSubscription>
    <Active>false</Active>
    <Code>String</Code>
    <CoresQty>0</CoresQty>
    <CreatedDate>0001-01-01T00:00:00</CreatedDate>
    <DiscountLabelOff>String</DiscountLabelOff>
    <DiscountOff>0</DiscountOff>
    <ExpiryDurationDays>0</ExpiryDurationDays>
    <Feature>None</Feature>
    <Id>0</Id>
    <IsPlan>false</IsPlan>
    <IsRenewal>false</IsRenewal>
    <LicenseType>Free</LicenseType>
    <MaxQty>0</MaxQty>
    <ModifiedDate>0001-01-01T00:00:00</ModifiedDate>
    <Name>String</Name>
    <Notes>String</Notes>
    <Plan>String</Plan>
    <Price>0</Price>
    <ProductId>0</ProductId>
    <SubscriptionDurationDays>0</SubscriptionDurationDays>
    <SupportQty>0</SupportQty>
    <TrialPeriodDays>0</TrialPeriodDays>
    <Type>Product</Type>
  </BusinessSubscription>
  <Enterprise>
    <Active>false</Active>
    <Code>String</Code>
    <CoresQty>0</CoresQty>
    <CreatedDate>0001-01-01T00:00:00</CreatedDate>
    <DiscountLabelOff>String</DiscountLabelOff>
    <DiscountOff>0</DiscountOff>
    <ExpiryDurationDays>0</ExpiryDurationDays>
    <Feature>None</Feature>
    <Id>0</Id>
    <IsPlan>false</IsPlan>
    <IsRenewal>false</IsRenewal>
    <LicenseType>Free</LicenseType>
    <MaxQty>0</MaxQty>
    <ModifiedDate>0001-01-01T00:00:00</ModifiedDate>
    <Name>String</Name>
    <Notes>String</Notes>
    <Plan>String</Plan>
    <Price>0</Price>
    <ProductId>0</ProductId>
    <SubscriptionDurationDays>0</SubscriptionDurationDays>
    <SupportQty>0</SupportQty>
    <TrialPeriodDays>0</TrialPeriodDays>
    <Type>Product</Type>
  </Enterprise>
  <EnterpriseSubscription>
    <Active>false</Active>
    <Code>String</Code>
    <CoresQty>0</CoresQty>
    <CreatedDate>0001-01-01T00:00:00</CreatedDate>
    <DiscountLabelOff>String</DiscountLabelOff>
    <DiscountOff>0</DiscountOff>
    <ExpiryDurationDays>0</ExpiryDurationDays>
    <Feature>None</Feature>
    <Id>0</Id>
    <IsPlan>false</IsPlan>
    <IsRenewal>false</IsRenewal>
    <LicenseType>Free</LicenseType>
    <MaxQty>0</MaxQty>
    <ModifiedDate>0001-01-01T00:00:00</ModifiedDate>
    <Name>String</Name>
    <Notes>String</Notes>
    <Plan>String</Plan>
    <Price>0</Price>
    <ProductId>0</ProductId>
    <SubscriptionDurationDays>0</SubscriptionDurationDays>
    <SupportQty>0</SupportQty>
    <TrialPeriodDays>0</TrialPeriodDays>
    <Type>Product</Type>
  </EnterpriseSubscription>
  <Indie>
    <Active>false</Active>
    <Code>String</Code>
    <CoresQty>0</CoresQty>
    <CreatedDate>0001-01-01T00:00:00</CreatedDate>
    <DiscountLabelOff>String</DiscountLabelOff>
    <DiscountOff>0</DiscountOff>
    <ExpiryDurationDays>0</ExpiryDurationDays>
    <Feature>None</Feature>
    <Id>0</Id>
    <IsPlan>false</IsPlan>
    <IsRenewal>false</IsRenewal>
    <LicenseType>Free</LicenseType>
    <MaxQty>0</MaxQty>
    <ModifiedDate>0001-01-01T00:00:00</ModifiedDate>
    <Name>String</Name>
    <Notes>String</Notes>
    <Plan>String</Plan>
    <Price>0</Price>
    <ProductId>0</ProductId>
    <SubscriptionDurationDays>0</SubscriptionDurationDays>
    <SupportQty>0</SupportQty>
    <TrialPeriodDays>0</TrialPeriodDays>
    <Type>Product</Type>
  </Indie>
  <IndieRenewal>
    <Active>false</Active>
    <Code>String</Code>
    <CoresQty>0</CoresQty>
    <CreatedDate>0001-01-01T00:00:00</CreatedDate>
    <DiscountLabelOff>String</DiscountLabelOff>
    <DiscountOff>0</DiscountOff>
    <ExpiryDurationDays>0</ExpiryDurationDays>
    <Feature>None</Feature>
    <Id>0</Id>
    <IsPlan>false</IsPlan>
    <IsRenewal>false</IsRenewal>
    <LicenseType>Free</LicenseType>
    <MaxQty>0</MaxQty>
    <ModifiedDate>0001-01-01T00:00:00</ModifiedDate>
    <Name>String</Name>
    <Notes>String</Notes>
    <Plan>String</Plan>
    <Price>0</Price>
    <ProductId>0</ProductId>
    <SubscriptionDurationDays>0</SubscriptionDurationDays>
    <SupportQty>0</SupportQty>
    <TrialPeriodDays>0</TrialPeriodDays>
    <Type>Product</Type>
  </IndieRenewal>
  <IndieSubscription>
    <Active>false</Active>
    <Code>String</Code>
    <CoresQty>0</CoresQty>
    <CreatedDate>0001-01-01T00:00:00</CreatedDate>
    <DiscountLabelOff>String</DiscountLabelOff>
    <DiscountOff>0</DiscountOff>
    <ExpiryDurationDays>0</ExpiryDurationDays>
    <Feature>None</Feature>
    <Id>0</Id>
    <IsPlan>false</IsPlan>
    <IsRenewal>false</IsRenewal>
    <LicenseType>Free</LicenseType>
    <MaxQty>0</MaxQty>
    <ModifiedDate>0001-01-01T00:00:00</ModifiedDate>
    <Name>String</Name>
    <Notes>String</Notes>
    <Plan>String</Plan>
    <Price>0</Price>
    <ProductId>0</ProductId>
    <SubscriptionDurationDays>0</SubscriptionDurationDays>
    <SupportQty>0</SupportQty>
    <TrialPeriodDays>0</TrialPeriodDays>
    <Type>Product</Type>
  </IndieSubscription>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
</PricingResponse>