Skip to content

Commit

Permalink
Merge pull request #40 from commercetools/gen-sdk-updates
Browse files Browse the repository at this point in the history
Update generated SDKs
  • Loading branch information
barbara79 authored Aug 2, 2021
2 parents 6fc6678 + c3851ee commit 9667b0d
Show file tree
Hide file tree
Showing 60 changed files with 1,191 additions and 132 deletions.
2 changes: 1 addition & 1 deletion lib/commercetools-api-tests/gen.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=f0c268413ad3a79b40cf1506214f032faa04c4bb
hash=54444c4eae550cc5db7327b4047c36aa5f064bf7
2 changes: 1 addition & 1 deletion lib/commercetools-api/gen.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=f0c268413ad3a79b40cf1506214f032faa04c4bb
hash=54444c4eae550cc5db7327b4047c36aa5f064bf7
8 changes: 4 additions & 4 deletions lib/commercetools-api/src/Models/Order/OrderImportDraft.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Commercetools\Api\Models\Order;

use Commercetools\Api\Models\Cart\CustomLineItemDraftCollection;
use Commercetools\Api\Models\Cart\CustomLineItemImportDraftCollection;
use Commercetools\Api\Models\Cart\TaxedPriceDraft;
use Commercetools\Api\Models\Common\BaseAddress;
use Commercetools\Api\Models\Common\BaseAddressCollection;
Expand Down Expand Up @@ -78,7 +78,7 @@ public function getLineItems();
/**
* <p>If not given <code>lineItems</code> must not be empty.</p>
*
* @return null|CustomLineItemDraftCollection
* @return null|CustomLineItemImportDraftCollection
*/
public function getCustomLineItems();

Expand Down Expand Up @@ -211,9 +211,9 @@ public function setCustomerEmail(?string $customerEmail): void;
public function setLineItems(?LineItemImportDraftCollection $lineItems): void;

/**
* @param ?CustomLineItemDraftCollection $customLineItems
* @param ?CustomLineItemImportDraftCollection $customLineItems
*/
public function setCustomLineItems(?CustomLineItemDraftCollection $customLineItems): void;
public function setCustomLineItems(?CustomLineItemImportDraftCollection $customLineItems): void;

/**
* @param ?Money $totalPrice
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Commercetools\Api\Models\Order;

use Commercetools\Api\Models\Cart\CustomLineItemDraftCollection;
use Commercetools\Api\Models\Cart\CustomLineItemImportDraftCollection;
use Commercetools\Api\Models\Cart\TaxedPriceDraft;
use Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder;
use Commercetools\Api\Models\Common\BaseAddress;
Expand Down Expand Up @@ -56,7 +56,7 @@ final class OrderImportDraftBuilder implements Builder
private $lineItems;

/**
* @var ?CustomLineItemDraftCollection
* @var ?CustomLineItemImportDraftCollection
*/
private $customLineItems;

Expand Down Expand Up @@ -190,7 +190,7 @@ public function getLineItems()
/**
* <p>If not given <code>lineItems</code> must not be empty.</p>
*
* @return null|CustomLineItemDraftCollection
* @return null|CustomLineItemImportDraftCollection
*/
public function getCustomLineItems()
{
Expand Down Expand Up @@ -401,10 +401,10 @@ public function withLineItems(?LineItemImportDraftCollection $lineItems)
}

