CoreService

<back to all web services

QueryResourceGroups

ResourceGroup - CRUD

GetResourceGroups

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
GET/api/resourcegroups/Returns all resourcegroups
GET/resourcegroups/Returns all resourcegroups
<?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};


// @DataContract
class QueryBase implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=1)
        /** @var int|null */
        public ?int $skip=null,

        // @DataMember(Order=2)
        /** @var int|null */
        public ?int $take=null,

        // @DataMember(Order=3)
        /** @var string|null */
        public ?string $orderBy=null,

        // @DataMember(Order=4)
        /** @var string|null */
        public ?string $orderByDesc=null,

        // @DataMember(Order=5)
        /** @var string|null */
        public ?string $include=null,

        // @DataMember(Order=6)
        /** @var string|null */
        public ?string $fields=null,

        // @DataMember(Order=7)
        /** @var array<string,string>|null */
        public ?array $meta=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['skip'])) $this->skip = $o['skip'];
        if (isset($o['take'])) $this->take = $o['take'];
        if (isset($o['orderBy'])) $this->orderBy = $o['orderBy'];
        if (isset($o['orderByDesc'])) $this->orderByDesc = $o['orderByDesc'];
        if (isset($o['include'])) $this->include = $o['include'];
        if (isset($o['fields'])) $this->fields = $o['fields'];
        if (isset($o['meta'])) $this->meta = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['meta']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->skip)) $o['skip'] = $this->skip;
        if (isset($this->take)) $o['take'] = $this->take;
        if (isset($this->orderBy)) $o['orderBy'] = $this->orderBy;
        if (isset($this->orderByDesc)) $o['orderByDesc'] = $this->orderByDesc;
        if (isset($this->include)) $o['include'] = $this->include;
        if (isset($this->fields)) $o['fields'] = $this->fields;
        if (isset($this->meta)) $o['meta'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->meta);
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template T
 */
class QueryDb extends QueryBase implements JsonSerializable
{
    public array $genericArgs = [];
    public static function create(array $genericArgs=[]): QueryDb {
        $to = new QueryDb();
        $to->genericArgs = $genericArgs;
        return $to;
    }

    /**
     * @param int|null $skip
     * @param int|null $take
     * @param string|null $orderBy
     * @param string|null $orderByDesc
     * @param string|null $include
     * @param string|null $fields
     * @param array<string,string>|null $meta
     */
    public function __construct(
        mixed $skip=null,
        mixed $take=null,
        mixed $orderBy=null,
        mixed $orderByDesc=null,
        mixed $include=null,
        mixed $fields=null,
        mixed $meta=null
    ) {
        parent::__construct($skip,$take,$orderBy,$orderByDesc,$include,$fields,$meta);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        return empty($o) ? new class(){} : $o;
    }
}

class Auditable implements IAuditable, JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var DateTime */
        public DateTime $created=new DateTime(),

        // @Required()
        /** @var string */
        public string $createUser='',

        // @Required()
        /** @var string */
        public string $createUserId='',

        // @Required()
        /** @var DateTime */
        public DateTime $modified=new DateTime(),

        // @Required()
        /** @var string */
        public string $modifyUser='',

        // @Required()
        /** @var string */
        public string $modifyUserId='',

        // @Required()
        /** @var bool|null */
        public ?bool $isDeleted=null,

        /** @var DateTime|null */
        public ?DateTime $deleted=null,
        /** @var string|null */
        public ?string $deleteUser=null,
        /** @var string|null */
        public ?string $deleteUserId=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['created'])) $this->created = JsonConverters::from('DateTime', $o['created']);
        if (isset($o['createUser'])) $this->createUser = $o['createUser'];
        if (isset($o['createUserId'])) $this->createUserId = $o['createUserId'];
        if (isset($o['modified'])) $this->modified = JsonConverters::from('DateTime', $o['modified']);
        if (isset($o['modifyUser'])) $this->modifyUser = $o['modifyUser'];
        if (isset($o['modifyUserId'])) $this->modifyUserId = $o['modifyUserId'];
        if (isset($o['isDeleted'])) $this->isDeleted = $o['isDeleted'];
        if (isset($o['deleted'])) $this->deleted = JsonConverters::from('DateTime', $o['deleted']);
        if (isset($o['deleteUser'])) $this->deleteUser = $o['deleteUser'];
        if (isset($o['deleteUserId'])) $this->deleteUserId = $o['deleteUserId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->created)) $o['created'] = JsonConverters::to('DateTime', $this->created);
        if (isset($this->createUser)) $o['createUser'] = $this->createUser;
        if (isset($this->createUserId)) $o['createUserId'] = $this->createUserId;
        if (isset($this->modified)) $o['modified'] = JsonConverters::to('DateTime', $this->modified);
        if (isset($this->modifyUser)) $o['modifyUser'] = $this->modifyUser;
        if (isset($this->modifyUserId)) $o['modifyUserId'] = $this->modifyUserId;
        if (isset($this->isDeleted)) $o['isDeleted'] = $this->isDeleted;
        if (isset($this->deleted)) $o['deleted'] = JsonConverters::to('DateTime', $this->deleted);
        if (isset($this->deleteUser)) $o['deleteUser'] = $this->deleteUser;
        if (isset($this->deleteUserId)) $o['deleteUserId'] = $this->deleteUserId;
        return empty($o) ? new class(){} : $o;
    }
}

enum ObjectTypes : string
{
    case None = 'None';
    case ConfigItem = 'ConfigItem';
    case Tenant = 'Tenant';
    case Collection = 'Collection';
    case Resource = 'Resource';
    case ComputeNode = 'ComputeNode';
    case VirtualMachine = 'VirtualMachine';
    case PhysicalMachine = 'PhysicalMachine';
    case Disk = 'Disk';
    case Subnet = 'Subnet';
    case IPAddress = 'IPAddress';
    case Job = 'Job';
    case JobEvent = 'JobEvent';
    case FreezePeriod = 'FreezePeriod';
    case ResourceGroup = 'ResourceGroup';
    case Deployment = 'Deployment';
    case ResourceGroupTemplate = 'ResourceGroupTemplate';
    case DeploymentTemplate = 'DeploymentTemplate';
    case ResourceProvider = 'ResourceProvider';
    case GenericResource = 'GenericResource';
    case Role = 'Role';
    case Permission = 'Permission';
    case User = 'User';
    case PatchingWindow = 'PatchingWindow';
    case Update = 'Update';
    case ReportDefinition = 'ReportDefinition';
    case TimeSeries = 'TimeSeries';
    case DataPoint = 'DataPoint';
    case Action = 'Action';
    case ActionAssignment = 'ActionAssignment';
    case UserNote = 'UserNote';
}

