Power.Dev Optimization Services

<back to all web services

CommonOptimizerProjectInfoRequest

The following routes are available for this service:
POST/optimizer/project-info
<?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};


class CommonOptimizerPortalRequestBase implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $projectId='',
        /** @var bool|null */
        public ?bool $isBatchSimulation=null,
        /** @var bool|null */
        public ?bool $force=null,
        /** @var bool|null */
        public ?bool $disableEBSSpot=null,
        /** @var bool|null */
        public ?bool $isServerless=null,
        /** @var string */
        public string $apiActionId='',
        /** @var int */
        public int $nodeId=0,
        /** @var int */
        public int $parallelProject=0,
        /** @var int */
        public int $parallelYears=0,
        /** @var int */
        public int $ensureExlusive=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['projectId'])) $this->projectId = $o['projectId'];
        if (isset($o['isBatchSimulation'])) $this->isBatchSimulation = $o['isBatchSimulation'];
        if (isset($o['force'])) $this->force = $o['force'];
        if (isset($o['disableEBSSpot'])) $this->disableEBSSpot = $o['disableEBSSpot'];
        if (isset($o['isServerless'])) $this->isServerless = $o['isServerless'];
        if (isset($o['apiActionId'])) $this->apiActionId = $o['apiActionId'];
        if (isset($o['nodeId'])) $this->nodeId = $o['nodeId'];
        if (isset($o['parallelProject'])) $this->parallelProject = $o['parallelProject'];
        if (isset($o['parallelYears'])) $this->parallelYears = $o['parallelYears'];
        if (isset($o['ensureExlusive'])) $this->ensureExlusive = $o['ensureExlusive'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->projectId)) $o['projectId'] = $this->projectId;
        if (isset($this->isBatchSimulation)) $o['isBatchSimulation'] = $this->isBatchSimulation;
        if (isset($this->force)) $o['force'] = $this->force;
        if (isset($this->disableEBSSpot)) $o['disableEBSSpot'] = $this->disableEBSSpot;
        if (isset($this->isServerless)) $o['isServerless'] = $this->isServerless;
        if (isset($this->apiActionId)) $o['apiActionId'] = $this->apiActionId;
        if (isset($this->nodeId)) $o['nodeId'] = $this->nodeId;
        if (isset($this->parallelProject)) $o['parallelProject'] = $this->parallelProject;
        if (isset($this->parallelYears)) $o['parallelYears'] = $this->parallelYears;
        if (isset($this->ensureExlusive)) $o['ensureExlusive'] = $this->ensureExlusive;
        return empty($o) ? new class(){} : $o;
    }
}

class CommonOptimizerProjectInfoRequest extends CommonOptimizerPortalRequestBase implements JsonSerializable
{
    /**
     * @param string $projectId
     * @param bool|null $isBatchSimulation
     * @param bool|null $force
     * @param bool|null $disableEBSSpot
     * @param bool|null $isServerless
     * @param string $apiActionId
     * @param int $nodeId
     * @param int $parallelProject
     * @param int $parallelYears
     * @param int $ensureExlusive
     */
    public function __construct(
        string $projectId='',
        ?bool $isBatchSimulation=null,
        ?bool $force=null,
        ?bool $disableEBSSpot=null,
        ?bool $isServerless=null,
        string $apiActionId='',
        int $nodeId=0,
        int $parallelProject=0,
        int $parallelYears=0,
        int $ensureExlusive=0
    ) {
        parent::__construct($projectId,$isBatchSimulation,$force,$disableEBSSpot,$isServerless,$apiActionId,$nodeId,$parallelProject,$parallelYears,$ensureExlusive);
    }

    /** @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;
    }
}

PHP CommonOptimizerProjectInfoRequest DTOs

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

HTTP + CSV

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

POST /optimizer/project-info HTTP/1.1 
Host: dev-optimization.power.dev 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"projectId":"00000000000000000000000000000000","isBatchSimulation":false,"force":false,"disableEBSSpot":false,"isServerless":false,"apiActionId":"00000000000000000000000000000000","nodeId":0,"parallelProject":0,"parallelYears":0,"ensureExlusive":0}