POST | /optimizer/yearly |
---|
<?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 DataProvider : int
{
case Undefined = 0;
case SPP = 1;
case ERCOT = 2;
case MISO = 3;
case CAISO = 4;
case PJM = 5;
case ISONE = 6;
case NYISO = 7;
case NW = 8;
case SW = 9;
case SE = 10;
case AESO = 11;
case IESO = 12;
case CENACE = 20;
case NONISO = 99;
case EIA = 100;
case PNM = 150;
case NREL = 200;
case NOAA = 210;
case ENTSOE = 1000;
case EPIAS = 1010;
case SELF = 10000;
}
enum BooleanValue : string
{
case Undefined = 'Undefined';
case Yes = 'Yes';
case No = 'No';
case Custom = 'Custom';
}
enum PriceMarketType : int
{
case Undefined = 0;
case Realtime = 1;
case DayAhead = 10;
case DART = 101;
}
class BatteryProjectTodItem implements JsonSerializable
{
public function __construct(
/** @var int */
public int $month=0,
/** @var int */
public int $weekDay=0,
/** @var int */
public int $hour=0,
/** @var float */
public float $price=0.0,
// @Ignore()
/** @var string|null */
public ?string $id=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['month'])) $this->month = $o['month'];
if (isset($o['weekDay'])) $this->weekDay = $o['weekDay'];
if (isset($o['hour'])) $this->hour = $o['hour'];
if (isset($o['price'])) $this->price = $o['price'];
if (isset($o['id'])) $this->id = $o['id'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->month)) $o['month'] = $this->month;
if (isset($this->weekDay)) $o['weekDay'] = $this->weekDay;
if (isset($this->hour)) $o['hour'] = $this->hour;
if (isset($this->price)) $o['price'] = $this->price;
if (isset($this->id)) $o['id'] = $this->id;
return empty($o) ? new class(){} : $o;
}
}
enum RevenueStackingMode : string
{
case SolveWithoutAncillary = 'SolveWithoutAncillary';
case SolveWithAncillary = 'SolveWithAncillary';
}
class MonthlyRequestBase implements JsonSerializable
{
public function __construct(
/** @var string */
public string $projectId='',
/** @var int */
public int $nodeAltId=0,
/** @var DataProvider|null */
public ?DataProvider $iso=null,
/** @var BooleanValue|null */
public ?BooleanValue $useEnergy=null,
/** @var BooleanValue|null */
public ?BooleanValue $useAncillary=null,
/** @var bool|null */
public ?bool $useCapacityTod=null,
/** @var PriceMarketType|null */
public ?PriceMarketType $baseMarket=null,
/** @var array<BatteryProjectTodItem>|null */
public ?array $capacityTODs=null,
/** @var float */
public float $useRegup=0.0,
/** @var float */
public float $useRegdown=0.0,
/** @var float */
public float $useSpinning=0.0,
/** @var float */
public float $useNonSpinning=0.0,
/** @var float */
public float $paraciticLossesOperation=0.0,
/** @var float */
public float $paraciticLossesResting=0.0,
/** @var float */
public float $hvacLosses=0.0,
/** @var float */
public float $acCablingLosses=0.0,
/** @var float */
public float $transformatorLosses=0.0,
/** @var float */
public float $otherLosses=0.0,
/** @var int */
public int $representativeYear=0,
/** @var int */
public int $incrementReferanceYear=0,
/** @var int */
public int $useFutureData=0,
/** @var float */
public float $maxDailyCycle=0.0,
/** @var float */
public float $minDailyProfitPerMw=0.0,
/** @var int */
public int $ancillaryFileId=0,
/** @var int */
public int $lmpFileId=0,
/** @var float */
public float $maxChargingPriceCap=0.0,
/** @var float */
public float $maxDischargingPriceCap=0.0,
/** @var float */
public float $maxAncillaryPriceCap=0.0,
/** @var RevenueStackingMode|null */
public ?RevenueStackingMode $revenueStackingMode=null,
/** @var int */
public int $optimizationQuality=0,
/** @var int */
public int $ensureExlusive=0,
/** @var int */
public int $nodeRefId=0,
/** @var bool|null */
public ?bool $useInternalSolver=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['projectId'])) $this->projectId = $o['projectId'];
if (isset($o['nodeAltId'])) $this->nodeAltId = $o['nodeAltId'];
if (isset($o['iso'])) $this->iso = JsonConverters::from('DataProvider', $o['iso']);
if (isset($o['useEnergy'])) $this->useEnergy = JsonConverters::from('BooleanValue', $o['useEnergy']);
if (isset($o['useAncillary'])) $this->useAncillary = JsonConverters::from('BooleanValue', $o['useAncillary']);
if (isset($o['useCapacityTod'])) $this->useCapacityTod = $o['useCapacityTod'];
if (isset($o['baseMarket'])) $this->baseMarket = JsonConverters::from('PriceMarketType', $o['baseMarket']);
if (isset($o['capacityTODs'])) $this->capacityTODs = JsonConverters::fromArray('BatteryProjectTodItem', $o['capacityTODs']);
if (isset($o['useRegup'])) $this->useRegup = $o['useRegup'];
if (isset($o['useRegdown'])) $this->useRegdown = $o['useRegdown'];
if (isset($o['useSpinning'])) $this->useSpinning = $o['useSpinning'];
if (isset($o['useNonSpinning'])) $this->useNonSpinning = $o['useNonSpinning'];
if (isset($o['paraciticLossesOperation'])) $this->paraciticLossesOperation = $o['paraciticLossesOperation'];
if (isset($o['paraciticLossesResting'])) $this->paraciticLossesResting = $o['paraciticLossesResting'];
if (isset($o['hvacLosses'])) $this->hvacLosses = $o['hvacLosses'];
if (isset($o['acCablingLosses'])) $this->acCablingLosses = $o['acCablingLosses'];
if (isset($o['transformatorLosses'])) $this->transformatorLosses = $o['transformatorLosses'];
if (isset($o['otherLosses'])) $this->otherLosses = $o['otherLosses'];
if (isset($o['representativeYear'])) $this->representativeYear = $o['representativeYear'];
if (isset($o['incrementReferanceYear'])) $this->incrementReferanceYear = $o['incrementReferanceYear'];
if (isset($o['useFutureData'])) $this->useFutureData = $o['useFutureData'];
if (isset($o['maxDailyCycle'])) $this->maxDailyCycle = $o['maxDailyCycle'];
if (isset($o['minDailyProfitPerMw'])) $this->minDailyProfitPerMw = $o['minDailyProfitPerMw'];
if (isset($o['ancillaryFileId'])) $this->ancillaryFileId = $o['ancillaryFileId'];
if (isset($o['lmpFileId'])) $this->lmpFileId = $o['lmpFileId'];
if (isset($o['maxChargingPriceCap'])) $this->maxChargingPriceCap = $o['maxChargingPriceCap'];
if (isset($o['maxDischargingPriceCap'])) $this->maxDischargingPriceCap = $o['maxDischargingPriceCap'];
if (isset($o['maxAncillaryPriceCap'])) $this->maxAncillaryPriceCap = $o['maxAncillaryPriceCap'];
if (isset($o['revenueStackingMode'])) $this->revenueStackingMode = JsonConverters::from('RevenueStackingMode', $o['revenueStackingMode']);
if (isset($o['optimizationQuality'])) $this->optimizationQuality = $o['optimizationQuality'];
if (isset($o['ensureExlusive'])) $this->ensureExlusive = $o['ensureExlusive'];
if (isset($o['nodeRefId'])) $this->nodeRefId = $o['nodeRefId'];
if (isset($o['useInternalSolver'])) $this->useInternalSolver = $o['useInternalSolver'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->projectId)) $o['projectId'] = $this->projectId;
if (isset($this->nodeAltId)) $o['nodeAltId'] = $this->nodeAltId;
if (isset($this->iso)) $o['iso'] = JsonConverters::to('DataProvider', $this->iso);
if (isset($this->useEnergy)) $o['useEnergy'] = JsonConverters::to('BooleanValue', $this->useEnergy);
if (isset($this->useAncillary)) $o['useAncillary'] = JsonConverters::to('BooleanValue', $this->useAncillary);
if (isset($this->useCapacityTod)) $o['useCapacityTod'] = $this->useCapacityTod;
if (isset($this->baseMarket)) $o['baseMarket'] = JsonConverters::to('PriceMarketType', $this->baseMarket);
if (isset($this->capacityTODs)) $o['capacityTODs'] = JsonConverters::toArray('BatteryProjectTodItem', $this->capacityTODs);
if (isset($this->useRegup)) $o['useRegup'] = $this->useRegup;
if (isset($this->useRegdown)) $o['useRegdown'] = $this->useRegdown;
if (isset($this->useSpinning)) $o['useSpinning'] = $this->useSpinning;
if (isset($this->useNonSpinning)) $o['useNonSpinning'] = $this->useNonSpinning;
if (isset($this->paraciticLossesOperation)) $o['paraciticLossesOperation'] = $this->paraciticLossesOperation;
if (isset($this->paraciticLossesResting)) $o['paraciticLossesResting'] = $this->paraciticLossesResting;
if (isset($this->hvacLosses)) $o['hvacLosses'] = $this->hvacLosses;
if (isset($this->acCablingLosses)) $o['acCablingLosses'] = $this->acCablingLosses;
if (isset($this->transformatorLosses)) $o['transformatorLosses'] = $this->transformatorLosses;
if (isset($this->otherLosses)) $o['otherLosses'] = $this->otherLosses;
if (isset($this->representativeYear)) $o['representativeYear'] = $this->representativeYear;
if (isset($this->incrementReferanceYear)) $o['incrementReferanceYear'] = $this->incrementReferanceYear;
if (isset($this->useFutureData)) $o['useFutureData'] = $this->useFutureData;
if (isset($this->maxDailyCycle)) $o['maxDailyCycle'] = $this->maxDailyCycle;
if (isset($this->minDailyProfitPerMw)) $o['minDailyProfitPerMw'] = $this->minDailyProfitPerMw;
if (isset($this->ancillaryFileId)) $o['ancillaryFileId'] = $this->ancillaryFileId;
if (isset($this->lmpFileId)) $o['lmpFileId'] = $this->lmpFileId;
if (isset($this->maxChargingPriceCap)) $o['maxChargingPriceCap'] = $this->maxChargingPriceCap;
if (isset($this->maxDischargingPriceCap)) $o['maxDischargingPriceCap'] = $this->maxDischargingPriceCap;
if (isset($this->maxAncillaryPriceCap)) $o['maxAncillaryPriceCap'] = $this->maxAncillaryPriceCap;
if (isset($this->revenueStackingMode)) $o['revenueStackingMode'] = JsonConverters::to('RevenueStackingMode', $this->revenueStackingMode);
if (isset($this->optimizationQuality)) $o['optimizationQuality'] = $this->optimizationQuality;
if (isset($this->ensureExlusive)) $o['ensureExlusive'] = $this->ensureExlusive;
if (isset($this->nodeRefId)) $o['nodeRefId'] = $this->nodeRefId;
if (isset($this->useInternalSolver)) $o['useInternalSolver'] = $this->useInternalSolver;
return empty($o) ? new class(){} : $o;
}
}
enum PowerPlantType : string
{
case Undefined = 'Undefined';
case Solar = 'Solar';
case Wind = 'Wind';
case Hybrid = 'Hybrid';
}
class BatteryScenarioKeyGroup implements JsonSerializable
{
public function __construct(
/** @var int */
public int $keyId=0,
/** @var int */
public int $year=0,
/** @var int */
public int $nodeId=0,
/** @var DataProvider|null */
public ?DataProvider $provider=null,
/** @var int */
public int $zoneId=0,
/** @var PowerPlantType|null */
public ?PowerPlantType $plantType=null,
/** @var int */
public int $solarId=0,
/** @var int */
public int $windId=0,
/** @var bool|null */
public ?bool $isServerless=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['keyId'])) $this->keyId = $o['keyId'];
if (isset($o['year'])) $this->year = $o['year'];
if (isset($o['nodeId'])) $this->nodeId = $o['nodeId'];
if (isset($o['provider'])) $this->provider = JsonConverters::from('DataProvider', $o['provider']);
if (isset($o['zoneId'])) $this->zoneId = $o['zoneId'];
if (isset($o['plantType'])) $this->plantType = JsonConverters::from('PowerPlantType', $o['plantType']);
if (isset($o['solarId'])) $this->solarId = $o['solarId'];
if (isset($o['windId'])) $this->windId = $o['windId'];
if (isset($o['isServerless'])) $this->isServerless = $o['isServerless'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->keyId)) $o['keyId'] = $this->keyId;
if (isset($this->year)) $o['year'] = $this->year;
if (isset($this->nodeId)) $o['nodeId'] = $this->nodeId;
if (isset($this->provider)) $o['provider'] = JsonConverters::to('DataProvider', $this->provider);
if (isset($this->zoneId)) $o['zoneId'] = $this->zoneId;
if (isset($this->plantType)) $o['plantType'] = JsonConverters::to('PowerPlantType', $this->plantType);
if (isset($this->solarId)) $o['solarId'] = $this->solarId;
if (isset($this->windId)) $o['windId'] = $this->windId;
if (isset($this->isServerless)) $o['isServerless'] = $this->isServerless;
return empty($o) ? new class(){} : $o;
}
}
enum BatteryScenarioType : string
{
case Undefined = 'Undefined';
case Optimization = 'Optimization';
case Sum = 'Sum';
case OptiSum = 'OptiSum';
case FullTod = 'FullTod';
case CapacityTod = 'CapacityTod';
}
class BatteryScenarioKeyItem implements JsonSerializable
{
public function __construct(
/** @var string */
public string $projectId='',
/** @var int */
public int $keyId=0,
/** @var BatteryScenarioType|null */
public ?BatteryScenarioType $keyType=null,
/** @var string|null */
public ?string $recordKey=null,
/** @var int */
public int $jobStatus=0,
/** @var int */
public int $status=0,
/** @var DateTime */
public DateTime $minDate=new DateTime(),
/** @var DateTime */
public DateTime $maxDate=new DateTime(),
/** @var int */
public int $year=0,
/** @var int */
public int $yoyStatus=0,
/** @var float */
public float $usableCapacity=0.0,
/** @var float */
public float $usableCapacityFactor=0.0,
/** @var float */
public float $solarUsableCapacity=0.0,
/** @var float */
public float $solarUsableCapacityFactor=0.0,
/** @var PriceMarketType|null */
public ?PriceMarketType $baseMarket=null,
/** @var float */
public float $baseCapacityRate=0.0,
/** @var float */
public float $capacityRate=0.0,
/** @var float */
public float $solarCapacityRate=0.0,
/** @var float */
public float $windCapacityRate=0.0,
/** @var float */
public float $chargeEfficinecy=0.0,
/** @var float */
public float $dischargeEfficinecy=0.0,
/** @var int */
public int $nodeId=0,
/** @var DataProvider|null */
public ?DataProvider $provider=null,
/** @var int */
public int $zoneId=0,
/** @var int */
public int $lmpFileId=0,
/** @var int */
public int $productionFileId=0,
/** @var int */
public int $loadFileId=0,
/** @var int */
public int $capacityFileId=0,
/** @var PowerPlantType|null */
public ?PowerPlantType $plantType=null,
/** @var int */
public int $solarId=0,
/** @var int */
public int $windId=0,
/** @var float */
public float $ancillaryIncrementFactor=0.0,
/** @var float */
public float $energyIncrementFactor=0.0,
/** @var float */
public float $capacityIncrementFactor=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['projectId'])) $this->projectId = $o['projectId'];
if (isset($o['keyId'])) $this->keyId = $o['keyId'];
if (isset($o['keyType'])) $this->keyType = JsonConverters::from('BatteryScenarioType', $o['keyType']);
if (isset($o['recordKey'])) $this->recordKey = $o['recordKey'];
if (isset($o['jobStatus'])) $this->jobStatus = $o['jobStatus'];
if (isset($o['status'])) $this->status = $o['status'];
if (isset($o['minDate'])) $this->minDate = JsonConverters::from('DateTime', $o['minDate']);
if (isset($o['maxDate'])) $this->maxDate = JsonConverters::from('DateTime', $o['maxDate']);
if (isset($o['year'])) $this->year = $o['year'];
if (isset($o['yoyStatus'])) $this->yoyStatus = $o['yoyStatus'];
if (isset($o['usableCapacity'])) $this->usableCapacity = $o['usableCapacity'];
if (isset($o['usableCapacityFactor'])) $this->usableCapacityFactor = $o['usableCapacityFactor'];
if (isset($o['solarUsableCapacity'])) $this->solarUsableCapacity = $o['solarUsableCapacity'];
if (isset($o['solarUsableCapacityFactor'])) $this->solarUsableCapacityFactor = $o['solarUsableCapacityFactor'];
if (isset($o['baseMarket'])) $this->baseMarket = JsonConverters::from('PriceMarketType', $o['baseMarket']);
if (isset($o['baseCapacityRate'])) $this->baseCapacityRate = $o['baseCapacityRate'];
if (isset($o['capacityRate'])) $this->capacityRate = $o['capacityRate'];
if (isset($o['solarCapacityRate'])) $this->solarCapacityRate = $o['solarCapacityRate'];
if (isset($o['windCapacityRate'])) $this->windCapacityRate = $o['windCapacityRate'];
if (isset($o['chargeEfficinecy'])) $this->chargeEfficinecy = $o['chargeEfficinecy'];
if (isset($o['dischargeEfficinecy'])) $this->dischargeEfficinecy = $o['dischargeEfficinecy'];
if (isset($o['nodeId'])) $this->nodeId = $o['nodeId'];
if (isset($o['provider'])) $this->provider = JsonConverters::from('DataProvider', $o['provider']);
if (isset($o['zoneId'])) $this->zoneId = $o['zoneId'];
if (isset($o['lmpFileId'])) $this->lmpFileId = $o['lmpFileId'];
if (isset($o['productionFileId'])) $this->productionFileId = $o['productionFileId'];
if (isset($o['loadFileId'])) $this->loadFileId = $o['loadFileId'];
if (isset($o['capacityFileId'])) $this->capacityFileId = $o['capacityFileId'];
if (isset($o['plantType'])) $this->plantType = JsonConverters::from('PowerPlantType', $o['plantType']);
if (isset($o['solarId'])) $this->solarId = $o['solarId'];
if (isset($o['windId'])) $this->windId = $o['windId'];
if (isset($o['ancillaryIncrementFactor'])) $this->ancillaryIncrementFactor = $o['ancillaryIncrementFactor'];
if (isset($o['energyIncrementFactor'])) $this->energyIncrementFactor = $o['energyIncrementFactor'];
if (isset($o['capacityIncrementFactor'])) $this->capacityIncrementFactor = $o['capacityIncrementFactor'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->projectId)) $o['projectId'] = $this->projectId;
if (isset($this->keyId)) $o['keyId'] = $this->keyId;
if (isset($this->keyType)) $o['keyType'] = JsonConverters::to('BatteryScenarioType', $this->keyType);
if (isset($this->recordKey)) $o['recordKey'] = $this->recordKey;
if (isset($this->jobStatus)) $o['jobStatus'] = $this->jobStatus;
if (isset($this->status)) $o['status'] = $this->status;
if (isset($this->minDate)) $o['minDate'] = JsonConverters::to('DateTime', $this->minDate);
if (isset($this->maxDate)) $o['maxDate'] = JsonConverters::to('DateTime', $this->maxDate);
if (isset($this->year)) $o['year'] = $this->year;
if (isset($this->yoyStatus)) $o['yoyStatus'] = $this->yoyStatus;
if (isset($this->usableCapacity)) $o['usableCapacity'] = $this->usableCapacity;
if (isset($this->usableCapacityFactor)) $o['usableCapacityFactor'] = $this->usableCapacityFactor;
if (isset($this->solarUsableCapacity)) $o['solarUsableCapacity'] = $this->solarUsableCapacity;
if (isset($this->solarUsableCapacityFactor)) $o['solarUsableCapacityFactor'] = $this->solarUsableCapacityFactor;
if (isset($this->baseMarket)) $o['baseMarket'] = JsonConverters::to('PriceMarketType', $this->baseMarket);
if (isset($this->baseCapacityRate)) $o['baseCapacityRate'] = $this->baseCapacityRate;
if (isset($this->capacityRate)) $o['capacityRate'] = $this->capacityRate;
if (isset($this->solarCapacityRate)) $o['solarCapacityRate'] = $this->solarCapacityRate;
if (isset($this->windCapacityRate)) $o['windCapacityRate'] = $this->windCapacityRate;
if (isset($this->chargeEfficinecy)) $o['chargeEfficinecy'] = $this->chargeEfficinecy;
if (isset($this->dischargeEfficinecy)) $o['dischargeEfficinecy'] = $this->dischargeEfficinecy;
if (isset($this->nodeId)) $o['nodeId'] = $this->nodeId;
if (isset($this->provider)) $o['provider'] = JsonConverters::to('DataProvider', $this->provider);
if (isset($this->zoneId)) $o['zoneId'] = $this->zoneId;
if (isset($this->lmpFileId)) $o['lmpFileId'] = $this->lmpFileId;
if (isset($this->productionFileId)) $o['productionFileId'] = $this->productionFileId;
if (isset($this->loadFileId)) $o['loadFileId'] = $this->loadFileId;
if (isset($this->capacityFileId)) $o['capacityFileId'] = $this->capacityFileId;
if (isset($this->plantType)) $o['plantType'] = JsonConverters::to('PowerPlantType', $this->plantType);
if (isset($this->solarId)) $o['solarId'] = $this->solarId;
if (isset($this->windId)) $o['windId'] = $this->windId;
if (isset($this->ancillaryIncrementFactor)) $o['ancillaryIncrementFactor'] = $this->ancillaryIncrementFactor;
if (isset($this->energyIncrementFactor)) $o['energyIncrementFactor'] = $this->energyIncrementFactor;
if (isset($this->capacityIncrementFactor)) $o['capacityIncrementFactor'] = $this->capacityIncrementFactor;
return empty($o) ? new class(){} : $o;
}
}
enum BatteryProjectGroup : string
{
case Undefined = 'Undefined';
case StandAlone = 'StandAlone';
case FTM = 'FTM';
case BTM = 'BTM';
}
class CommonOptimizerYearlyRequest extends MonthlyRequestBase implements JsonSerializable
{
/**
* @param string $projectId
* @param int $nodeAltId
* @param DataProvider|null $iso
* @param BooleanValue|null $useEnergy
* @param BooleanValue|null $useAncillary
* @param bool|null $useCapacityTod
* @param PriceMarketType|null $baseMarket
* @param array<BatteryProjectTodItem>|null $capacityTODs
* @param float $useRegup
* @param float $useRegdown
* @param float $useSpinning
* @param float $useNonSpinning
* @param float $paraciticLossesOperation
* @param float $paraciticLossesResting
* @param float $hvacLosses
* @param float $acCablingLosses
* @param float $transformatorLosses
* @param float $otherLosses
* @param int $representativeYear
* @param int $incrementReferanceYear
* @param int $useFutureData
* @param float $maxDailyCycle
* @param float $minDailyProfitPerMw
* @param int $ancillaryFileId
* @param int $lmpFileId
* @param float $maxChargingPriceCap
* @param float $maxDischargingPriceCap
* @param float $maxAncillaryPriceCap
* @param RevenueStackingMode|null $revenueStackingMode
* @param int $optimizationQuality
* @param int $ensureExlusive
* @param int $nodeRefId
* @param bool|null $useInternalSolver
*/
public function __construct(
string $projectId='',
int $nodeAltId=0,
?DataProvider $iso=null,
?BooleanValue $useEnergy=null,
?BooleanValue $useAncillary=null,
?bool $useCapacityTod=null,
?PriceMarketType $baseMarket=null,
?array $capacityTODs=null,
float $useRegup=0.0,
float $useRegdown=0.0,
float $useSpinning=0.0,
float $useNonSpinning=0.0,
float $paraciticLossesOperation=0.0,
float $paraciticLossesResting=0.0,
float $hvacLosses=0.0,
float $acCablingLosses=0.0,
float $transformatorLosses=0.0,
float $otherLosses=0.0,
int $representativeYear=0,
int $incrementReferanceYear=0,
int $useFutureData=0,
float $maxDailyCycle=0.0,
float $minDailyProfitPerMw=0.0,
int $ancillaryFileId=0,
int $lmpFileId=0,
float $maxChargingPriceCap=0.0,
float $maxDischargingPriceCap=0.0,
float $maxAncillaryPriceCap=0.0,
?RevenueStackingMode $revenueStackingMode=null,
int $optimizationQuality=0,
int $ensureExlusive=0,
int $nodeRefId=0,
?bool $useInternalSolver=null,
/** @var int */
public int $month=0,
/** @var BatteryScenarioKeyGroup|null */
public ?BatteryScenarioKeyGroup $group=null,
/** @var BatteryScenarioKeyItem|null */
public ?BatteryScenarioKeyItem $key=null,
/** @var BatteryProjectGroup|null */
public ?BatteryProjectGroup $projectGroup=null
) {
parent::__construct($projectId,$nodeAltId,$iso,$useEnergy,$useAncillary,$useCapacityTod,$baseMarket,$capacityTODs,$useRegup,$useRegdown,$useSpinning,$useNonSpinning,$paraciticLossesOperation,$paraciticLossesResting,$hvacLosses,$acCablingLosses,$transformatorLosses,$otherLosses,$representativeYear,$incrementReferanceYear,$useFutureData,$maxDailyCycle,$minDailyProfitPerMw,$ancillaryFileId,$lmpFileId,$maxChargingPriceCap,$maxDischargingPriceCap,$maxAncillaryPriceCap,$revenueStackingMode,$optimizationQuality,$ensureExlusive,$nodeRefId,$useInternalSolver);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['month'])) $this->month = $o['month'];
if (isset($o['group'])) $this->group = JsonConverters::from('BatteryScenarioKeyGroup', $o['group']);
if (isset($o['key'])) $this->key = JsonConverters::from('BatteryScenarioKeyItem', $o['key']);
if (isset($o['projectGroup'])) $this->projectGroup = JsonConverters::from('BatteryProjectGroup', $o['projectGroup']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->month)) $o['month'] = $this->month;
if (isset($this->group)) $o['group'] = JsonConverters::to('BatteryScenarioKeyGroup', $this->group);
if (isset($this->key)) $o['key'] = JsonConverters::to('BatteryScenarioKeyItem', $this->key);
if (isset($this->projectGroup)) $o['projectGroup'] = JsonConverters::to('BatteryProjectGroup', $this->projectGroup);
return empty($o) ? new class(){} : $o;
}
}
class YearlyApiStatusResponse implements JsonSerializable
{
public function __construct(
/** @var int */
public int $failedCount=0,
/** @var string */
public string $message=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['failedCount'])) $this->failedCount = $o['failedCount'];
if (isset($o['message'])) $this->message = $o['message'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->failedCount)) $o['failedCount'] = $this->failedCount;
if (isset($this->message)) $o['message'] = $this->message;
return empty($o) ? new class(){} : $o;
}
}
PHP CommonOptimizerYearlyRequest DTOs
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.
POST /optimizer/yearly HTTP/1.1
Host: dev-optimization.power.dev
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"month":0,"group":{"keyId":0,"year":0,"nodeId":0,"provider":"Undefined","zoneId":0,"plantType":"Undefined","solarId":0,"windId":0,"isServerless":false},"key":{"projectId":"00000000000000000000000000000000","keyId":0,"keyType":"Undefined","recordKey":"String","jobStatus":0,"status":0,"year":0,"yoyStatus":0,"usableCapacity":0,"usableCapacityFactor":0,"solarUsableCapacity":0,"solarUsableCapacityFactor":0,"baseMarket":"Undefined","baseCapacityRate":0,"capacityRate":0,"solarCapacityRate":0,"windCapacityRate":0,"chargeEfficinecy":0,"dischargeEfficinecy":0,"nodeId":0,"provider":"Undefined","zoneId":0,"lmpFileId":0,"productionFileId":0,"loadFileId":0,"capacityFileId":0,"plantType":"Undefined","solarId":0,"windId":0,"ancillaryIncrementFactor":0,"energyIncrementFactor":0,"capacityIncrementFactor":0},"projectGroup":"Undefined","projectId":"00000000000000000000000000000000","nodeAltId":0,"iso":"Undefined","useEnergy":"Undefined","useAncillary":"Undefined","useCapacityTod":false,"baseMarket":"Undefined","useRegup":0,"useRegdown":0,"useSpinning":0,"useNonSpinning":0,"paraciticLossesOperation":0,"paraciticLossesResting":0,"hvacLosses":0,"acCablingLosses":0,"transformatorLosses":0,"otherLosses":0,"representativeYear":0,"incrementReferanceYear":0,"useFutureData":0,"maxDailyCycle":0,"minDailyProfitPerMw":0,"ancillaryFileId":0,"lmpFileId":0,"maxChargingPriceCap":0,"maxDischargingPriceCap":0,"maxAncillaryPriceCap":0,"revenueStackingMode":"SolveWithoutAncillary","optimizationQuality":0,"ensureExlusive":0,"nodeRefId":0,"useInternalSolver":false}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"failedCount":0,"message":"String"}