BokaMera.API.Host

<back to all web services

DeleteRebateCode

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
DELETE/rebatecodes/{Id}Delete RebateCode.Delete RebateCode.
<?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 DaysOfWeekResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $DayOfWeek=null,
        /** @var string|null */
        public ?string $DayOfWeekTranslation=null,
        /** @var bool|null */
        public ?bool $DayOfWeekActive=null,
        /** @var int|null */
        public ?int $DayOfWeekSortOrder=null
    ) {
    }

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

class RebateCodeServiceResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var bool|null */
        public ?bool $Active=null
    ) {
    }

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

class BaseModel implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

class ArticleServiceDb extends BaseModel implements JsonSerializable
{
    public function __construct(
        // @Required()
        /** @var string */
        public string $CompanyId='',

        /** @var int */
        public int $Id=0,
        // @Required()
        /** @var int */
        public int $ServiceId=0,

        // @Required()
        /** @var int */
        public int $ArticleId=0
    ) {
    }

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

class ArticleResponse implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $CompanyId='',
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var int */
        public int $ArticleTypeId=0,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $ImageUrl=null,
        /** @var bool|null */
        public ?bool $Active=null,
        /** @var int */
        public int $Amount=0,
        /** @var float */
        public float $Price=0.0,
        /** @var string|null */
        public ?string $CurrencyId=null,
        /** @var DateTime */
        public DateTime $UpdatedDate=new DateTime(),
        /** @var DateTime */
        public DateTime $CreatedDate=new DateTime(),
        /** @var array<ArticleServiceDb>|null */
        public ?array $Services=null,
        /** @var array<int>|null */
        public ?array $ServiceIds=null,
        /** @var string|null */
        public ?string $PriceSign=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['ArticleTypeId'])) $this->ArticleTypeId = $o['ArticleTypeId'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ImageUrl'])) $this->ImageUrl = $o['ImageUrl'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['Amount'])) $this->Amount = $o['Amount'];
        if (isset($o['Price'])) $this->Price = $o['Price'];
        if (isset($o['CurrencyId'])) $this->CurrencyId = $o['CurrencyId'];
        if (isset($o['UpdatedDate'])) $this->UpdatedDate = JsonConverters::from('DateTime', $o['UpdatedDate']);
        if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
        if (isset($o['Services'])) $this->Services = JsonConverters::fromArray('ArticleServiceDb', $o['Services']);
        if (isset($o['ServiceIds'])) $this->ServiceIds = JsonConverters::fromArray('int', $o['ServiceIds']);
        if (isset($o['PriceSign'])) $this->PriceSign = $o['PriceSign'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->ArticleTypeId)) $o['ArticleTypeId'] = $this->ArticleTypeId;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ImageUrl)) $o['ImageUrl'] = $this->ImageUrl;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->Amount)) $o['Amount'] = $this->Amount;
        if (isset($this->Price)) $o['Price'] = $this->Price;
        if (isset($this->CurrencyId)) $o['CurrencyId'] = $this->CurrencyId;
        if (isset($this->UpdatedDate)) $o['UpdatedDate'] = JsonConverters::to('DateTime', $this->UpdatedDate);
        if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
        if (isset($this->Services)) $o['Services'] = JsonConverters::toArray('ArticleServiceDb', $this->Services);
        if (isset($this->ServiceIds)) $o['ServiceIds'] = JsonConverters::toArray('int', $this->ServiceIds);
        if (isset($this->PriceSign)) $o['PriceSign'] = $this->PriceSign;
        return empty($o) ? new class(){} : $o;
    }
}

class RebateCodeCustomerResponse implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Id='',
        /** @var string|null */
        public ?string $Firstname=null,
        /** @var string|null */
        public ?string $Lastname=null,
        /** @var string|null */
        public ?string $Email=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $ImageUrl=null
    ) {
    }

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

class RebateCodeTransactionQueryResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string */
        public string $CompanyId='',
        /** @var string|null */
        public ?string $Note=null,
        /** @var int */
        public int $RebateCodeId=0,
        /** @var string|null */
        public ?string $RebateCodeSign=null,
        /** @var int|null */
        public ?int $RebateCodeTypeId=null,
        /** @var string|null */
        public ?string $RebateCodeTypeName=null,
        /** @var float */
        public float $Amount=0.0,
        /** @var int|null */
        public ?int $BookingId=null,
        /** @var DateTime */
        public DateTime $UpdatedDate=new DateTime(),
        /** @var DateTime */
        public DateTime $CreatedDate=new DateTime(),
        /** @var RebateCodeServiceResponse|null */
        public ?RebateCodeServiceResponse $Service=null,
        /** @var RebateCodeCustomerResponse|null */
        public ?RebateCodeCustomerResponse $Customer=null,
        /** @var string|null */
        public ?string $PriceSign=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Note'])) $this->Note = $o['Note'];
        if (isset($o['RebateCodeId'])) $this->RebateCodeId = $o['RebateCodeId'];
        if (isset($o['RebateCodeSign'])) $this->RebateCodeSign = $o['RebateCodeSign'];
        if (isset($o['RebateCodeTypeId'])) $this->RebateCodeTypeId = $o['RebateCodeTypeId'];
        if (isset($o['RebateCodeTypeName'])) $this->RebateCodeTypeName = $o['RebateCodeTypeName'];
        if (isset($o['Amount'])) $this->Amount = $o['Amount'];
        if (isset($o['BookingId'])) $this->BookingId = $o['BookingId'];
        if (isset($o['UpdatedDate'])) $this->UpdatedDate = JsonConverters::from('DateTime', $o['UpdatedDate']);
        if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
        if (isset($o['Service'])) $this->Service = JsonConverters::from('RebateCodeServiceResponse', $o['Service']);
        if (isset($o['Customer'])) $this->Customer = JsonConverters::from('RebateCodeCustomerResponse', $o['Customer']);
        if (isset($o['PriceSign'])) $this->PriceSign = $o['PriceSign'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Note)) $o['Note'] = $this->Note;
        if (isset($this->RebateCodeId)) $o['RebateCodeId'] = $this->RebateCodeId;
        if (isset($this->RebateCodeSign)) $o['RebateCodeSign'] = $this->RebateCodeSign;
        if (isset($this->RebateCodeTypeId)) $o['RebateCodeTypeId'] = $this->RebateCodeTypeId;
        if (isset($this->RebateCodeTypeName)) $o['RebateCodeTypeName'] = $this->RebateCodeTypeName;
        if (isset($this->Amount)) $o['Amount'] = $this->Amount;
        if (isset($this->BookingId)) $o['BookingId'] = $this->BookingId;
        if (isset($this->UpdatedDate)) $o['UpdatedDate'] = JsonConverters::to('DateTime', $this->UpdatedDate);
        if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
        if (isset($this->Service)) $o['Service'] = JsonConverters::to('RebateCodeServiceResponse', $this->Service);
        if (isset($this->Customer)) $o['Customer'] = JsonConverters::to('RebateCodeCustomerResponse', $this->Customer);
        if (isset($this->PriceSign)) $o['PriceSign'] = $this->PriceSign;
        return empty($o) ? new class(){} : $o;
    }
}

class RebateCodeResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $CompanyId=null,
        /** @var DateTime */
        public DateTime $ValidFrom=new DateTime(),
        /** @var DateTime */
        public DateTime $ValidTo=new DateTime(),
        /** @description If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update. */
        // @ApiMember(Description="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.")
        /** @var DateInterval|null */
        public ?DateInterval $FromTime=null,

        /** @description If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters. */
        // @ApiMember(Description="If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.")
        /** @var DateInterval|null */
        public ?DateInterval $ToTime=null,

        /** @var string|null */
        public ?string $CreatedBy=null,
        /** @var DateTime */
        public DateTime $Created=new DateTime(),
        /** @var string|null */
        public ?string $UpdatedBy=null,
        /** @var DateTime */
        public DateTime $Updated=new DateTime(),
        /** @var string|null */
        public ?string $PersonalNote=null,
        /** @var string|null */
        public ?string $RebateCodeSign=null,
        /** @var int */
        public int $RebateCodeValue=0,
        /** @var int */
        public int $RebateCodeTypeId=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var int */
        public int $RebateCodeStatusId=0,
        /** @var string|null */
        public ?string $StatusName=null,
        /** @var int */
        public int $MaxNumberOfUses=0,
        /** @var int */
        public int $MaxNumberOfUsesPerCustomer=0,
        /** @var int */
        public int $NumberOfUsesUsed=0,
        /** @var array<DaysOfWeekResponse>|null */
        public ?array $DaysOfWeek=null,
        /** @var array<RebateCodeServiceResponse>|null */
        public ?array $Services=null,
        /** @var ArticleResponse|null */
        public ?ArticleResponse $Article=null,
        /** @var array<RebateCodeTransactionQueryResponse>|null */
        public ?array $Transactions=null,
        /** @var float|null */
        public ?float $RemainingAmount=null,
        /** @var int|null */
        public ?int $RemainingUsage=null,
        /** @var array<RebateCodeCustomerResponse>|null */
        public ?array $Customers=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var bool|null */
        public ?bool $PaymentReceived=null,
        /** @var string|null */
        public ?string $RebateCodeCurrencySign=null,
        /** @var bool|null */
        public ?bool $ActiveByStatus=null,
        /** @var string|null */
        public ?string $PriceSign=null,
        /** @var string|null */
        public ?string $RebateCodeTypeName=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['ValidFrom'])) $this->ValidFrom = JsonConverters::from('DateTime', $o['ValidFrom']);
        if (isset($o['ValidTo'])) $this->ValidTo = JsonConverters::from('DateTime', $o['ValidTo']);
        if (isset($o['FromTime'])) $this->FromTime = JsonConverters::from('DateInterval', $o['FromTime']);
        if (isset($o['ToTime'])) $this->ToTime = JsonConverters::from('DateInterval', $o['ToTime']);
        if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
        if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
        if (isset($o['UpdatedBy'])) $this->UpdatedBy = $o['UpdatedBy'];
        if (isset($o['Updated'])) $this->Updated = JsonConverters::from('DateTime', $o['Updated']);
        if (isset($o['PersonalNote'])) $this->PersonalNote = $o['PersonalNote'];
        if (isset($o['RebateCodeSign'])) $this->RebateCodeSign = $o['RebateCodeSign'];
        if (isset($o['RebateCodeValue'])) $this->RebateCodeValue = $o['RebateCodeValue'];
        if (isset($o['RebateCodeTypeId'])) $this->RebateCodeTypeId = $o['RebateCodeTypeId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['RebateCodeStatusId'])) $this->RebateCodeStatusId = $o['RebateCodeStatusId'];
        if (isset($o['StatusName'])) $this->StatusName = $o['StatusName'];
        if (isset($o['MaxNumberOfUses'])) $this->MaxNumberOfUses = $o['MaxNumberOfUses'];
        if (isset($o['MaxNumberOfUsesPerCustomer'])) $this->MaxNumberOfUsesPerCustomer = $o['MaxNumberOfUsesPerCustomer'];
        if (isset($o['NumberOfUsesUsed'])) $this->NumberOfUsesUsed = $o['NumberOfUsesUsed'];
        if (isset($o['DaysOfWeek'])) $this->DaysOfWeek = JsonConverters::fromArray('DaysOfWeekResponse', $o['DaysOfWeek']);
        if (isset($o['Services'])) $this->Services = JsonConverters::fromArray('RebateCodeServiceResponse', $o['Services']);
        if (isset($o['Article'])) $this->Article = JsonConverters::from('ArticleResponse', $o['Article']);
        if (isset($o['Transactions'])) $this->Transactions = JsonConverters::fromArray('RebateCodeTransactionQueryResponse', $o['Transactions']);
        if (isset($o['RemainingAmount'])) $this->RemainingAmount = $o['RemainingAmount'];
        if (isset($o['RemainingUsage'])) $this->RemainingUsage = $o['RemainingUsage'];
        if (isset($o['Customers'])) $this->Customers = JsonConverters::fromArray('RebateCodeCustomerResponse', $o['Customers']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['PaymentReceived'])) $this->PaymentReceived = $o['PaymentReceived'];
        if (isset($o['RebateCodeCurrencySign'])) $this->RebateCodeCurrencySign = $o['RebateCodeCurrencySign'];
        if (isset($o['ActiveByStatus'])) $this->ActiveByStatus = $o['ActiveByStatus'];
        if (isset($o['PriceSign'])) $this->PriceSign = $o['PriceSign'];
        if (isset($o['RebateCodeTypeName'])) $this->RebateCodeTypeName = $o['RebateCodeTypeName'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->ValidFrom)) $o['ValidFrom'] = JsonConverters::to('DateTime', $this->ValidFrom);
        if (isset($this->ValidTo)) $o['ValidTo'] = JsonConverters::to('DateTime', $this->ValidTo);
        if (isset($this->FromTime)) $o['FromTime'] = JsonConverters::to('DateInterval', $this->FromTime);
        if (isset($this->ToTime)) $o['ToTime'] = JsonConverters::to('DateInterval', $this->ToTime);
        if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
        if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
        if (isset($this->UpdatedBy)) $o['UpdatedBy'] = $this->UpdatedBy;
        if (isset($this->Updated)) $o['Updated'] = JsonConverters::to('DateTime', $this->Updated);
        if (isset($this->PersonalNote)) $o['PersonalNote'] = $this->PersonalNote;
        if (isset($this->RebateCodeSign)) $o['RebateCodeSign'] = $this->RebateCodeSign;
        if (isset($this->RebateCodeValue)) $o['RebateCodeValue'] = $this->RebateCodeValue;
        if (isset($this->RebateCodeTypeId)) $o['RebateCodeTypeId'] = $this->RebateCodeTypeId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->RebateCodeStatusId)) $o['RebateCodeStatusId'] = $this->RebateCodeStatusId;
        if (isset($this->StatusName)) $o['StatusName'] = $this->StatusName;
        if (isset($this->MaxNumberOfUses)) $o['MaxNumberOfUses'] = $this->MaxNumberOfUses;
        if (isset($this->MaxNumberOfUsesPerCustomer)) $o['MaxNumberOfUsesPerCustomer'] = $this->MaxNumberOfUsesPerCustomer;
        if (isset($this->NumberOfUsesUsed)) $o['NumberOfUsesUsed'] = $this->NumberOfUsesUsed;
        if (isset($this->DaysOfWeek)) $o['DaysOfWeek'] = JsonConverters::toArray('DaysOfWeekResponse', $this->DaysOfWeek);
        if (isset($this->Services)) $o['Services'] = JsonConverters::toArray('RebateCodeServiceResponse', $this->Services);
        if (isset($this->Article)) $o['Article'] = JsonConverters::to('ArticleResponse', $this->Article);
        if (isset($this->Transactions)) $o['Transactions'] = JsonConverters::toArray('RebateCodeTransactionQueryResponse', $this->Transactions);
        if (isset($this->RemainingAmount)) $o['RemainingAmount'] = $this->RemainingAmount;
        if (isset($this->RemainingUsage)) $o['RemainingUsage'] = $this->RemainingUsage;
        if (isset($this->Customers)) $o['Customers'] = JsonConverters::toArray('RebateCodeCustomerResponse', $this->Customers);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->PaymentReceived)) $o['PaymentReceived'] = $this->PaymentReceived;
        if (isset($this->RebateCodeCurrencySign)) $o['RebateCodeCurrencySign'] = $this->RebateCodeCurrencySign;
        if (isset($this->ActiveByStatus)) $o['ActiveByStatus'] = $this->ActiveByStatus;
        if (isset($this->PriceSign)) $o['PriceSign'] = $this->PriceSign;
        if (isset($this->RebateCodeTypeName)) $o['RebateCodeTypeName'] = $this->RebateCodeTypeName;
        return empty($o) ? new class(){} : $o;
    }
}

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
class DeleteRebateCode implements ICompany, JsonSerializable
{
    public function __construct(
        /** @description  */
        // @ApiMember(Description="")
        /** @var string|null */
        public ?string $CompanyId=null,

        /** @description Id of the rebate code */
        // @ApiMember(Description="Id of the rebate code", IsRequired=true, ParameterType="path")
        /** @var int */
        public int $Id=0,

        /** @var bool|null */
        public ?bool $ForceDelete=null
    ) {
    }

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

PHP DeleteRebateCode 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.

DELETE /rebatecodes/{Id} HTTP/1.1 
Host: api.bokamera.se 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<RebateCodeResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <ActiveByStatus>false</ActiveByStatus>
  <Article>
    <Active>false</Active>
    <Amount>0</Amount>
    <ArticleTypeId>0</ArticleTypeId>
    <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
    <CreatedDate>0001-01-01T00:00:00</CreatedDate>
    <CurrencyId>String</CurrencyId>
    <Description>String</Description>
    <Id>0</Id>
    <ImageUrl>String</ImageUrl>
    <Name>String</Name>
    <Price>0</Price>
    <PriceSign>String</PriceSign>
    <ServiceIds xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>0</d3p1:int>
    </ServiceIds>
    <Services xmlns:d3p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Db">
      <d3p1:ArticleServiceDb>
        <d3p1:ArticleId>0</d3p1:ArticleId>
        <d3p1:CompanyId>00000000-0000-0000-0000-000000000000</d3p1:CompanyId>
        <d3p1:Id>0</d3p1:Id>
        <d3p1:ServiceId>0</d3p1:ServiceId>
      </d3p1:ArticleServiceDb>
    </Services>
    <UpdatedDate>0001-01-01T00:00:00</UpdatedDate>
  </Article>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <Created>0001-01-01T00:00:00</Created>
  <CreatedBy>String</CreatedBy>
  <Customers>
    <RebateCodeCustomerResponse>
      <Email>String</Email>
      <Firstname>String</Firstname>
      <Id>00000000-0000-0000-0000-000000000000</Id>
      <ImageUrl>String</ImageUrl>
      <Lastname>String</Lastname>
      <Phone>String</Phone>
    </RebateCodeCustomerResponse>
  </Customers>
  <DaysOfWeek>
    <DaysOfWeekResponse>
      <DayOfWeek>String</DayOfWeek>
      <DayOfWeekActive>false</DayOfWeekActive>
      <DayOfWeekSortOrder>0</DayOfWeekSortOrder>
      <DayOfWeekTranslation>String</DayOfWeekTranslation>
      <Id>0</Id>
    </DaysOfWeekResponse>
  </DaysOfWeek>
  <FromTime>PT0S</FromTime>
  <Id>0</Id>
  <MaxNumberOfUses>0</MaxNumberOfUses>
  <MaxNumberOfUsesPerCustomer>0</MaxNumberOfUsesPerCustomer>
  <Name>String</Name>
  <NumberOfUsesUsed>0</NumberOfUsesUsed>
  <PaymentReceived>false</PaymentReceived>
  <PersonalNote>String</PersonalNote>
  <PriceSign>String</PriceSign>
  <RebateCodeCurrencySign>String</RebateCodeCurrencySign>
  <RebateCodeSign>String</RebateCodeSign>
  <RebateCodeStatusId>0</RebateCodeStatusId>
  <RebateCodeTypeId>0</RebateCodeTypeId>
  <RebateCodeTypeName>String</RebateCodeTypeName>
  <RebateCodeValue>0</RebateCodeValue>
  <RemainingAmount>0</RemainingAmount>
  <RemainingUsage>0</RemainingUsage>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <Services>
    <RebateCodeServiceResponse>
      <Active>false</Active>
      <Description>String</Description>
      <Id>0</Id>
      <Name>String</Name>
    </RebateCodeServiceResponse>
  </Services>
  <StatusName>String</StatusName>
  <ToTime>PT0S</ToTime>
  <Transactions>
    <RebateCodeTransactionQueryResponse>
      <Amount>0</Amount>
      <BookingId>0</BookingId>
      <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
      <CreatedDate>0001-01-01T00:00:00</CreatedDate>
      <Customer>
        <Email>String</Email>
        <Firstname>String</Firstname>
        <Id>00000000-0000-0000-0000-000000000000</Id>
        <ImageUrl>String</ImageUrl>
        <Lastname>String</Lastname>
        <Phone>String</Phone>
      </Customer>
      <Id>0</Id>
      <Note>String</Note>
      <PriceSign>String</PriceSign>
      <RebateCodeId>0</RebateCodeId>
      <RebateCodeSign>String</RebateCodeSign>
      <RebateCodeTypeId>0</RebateCodeTypeId>
      <RebateCodeTypeName>String</RebateCodeTypeName>
      <Service>
        <Active>false</Active>
        <Description>String</Description>
        <Id>0</Id>
        <Name>String</Name>
      </Service>
      <UpdatedDate>0001-01-01T00:00:00</UpdatedDate>
    </RebateCodeTransactionQueryResponse>
  </Transactions>
  <Updated>0001-01-01T00:00:00</Updated>
  <UpdatedBy>String</UpdatedBy>
  <ValidFrom>0001-01-01T00:00:00</ValidFrom>
  <ValidTo>0001-01-01T00:00:00</ValidTo>
</RebateCodeResponse>