class Tag implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $name='',
        /** @var string|null */
        public ?string $value=null,
        /** @var bool|null */
        public ?bool $isProtected=null
    ) {
    }

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

class PathItem implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $label='',
        /** @var string */
        public string $link='',
        /** @var ObjectTypes|null */
        public ?ObjectTypes $objectType=null,
        /** @var string */
        public string $objectId=''
    ) {
    }

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

class ConfigItem extends Auditable implements IConfigItem, JsonSerializable
{
    /**
     * @param DateTime $created
     * @param string $createUser
     * @param string $createUserId
     * @param DateTime $modified
     * @param string $modifyUser
     * @param string $modifyUserId
     * @param bool|null $isDeleted
     * @param DateTime|null $deleted
     * @param string|null $deleteUser
     * @param string|null $deleteUserId
     */
    public function __construct(
        DateTime $created=new DateTime(),
        string $createUser='',
        string $createUserId='',
        DateTime $modified=new DateTime(),
        string $modifyUser='',
        string $modifyUserId='',
        ?bool $isDeleted=null,
        ?DateTime $deleted=null,
        ?string $deleteUser=null,
        ?string $deleteUserId=null,
        /** @var string */
        public string $id='',
        // @Required()
        /** @var string */
        public string $name='',

        // @Required()
        // @StringLength(250)
        /** @var string */
        public string $displayName='',

        // @StringLength(8000)
        /** @var string|null */
        public ?string $description=null,

        /** @var ObjectTypes|null */
        public ?ObjectTypes $objectType=null,
        // @Ignore()
        /** @var string */
        public string $selfLink='',

        // @Required()
        /** @var array<Tag>|null */
        public ?array $tags=null,

        // @Required()
        /** @var array<PathItem>|null */
        public ?array $path=null
    ) {
        parent::__construct($created,$createUser,$createUserId,$modified,$modifyUser,$modifyUserId,$isDeleted,$deleted,$deleteUser,$deleteUserId);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['displayName'])) $this->displayName = $o['displayName'];
        if (isset($o['description'])) $this->description = $o['description'];
        if (isset($o['objectType'])) $this->objectType = JsonConverters::from('ObjectTypes', $o['objectType']);
        if (isset($o['selfLink'])) $this->selfLink = $o['selfLink'];
        if (isset($o['tags'])) $this->tags = JsonConverters::fromArray('Tag', $o['tags']);
        if (isset($o['path'])) $this->path = JsonConverters::fromArray('PathItem', $o['path']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->displayName)) $o['displayName'] = $this->displayName;
        if (isset($this->description)) $o['description'] = $this->description;
        if (isset($this->objectType)) $o['objectType'] = JsonConverters::to('ObjectTypes', $this->objectType);
        if (isset($this->selfLink)) $o['selfLink'] = $this->selfLink;
        if (isset($this->tags)) $o['tags'] = JsonConverters::toArray('Tag', $this->tags);
        if (isset($this->path)) $o['path'] = JsonConverters::toArray('PathItem', $this->path);
        return empty($o) ? new class(){} : $o;
    }
}

enum Environments : string
{
    case Lab = 'Lab';
    case Poc = 'Poc';
    case Dev = 'Dev';
    case Test = 'Test';
    case Int = 'Int';
    case Uat = 'Uat';
    case Prod = 'Prod';
}

enum LifecycleStates : string
{
    case New = 'New';
    case Deploying = 'Deploying';
    case Deployed = 'Deployed';
    case Removing = 'Removing';
    case Removed = 'Removed';
    case Failure = 'Failure';
    case Imported = 'Imported';
}

enum ParameterValueType : string
{
    case String = 'String';
    case Number = 'Number';
    case Boolean = 'Boolean';
    case SecureString = 'SecureString';
}

class Parameter implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $name='',
        /** @var string|null */
        public ?string $description=null,
        /** @var string|null */
        public ?string $value=null,
        /** @var string|null */
        public ?string $default=null,
        /** @var bool|null */
        public ?bool $optional=null,
        /** @var ParameterValueType|null */
        public ?ParameterValueType $type=null,
        /** @var string|null */
        public ?string $validation=null
    ) {
    }

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

enum ValueDataType : string
{
    case String = 'String';
    case Number = 'Number';
    case Boolean = 'Boolean';
    case List = 'List';
}

class Variable implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $name='',
        /** @var string */
        public string $value='',
        /** @var ValueDataType|null */
        public ?ValueDataType $type=null,
        /** @var string|null */
        public ?string $description=null,
        /** @var bool|null */
        public ?bool $isInherited=null,
        /** @var Environments|null */
        public ?Environments $environment=null
    ) {
    }

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

