2022-10-21 10:46:09 +02:00
|
|
|
<?php
|
|
|
|
|
2023-02-28 13:36:25 +01:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2022 Andreas Palm
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2022-10-21 10:46:09 +02:00
|
|
|
namespace Xentral\Carrier\SendCloud\Data;
|
|
|
|
|
2024-03-27 00:14:39 +01:00
|
|
|
/**
|
|
|
|
* Documents object for a parcel
|
|
|
|
*/
|
2022-10-21 10:46:09 +02:00
|
|
|
class Document
|
|
|
|
{
|
|
|
|
public const TYPE_LABEL = 'label';
|
|
|
|
public const TYPE_CP71 = 'cp71';
|
|
|
|
public const TYPE_CN23 = 'cn23';
|
|
|
|
public const TYPE_CN23_DEFAULT = 'cn23-default';
|
|
|
|
public const TYPE_COMMERCIAL_INVOICE = 'commercial-invoice';
|
|
|
|
|
|
|
|
public string $Type;
|
|
|
|
public string $Size;
|
|
|
|
public string $Link;
|
|
|
|
|
|
|
|
public static function fromApiResponse(object $data): Document
|
|
|
|
{
|
|
|
|
$obj = new Document();
|
|
|
|
$obj->Type = $data->type;
|
|
|
|
$obj->Size = $data->size;
|
|
|
|
$obj->Link = $data->link;
|
|
|
|
return $obj;
|
|
|
|
}
|
|
|
|
}
|