Skip to content

Commit

Permalink
build(codegen): updating SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-sdks[bot] committed Sep 26, 2024
1 parent 2d16749 commit f05eed1
Show file tree
Hide file tree
Showing 24 changed files with 1,642 additions and 4 deletions.
14 changes: 14 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,28 @@
- added property `staged` to type `ProductVariantDeletedMessage`
- added property `staged` to type `ProductVariantDeletedMessagePayload`
- added property `warnings` to type `ProductTailoring`
- added property `attributes` to type `ProductVariantTailoring`
- added property `attributes` to type `ProductVariantTailoringDraft`
- added property `attributes` to type `ProductTailoringAddVariantAction`
- added property `warnings` to type `Product`
</details>


<details>
<summary>Added Type(s)</summary>

- added type `ProductTailoringAttribute`
- added type `ProductTailoringSetAttributeAction`
- added type `ProductTailoringSetAttributeInAllVariantsAction`
- added type `ImageProcessingOngoingWarning`
- added type `WarningObject`
</details>


<details>
<summary>Added Enum(s)</summary>

- added enum `product-tailoring` to type `MessageSubscriptionResourceTypeId`
- added enum `product-tailoring` to type `ResourceTypeId`
</details>

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface ProductTailoringAddVariantAction extends ProductTailoringUpdateAction
public const FIELD_SKU = 'sku';
public const FIELD_IMAGES = 'images';
public const FIELD_ASSETS = 'assets';
public const FIELD_ATTRIBUTES = 'attributes';
public const FIELD_STAGED = 'staged';

/**
Expand Down Expand Up @@ -53,6 +54,14 @@ public function getImages();
*/
public function getAssets();

/**
* <p>Attributes for the Product Variant Tailoring.</p>
*
* @return null|ProductTailoringAttributeCollection
*/
public function getAttributes();

/**
* <p>If <code>true</code> the new Product Variant Tailoring is only staged. If <code>false</code> the new Product Variant Tailoring is both current and staged.</p>
*
Expand Down Expand Up @@ -81,6 +90,11 @@ public function setImages(?ImageCollection $images): void;
*/
public function setAssets(?AssetDraftCollection $assets): void;

/**
* @param ?ProductTailoringAttributeCollection $attributes
*/
public function setAttributes(?ProductTailoringAttributeCollection $attributes): void;

/**
* @param ?bool $staged
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ final class ProductTailoringAddVariantActionBuilder implements Builder
*/
private $assets;

/**
* @var ?ProductTailoringAttributeCollection
*/
private $attributes;

/**
* @var ?bool
Expand Down Expand Up @@ -96,6 +102,17 @@ public function getAssets()
return $this->assets;
}

/**
* <p>Attributes for the Product Variant Tailoring.</p>
*
* @return null|ProductTailoringAttributeCollection
*/
public function getAttributes()
{
return $this->attributes;
}

/**
* <p>If <code>true</code> the new Product Variant Tailoring is only staged. If <code>false</code> the new Product Variant Tailoring is both current and staged.</p>
*
Expand Down Expand Up @@ -151,6 +168,17 @@ public function withAssets(?AssetDraftCollection $assets)
return $this;
}

/**
* @param ?ProductTailoringAttributeCollection $attributes
* @return $this
*/
public function withAttributes(?ProductTailoringAttributeCollection $attributes)
{
$this->attributes = $attributes;

return $this;
}

/**
* @param ?bool $staged
* @return $this
Expand All @@ -170,6 +198,7 @@ public function build(): ProductTailoringAddVariantAction
$this->sku,
$this->images,
$this->assets,
$this->attributes,
$this->staged
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ final class ProductTailoringAddVariantActionModel extends JsonObjectModel implem
*/
protected $assets;

/**
*
* @var ?ProductTailoringAttributeCollection
*/
protected $attributes;

/**
*
* @var ?bool
Expand All @@ -67,13 +73,15 @@ public function __construct(
?string $sku = null,
?ImageCollection $images = null,
?AssetDraftCollection $assets = null,
?ProductTailoringAttributeCollection $attributes = null,
?bool $staged = null,
?string $action = null
) {
$this->id = $id;
$this->sku = $sku;
$this->images = $images;
$this->assets = $assets;
$this->attributes = $attributes;
$this->staged = $staged;
$this->action = $action ?? self::DISCRIMINATOR_VALUE;
}
Expand Down Expand Up @@ -176,6 +184,26 @@ public function getAssets()
return $this->assets;
}

/**
* <p>Attributes for the Product Variant Tailoring.</p>
*
*
* @return null|ProductTailoringAttributeCollection
*/
public function getAttributes()
{
if (is_null($this->attributes)) {
/** @psalm-var ?list<stdClass> $data */
$data = $this->raw(self::FIELD_ATTRIBUTES);
if (is_null($data)) {
return null;
}
$this->attributes = ProductTailoringAttributeCollection::fromArray($data);
}

return $this->attributes;
}