class DeploymentCollection extends ConfigItem implements IHasTenantId, IHasVariables, JsonSerializable
{
    /**
     * @param DateTime $created
     * @param string $createUser
     * @param string $createUserId
     * @param DateTime $modified
     * @param string $modifyUser
     * @param string $modifyUserId
     * @param bool|null $isDeleted
     * @param DateTime|null $deleted
     * @param string|null $deleteUser
     * @param string|null $deleteUserId
     * @param string $id
     * @param string $name
     * @param string $displayName
     * @param string|null $description
     * @param ObjectTypes|null $objectType
     * @param string $selfLink
     * @param array<Tag>|null $tags
     * @param array<PathItem>|null $path
     */
    public function __construct(
        DateTime $created=new DateTime(),
        string $createUser='',
        string $createUserId='',
        DateTime $modified=new DateTime(),
        string $modifyUser='',
        string $modifyUserId='',
        ?bool $isDeleted=null,
        ?DateTime $deleted=null,
        ?string $deleteUser=null,
        ?string $deleteUserId=null,
        string $id='',
        string $name='',
        string $displayName='',
        ?string $description=null,
        ?ObjectTypes $objectType=null,
        string $selfLink='',
        ?array $tags=null,
        ?array $path=null,
        // @Required()
        /** @var string */
        public string $tenantId='',

        // @Required()
        /** @var array<Variable>|null */
        public ?array $variables=null,

        // @Required()
        /** @var bool|null */
        public ?bool $isLostAndFound=null,

        /** @var float */
        public float $monthlyBudget=0.0,
        /** @var bool|null */
        public ?bool $sendBudgetNotificationMails=null,
        /** @var int */
        public int $budgetWarningThresholdPercent=0
    ) {
        parent::__construct($created,$createUser,$createUserId,$modified,$modifyUser,$modifyUserId,$isDeleted,$deleted,$deleteUser,$deleteUserId,$id,$name,$displayName,$description,$objectType,$selfLink,$tags,$path);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['tenantId'])) $this->tenantId = $o['tenantId'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['objectType'])) $this->objectType = JsonConverters::from('ObjectTypes', $o['objectType']);
        if (isset($o['selfLink'])) $this->selfLink = $o['selfLink'];
        if (isset($o['variables'])) $this->variables = JsonConverters::fromArray('Variable', $o['variables']);
        if (isset($o['isLostAndFound'])) $this->isLostAndFound = $o['isLostAndFound'];
        if (isset($o['monthlyBudget'])) $this->monthlyBudget = $o['monthlyBudget'];
        if (isset($o['sendBudgetNotificationMails'])) $this->sendBudgetNotificationMails = $o['sendBudgetNotificationMails'];
        if (isset($o['budgetWarningThresholdPercent'])) $this->budgetWarningThresholdPercent = $o['budgetWarningThresholdPercent'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->tenantId)) $o['tenantId'] = $this->tenantId;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->objectType)) $o['objectType'] = JsonConverters::to('ObjectTypes', $this->objectType);
        if (isset($this->selfLink)) $o['selfLink'] = $this->selfLink;
        if (isset($this->variables)) $o['variables'] = JsonConverters::toArray('Variable', $this->variables);
        if (isset($this->isLostAndFound)) $o['isLostAndFound'] = $this->isLostAndFound;
        if (isset($this->monthlyBudget)) $o['monthlyBudget'] = $this->monthlyBudget;
        if (isset($this->sendBudgetNotificationMails)) $o['sendBudgetNotificationMails'] = $this->sendBudgetNotificationMails;
        if (isset($this->budgetWarningThresholdPercent)) $o['budgetWarningThresholdPercent'] = $this->budgetWarningThresholdPercent;
        return empty($o) ? new class(){} : $o;
    }
}

enum ResourceCompositions : string
{
    case Native = 'Native';
    case Foreign = 'Foreign';
    case Mixed = 'Mixed';
}

enum OperationalStates : string
{
    case None = 'None';
    case Starting = 'Starting';
    case Running = 'Running';
    case Stopping = 'Stopping';
    case Stopped = 'Stopped';
    case Restarting = 'Restarting';
    case Deleting = 'Deleting';
    case Unknown = 'Unknown';
}

