Power.Dev Optimization Services

<back to all web services

CommonOptimizerYearlyRequest

The following routes are available for this service:
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 .xml suffix or ?format=xml

HTTP + XML

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

POST /optimizer/yearly HTTP/1.1 
Host: dev-optimization.power.dev 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CommonOptimizerYearlyRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.ServiceModel">
  <AcCablingLosses xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</AcCablingLosses>
  <AncillaryFileId xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</AncillaryFileId>
  <BaseMarket xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">Undefined</BaseMarket>
  <CapacityTODs xmlns:d2p1="http://schemas.datacontract.org/2004/07/powerDev.Common.Models" i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models" />
  <EnsureExlusive xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</EnsureExlusive>
  <HVACLosses xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</HVACLosses>
  <IncrementReferanceYear xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</IncrementReferanceYear>
  <Iso xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">Undefined</Iso>
  <LmpFileId xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</LmpFileId>
  <MaxAncillaryPriceCap xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</MaxAncillaryPriceCap>
  <MaxChargingPriceCap xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</MaxChargingPriceCap>
  <MaxDailyCycle xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</MaxDailyCycle>
  <MaxDischargingPriceCap xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</MaxDischargingPriceCap>
  <MinDailyProfitPerMw xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</MinDailyProfitPerMw>
  <NodeAltId xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</NodeAltId>
  <NodeRefId xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</NodeRefId>
  <OptimizationQuality xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</OptimizationQuality>
  <OtherLosses xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</OtherLosses>
  <ParaciticLossesOperation xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</ParaciticLossesOperation>
  <ParaciticLossesResting xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</ParaciticLossesResting>
  <ProjectId xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">00000000-0000-0000-0000-000000000000</ProjectId>
  <RepresentativeYear xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</RepresentativeYear>
  <RevenueStackingMode xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">SolveWithoutAncillary</RevenueStackingMode>
  <TransformatorLosses xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</TransformatorLosses>
  <UseAncillary xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">Undefined</UseAncillary>
  <UseCapacityTod xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">false</UseCapacityTod>
  <UseEnergy xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">Undefined</UseEnergy>
  <UseFutureData xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</UseFutureData>
  <UseInternalSolver xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">false</UseInternalSolver>
  <UseNonSpinning xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</UseNonSpinning>
  <UseRegdown xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</UseRegdown>
  <UseRegup xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</UseRegup>
  <UseSpinning xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">0</UseSpinning>
  <Group xmlns:d2p1="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">
    <d2p1:IsServerless>false</d2p1:IsServerless>
    <d2p1:KeyId>0</d2p1:KeyId>
    <d2p1:NodeId>0</d2p1:NodeId>
    <d2p1:PlantType>Undefined</d2p1:PlantType>
    <d2p1:Provider>Undefined</d2p1:Provider>
    <d2p1:SolarId>0</d2p1:SolarId>
    <d2p1:WindId>0</d2p1:WindId>
    <d2p1:Year>0</d2p1:Year>
    <d2p1:ZoneId>0</d2p1:ZoneId>
  </Group>
  <Key xmlns:d2p1="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">
    <d2p1:AncillaryIncrementFactor>0</d2p1:AncillaryIncrementFactor>
    <d2p1:BaseCapacityRate>0</d2p1:BaseCapacityRate>
    <d2p1:BaseMarket>Undefined</d2p1:BaseMarket>
    <d2p1:CapacityFileId>0</d2p1:CapacityFileId>
    <d2p1:CapacityIncrementFactor>0</d2p1:CapacityIncrementFactor>
    <d2p1:CapacityRate>0</d2p1:CapacityRate>
    <d2p1:ChargeEfficinecy>0</d2p1:ChargeEfficinecy>
    <d2p1:DischargeEfficinecy>0</d2p1:DischargeEfficinecy>
    <d2p1:EnergyIncrementFactor>0</d2p1:EnergyIncrementFactor>
    <d2p1:JobStatus>0</d2p1:JobStatus>
    <d2p1:KeyId>0</d2p1:KeyId>
    <d2p1:KeyType>Undefined</d2p1:KeyType>
    <d2p1:LmpFileId>0</d2p1:LmpFileId>
    <d2p1:LoadFileId>0</d2p1:LoadFileId>
    <d2p1:MaxDate>0001-01-01T00:00:00</d2p1:MaxDate>
    <d2p1:MinDate>0001-01-01T00:00:00</d2p1:MinDate>
    <d2p1:NodeId>0</d2p1:NodeId>
    <d2p1:PlantType>Undefined</d2p1:PlantType>
    <d2p1:ProductionFileId>0</d2p1:ProductionFileId>
    <d2p1:ProjectId>00000000-0000-0000-0000-000000000000</d2p1:ProjectId>
    <d2p1:Provider>Undefined</d2p1:Provider>
    <d2p1:RecordKey>String</d2p1:RecordKey>
    <d2p1:SolarCapacityRate>0</d2p1:SolarCapacityRate>
    <d2p1:SolarId>0</d2p1:SolarId>
    <d2p1:SolarUsableCapacity>0</d2p1:SolarUsableCapacity>
    <d2p1:SolarUsableCapacityFactor>0</d2p1:SolarUsableCapacityFactor>
    <d2p1:Status>0</d2p1:Status>
    <d2p1:UsableCapacity>0</d2p1:UsableCapacity>
    <d2p1:UsableCapacityFactor>0</d2p1:UsableCapacityFactor>
    <d2p1:WindCapacityRate>0</d2p1:WindCapacityRate>
    <d2p1:WindId>0</d2p1:WindId>
    <d2p1:Year>0</d2p1:Year>
    <d2p1:YoyStatus>0</d2p1:YoyStatus>
    <d2p1:ZoneId>0</d2p1:ZoneId>
  </Key>
  <Month>0</Month>
  <ProjectGroup>Undefined</ProjectGroup>
</CommonOptimizerYearlyRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<YearlyApiStatusResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.Models">
  <FailedCount>0</FailedCount>
  <Message>String</Message>
</YearlyApiStatusResponse>