/**
* @param ?CustomLineItemDraftCollection $customLineItems
* @param ?CustomLineItemImportDraftCollection $customLineItems
* @return $this
*/
public function withCustomLineItems(?CustomLineItemDraftCollection $customLineItems)
public function withCustomLineItems(?CustomLineItemImportDraftCollection $customLineItems)
{
$this->customLineItems = $customLineItems;

Expand Down
14 changes: 7 additions & 7 deletions lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Commercetools\Api\Models\Order;

use Commercetools\Api\Models\Cart\CustomLineItemDraftCollection;
use Commercetools\Api\Models\Cart\CustomLineItemImportDraftCollection;
use Commercetools\Api\Models\Cart\TaxedPriceDraft;
use Commercetools\Api\Models\Cart\TaxedPriceDraftModel;
use Commercetools\Api\Models\Common\BaseAddress;
Expand Down Expand Up @@ -55,7 +55,7 @@ final class OrderImportDraftModel extends JsonObjectModel implements OrderImport
protected $lineItems;

/**
* @var ?CustomLineItemDraftCollection
* @var ?CustomLineItemImportDraftCollection
*/
protected $customLineItems;

Expand Down Expand Up @@ -153,7 +153,7 @@ public function __construct(
?string $customerId = null,
?string $customerEmail = null,
?LineItemImportDraftCollection $lineItems = null,
?CustomLineItemDraftCollection $customLineItems = null,
?CustomLineItemImportDraftCollection $customLineItems = null,
?Money $totalPrice = null,
?TaxedPriceDraft $taxedPrice = null,
?BaseAddress $shippingAddress = null,
Expand Down Expand Up @@ -277,7 +277,7 @@ public function getLineItems()
/**
* <p>If not given <code>lineItems</code> must not be empty.</p>
*
* @return null|CustomLineItemDraftCollection
* @return null|CustomLineItemImportDraftCollection
*/
public function getCustomLineItems()
{
Expand All @@ -287,7 +287,7 @@ public function getCustomLineItems()
if (is_null($data)) {
return null;
}
$this->customLineItems = CustomLineItemDraftCollection::fromArray($data);
$this->customLineItems = CustomLineItemImportDraftCollection::fromArray($data);
}

return $this->customLineItems;
Expand Down Expand Up @@ -651,9 +651,9 @@ public function setLineItems(?LineItemImportDraftCollection $lineItems): void
}

/**
* @param ?CustomLineItemDraftCollection $customLineItems
* @param ?CustomLineItemImportDraftCollection $customLineItems
*/
public function setCustomLineItems(?CustomLineItemDraftCollection $customLineItems): void
public function setCustomLineItems(?CustomLineItemImportDraftCollection $customLineItems): void
{
$this->customLineItems = $customLineItems;
}
Expand Down
11 changes: 11 additions & 0 deletions lib/commercetools-api/src/Models/Project/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ interface Project extends JsonObject
public const FIELD_EXTERNAL_O_AUTH = 'externalOAuth';
public const FIELD_CARTS = 'carts';
public const FIELD_SEARCH_INDEXING = 'searchIndexing';
public const FIELD_SHOPPING_LISTS = 'shoppingLists';

/**
* <p>The current version of the project.</p>
Expand Down Expand Up @@ -106,6 +107,11 @@ public function getCarts();
*/
public function getSearchIndexing();

/**
* @return null|ShoppingListsConfiguration
*/
public function getShoppingLists();

/**
* @param ?int $version
*/
Expand Down Expand Up @@ -170,4 +176,9 @@ public function setCarts(?CartsConfiguration $carts): void;
* @param ?SearchIndexingConfiguration $searchIndexing
*/
public function setSearchIndexing(?SearchIndexingConfiguration $searchIndexing): void;

/**
* @param ?ShoppingListsConfiguration $shoppingLists
*/
public function setShoppingLists(?ShoppingListsConfiguration $shoppingLists): void;
}
38 changes: 37 additions & 1 deletion lib/commercetools-api/src/Models/Project/ProjectBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ final class ProjectBuilder implements Builder
*/
private $searchIndexing;

/**
* @var null|ShoppingListsConfiguration|ShoppingListsConfigurationBuilder
*/
private $shoppingLists;

/**
* <p>The current version of the project.</p>
*
Expand Down Expand Up @@ -204,6 +209,14 @@ public function getSearchIndexing()
return $this->searchIndexing instanceof SearchIndexingConfigurationBuilder ? $this->searchIndexing->build() : $this->searchIndexing;
}

/**
* @return null|ShoppingListsConfiguration
*/
public function getShoppingLists()
{
return $this->shoppingLists instanceof ShoppingListsConfigurationBuilder ? $this->shoppingLists->build() : $this->shoppingLists;
}

/**
* @param ?int $version
* @return $this
Expand Down Expand Up @@ -347,6 +360,17 @@ public function withSearchIndexing(?SearchIndexingConfiguration $searchIndexing)
return $this;
}

/**
* @param ?ShoppingListsConfiguration $shoppingLists
* @return $this
*/
public function withShoppingLists(?ShoppingListsConfiguration $shoppingLists)
{
$this->shoppingLists = $shoppingLists;

return $this;
}

/**
* @deprecated use withMessages() instead
* @return $this
Expand Down Expand Up @@ -402,6 +426,17 @@ public function withSearchIndexingBuilder(?SearchIndexingConfigurationBuilder $s
return $this;
}

/**
* @deprecated use withShoppingLists() instead
* @return $this
*/
public function withShoppingListsBuilder(?ShoppingListsConfigurationBuilder $shoppingLists)
{
$this->shoppingLists = $shoppingLists;

return $this;
}