class Deployment extends ConfigItem implements IHasTenantId, IHasVariables, IEnvironmentSpecific, IHasSequence, JsonSerializable
{
    /**
     * @param DateTime $created
     * @param string $createUser
     * @param string $createUserId
     * @param DateTime $modified
     * @param string $modifyUser
     * @param string $modifyUserId
     * @param bool|null $isDeleted
     * @param DateTime|null $deleted
     * @param string|null $deleteUser
     * @param string|null $deleteUserId
     * @param string $id
     * @param string $name
     * @param string $displayName
     * @param string|null $description
     * @param ObjectTypes|null $objectType
     * @param string $selfLink
     * @param array<Tag>|null $tags
     * @param array<PathItem>|null $path
     */
    public function __construct(
        DateTime $created=new DateTime(),
        string $createUser='',
        string $createUserId='',
        DateTime $modified=new DateTime(),
        string $modifyUser='',
        string $modifyUserId='',
        ?bool $isDeleted=null,
        ?DateTime $deleted=null,
        ?string $deleteUser=null,
        ?string $deleteUserId=null,
        string $id='',
        string $name='',
        string $displayName='',
        ?string $description=null,
        ?ObjectTypes $objectType=null,
        string $selfLink='',
        ?array $tags=null,
        ?array $path=null,
        // @Required()
        /** @var string */
        public string $shortId='',

        // @Required()
        /** @var string */
        public string $tenantId='',

        // @Required()
        /** @var string */
        public string $nameUserDefinedPart='',

        // @Required()
        /** @var LifecycleStates|null */
        public ?LifecycleStates $state=null,

        // @Required()
        /** @var Environments|null */
        public ?Environments $environment=null,

        /** @var string|null */
        public ?string $templateId=null,
        // @Required()
        /** @var array<Parameter>|null */
        public ?array $parameters=null,

        // @Required()
        /** @var array<Variable>|null */
        public ?array $variables=null,

        // @Required()
        /** @var array<Variable>|null */
        public ?array $variablesSnapshot=null,

        // @Required()
        // @References("typeof(CoreService.ServiceModel.BusinessObjects.Structure.DeploymentCollection)")
        /** @var string */
        public string $parentId='',

        /** @var DeploymentCollection|null */
        public ?DeploymentCollection $parent=null,
        // @Required()
        /** @var DateTime */
        public DateTime $validFrom=new DateTime(),

        /** @var DateTime|null */
        public ?DateTime $validUntil=null,
        // @Required()
        /** @var bool|null */
        public ?bool $isNeverExpiring=null,

        /** @var DateTime|null */
        public ?DateTime $nextPatchDate=null,
        // @Required()
        /** @var string */
        public string $defaultResourceProviderId='',

        // @Required()
        /** @var bool|null */
        public ?bool $needsAttention=null,

        /** @var ResourceCompositions|null */
        public ?ResourceCompositions $composition=null,
        /** @var float */
        public float $monthlyBudget=0.0,
        /** @var bool|null */
        public ?bool $sendBudgetNotificationMails=null,
        /** @var int */
        public int $budgetWarningThresholdPercent=0,
        /** @var OperationalStates|null */
        public ?OperationalStates $operationalState=null,
        /** @var int */
        public int $resourcesRunning=0,
        /** @var int */
        public int $resourcesTotal=0
    ) {
        parent::__construct($created,$createUser,$createUserId,$modified,$modifyUser,$modifyUserId,$isDeleted,$deleted,$deleteUser,$deleteUserId,$id,$name,$displayName,$description,$objectType,$selfLink,$tags,$path);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['shortId'])) $this->shortId = $o['shortId'];
        if (isset($o['tenantId'])) $this->tenantId = $o['tenantId'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['nameUserDefinedPart'])) $this->nameUserDefinedPart = $o['nameUserDefinedPart'];
        if (isset($o['objectType'])) $this->objectType = JsonConverters::from('ObjectTypes', $o['objectType']);
        if (isset($o['selfLink'])) $this->selfLink = $o['selfLink'];
        if (isset($o['state'])) $this->state = JsonConverters::from('LifecycleStates', $o['state']);
        if (isset($o['environment'])) $this->environment = JsonConverters::from('Environments', $o['environment']);
        if (isset($o['templateId'])) $this->templateId = $o['templateId'];
        if (isset($o['parameters'])) $this->parameters = JsonConverters::fromArray('Parameter', $o['parameters']);
        if (isset($o['variables'])) $this->variables = JsonConverters::fromArray('Variable', $o['variables']);
        if (isset($o['variablesSnapshot'])) $this->variablesSnapshot = JsonConverters::fromArray('Variable', $o['variablesSnapshot']);
        if (isset($o['parentId'])) $this->parentId = $o['parentId'];
        if (isset($o['parent'])) $this->parent = JsonConverters::from('DeploymentCollection', $o['parent']);
        if (isset($o['validFrom'])) $this->validFrom = JsonConverters::from('DateTime', $o['validFrom']);
        if (isset($o['validUntil'])) $this->validUntil = JsonConverters::from('DateTime', $o['validUntil']);
        if (isset($o['isNeverExpiring'])) $this->isNeverExpiring = $o['isNeverExpiring'];
        if (isset($o['nextPatchDate'])) $this->nextPatchDate = JsonConverters::from('DateTime', $o['nextPatchDate']);
        if (isset($o['defaultResourceProviderId'])) $this->defaultResourceProviderId = $o['defaultResourceProviderId'];
        if (isset($o['needsAttention'])) $this->needsAttention = $o['needsAttention'];
        if (isset($o['composition'])) $this->composition = JsonConverters::from('ResourceCompositions', $o['composition']);
        if (isset($o['monthlyBudget'])) $this->monthlyBudget = $o['monthlyBudget'];
        if (isset($o['sendBudgetNotificationMails'])) $this->sendBudgetNotificationMails = $o['sendBudgetNotificationMails'];
        if (isset($o['budgetWarningThresholdPercent'])) $this->budgetWarningThresholdPercent = $o['budgetWarningThresholdPercent'];
        if (isset($o['operationalState'])) $this->operationalState = JsonConverters::from('OperationalStates', $o['operationalState']);
        if (isset($o['resourcesRunning'])) $this->resourcesRunning = $o['resourcesRunning'];
        if (isset($o['resourcesTotal'])) $this->resourcesTotal = $o['resourcesTotal'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->shortId)) $o['shortId'] = $this->shortId;
        if (isset($this->tenantId)) $o['tenantId'] = $this->tenantId;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->nameUserDefinedPart)) $o['nameUserDefinedPart'] = $this->nameUserDefinedPart;
        if (isset($this->objectType)) $o['objectType'] = JsonConverters::to('ObjectTypes', $this->objectType);
        if (isset($this->selfLink)) $o['selfLink'] = $this->selfLink;
        if (isset($this->state)) $o['state'] = JsonConverters::to('LifecycleStates', $this->state);
        if (isset($this->environment)) $o['environment'] = JsonConverters::to('Environments', $this->environment);
        if (isset($this->templateId)) $o['templateId'] = $this->templateId;
        if (isset($this->parameters)) $o['parameters'] = JsonConverters::toArray('Parameter', $this->parameters);
        if (isset($this->variables)) $o['variables'] = JsonConverters::toArray('Variable', $this->variables);
        if (isset($this->variablesSnapshot)) $o['variablesSnapshot'] = JsonConverters::toArray('Variable', $this->variablesSnapshot);
        if (isset($this->parentId)) $o['parentId'] = $this->parentId;
        if (isset($this->parent)) $o['parent'] = JsonConverters::to('DeploymentCollection', $this->parent);
        if (isset($this->validFrom)) $o['validFrom'] = JsonConverters::to('DateTime', $this->validFrom);
        if (isset($this->validUntil)) $o['validUntil'] = JsonConverters::to('DateTime', $this->validUntil);
        if (isset($this->isNeverExpiring)) $o['isNeverExpiring'] = $this->isNeverExpiring;
        if (isset($this->nextPatchDate)) $o['nextPatchDate'] = JsonConverters::to('DateTime', $this->nextPatchDate);
        if (isset($this->defaultResourceProviderId)) $o['defaultResourceProviderId'] = $this->defaultResourceProviderId;
        if (isset($this->needsAttention)) $o['needsAttention'] = $this->needsAttention;
        if (isset($this->composition)) $o['composition'] = JsonConverters::to('ResourceCompositions', $this->composition);
        if (isset($this->monthlyBudget)) $o['monthlyBudget'] = $this->monthlyBudget;
        if (isset($this->sendBudgetNotificationMails)) $o['sendBudgetNotificationMails'] = $this->sendBudgetNotificationMails;
        if (isset($this->budgetWarningThresholdPercent)) $o['budgetWarningThresholdPercent'] = $this->budgetWarningThresholdPercent;
        if (isset($this->operationalState)) $o['operationalState'] = JsonConverters::to('OperationalStates', $this->operationalState);
        if (isset($this->resourcesRunning)) $o['resourcesRunning'] = $this->resourcesRunning;
        if (isset($this->resourcesTotal)) $o['resourcesTotal'] = $this->resourcesTotal;
        return empty($o) ? new class(){} : $o;
    }
}

