Skip to content

Commit

Permalink
Merge pull request #36 from WoutervanderLoopNL/develop-openapi-v3
Browse files Browse the repository at this point in the history
Support new Bol.com OpenAPI V3 format
  • Loading branch information
casperbakker authored Jan 2, 2024
2 parents a9defa4 + 2f73c0e commit d1a9f07
Show file tree
Hide file tree
Showing 21 changed files with 12,031 additions and 8,646 deletions.
114 changes: 60 additions & 54 deletions src/Client.php

Large diffs are not rendered by default.

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

namespace Picqer\BolRetailerV10\Model;

// This class is auto generated by OpenApi\ModelGenerator
class CancellationRequest 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 [
'orderItems' => [ 'model' => OrderItemCancellation::class, 'array' => true ],
];
}

/**
* @var OrderItemCancellation[] List of order items to cancel. Order item id's must belong to the same order.
*/
public $orderItems = [];
}
3 changes: 2 additions & 1 deletion src/Model/Offer.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ public function getModelDefinition(): array
public $minDeliveryDate;

/**
* @var string The date at which package can be delivered to customer latest.
* @var string The date at which package can be delivered to customer latest. In case of pre-orders where a specific
* delivery date is not available, a placeholder date will be used.
*/
public $maxDeliveryDate;
}
6 changes: 4 additions & 2 deletions src/Model/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ public function getModelDefinition(): array
public $orderPlacedDateTime;

/**
* @var ShipmentDetails
* @var ShipmentDetails The address details where this order needs to be shipped to. This can be the customers' own
* address, a (company) business address or a Pick Up Point address.
*/
public $shipmentDetails;

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

Expand Down
37 changes: 21 additions & 16 deletions src/Model/Problem.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,54 @@ class Problem extends AbstractModel
public function getModelDefinition(): array
{
return [
'instance' => [ 'model' => null, 'array' => false ],
'type' => [ 'model' => null, 'array' => false ],
'host' => [ 'model' => null, 'array' => false ],
'causedBy' => [ 'model' => Problem::class, 'array' => false ],
'title' => [ 'model' => null, 'array' => false ],
'status' => [ 'model' => null, 'array' => false ],
'detail' => [ 'model' => null, 'array' => false ],
'host' => [ 'model' => null, 'array' => false ],
'instance' => [ 'model' => null, 'array' => false ],
'violations' => [ 'model' => Violation::class, 'array' => true ],
'detail' => [ 'model' => null, 'array' => false ],
];
}

/**
* @var string Type URI for this problem. Fixed value: https://api.bol.com/problems.
* @var string
*/
public $type;
public $instance;

/**
* @var string Title describing the nature of the problem.
* @var string
*/
public $title;
public $type;

/**
* @var int HTTP status returned from the endpoint causing the problem.
* @var string
*/
public $status;
public $host;

/**
* @var string Detailed error message describing in additional detail what caused the service to return this
* problem.
* @var Problem Describes a problem that occurred interacting with the API.
*/
public $detail;
public $causedBy;

/**
* @var string Host identifier describing the server instance that reported the problem.
* @var string
*/
public $host;
public $title;

/**
* @var string Full URI path of the resource that reported the problem.
* @var int
*/
public $instance;
public $status;

/**
* @var Violation[]
*/
public $violations = [];

/**
* @var string
*/
public $detail;
}
44 changes: 44 additions & 0 deletions src/Model/ProductListFiltersRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace Picqer\BolRetailerV10\Model;

// This class is auto generated by OpenApi\ModelGenerator
class ProductListFiltersRequest 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 [
'searchTerm' => [ 'model' => null, 'array' => false ],
'categoryId' => [ 'model' => null, 'array' => false ],
'search' => [ 'model' => null, 'array' => false ],
'category' => [ 'model' => null, 'array' => false ],
];
}

/**
* @var string
*/
public $searchTerm;

/**
* @var string
*/
public $categoryId;

/**
* @var string
*/
public $search;

/**
* @var string
*/
public $category;
}
2 changes: 1 addition & 1 deletion src/Model/ProductListRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getModelDefinition(): array
}

