WS-RESTRICTED_API Host [RESTRICTED_API] : D5290-staging

<back to all web services

barcode_forced

Barcode

Service de création de barcodes (OLD SCHOOL)

The following routes are available for this service:
GET/barcode_forced/{BasicAuth}/{MimeType}/{BarcodeType}/{BarcodeValue}barcode
<?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 eapi_barcode_type_enum : string
{
    case code39 = 'code39';
    case ean13 = 'ean13';
    case qrcode = 'qrcode';
}

class barcode implements JsonSerializable
{
    public function __construct(
        /** @description barcode type */
        // @ApiMember(DataType="string", Description="barcode type", IsRequired=true, Name="BarcodeType", ParameterType="query")
        /** @var eapi_barcode_type_enum|null */
        public ?eapi_barcode_type_enum $barcodeType=null,

        /** @description barcode value */
        // @ApiMember(DataType="string", Description="barcode value", IsRequired=true, Name="BarcodeValue", ParameterType="query")
        /** @var string */
        public string $barcodeValue=''
    ) {
    }

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

/** @description Service de création de barcodes (OLD SCHOOL) */
// @Api(Description="Service de création de barcodes (OLD SCHOOL)")
class barcode_forced implements JsonSerializable
{
    public function __construct(
        /** @description Basic Auth */
        // @ApiMember(DataType="string", Description="Basic Auth", IsRequired=true, Name="BasicAuth", ParameterType="query")
        /** @var string */
        public string $basicAuth='',

        /** @description mime-type */
        // @ApiMember(DataType="string", Description="mime-type", IsRequired=true, Name="MimeType", ParameterType="query")
        /** @var string */
        public string $mimeType='',

        /** @description barcode type */
        // @ApiMember(DataType="string", Description="barcode type", IsRequired=true, Name="BarcodeType", ParameterType="query")
        /** @var eapi_barcode_type_enum|null */
        public ?eapi_barcode_type_enum $barcodeType=null,

        /** @description barcode value */
        // @ApiMember(DataType="string", Description="barcode value", IsRequired=true, Name="BarcodeValue", ParameterType="query")
        /** @var string */
        public string $barcodeValue='',

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

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['basicAuth'])) $this->basicAuth = $o['basicAuth'];
        if (isset($o['mimeType'])) $this->mimeType = $o['mimeType'];
        if (isset($o['barcodeType'])) $this->barcodeType = JsonConverters::from('eapi_barcode_type_enum', $o['barcodeType']);
        if (isset($o['barcodeValue'])) $this->barcodeValue = $o['barcodeValue'];
        if (isset($o['barcode'])) $this->barcode = JsonConverters::from('barcode', $o['barcode']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->basicAuth)) $o['basicAuth'] = $this->basicAuth;
        if (isset($this->mimeType)) $o['mimeType'] = $this->mimeType;
        if (isset($this->barcodeType)) $o['barcodeType'] = JsonConverters::to('eapi_barcode_type_enum', $this->barcodeType);
        if (isset($this->barcodeValue)) $o['barcodeValue'] = $this->barcodeValue;
        if (isset($this->barcode)) $o['barcode'] = JsonConverters::to('barcode', $this->barcode);
        return empty($o) ? new class(){} : $o;
    }
}

PHP barcode_forced DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

GET /barcode_forced/{BasicAuth}/{MimeType}/{BarcodeType}/{BarcodeValue} HTTP/1.1 
Host: milliet.io 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{}