class ResourceGroup extends ConfigItem implements IHasTenantId, IHasVariables, IEnvironmentSpecific, IHasSequence, JsonSerializable
{
    /**
     * @param DateTime $created
     * @param string $createUser
     * @param string $createUserId
     * @param DateTime $modified
     * @param string $modifyUser
     * @param string $modifyUserId
     * @param bool|null $isDeleted
     * @param DateTime|null $deleted
     * @param string|null $deleteUser
     * @param string|null $deleteUserId
     * @param string $id
     * @param string $name
     * @param string $displayName
     * @param string|null $description
     * @param ObjectTypes|null $objectType
     * @param string $selfLink
     * @param array<Tag>|null $tags
     * @param array<PathItem>|null $path
     */
    public function __construct(
        DateTime $created=new DateTime(),
        string $createUser='',
        string $createUserId='',
        DateTime $modified=new DateTime(),
        string $modifyUser='',
        string $modifyUserId='',
        ?bool $isDeleted=null,
        ?DateTime $deleted=null,
        ?string $deleteUser=null,
        ?string $deleteUserId=null,
        string $id='',
        string $name='',
        string $displayName='',
        ?string $description=null,
        ?ObjectTypes $objectType=null,
        string $selfLink='',
        ?array $tags=null,
        ?array $path=null,
        // @Required()
        /** @var string */
        public string $shortId='',

        // @Required()
        /** @var string */
        public string $tenantId='',

        // @Required()
        /** @var Environments|null */
        public ?Environments $environment=null,

        // @Required()
        /** @var LifecycleStates|null */
        public ?LifecycleStates $state=null,

        // @Required()
        // @References("typeof(CoreService.ServiceModel.BusinessObjects.Structure.Deployment)")
        /** @var string */
        public string $parentId='',

        /** @var Deployment|null */
        public ?Deployment $parent=null,
        /** @var string|null */
        public ?string $templateId=null,
        // @Required()
        /** @var array<Parameter>|null */
        public ?array $parameters=null,

        // @Required()
        /** @var array<Variable>|null */
        public ?array $variables=null,

        /** @var DateTime|null */
        public ?DateTime $nextPatchDate=null,
        /** @var ResourceCompositions|null */
        public ?ResourceCompositions $composition=null
    ) {
        parent::__construct($created,$createUser,$createUserId,$modified,$modifyUser,$modifyUserId,$isDeleted,$deleted,$deleteUser,$deleteUserId,$id,$name,$displayName,$description,$objectType,$selfLink,$tags,$path);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['shortId'])) $this->shortId = $o['shortId'];
        if (isset($o['tenantId'])) $this->tenantId = $o['tenantId'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['objectType'])) $this->objectType = JsonConverters::from('ObjectTypes', $o['objectType']);
        if (isset($o['selfLink'])) $this->selfLink = $o['selfLink'];
        if (isset($o['environment'])) $this->environment = JsonConverters::from('Environments', $o['environment']);
        if (isset($o['state'])) $this->state = JsonConverters::from('LifecycleStates', $o['state']);
        if (isset($o['parentId'])) $this->parentId = $o['parentId'];
        if (isset($o['parent'])) $this->parent = JsonConverters::from('Deployment', $o['parent']);
        if (isset($o['templateId'])) $this->templateId = $o['templateId'];
        if (isset($o['parameters'])) $this->parameters = JsonConverters::fromArray('Parameter', $o['parameters']);
        if (isset($o['variables'])) $this->variables = JsonConverters::fromArray('Variable', $o['variables']);
        if (isset($o['nextPatchDate'])) $this->nextPatchDate = JsonConverters::from('DateTime', $o['nextPatchDate']);
        if (isset($o['composition'])) $this->composition = JsonConverters::from('ResourceCompositions', $o['composition']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->shortId)) $o['shortId'] = $this->shortId;
        if (isset($this->tenantId)) $o['tenantId'] = $this->tenantId;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->objectType)) $o['objectType'] = JsonConverters::to('ObjectTypes', $this->objectType);
        if (isset($this->selfLink)) $o['selfLink'] = $this->selfLink;
        if (isset($this->environment)) $o['environment'] = JsonConverters::to('Environments', $this->environment);
        if (isset($this->state)) $o['state'] = JsonConverters::to('LifecycleStates', $this->state);
        if (isset($this->parentId)) $o['parentId'] = $this->parentId;
        if (isset($this->parent)) $o['parent'] = JsonConverters::to('Deployment', $this->parent);
        if (isset($this->templateId)) $o['templateId'] = $this->templateId;
        if (isset($this->parameters)) $o['parameters'] = JsonConverters::toArray('Parameter', $this->parameters);
        if (isset($this->variables)) $o['variables'] = JsonConverters::toArray('Variable', $this->variables);
        if (isset($this->nextPatchDate)) $o['nextPatchDate'] = JsonConverters::to('DateTime', $this->nextPatchDate);
        if (isset($this->composition)) $o['composition'] = JsonConverters::to('ResourceCompositions', $this->composition);
        return empty($o) ? new class(){} : $o;
    }
}

enum Aggregations : string
{
    case None = 'None';
    case Count = 'Count';
    case DistinctCount = 'DistinctCount';
    case Sum = 'Sum';
    case Min = 'Min';
    case Max = 'Max';
    case Avg = 'Avg';
    case First = 'First';
}

/** @description GetResourceGroups */
// @Api(Description="GetResourceGroups")
// @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType="typeof(YCO.Dune.Models.Dtos.Common.Responses.ItemsResponse`1[[CoreService.ServiceModel.Dtos.ResourceGroups.Responses.ResourceGroupDto, CoreService.ServiceModel, Version=0.15.14.0, Culture=neutral, PublicKeyToken=null]])", StatusCode=200)
/**
 * @template QueryDb of ResourceGroup
 */
