Skip to content

Commit

Permalink
Merge pull request #35 from commercetools/gen-sdk-updates
Browse files Browse the repository at this point in the history
Update generated SDKs
  • Loading branch information
barbara79 authored May 19, 2021
2 parents 830592f + e22b0a7 commit 818f1c6
Show file tree
Hide file tree
Showing 136 changed files with 11,235 additions and 57 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=786b9ece4b0f3ad1792a9502da69412ba14153fd
hash=05a877634096132acd39e22070622c84161d8ff3
2 changes: 1 addition & 1 deletion lib/commercetools-api/gen.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=786b9ece4b0f3ad1792a9502da69412ba14153fd
hash=05a877634096132acd39e22070622c84161d8ff3
8 changes: 4 additions & 4 deletions lib/commercetools-api/src/Models/Inventory/InventoryEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Commercetools\Api\Models\Inventory;

use Commercetools\Api\Models\Channel\ChannelResourceIdentifier;
use Commercetools\Api\Models\Channel\ChannelReference;
use Commercetools\Api\Models\Common\BaseResource;
use Commercetools\Api\Models\Common\CreatedBy;
use Commercetools\Api\Models\Common\LastModifiedBy;
Expand Down Expand Up @@ -73,7 +73,7 @@ public function getSku();
/**
* <p>Optional connection to a particular supplier.</p>
*
* @return null|ChannelResourceIdentifier
* @return null|ChannelReference
*/
public function getSupplyChannel();

Expand Down Expand Up @@ -148,9 +148,9 @@ public function setCreatedBy(?CreatedBy $createdBy): void;
public function setSku(?string $sku): void;

/**
* @param ?ChannelResourceIdentifier $supplyChannel
* @param ?ChannelReference $supplyChannel
*/
public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void;
public function setSupplyChannel(?ChannelReference $supplyChannel): void;

/**
* @param ?int $quantityOnStock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

namespace Commercetools\Api\Models\Inventory;

use Commercetools\Api\Models\Channel\ChannelResourceIdentifier;
use Commercetools\Api\Models\Channel\ChannelResourceIdentifierBuilder;
use Commercetools\Api\Models\Channel\ChannelReference;
use Commercetools\Api\Models\Channel\ChannelReferenceBuilder;
use Commercetools\Api\Models\Common\BaseResource;
use Commercetools\Api\Models\Common\BaseResourceBuilder;
use Commercetools\Api\Models\Common\CreatedBy;
Expand Down Expand Up @@ -67,7 +67,7 @@ final class InventoryEntryBuilder implements Builder
private $sku;

/**
* @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder
* @var null|ChannelReference|ChannelReferenceBuilder
*/
private $supplyChannel;

Expand Down Expand Up @@ -161,11 +161,11 @@ public function getSku()
/**
* <p>Optional connection to a particular supplier.</p>
*
* @return null|ChannelResourceIdentifier
* @return null|ChannelReference
*/
public function getSupplyChannel()
{
return $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel;
return $this->supplyChannel instanceof ChannelReferenceBuilder ? $this->supplyChannel->build() : $this->supplyChannel;
}