/**
* <p>If <code>true</code> the new Product Variant Tailoring is only staged. If <code>false</code> the new Product Variant Tailoring is both current and staged.</p>
*
Expand Down Expand Up @@ -229,6 +257,14 @@ public function setAssets(?AssetDraftCollection $assets): void
$this->assets = $assets;
}

/**
* @param ?ProductTailoringAttributeCollection $attributes
*/
public function setAttributes(?ProductTailoringAttributeCollection $attributes): void
{
$this->attributes = $attributes;
}

/**
* @param ?bool $staged
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php

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

namespace Commercetools\Api\Models\ProductTailoring;

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

interface ProductTailoringAttribute extends JsonObject
{
public const FIELD_NAME = 'name';
public const FIELD_VALUE = 'value';

/**
* <p>Name of the Attribute.</p>
*
* @return null|string
*/
public function getName();

/**
* <p>The <a href="ctp:api:type:AttributeType">AttributeType</a> determines the format of the Attribute <code>value</code> to be provided:</p>
* <ul>
* <li>For <a href="ctp:api:type:AttributeEnumType">Enum Type</a> and <a href="ctp:api:type:AttributeLocalizedEnumType">Localized Enum Type</a>,
* use the <code>key</code> of the <a href="ctp:api:type:AttributePlainEnumValue">Plain Enum Value</a> or <a href="ctp:api:type:AttributeLocalizedEnumValue">Localized Enum Value</a> objects,
* or the complete objects as <code>value</code>.</li>
* <li>For <a href="ctp:api:type:AttributeLocalizableTextType">Localizable Text Type</a>, use the <a href="ctp:api:type:LocalizedString">LocalizedString</a> object as <code>value</code>.</li>
* <li>For <a href="ctp:api:type:AttributeMoneyType">Money Type</a> Attributes, use the <a href="ctp:api:type:Money">Money</a> object as <code>value</code>.</li>
* <li>For <a href="ctp:api:type:AttributeSetType">Set Type</a> Attributes, use the entire <code>set</code> object as <code>value</code>.</li>
* <li>For <a href="ctp:api:type:AttributeReferenceType">Reference Type</a> Attributes, use the <a href="ctp:api:type:Reference">Reference</a> object as <code>value</code>.</li>
* </ul>
* <p>Tailoring of <a href="ctp:api:type:AttributeNestedType">Nested Type</a> Attributes is not supported.</p>
*
* @return null|mixed
*/
public function getValue();

/**
* @param ?string $name
*/
public function setName(?string $name): void;

/**
* @param mixed $value
*/
public function setValue($value): void;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?php

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

namespace Commercetools\Api\Models\ProductTailoring;

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

/**
* @implements Builder<ProductTailoringAttribute>
*/
final class ProductTailoringAttributeBuilder implements Builder
{
/**
* @var ?string
*/
private $name;

/**
* @var null|mixed|mixed
*/
private $value;

/**
* <p>Name of the Attribute.</p>
*
* @return null|string
*/
public function getName()
{
return $this->name;
}

/**
* <p>The <a href="ctp:api:type:AttributeType">AttributeType</a> determines the format of the Attribute <code>value</code> to be provided:</p>
* <ul>
* <li>For <a href="ctp:api:type:AttributeEnumType">Enum Type</a> and <a href="ctp:api:type:AttributeLocalizedEnumType">Localized Enum Type</a>,
* use the <code>key</code> of the <a href="ctp:api:type:AttributePlainEnumValue">Plain Enum Value</a> or <a href="ctp:api:type:AttributeLocalizedEnumValue">Localized Enum Value</a> objects,
* or the complete objects as <code>value</code>.</li>
* <li>For <a href="ctp:api:type:AttributeLocalizableTextType">Localizable Text Type</a>, use the <a href="ctp:api:type:LocalizedString">LocalizedString</a> object as <code>value</code>.</li>
* <li>For <a href="ctp:api:type:AttributeMoneyType">Money Type</a> Attributes, use the <a href="ctp:api:type:Money">Money</a> object as <code>value</code>.</li>
* <li>For <a href="ctp:api:type:AttributeSetType">Set Type</a> Attributes, use the entire <code>set</code> object as <code>value</code>.</li>
* <li>For <a href="ctp:api:type:AttributeReferenceType">Reference Type</a> Attributes, use the <a href="ctp:api:type:Reference">Reference</a> object as <code>value</code>.</li>
* </ul>
* <p>Tailoring of <a href="ctp:api:type:AttributeNestedType">Nested Type</a> Attributes is not supported.</p>
*
* @return null|mixed
*/
public function getValue()
{
return $this->value;
}

/**
* @param ?string $name
* @return $this
*/
public function withName(?string $name)
{
$this->name = $name;

return $this;
}

/**
* @param mixed $value
* @return $this
*/
public function withValue($value)
{
$this->value = $value;

return $this;
}


public function build(): ProductTailoringAttribute
{
return new ProductTailoringAttributeModel(
$this->name,
$this->value
);
}

public static function of(): ProductTailoringAttributeBuilder
{
return new self();
}
}
Loading

0 comments on commit f05eed1

Please sign in to comment.