class QueryResourceGroups extends QueryDb implements IGetMultipleRequest, IHasTenantName, IGet, IGroupable, JsonSerializable
{
    /**
     * @param int|null $skip
     * @param int|null $take
     * @param string|null $orderBy
     * @param string|null $orderByDesc
     * @param string|null $include
     * @param string|null $fields
     * @param array<string,string>|null $meta
     */
    public function __construct(
        ?int $skip=null,
        ?int $take=null,
        ?string $orderBy=null,
        ?string $orderByDesc=null,
        ?string $include=null,
        ?string $fields=null,
        ?array $meta=null,
        // @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
        // @Validate(Validator="NotEmpty")
        /** @var string */
        public string $tenantName='',

        /** @description If true, also soft deleted items will be returned */
        // @ApiMember(Description="If true, also soft deleted items will be returned", ParameterType="query")
        /** @var bool|null */
        public ?bool $includeDeleted=null,

        /** @description The property, the data will be grouped on */
        // @ApiMember(Description="The property, the data will be grouped on", ParameterType="query")
        /** @var string|null */
        public ?string $groupBy=null,

        /** @description The property, used for aggregation */
        // @ApiMember(Description="The property, used for aggregation", ParameterType="query")
        /** @var string|null */
        public ?string $aggregateOn=null,

        /** @description The aggregation function to use */
        // @ApiMember(Description="The aggregation function to use", ParameterType="query")
        /** @var Aggregations|null */
        public ?Aggregations $aggregation=null,

        /** @description Returns all referenced object */
        // @ApiMember(Description="Returns all referenced object", ParameterType="query")
        /** @var bool|null */
        public ?bool $includeReferencedObjects=null
    ) {
        parent::__construct($skip,$take,$orderBy,$orderByDesc,$include,$fields,$meta);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['tenantName'])) $this->tenantName = $o['tenantName'];
        if (isset($o['includeDeleted'])) $this->includeDeleted = $o['includeDeleted'];
        if (isset($o['groupBy'])) $this->groupBy = $o['groupBy'];
        if (isset($o['aggregateOn'])) $this->aggregateOn = $o['aggregateOn'];
        if (isset($o['aggregation'])) $this->aggregation = JsonConverters::from('Aggregations', $o['aggregation']);
        if (isset($o['includeReferencedObjects'])) $this->includeReferencedObjects = $o['includeReferencedObjects'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->tenantName)) $o['tenantName'] = $this->tenantName;
        if (isset($this->includeDeleted)) $o['includeDeleted'] = $this->includeDeleted;
        if (isset($this->groupBy)) $o['groupBy'] = $this->groupBy;
        if (isset($this->aggregateOn)) $o['aggregateOn'] = $this->aggregateOn;
        if (isset($this->aggregation)) $o['aggregation'] = JsonConverters::to('Aggregations', $this->aggregation);
        if (isset($this->includeReferencedObjects)) $o['includeReferencedObjects'] = $this->includeReferencedObjects;
        return empty($o) ? new class(){} : $o;
    }
}

class Tenant extends ConfigItem implements IHasVariables, JsonSerializable
{
    /**
     * @param DateTime $created
     * @param string $createUser
     * @param string $createUserId
     * @param DateTime $modified
     * @param string $modifyUser
     * @param string $modifyUserId
     * @param bool|null $isDeleted
     * @param DateTime|null $deleted
     * @param string|null $deleteUser
     * @param string|null $deleteUserId
     * @param string $id
     * @param string $name
     * @param string $displayName
     * @param string|null $description
     * @param ObjectTypes|null $objectType
     * @param string $selfLink
     * @param array<Tag>|null $tags
     * @param array<PathItem>|null $path
     */
    public function __construct(
        DateTime $created=new DateTime(),
        string $createUser='',
        string $createUserId='',
        DateTime $modified=new DateTime(),
        string $modifyUser='',
        string $modifyUserId='',
        ?bool $isDeleted=null,
        ?DateTime $deleted=null,
        ?string $deleteUser=null,
        ?string $deleteUserId=null,
        string $id='',
        string $name='',
        string $displayName='',
        ?string $description=null,
        ?ObjectTypes $objectType=null,
        string $selfLink='',
        ?array $tags=null,
        ?array $path=null,
        // @Required()
        /** @var array<Variable>|null */
        public ?array $variables=null,

        // @Required()
        /** @var array<string>|null */
        public ?array $allowedMailDomains=null,

        // @Required()
        /** @var array<string>|null */
        public ?array $licensedModules=null,

        // @Required()
        /** @var int */
        public int $defaultDeploymentLifetimeDays=0,

        // @Required()
        /** @var int */
        public int $maxDeploymentLifetimeDays=0,

        // @Required()
        /** @var int */
        public int $systemUnpatchedWarningDays=0,

        // @Required()
        /** @var int */
        public int $systemBackupMissingWarningHours=0,

        // @Required()
        /** @var int */
        public int $stopVulnerableResourceAfterDays=0,

        // @Required()
        /** @var int */
        public int $deploymentExpirationWarningDays=0,

        // @Required()
        /** @var int */
        public int $patchNotificationDays=0,

        // @Required()
        /** @var bool|null */
        public ?bool $useCustomHostnames=null,

        // @Required()
        /** @var int */
        public int $removeInactiveVulnerabilitiesAfterDays=0
    ) {
        parent::__construct($created,$createUser,$createUserId,$modified,$modifyUser,$modifyUserId,$isDeleted,$deleted,$deleteUser,$deleteUserId,$id,$name,$displayName,$description,$objectType,$selfLink,$tags,$path);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['objectType'])) $this->objectType = JsonConverters::from('ObjectTypes', $o['objectType']);
        if (isset($o['selfLink'])) $this->selfLink = $o['selfLink'];
        if (isset($o['variables'])) $this->variables = JsonConverters::fromArray('Variable', $o['variables']);
        if (isset($o['allowedMailDomains'])) $this->allowedMailDomains = JsonConverters::fromArray('string', $o['allowedMailDomains']);
        if (isset($o['licensedModules'])) $this->licensedModules = JsonConverters::fromArray('string', $o['licensedModules']);
        if (isset($o['defaultDeploymentLifetimeDays'])) $this->defaultDeploymentLifetimeDays = $o['defaultDeploymentLifetimeDays'];
        if (isset($o['maxDeploymentLifetimeDays'])) $this->maxDeploymentLifetimeDays = $o['maxDeploymentLifetimeDays'];
        if (isset($o['systemUnpatchedWarningDays'])) $this->systemUnpatchedWarningDays = $o['systemUnpatchedWarningDays'];
        if (isset($o['systemBackupMissingWarningHours'])) $this->systemBackupMissingWarningHours = $o['systemBackupMissingWarningHours'];
        if (isset($o['stopVulnerableResourceAfterDays'])) $this->stopVulnerableResourceAfterDays = $o['stopVulnerableResourceAfterDays'];
        if (isset($o['deploymentExpirationWarningDays'])) $this->deploymentExpirationWarningDays = $o['deploymentExpirationWarningDays'];
        if (isset($o['patchNotificationDays'])) $this->patchNotificationDays = $o['patchNotificationDays'];
        if (isset($o['useCustomHostnames'])) $this->useCustomHostnames = $o['useCustomHostnames'];
        if (isset($o['removeInactiveVulnerabilitiesAfterDays'])) $this->removeInactiveVulnerabilitiesAfterDays = $o['removeInactiveVulnerabilitiesAfterDays'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->objectType)) $o['objectType'] = JsonConverters::to('ObjectTypes', $this->objectType);
        if (isset($this->selfLink)) $o['selfLink'] = $this->selfLink;
        if (isset($this->variables)) $o['variables'] = JsonConverters::toArray('Variable', $this->variables);
        if (isset($this->allowedMailDomains)) $o['allowedMailDomains'] = JsonConverters::toArray('string', $this->allowedMailDomains);
        if (isset($this->licensedModules)) $o['licensedModules'] = JsonConverters::toArray('string', $this->licensedModules);
        if (isset($this->defaultDeploymentLifetimeDays)) $o['defaultDeploymentLifetimeDays'] = $this->defaultDeploymentLifetimeDays;
        if (isset($this->maxDeploymentLifetimeDays)) $o['maxDeploymentLifetimeDays'] = $this->maxDeploymentLifetimeDays;
        if (isset($this->systemUnpatchedWarningDays)) $o['systemUnpatchedWarningDays'] = $this->systemUnpatchedWarningDays;
        if (isset($this->systemBackupMissingWarningHours)) $o['systemBackupMissingWarningHours'] = $this->systemBackupMissingWarningHours;
        if (isset($this->stopVulnerableResourceAfterDays)) $o['stopVulnerableResourceAfterDays'] = $this->stopVulnerableResourceAfterDays;
        if (isset($this->deploymentExpirationWarningDays)) $o['deploymentExpirationWarningDays'] = $this->deploymentExpirationWarningDays;
        if (isset($this->patchNotificationDays)) $o['patchNotificationDays'] = $this->patchNotificationDays;
        if (isset($this->useCustomHostnames)) $o['useCustomHostnames'] = $this->useCustomHostnames;
        if (isset($this->removeInactiveVulnerabilitiesAfterDays)) $o['removeInactiveVulnerabilitiesAfterDays'] = $this->removeInactiveVulnerabilitiesAfterDays;
        return empty($o) ? new class(){} : $o;
    }
}

