Skip to content

Commit

Permalink
Merge pull request #40 from WoutervanderLoopNL/develop-finalize-v10
Browse files Browse the repository at this point in the history
Finalize v10 API
  • Loading branch information
casperbakker authored Jan 2, 2024
2 parents 4299731 + 23d96e8 commit ef9a4e3
Show file tree
Hide file tree
Showing 27 changed files with 1,420 additions and 2,355 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Bol.com Retailer API client for PHP
This is an open source PHP client for the [Bol.com Retailer API](https://api.bol.com/retailer/public/Retailer-API/v10/releasenotes.html) version 10.0 (BETA).
This is an open source PHP client for the [Bol.com Retailer API](https://api.bol.com/retailer/public/Retailer-API/v10/releasenotes.html) version 10.4.

## Installation
This project can easily be installed through Composer:
Expand Down Expand Up @@ -149,6 +149,7 @@ Methods on the Client may throw Exceptions. All Exceptions have the parent class

## Migrate to v10
If you're migrating to v10, please have a look at the official migration guides to find out what has changed:
- [bol.com Retailer API migration guide from v9 to v10](https://api.bol.com/retailer/public/Retailer-API/v10/migrationguide/v9-v10/migrationguide.html)
- [bol.com Retailer API migration guide from v8 to v9](https://api.bol.com/retailer/public/Retailer-API/v9/migrationguide/v8-v9/migrationguide.html)
- [bol.com Retailer API migration guide from v7 to v8](https://api.bol.com/retailer/public/Retailer-API/v8/migrationguide/v7-v8/migrationguide.html)

Expand Down
398 changes: 199 additions & 199 deletions src/Client.php

Large diffs are not rendered by default.

44 changes: 23 additions & 21 deletions src/Enum/ChangeTransportRequestTransporterCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,34 @@
// This class is auto generated by OpenApi\ModelGenerator
enum ChangeTransportRequestTransporterCode: string
{
case BRIEFPOST = 'BRIEFPOST';
case UPS = 'UPS';
case TNT = 'TNT';
case TNT_EXTRA = 'TNT-EXTRA';
case TNT_BRIEF = 'TNT_BRIEF';
case TNT_EXPRESS = 'TNT-EXPRESS';
case DYL = 'DYL';
case DPD_NL = 'DPD-NL';
case DPD_BE = 'DPD-BE';
case AMPERE = 'AMPERE';
case BPOST_BE = 'BPOST_BE';
case BPOST_BRIEF = 'BPOST_BRIEF';
case BRIEFPOST = 'BRIEFPOST';
case BUDBEE = 'BUDBEE';
case COURIER = 'COURIER';
case CYCLOON = 'CYCLOON';
case DHL = 'DHL';
case DHL_GLOBAL_MAIL = 'DHL-GLOBAL-MAIL';
case DHL_SD = 'DHL-SD';
case DHLFORYOU = 'DHLFORYOU';
case GLS = 'GLS';
case FEDEX_NL = 'FEDEX_NL';
case DHL_DE = 'DHL_DE';
case DPD_BE = 'DPD-BE';
case DPD_NL = 'DPD-NL';
case DYL = 'DYL';
case FEDEX_BE = 'FEDEX_BE';
case FEDEX_NL = 'FEDEX_NL';
case GLS = 'GLS';
case OTHER = 'OTHER';
case DHL = 'DHL';
case DHL_DE = 'DHL_DE';
case DHL_GLOBAL_MAIL = 'DHL-GLOBAL-MAIL';
case TSN = 'TSN';
case FIEGE = 'FIEGE';
case TRANSMISSION = 'TRANSMISSION';
case PARCEL_NL = 'PARCEL-NL';
case LOGOIX = 'LOGOIX';
case PACKS = 'PACKS';
case COURIER = 'COURIER';
case PARCEL_NL = 'PARCEL-NL';
case PES = 'PES';
case TNT = 'TNT';
case TNT_EXPRESS = 'TNT-EXPRESS';
case TNT_EXTRA = 'TNT-EXTRA';
case TNT_BRIEF = 'TNT_BRIEF';
case TRANSMISSION = 'TRANSMISSION';
case TRUNKRS = 'TRUNKRS';
case CYCLOON = 'CYCLOON';
case TSN = 'TSN';
case UPS = 'UPS';
}
1 change: 1 addition & 0 deletions src/Enum/GetProcessStatusEntityIdEventType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
enum GetProcessStatusEntityIdEventType: string
{
case CONFIRM_SHIPMENT = 'CONFIRM_SHIPMENT';
case CREATE_SHIPMENT = 'CREATE_SHIPMENT';
case CANCEL_ORDER = 'CANCEL_ORDER';
case CHANGE_TRANSPORT = 'CHANGE_TRANSPORT';
case HANDLE_RETURN_ITEM = 'HANDLE_RETURN_ITEM';
Expand Down
11 changes: 11 additions & 0 deletions src/Enum/InvoiceRequestsBillingDetailsSalutation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Picqer\BolRetailerV10\Enum;

// This class is auto generated by OpenApi\ModelGenerator
enum InvoiceRequestsBillingDetailsSalutation: string
{
case MALE = 'MALE';
case FEMALE = 'FEMALE';
case UNKNOWN = 'UNKNOWN';
}
1 change: 1 addition & 0 deletions src/Enum/TransportEventEventCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ enum TransportEventEventCode: string
case PICKED_UP_AT_PICK_UP_POINT = 'PICKED_UP_AT_PICK_UP_POINT';
case AT_PICK_UP_POINT = 'AT_PICK_UP_POINT';
case RETURNED_TO_SENDER = 'RETURNED_TO_SENDER';
case INBOUND_COLLECT = 'INBOUND_COLLECT';
}
20 changes: 19 additions & 1 deletion src/Model/BillingDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ public function getModelDefinition(): array
'streetName' => [ 'model' => null, 'enum' => null, 'array' => false ],
'houseNumber' => [ 'model' => null, 'enum' => null, 'array' => false ],
'houseNumberExtension' => [ 'model' => null, 'enum' => null, 'array' => false ],
'extraAddressInformation' => [ 'model' => null, 'enum' => null, 'array' => false ],
'zipCode' => [ 'model' => null, 'enum' => null, 'array' => false ],
'city' => [ 'model' => null, 'enum' => null, 'array' => false ],
'countryCode' => [ 'model' => null, 'enum' => null, 'array' => false ],
'email' => [ 'model' => null, 'enum' => null, 'array' => false ],
'company' => [ 'model' => null, 'enum' => null, 'array' => false ],
'vatNumber' => [ 'model' => null, 'enum' => null, 'array' => false ],
'kvkNumber' => [ 'model' => null, 'enum' => null, 'array' => false ],
'orderReference' => [ 'model' => null, 'enum' => null, 'array' => false ],
];
}

Expand Down Expand Up @@ -62,6 +65,11 @@ public function getModelDefinition(): array
*/
public $houseNumberExtension;

/**
* @var string Additional information related to the address that helps in delivering the package.
*/
public $extraAddressInformation;

/**
* @var string The ZIP code in '1234AB' format for NL orders and '0000' format for BE orders.
*/
Expand All @@ -77,6 +85,11 @@ public function getModelDefinition(): array
*/
public $countryCode;

/**
* @var string A scrambled email address that can be used to contact the customer.
*/
public $email;

/**
* @var string The company name.
*/
Expand All @@ -88,8 +101,13 @@ public function getModelDefinition(): array
public $vatNumber;

/**
* @var string The Kamer van Koophandel (KvK) number for organizations situated in the Netherlands or
* @var string The Kamer van Koophandel (kvk) number for organizations situated in the Netherlands or
* ondernemingsnummer for organizations situated in Belgium.
*/
public $kvkNumber;

/**
* @var string The order reference specified by the customer when ordering a product.
*/
public $orderReference;
}
31 changes: 0 additions & 31 deletions src/Model/DeliveryOptionsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,4 @@ public function getModelDefinition(): array
* @var DeliveryOptionsRequestOrderItem[] Order items for which the delivery options are requested.
*/
public $orderItems = [];

/**
* Returns an array with the orderItemIds from orderItems.
* @return string[] OrderItemIds from orderItems.
*/
public function getOrderItemIds(): array
{
return array_map(function ($model) {
return $model->orderItemId;
}, $this->orderItems);
}

/**
* Sets orderItems by an array of orderItemIds.
* @param string[] $orderItemIds OrderItemIds for orderItems.
*/
public function setOrderItemIds(array $orderItemIds): void
{
$this->orderItems = array_map(function ($orderItemId) {
return DeliveryOptionsRequestOrderItem::constructFromArray(['orderItemId' => $orderItemId]);
}, $orderItemIds);
}

/**
* Adds a new DeliveryOptionsRequestOrderItem to orderItems by orderItemId.
* @param string $orderItemId OrderItemId for the DeliveryOptionsRequestOrderItem to add.
*/
public function addOrderItemId(string $orderItemId): void
{
$this->orderItems[] = DeliveryOptionsRequestOrderItem::constructFromArray(['orderItemId' => $orderItemId]);
}
}
7 changes: 7 additions & 0 deletions src/Model/DeliveryOptionsRequestOrderItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@ public function getModelDefinition(): array
{
return [
'orderItemId' => [ 'model' => null, 'enum' => null, 'array' => false ],
'quantity' => [ 'model' => null, 'enum' => null, 'array' => false ],
];
}

/**
* @var string The id for the order item (1 order can have multiple order items).
*/
public $orderItemId;

/**
* @var int The quantity of the order item for which the shipping label creation is requested for. If omitted, will
* be interpreted as the full quantity that is still open for this order item.
*/
public $quantity;
}
10 changes: 5 additions & 5 deletions src/Model/InvoiceRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public function getModelDefinition(): array
'shipmentId' => [ 'model' => null, 'enum' => null, 'array' => false ],
'orderId' => [ 'model' => null, 'enum' => null, 'array' => false ],
'customerAccountNumber' => [ 'model' => null, 'enum' => null, 'array' => false ],
'billingDetails' => [ 'model' => BillingDetails::class, 'enum' => null, 'array' => false ],
'products' => [ 'model' => Products::class, 'enum' => null, 'array' => true ],
'billingDetails' => [ 'model' => InvoiceRequestsBillingDetails::class, 'enum' => null, 'array' => false ],
'products' => [ 'model' => InvoiceRequestsProducts::class, 'enum' => null, 'array' => true ],
'status' => [ 'model' => null, 'enum' => null, 'array' => false ],
'statusTransitions' => [ 'model' => StatusTransitions::class, 'enum' => null, 'array' => true ],
];
Expand All @@ -43,13 +43,13 @@ public function getModelDefinition(): array
public $customerAccountNumber;

