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 Oct 22, 2024
1 parent b49a50d commit 915179f
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 1 deletion.
1 change: 1 addition & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
- added property `attributes` to type `ProductTailoringAddVariantAction`
- added property `warnings` to type `Product`
- added property `customers` to type `SearchIndexingConfiguration`
- added property `source` to type `EventBridgeDestination`
</details>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface EventBridgeDestination extends Destination
{
public const FIELD_REGION = 'region';
public const FIELD_ACCOUNT_ID = 'accountId';
public const FIELD_SOURCE = 'source';

/**
* <p>AWS region that receives the events.</p>
Expand All @@ -32,6 +33,14 @@ public function getRegion();
*/
public function getAccountId();

/**
* <p>URN for the EventBridge destination.</p>
*
* @return null|string
*/
public function getSource();

/**
* @param ?string $region
*/
Expand All @@ -41,4 +50,9 @@ public function setRegion(?string $region): void;
* @param ?string $accountId
*/
public function setAccountId(?string $accountId): void;

/**
* @param ?string $source
*/
public function setSource(?string $source): void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ final class EventBridgeDestinationBuilder implements Builder
*/
private $accountId;

/**
* @var ?string
*/
private $source;

/**
* <p>AWS region that receives the events.</p>
*
Expand All @@ -54,6 +60,17 @@ public function getAccountId()
return $this->accountId;
}

/**
* <p>URN for the EventBridge destination.</p>
*
* @return null|string
*/
public function getSource()

Check warning on line 69 in lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationBuilder.php#L69

Added line #L69 was not covered by tests
{
return $this->source;

Check warning on line 71 in lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationBuilder.php#L71

Added line #L71 was not covered by tests
}

/**
* @param ?string $region
* @return $this
Expand All @@ -76,12 +93,24 @@ public function withAccountId(?string $accountId)
return $this;
}

/**
* @param ?string $source
* @return $this
*/
public function withSource(?string $source)

Check warning on line 100 in lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationBuilder.php#L100

Added line #L100 was not covered by tests
{
$this->source = $source;

Check warning on line 102 in lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationBuilder.php#L102

Added line #L102 was not covered by tests

return $this;

Check warning on line 104 in lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationBuilder.php#L104

Added line #L104 was not covered by tests
}


public function build(): EventBridgeDestination
{
return new EventBridgeDestinationModel(
$this->region,
$this->accountId
$this->accountId,
$this->source

Check warning on line 113 in lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationBuilder.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationBuilder.php#L112-L113

Added lines #L112 - L113 were not covered by tests
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,25 @@ final class EventBridgeDestinationModel extends JsonObjectModel implements Event
*/
protected $accountId;

/**
*
* @var ?string
*/
protected $source;


/**
* @psalm-suppress MissingParamType
*/
public function __construct(
?string $region = null,
?string $accountId = null,
?string $source = null,
?string $type = null
) {
$this->region = $region;
$this->accountId = $accountId;
$this->source = $source;

Check warning on line 59 in lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php#L59

Added line #L59 was not covered by tests
$this->type = $type ?? self::DISCRIMINATOR_VALUE;
}

Expand Down Expand Up @@ -110,6 +118,26 @@ public function getAccountId()
return $this->accountId;
}

/**
* <p>URN for the EventBridge destination.</p>
*
*
* @return null|string
*/
public function getSource()

Check warning on line 127 in lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php#L127

Added line #L127 was not covered by tests
{
if (is_null($this->source)) {

Check warning on line 129 in lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php#L129

Added line #L129 was not covered by tests
/** @psalm-var ?string $data */
$data = $this->raw(self::FIELD_SOURCE);
if (is_null($data)) {
return null;

Check warning on line 133 in lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php#L131-L133

Added lines #L131 - L133 were not covered by tests
}
$this->source = (string) $data;

Check warning on line 135 in lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php#L135

Added line #L135 was not covered by tests
}

return $this->source;

Check warning on line 138 in lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php#L138

Added line #L138 was not covered by tests
}


/**
* @param ?string $region
Expand All @@ -126,4 +154,12 @@ public function setAccountId(?string $accountId): void
{
$this->accountId = $accountId;
}

/**
* @param ?string $source
*/
public function setSource(?string $source): void

Check warning on line 161 in lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php#L161

Added line #L161 was not covered by tests
{
$this->source = $source;

Check warning on line 163 in lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php

View check run for this annotation

Codecov / codecov/patch

lib/commercetools-api/src/Models/Subscription/EventBridgeDestinationModel.php#L163

Added line #L163 was not covered by tests
}
}
1 change: 1 addition & 0 deletions references.txt
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,4 @@ e985f4b7aa55610705ee49bd3eb645c2fd03eb6c
c27603f949e869148570ebb8bd3ec6db34a985b7
cac013ef26a2c100979f66df86f605953dd5d736
82bca33a98d14907ea79e2cca281625dd82cdf0d
c8c2455221baca20421082b7715eaa0a712af7f1

0 comments on commit 915179f

Please sign in to comment.