enum IntervalUnits : string
{
    case Second = 'Second';
    case Minute = 'Minute';
    case Hour = 'Hour';
    case Day = 'Day';
    case Week = 'Week';
    case Month = 'Month';
    case Year = 'Year';
}

class TimeSeriesDefinition extends Auditable implements IHasIdName, IHasTenantId, IHasObjectType, JsonSerializable
{
    /**
     * @param DateTime $created
     * @param string $createUser
     * @param string $createUserId
     * @param DateTime $modified
     * @param string $modifyUser
     * @param string $modifyUserId
     * @param bool|null $isDeleted
     * @param DateTime|null $deleted
     * @param string|null $deleteUser
     * @param string|null $deleteUserId
     */
    public function __construct(
        DateTime $created=new DateTime(),
        string $createUser='',
        string $createUserId='',
        DateTime $modified=new DateTime(),
        string $modifyUser='',
        string $modifyUserId='',
        ?bool $isDeleted=null,
        ?DateTime $deleted=null,
        ?string $deleteUser=null,
        ?string $deleteUserId=null,
        /** @var string */
        public string $id='',
        // @References("typeof(CoreService.ServiceModel.BusinessObjects.Structure.Tenant)")
        /** @var string */
        public string $tenantId='',

        /** @var Tenant|null */
        public ?Tenant $tenant=null,
        /** @var string */
        public string $name='',
        /** @var string|null */
        public ?string $displayName=null,
        // @Ignore()
        /** @var string */
        public string $selfLink='',

        // @Required()
        /** @var ObjectTypes|null */
        public ?ObjectTypes $objectType=null,

        /** @var string|null */
        public ?string $description=null,
        /** @var ObjectTypes|null */
        public ?ObjectTypes $sourceType=null,
        /** @var bool|null */
        public ?bool $autoCollection=null,
        /** @var string|null */
        public ?string $autoCollectionQuery=null,
        /** @var int|null */
        public ?int $autoCollectionInterval=null,
        /** @var IntervalUnits|null */
        public ?IntervalUnits $autoCollectionIntervalUnit=null,
        /** @var DateInterval|null */
        public ?DateInterval $autoCollectionTime=null,
        /** @var DateTime|null */
        public ?DateTime $lastAutoCollected=null,
        /** @var int */
        public int $retentionTimeMonths=0
    ) {
        parent::__construct($created,$createUser,$createUserId,$modified,$modifyUser,$modifyUserId,$isDeleted,$deleted,$deleteUser,$deleteUserId);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['tenantId'])) $this->tenantId = $o['tenantId'];
        if (isset($o['tenant'])) $this->tenant = JsonConverters::from('Tenant', $o['tenant']);
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['displayName'])) $this->displayName = $o['displayName'];
        if (isset($o['selfLink'])) $this->selfLink = $o['selfLink'];
        if (isset($o['objectType'])) $this->objectType = JsonConverters::from('ObjectTypes', $o['objectType']);
        if (isset($o['description'])) $this->description = $o['description'];
        if (isset($o['sourceType'])) $this->sourceType = JsonConverters::from('ObjectTypes', $o['sourceType']);
        if (isset($o['autoCollection'])) $this->autoCollection = $o['autoCollection'];
        if (isset($o['autoCollectionQuery'])) $this->autoCollectionQuery = $o['autoCollectionQuery'];
        if (isset($o['autoCollectionInterval'])) $this->autoCollectionInterval = $o['autoCollectionInterval'];
        if (isset($o['autoCollectionIntervalUnit'])) $this->autoCollectionIntervalUnit = JsonConverters::from('IntervalUnits', $o['autoCollectionIntervalUnit']);
        if (isset($o['autoCollectionTime'])) $this->autoCollectionTime = JsonConverters::from('TimeOnly', $o['autoCollectionTime']);
        if (isset($o['lastAutoCollected'])) $this->lastAutoCollected = JsonConverters::from('DateTime', $o['lastAutoCollected']);
        if (isset($o['retentionTimeMonths'])) $this->retentionTimeMonths = $o['retentionTimeMonths'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->tenantId)) $o['tenantId'] = $this->tenantId;
        if (isset($this->tenant)) $o['tenant'] = JsonConverters::to('Tenant', $this->tenant);
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->displayName)) $o['displayName'] = $this->displayName;
        if (isset($this->selfLink)) $o['selfLink'] = $this->selfLink;
        if (isset($this->objectType)) $o['objectType'] = JsonConverters::to('ObjectTypes', $this->objectType);
        if (isset($this->description)) $o['description'] = $this->description;
        if (isset($this->sourceType)) $o['sourceType'] = JsonConverters::to('ObjectTypes', $this->sourceType);
        if (isset($this->autoCollection)) $o['autoCollection'] = $this->autoCollection;
        if (isset($this->autoCollectionQuery)) $o['autoCollectionQuery'] = $this->autoCollectionQuery;
        if (isset($this->autoCollectionInterval)) $o['autoCollectionInterval'] = $this->autoCollectionInterval;
        if (isset($this->autoCollectionIntervalUnit)) $o['autoCollectionIntervalUnit'] = JsonConverters::to('IntervalUnits', $this->autoCollectionIntervalUnit);
        if (isset($this->autoCollectionTime)) $o['autoCollectionTime'] = JsonConverters::to('TimeOnly', $this->autoCollectionTime);
        if (isset($this->lastAutoCollected)) $o['lastAutoCollected'] = JsonConverters::to('DateTime', $this->lastAutoCollected);
        if (isset($this->retentionTimeMonths)) $o['retentionTimeMonths'] = $this->retentionTimeMonths;
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
/**
 * @template T
 */