/**
Expand Down Expand Up @@ -296,10 +296,10 @@ public function withSku(?string $sku)
}

/**
* @param ?ChannelResourceIdentifier $supplyChannel
* @param ?ChannelReference $supplyChannel
* @return $this
*/
public function withSupplyChannel(?ChannelResourceIdentifier $supplyChannel)
public function withSupplyChannel(?ChannelReference $supplyChannel)
{
$this->supplyChannel = $supplyChannel;

Expand Down Expand Up @@ -387,7 +387,7 @@ public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
* @deprecated use withSupplyChannel() instead
* @return $this
*/
public function withSupplyChannelBuilder(?ChannelResourceIdentifierBuilder $supplyChannel)
public function withSupplyChannelBuilder(?ChannelReferenceBuilder $supplyChannel)
{
$this->supplyChannel = $supplyChannel;

Expand Down Expand Up @@ -415,7 +415,7 @@ public function build(): InventoryEntry
$this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
$this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
$this->sku,
$this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel,
$this->supplyChannel instanceof ChannelReferenceBuilder ? $this->supplyChannel->build() : $this->supplyChannel,
$this->quantityOnStock,
$this->availableQuantity,
$this->restockableInDays,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

namespace Commercetools\Api\Models\Inventory;

use Commercetools\Api\Models\Channel\ChannelResourceIdentifier;
use Commercetools\Api\Models\Channel\ChannelResourceIdentifierModel;
use Commercetools\Api\Models\Channel\ChannelReference;
use Commercetools\Api\Models\Channel\ChannelReferenceModel;
use Commercetools\Api\Models\Common\BaseResource;
use Commercetools\Api\Models\Common\BaseResourceModel;
use Commercetools\Api\Models\Common\CreatedBy;
Expand Down Expand Up @@ -66,7 +66,7 @@ final class InventoryEntryModel extends JsonObjectModel implements InventoryEntr
protected $sku;

/**
* @var ?ChannelResourceIdentifier
* @var ?ChannelReference
*/
protected $supplyChannel;

Expand Down Expand Up @@ -107,7 +107,7 @@ public function __construct(
?LastModifiedBy $lastModifiedBy = null,
?CreatedBy $createdBy = null,
?string $sku = null,
?ChannelResourceIdentifier $supplyChannel = null,
?ChannelReference $supplyChannel = null,
?int $quantityOnStock = null,
?int $availableQuantity = null,
?int $restockableInDays = null,
Expand Down Expand Up @@ -267,7 +267,7 @@ public function getSku()
/**
* <p>Optional connection to a particular supplier.</p>
*
* @return null|ChannelResourceIdentifier
* @return null|ChannelReference
*/
public function getSupplyChannel()
{
Expand All @@ -278,7 +278,7 @@ public function getSupplyChannel()
return null;
}

$this->supplyChannel = ChannelResourceIdentifierModel::of($data);
$this->supplyChannel = ChannelReferenceModel::of($data);
}

return $this->supplyChannel;
Expand Down Expand Up @@ -442,9 +442,9 @@ public function setSku(?string $sku): void
}

/**
* @param ?ChannelResourceIdentifier $supplyChannel
* @param ?ChannelReference $supplyChannel
*/
public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void
public function setSupplyChannel(?ChannelReference $supplyChannel): void
{
$this->supplyChannel = $supplyChannel;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@
interface OrderStateTransitionMessage extends Message
{
public const FIELD_STATE = 'state';
public const FIELD_OLD_STATE = 'oldState';
public const FIELD_FORCE = 'force';

/**
* @return null|StateReference
*/
public function getState();

/**
* @return null|StateReference
*/
public function getOldState();

/**
* @return null|bool
*/
Expand All @@ -32,6 +38,11 @@ public function getForce();
*/
public function setState(?StateReference $state): void;

/**
* @param ?StateReference $oldState
*/
public function setOldState(?StateReference $oldState): void;

/**
* @param ?bool $force
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ final class OrderStateTransitionMessageBuilder implements Builder
*/
private $state;

/**
* @var null|StateReference|StateReferenceBuilder
*/
private $oldState;

/**
* @var ?bool
*/
Expand Down Expand Up @@ -177,6 +182,14 @@ public function getState()
return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state;
}

/**
* @return null|StateReference
*/
public function getOldState()
{
return $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState;
}

/**
* @return null|bool
*/
Expand Down Expand Up @@ -306,6 +319,17 @@ public function withState(?StateReference $state)
return $this;
}

/**
* @param ?StateReference $oldState
* @return $this
*/
public function withOldState(?StateReference $oldState)
{
$this->oldState = $oldState;

return $this;
}

/**
* @param ?bool $force
* @return $this
Expand Down Expand Up @@ -372,6 +396,17 @@ public function withStateBuilder(?StateReferenceBuilder $state)
return $this;
}

/**
* @deprecated use withOldState() instead
* @return $this
*/
public function withOldStateBuilder(?StateReferenceBuilder $oldState)
{
$this->oldState = $oldState;

return $this;
}

public function build(): OrderStateTransitionMessage
{
return new OrderStateTransitionMessageModel(
Expand All @@ -386,6 +421,7 @@ public function build(): OrderStateTransitionMessage
$this->resourceVersion,
$this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers,
$this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state,
$this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState,
$this->force
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ final class OrderStateTransitionMessageModel extends JsonObjectModel implements
*/
protected $state;

/**
* @var ?StateReference
*/
protected $oldState;

/**
* @var ?bool
*/
Expand All @@ -110,6 +115,7 @@ public function __construct(
?int $resourceVersion = null,
?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null,
?StateReference $state = null,
?StateReference $oldState = null,
?bool $force = null
) {
$this->id = $id;
Expand All @@ -123,6 +129,7 @@ public function __construct(
$this->resourceVersion = $resourceVersion;
$this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
$this->state = $state;
$this->oldState = $oldState;
$this->force = $force;
$this->type = static::DISCRIMINATOR_VALUE;
}
Expand Down Expand Up @@ -344,6 +351,24 @@ public function getState()
return $this->state;
}

/**
* @return null|StateReference
*/
public function getOldState()
{
if (is_null($this->oldState)) {
/** @psalm-var stdClass|array<string, mixed>|null $data */
$data = $this->raw(self::FIELD_OLD_STATE);
if (is_null($data)) {
return null;
}

$this->oldState = StateReferenceModel::of($data);
}

return $this->oldState;
}

/**
* @return null|bool
*/
Expand Down Expand Up @@ -450,6 +475,14 @@ public function setState(?StateReference $state): void
$this->state = $state;
}

/**
* @param ?StateReference $oldState
*/
public function setOldState(?StateReference $oldState): void
{
$this->oldState = $oldState;
}

/**
* @param ?bool $force
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/commercetools-base/gen.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=786b9ece4b0f3ad1792a9502da69412ba14153fd
hash=05a877634096132acd39e22070622c84161d8ff3
2 changes: 1 addition & 1 deletion lib/commercetools-history-tests/gen.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=786b9ece4b0f3ad1792a9502da69412ba14153fd
hash=05a877634096132acd39e22070622c84161d8ff3
2 changes: 1 addition & 1 deletion lib/commercetools-history/gen.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=786b9ece4b0f3ad1792a9502da69412ba14153fd
hash=05a877634096132acd39e22070622c84161d8ff3
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

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

namespace Commercetools\History\Models\Change;

use Commercetools\Base\JsonObject;
use Commercetools\Base\DateTimeImmutableCollection;
use Commercetools\History\Models\Common\DiscountCodeInfo;

interface AddDiscountCodeChange extends Change
{

public const FIELD_NEXT_VALUE = 'nextValue';

/**
* @return null|string
*/
public function getType();

/**
* <p>Update action for <code>addDiscountCode</code></p>
*
* @return null|string
*/
public function getChange();

/**
* @return null|DiscountCodeInfo
*/
public function getNextValue();

/**
* @param ?string $change
*/
public function setChange(?string $change): void;

/**
* @param ?DiscountCodeInfo $nextValue
*/
public function setNextValue(?DiscountCodeInfo $nextValue): void;
}
Loading

0 comments on commit 818f1c6

Please sign in to comment.