Mercedes.Agency.Orchestration.API

<back to all web services

FeatureFlagUpdateRequest

FeatureFlagManagement
Requires Authentication
The following routes are available for this service:
PUT/v1/FeatureFlagUpdates the feature flag statuses
<?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 VehicleSwapAgentEnabledDto implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Enabled=null,
        /** @var string|null */
        public ?string $Reason=null
    ) {
    }

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

class FeatureFlagStatusVehicleSwapBase implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $AgencyEnabled=null,
        /** @var bool|null */
        public ?bool $OrdersEnabled=null,
        /** @var VehicleSwapAgentEnabledDto|null */
        public ?VehicleSwapAgentEnabledDto $VehicleSwapAgentEnabledData=null
    ) {
    }

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

class SuccessResponse implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Success=null
    ) {
    }

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

class FeatureFlagUpdateRequest extends FeatureFlagStatusVehicleSwapBase implements IPut, JsonSerializable
{
    /**
     * @param bool|null $AgencyEnabled
     * @param bool|null $OrdersEnabled
     * @param VehicleSwapAgentEnabledDto|null $VehicleSwapAgentEnabledData
     */
    public function __construct(
        ?bool $AgencyEnabled=null,
        ?bool $OrdersEnabled=null,
        ?VehicleSwapAgentEnabledDto $VehicleSwapAgentEnabledData=null
    ) {
        parent::__construct($AgencyEnabled,$OrdersEnabled,$VehicleSwapAgentEnabledData);
    }

    /** @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 FeatureFlagUpdateRequest DTOs

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

HTTP + OTHER

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

PUT /v1/FeatureFlag HTTP/1.1 
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"AgencyEnabled":false,"OrdersEnabled":false,"VehicleSwapAgentEnabledData":{"Enabled":false,"Reason":"String"}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Success":false}