/**
* @var BillingDetails The details of the customer that is responsible for the financial fulfillment of this
* shipment.
* @var InvoiceRequestsBillingDetails The details of the customer that is responsible for the financial fulfillment
* of this shipment.
*/
public $billingDetails;

/**
* @var Products[]
* @var InvoiceRequestsProducts[]
*/
public $products = [];

Expand Down
95 changes: 95 additions & 0 deletions src/Model/InvoiceRequestsBillingDetails.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?php

namespace Picqer\BolRetailerV10\Model;

use Picqer\BolRetailerV10\Enum;

// This class is auto generated by OpenApi\ModelGenerator
class InvoiceRequestsBillingDetails extends AbstractModel
{
/**
* Returns the definition of the model: an associative array with field names as key and
* field definition as value. The field definition contains of
* model: Model class or null if it is a scalar type
* array: Boolean whether it is an array
* @return array The model definition
*/
public function getModelDefinition(): array
{
return [
'salutation' => [ 'model' => null, 'enum' => Enum\InvoiceRequestsBillingDetailsSalutation::class, 'array' => false ],
'firstName' => [ 'model' => null, 'enum' => null, 'array' => false ],
'surname' => [ 'model' => null, 'enum' => null, 'array' => false ],
'streetName' => [ 'model' => null, 'enum' => null, 'array' => false ],
'houseNumber' => [ 'model' => null, 'enum' => null, 'array' => false ],
'houseNumberExtension' => [ 'model' => null, 'enum' => null, 'array' => false ],
'zipCode' => [ 'model' => null, 'enum' => null, 'array' => false ],
'city' => [ 'model' => null, 'enum' => null, 'array' => false ],
'countryCode' => [ 'model' => null, 'enum' => null, 'array' => false ],
'company' => [ 'model' => null, 'enum' => null, 'array' => false ],
'vatNumber' => [ 'model' => null, 'enum' => null, 'array' => false ],
'kvkNumber' => [ 'model' => null, 'enum' => null, 'array' => false ],
];
}

/**
* @var Enum\InvoiceRequestsBillingDetailsSalutation The salutation of the customer.
*/
public $salutation;

/**
* @var string The first name of the customer.
*/
public $firstName;

/**
* @var string The surname of the customer.
*/
public $surname;

/**
* @var string The street name.
*/
public $streetName;

/**
* @var string The house number.
*/
public $houseNumber;

/**
* @var string The extension on the house number.
*/
public $houseNumberExtension;

/**
* @var string The ZIP code in '1234AB' format for NL orders and '0000' format for BE orders.
*/
public $zipCode;

/**
* @var string The name of the city.
*/
public $city;

/**
* @var string The country code.
*/
public $countryCode;

/**
* @var string The company name.
*/
public $company;

/**
* @var string The Value Added Tax (VAT) / BTW number for business sellers situated in the Netherlands.
*/
public $vatNumber;

/**
* @var string The Kamer van Koophandel (KvK) number for organizations situated in the Netherlands or
* ondernemingsnummer for organizations situated in Belgium.
*/
public $kvkNumber;
}
40 changes: 40 additions & 0 deletions src/Model/InvoiceRequestsProducts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

namespace Picqer\BolRetailerV10\Model;

use Picqer\BolRetailerV10\Enum;

// This class is auto generated by OpenApi\ModelGenerator
class InvoiceRequestsProducts extends AbstractModel
{
/**
* Returns the definition of the model: an associative array with field names as key and
* field definition as value. The field definition contains of
* model: Model class or null if it is a scalar type
* array: Boolean whether it is an array
* @return array The model definition
*/
public function getModelDefinition(): array
{
return [
'description' => [ 'model' => null, 'enum' => null, 'array' => false ],
'quantity' => [ 'model' => null, 'enum' => null, 'array' => false ],
'unitPrice' => [ 'model' => null, 'enum' => null, 'array' => false ],
];
}

/**
* @var string The description of the ordered product.
*/
public $description;

/**
* @var int Amount of the product being ordered.
*/
public $quantity;

/**
* @var float The selling price to the customer of a single unit including VAT.
*/
public $unitPrice;
}
Loading

0 comments on commit ef9a4e3

Please sign in to comment.