class QueryResponse implements JsonSerializable
{
    public array $genericArgs = [];
    public static function create(array $genericArgs=[]): QueryResponse {
        $to = new QueryResponse();
        $to->genericArgs = $genericArgs;
        return $to;
    }

    public function __construct(
        // @DataMember(Order=1)
        /** @var int */
        public mixed $offset=0,

        // @DataMember(Order=2)
        /** @var int */
        public mixed $total=0,

        // @DataMember(Order=3)
        /** @var array<TimeSeriesDefinition>|null */
        public mixed $results=null,

        // @DataMember(Order=4)
        /** @var array<string,string>|null */
        public mixed $meta=null,

        // @DataMember(Order=5)
        /** @var ResponseStatus|null */
        public mixed $responseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['offset'])) $this->offset = $o['offset'];
        if (isset($o['total'])) $this->total = $o['total'];
        if (isset($o['results'])) $this->results = JsonConverters::fromArray('TimeSeriesDefinition', $o['results']);
        if (isset($o['meta'])) $this->meta = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['meta']);
        if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->offset)) $o['offset'] = $this->offset;
        if (isset($this->total)) $o['total'] = $this->total;
        if (isset($this->results)) $o['results'] = JsonConverters::toArray('TimeSeriesDefinition', $this->results);
        if (isset($this->meta)) $o['meta'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->meta);
        if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

PHP QueryResourceGroups 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 /api/resourcegroups/ HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"offset":0,"total":0,"results":[{"shortId":"String","tenantId":"00000000-0000-0000-0000-000000000000","name":"String","objectType":"ResourceGroup","selfLink":"/resourcegroups/00000000-0000-0000-0000-000000000000","environment":"Lab","state":"New","parentId":"00000000-0000-0000-0000-000000000000","parent":{"shortId":"String","tenantId":"00000000-0000-0000-0000-000000000000","name":"String","nameUserDefinedPart":"String","objectType":"Deployment","selfLink":"/deployments/00000000-0000-0000-0000-000000000000","state":"New","environment":"Lab","templateId":"00000000-0000-0000-0000-000000000000","parameters":null,"variables":null,"variablesSnapshot":null,"parentId":"00000000-0000-0000-0000-000000000000","parent":{"tenantId":"00000000-0000-0000-0000-000000000000","name":"String","objectType":"Collection","selfLink":"/collections/00000000-0000-0000-0000-000000000000","variables":null,"isLostAndFound":false,"monthlyBudget":0,"sendBudgetNotificationMails":false,"budgetWarningThresholdPercent":0,"id":"00000000-0000-0000-0000-000000000000","displayName":"String","description":"String","tags":null,"path":null,"created":"0001-01-01T00:00:00.0000000Z","createUser":"String","createUserId":"String","modified":"0001-01-01T00:00:00.0000000Z","modifyUser":"String","modifyUserId":"String","isDeleted":false,"deleted":"0001-01-01T00:00:00.0000000Z","deleteUser":"String","deleteUserId":"String"},"validFrom":"0001-01-01T00:00:00.0000000Z","validUntil":"0001-01-01T00:00:00.0000000Z","isNeverExpiring":false,"nextPatchDate":"0001-01-01T00:00:00.0000000Z","defaultResourceProviderId":"00000000-0000-0000-0000-000000000000","needsAttention":false,"composition":"Native","monthlyBudget":0,"sendBudgetNotificationMails":false,"budgetWarningThresholdPercent":0,"operationalState":"None","resourcesRunning":0,"resourcesTotal":0,"id":"00000000-0000-0000-0000-000000000000","displayName":"String","description":"String","tags":null,"path":null,"created":"0001-01-01T00:00:00.0000000Z","createUser":"String","createUserId":"String","modified":"0001-01-01T00:00:00.0000000Z","modifyUser":"String","modifyUserId":"String","isDeleted":false,"deleted":"0001-01-01T00:00:00.0000000Z","deleteUser":"String","deleteUserId":"String"},"templateId":"00000000-0000-0000-0000-000000000000","parameters":null,"variables":null,"nextPatchDate":"0001-01-01T00:00:00.0000000Z","composition":"Native","id":"00000000-0000-0000-0000-000000000000","displayName":"String","description":"String","tags":null,"path":null,"created":"0001-01-01T00:00:00.0000000Z","createUser":"String","createUserId":"String","modified":"0001-01-01T00:00:00.0000000Z","modifyUser":"String","modifyUserId":"String","isDeleted":false,"deleted":"0001-01-01T00:00:00.0000000Z","deleteUser":"String","deleteUserId":"String"}],"meta":{"String":"String"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}