/**
* @var string The country for which the products will be retrieved. Default value: NL
* @var string The country for which the products will be retrieved.
*/
public $countryCode;

Expand Down
2 changes: 1 addition & 1 deletion src/Model/ReducedReturnItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getModelDefinition(): array
public $expectedQuantity;

/**
* @var ReturnReason
* @var ReturnReason The reason why the customer returned this product.
*/
public $returnReason;

Expand Down
4 changes: 2 additions & 2 deletions src/Model/ReturnItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function getModelDefinition(): array
public $expectedQuantity;

/**
* @var ReturnReason
* @var ReturnReason The reason why the customer returned this product.
*/
public $returnReason;

Expand All @@ -81,7 +81,7 @@ public function getModelDefinition(): array
public $processingResults = [];

/**
* @var CustomerDetails
* @var CustomerDetails Information related to the customer.
*/
public $customerDetails;
}
6 changes: 4 additions & 2 deletions src/Model/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ public function getModelDefinition(): array
public $order;

/**
* @var ShipmentDetails
* @var ShipmentDetails The address details where this order needs to be shipped to. This can be the customers' own
* address, a (company) business address or a Pick Up Point address.
*/
public $shipmentDetails;

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

Expand Down
6 changes: 0 additions & 6 deletions src/Model/SubCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public function getModelDefinition(): array
return [
'id' => [ 'model' => null, 'array' => false ],
'name' => [ 'model' => null, 'array' => false ],
'subcategories' => [ 'model' => SubCategory::class, 'array' => true ],
];
}

Expand All @@ -30,9 +29,4 @@ public function getModelDefinition(): array
* @var string The name of the subcategory which the product belongs to.
*/
public $name;

/**
* @var SubCategory[] The subcategories which the product belongs to.
*/
public $subcategories = [];
}
41 changes: 41 additions & 0 deletions src/Model/SubscriptionRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace Picqer\BolRetailerV10\Model;

// This class is auto generated by OpenApi\ModelGenerator
class SubscriptionRequest 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 [
'resources' => [ 'model' => null, 'array' => true ],
'url' => [ 'model' => null, 'array' => false ],
'subscriptionType' => [ 'model' => null, 'array' => false ],
];
}

/**
* @var array Array of event types for which the subscription is set. Note that some event types are only available
* for certain subscription types.
*/
public $resources = [];

/**
* @var string The destination for event notifications. For WEBHOOK subscription types, this is the URL where
* messages are posted to. For GCP_PUBSUB, this is the topic name.
*/
public $url;

/**
* @var string The type of subscription. It indicates the platform where the events will be subscribed to. Be aware
* that certain event types are only available for specific types.
*/
public $subscriptionType;
}
15 changes: 12 additions & 3 deletions src/Model/SubscriptionResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,30 @@ public function getModelDefinition(): array
'id' => [ 'model' => null, 'array' => false ],
'resources' => [ 'model' => null, 'array' => true ],
'url' => [ 'model' => null, 'array' => false ],
'subscriptionType' => [ 'model' => null, 'array' => false ],
];
}

/**
* @var string A unique identifier for the subscription.
* @var string The unique identifier assigned to each event notification subscription. This ID is used for tracking
* and managing each subscription.
*/
public $id;

/**
* @var array Type of event.
* @var array
*/
public $resources = [];

/**
* @var string URL to receive this WebHook notification.
* @var string The destination for event notifications. For WEBHOOK subscription types, this is the URL where
* messages are posted to. For GCP_PUBSUB, this is the topic name.
*/
public $url;

/**
* @var string The type of subscription. It indicates the platform where the events will be subscribed to. Be aware
* that certain event types are only available for specific types.
*/
public $subscriptionType;
}
4 changes: 2 additions & 2 deletions src/Model/Violation.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public function getModelDefinition(): array
}

/**
* @var string Describes the origin of the error, for instance a field or query parameter validation error.
* @var string
*/
public $name;

/**
* @var string Detailed description of the validation error that caused the problem.
* @var string
*/
public $reason;
}
Loading

0 comments on commit d1a9f07

Please sign in to comment.