BokaMera.API.Host

<back to all web services

UpdateCompanyInvoiceArticle

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/company/invoice/articleUpdate company invoice articleUpdate company invoice article.
<?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 CompanyInvoiceArticleQueryResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Name=null,
        /** @var int|null */
        public ?int $LicenseTypeId=null,
        /** @var int */
        public int $LicenseProductTypeId=0,
        /** @var int */
        public int $Id=0
    ) {
    }

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

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
class UpdateCompanyInvoiceArticle implements JsonSerializable
{
    public function __construct(
        /** @description Invoice article No in Db. */
        // @ApiMember(Description="Invoice article No in Db.", IsRequired=true)
        /** @var int */
        public int $Id=0,

        /** @description Invoice article Name */
        // @ApiMember(Description="Invoice article Name")
        /** @var string|null */
        public ?string $Name=null,

        /** @description Invoice article Name */
        // @ApiMember(Description="Invoice article Name")
        /** @var int|null */
        public ?int $LicenseTypeId=null,

        /** @description Invoice LicenseProductTypeId */
        // @ApiMember(Description="Invoice LicenseProductTypeId")
        /** @var int|null */
        public ?int $LicenseProductTypeId=null,

        /** @description Invoice article is TIER license */
        // @ApiMember(Description="Invoice article is TIER license")
        /** @var bool|null */
        public ?bool $IsMainLicense=null,

        /** @description Invoice VossProductGroupId reference */
        // @ApiMember(Description="Invoice VossProductGroupId reference")
        /** @var string|null */
        public ?string $VossProductGroupId=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['LicenseTypeId'])) $this->LicenseTypeId = $o['LicenseTypeId'];
        if (isset($o['LicenseProductTypeId'])) $this->LicenseProductTypeId = $o['LicenseProductTypeId'];
        if (isset($o['IsMainLicense'])) $this->IsMainLicense = $o['IsMainLicense'];
        if (isset($o['VossProductGroupId'])) $this->VossProductGroupId = $o['VossProductGroupId'];
    }
    
    /** @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->LicenseTypeId)) $o['LicenseTypeId'] = $this->LicenseTypeId;
        if (isset($this->LicenseProductTypeId)) $o['LicenseProductTypeId'] = $this->LicenseProductTypeId;
        if (isset($this->IsMainLicense)) $o['IsMainLicense'] = $this->IsMainLicense;
        if (isset($this->VossProductGroupId)) $o['VossProductGroupId'] = $this->VossProductGroupId;
        return empty($o) ? new class(){} : $o;
    }
}

PHP UpdateCompanyInvoiceArticle DTOs

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

HTTP + CSV

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

PUT /company/invoice/article HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"Id":0,"Name":"String","LicenseTypeId":0,"LicenseProductTypeId":0,"IsMainLicense":false,"VossProductGroupId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Name":"String","LicenseTypeId":0,"LicenseProductTypeId":0,"Id":0}