public function build(): Project
{
return new ProjectModel(
Expand All @@ -417,7 +452,8 @@ public function build(): Project
$this->shippingRateInputType instanceof ShippingRateInputTypeBuilder ? $this->shippingRateInputType->build() : $this->shippingRateInputType,
$this->externalOAuth instanceof ExternalOAuthBuilder ? $this->externalOAuth->build() : $this->externalOAuth,
$this->carts instanceof CartsConfigurationBuilder ? $this->carts->build() : $this->carts,
$this->searchIndexing instanceof SearchIndexingConfigurationBuilder ? $this->searchIndexing->build() : $this->searchIndexing
$this->searchIndexing instanceof SearchIndexingConfigurationBuilder ? $this->searchIndexing->build() : $this->searchIndexing,
$this->shoppingLists instanceof ShoppingListsConfigurationBuilder ? $this->shoppingLists->build() : $this->shoppingLists
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);
/**
* This file has been auto generated
* Do not change it.
*/

namespace Commercetools\Api\Models\Project;

use Commercetools\Base\DateTimeImmutableCollection;
use Commercetools\Base\JsonObject;

interface ProjectChangeShoppingListsConfiguration extends ProjectUpdateAction
{
public const FIELD_SHOPPING_LISTS_CONFIGURATION = 'shoppingListsConfiguration';

/**
* @return null|ShoppingListsConfiguration
*/
public function getShoppingListsConfiguration();

/**
* @param ?ShoppingListsConfiguration $shoppingListsConfiguration
*/
public function setShoppingListsConfiguration(?ShoppingListsConfiguration $shoppingListsConfiguration): void;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php

declare(strict_types=1);
/**
* This file has been auto generated
* Do not change it.
*/

namespace Commercetools\Api\Models\Project;

use Commercetools\Base\Builder;
use Commercetools\Base\DateTimeImmutableCollection;
use Commercetools\Base\JsonObject;
use Commercetools\Base\JsonObjectModel;
use Commercetools\Base\MapperFactory;
use stdClass;

/**
* @implements Builder<ProjectChangeShoppingListsConfiguration>
*/
final class ProjectChangeShoppingListsConfigurationBuilder implements Builder
{
/**
* @var null|ShoppingListsConfiguration|ShoppingListsConfigurationBuilder
*/
private $shoppingListsConfiguration;

/**
* @return null|ShoppingListsConfiguration
*/
public function getShoppingListsConfiguration()
{
return $this->shoppingListsConfiguration instanceof ShoppingListsConfigurationBuilder ? $this->shoppingListsConfiguration->build() : $this->shoppingListsConfiguration;
}

/**
* @param ?ShoppingListsConfiguration $shoppingListsConfiguration
* @return $this
*/
public function withShoppingListsConfiguration(?ShoppingListsConfiguration $shoppingListsConfiguration)
{
$this->shoppingListsConfiguration = $shoppingListsConfiguration;

return $this;
}

/**
* @deprecated use withShoppingListsConfiguration() instead
* @return $this
*/
public function withShoppingListsConfigurationBuilder(?ShoppingListsConfigurationBuilder $shoppingListsConfiguration)
{
$this->shoppingListsConfiguration = $shoppingListsConfiguration;

return $this;
}

public function build(): ProjectChangeShoppingListsConfiguration
{
return new ProjectChangeShoppingListsConfigurationModel(
$this->shoppingListsConfiguration instanceof ShoppingListsConfigurationBuilder ? $this->shoppingListsConfiguration->build() : $this->shoppingListsConfiguration
);
}

public static function of(): ProjectChangeShoppingListsConfigurationBuilder
{
return new self();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

declare(strict_types=1);
/**
* This file has been auto generated
* Do not change it.
*/

namespace Commercetools\Api\Models\Project;

use Commercetools\Api\Models\Project\ProjectUpdateActionCollection;
use Commercetools\Exception\InvalidArgumentException;
use stdClass;

/**
* @extends ProjectUpdateActionCollection<ProjectChangeShoppingListsConfiguration>
* @method ProjectChangeShoppingListsConfiguration current()
* @method ProjectChangeShoppingListsConfiguration at($offset)
*/
class ProjectChangeShoppingListsConfigurationCollection extends ProjectUpdateActionCollection
{
/**
* @psalm-assert ProjectChangeShoppingListsConfiguration $value
* @psalm-param ProjectChangeShoppingListsConfiguration|stdClass $value
* @throws InvalidArgumentException
*
* @return ProjectChangeShoppingListsConfigurationCollection
*/
public function add($value)
{
if (!$value instanceof ProjectChangeShoppingListsConfiguration) {
throw new InvalidArgumentException();
}
$this->store($value);

return $this;
}

/**
* @psalm-return callable(int):?ProjectChangeShoppingListsConfiguration
*/
protected function mapper()
{
return function (int $index): ?ProjectChangeShoppingListsConfiguration {
$data = $this->get($index);
if ($data instanceof stdClass) {
/** @var ProjectChangeShoppingListsConfiguration $data */
$data = ProjectChangeShoppingListsConfigurationModel::of($data);
$this->set($data, $index);
}

return $data;
};
}
}
Loading

0 comments on commit 9667b0d

Please sign in to comment.