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 .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<CommonOptimizerProjectInfoRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.ServiceModel">
<ApiActionId xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">00000000-0000-0000-0000-000000000000</ApiActionId>
<DisableEBSSpot xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">false</DisableEBSSpot>
<EnsureExlusive xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">0</EnsureExlusive>
<Force xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">false</Force>
<IsBatchSimulation xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">false</IsBatchSimulation>
<IsServerless xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">false</IsServerless>
<NodeId xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">0</NodeId>
<ParallelProject xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">0</ParallelProject>
<ParallelYears xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">0</ParallelYears>
<ProjectId xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">00000000-0000-0000-0000-000000000000</ProjectId>
</CommonOptimizerProjectInfoRequest>